โ Raspberry Pi learning pathRaspberry Pi ยท Module 5 of 10
GPIO and electronics
Control LEDs, buttons and sensors.
๐ Key ideas
- GPIO pins use 3.3V logic; never apply 5V directly.
- gpiozero: LED(17).on(), Button(2).when_pressed = fn.
- Use resistors with LEDs and pull-ups with buttons.
- BCM numbering refers to GPIO numbers; physical numbering to pin positions.
- No built-in ADC: use an MCP3008 for analog sensors.
๐ก Real-life example: GPIO pins are the Pi's fingers; treat them gently because 5V can burn them.
3.3V logicPi GPIO voltage level
BCM numberingBroadcom GPIO numbers
MCP3008External ADC chip
gpiozeroPython GPIO library