โ† Raspberry Pi learning path
Raspberry Pi ยท Module 5 of 10

GPIO and electronics

Control LEDs, buttons and sensors.

๐Ÿ“– Key ideas

  1. GPIO pins use 3.3V logic; never apply 5V directly.
  2. gpiozero: LED(17).on(), Button(2).when_pressed = fn.
  3. Use resistors with LEDs and pull-ups with buttons.
  4. BCM numbering refers to GPIO numbers; physical numbering to pin positions.
  5. 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