Skip to content
robotips

Lab 14

Raspberry Pi: boot your Pi 5 and light an LED

The Raspberry Pi 5 is already on the bench: build everything else. Cooler, microSD, display, keyboard and power until it boots, then an LED and a button on the GPIO with Python.

Published on

Lab 14Raspberry Pi: boot your Pi 5 and light an LED
Isometric drawing of a bench with a Raspberry Pi 5 with Active Cooler in the middle, a 7-inch display, a red keyboard, a white USB-C power supply and a breadboard with a red LED and a blue button wired to the GPIO.
Loads when you tap it, 588 KB
Lab 14. The Pi is a computer with pins: the GPIO.
Share on X

What you will see

Two sections. Boot: the Active Cooler goes first, the microSD with Raspberry Pi OS slides in under the board, micro HDMI goes to HDMI0, the keyboard to a USB port and the 27 W USB-C supply goes last. The status LED turns from red to green and the desktop shows up.

GPIO: you shut the Pi down, wire an LED with its 330 Ω resistor to GPIO17 (pin 11) and a button to GPIO2 (pin 3), and run a gpiozero script in Thonny. In practice mode you press the button with B and turn the Pi off or on with P. Currents come from a simple model: the assumptions are in the note.

Model note

What the lab assumes and where its numbers come from.

Data: Raspberry Pi 5 of 85 x 56 mm, 40 GPIO pins, 2 micro HDMI, 2 USB 3.0 + 2 USB 2.0, Ethernet and 5 V / 5 A power over USB-C with Power Delivery (Raspberry Pi product brief). Official 27 W supply: 5.1 V up to 5 A (DigiKey). With a 3 A supply, USB peripherals are limited to 600 mA (Getting Started with Raspberry Pi 5). Two-colour status LED: red when power is connected and when shut down, green while booting and running, blinking with microSD activity (Raspberry Pi documentation, issue 3505). Active Cooler: aluminium heatsink with a temperature-controlled fan, spring-loaded pins and pre-applied thermal pads; removing it is not recommended (raspberrypi.com); the fan turns on at 60 °C (Mouser). Power button: two quick presses shut it down from the desktop (Getting Started with Raspberry Pi 5). GPIO17 = physical pin 11, GPIO2 = pin 3, GND on 6 and 9 (raspberrypi.com/documentation/hardware; NextPCB). Code: the gpiozero 'Button controlled LED' recipe, LED(17) and Button(2). Model assumptions: red LED with a 2.0 V drop and a 330 Ω resistor on a 3.3 V GPIO: (3.3 − 2.0) / 330 ≈ 3.9 mA; sped-up boot times; generic 7" 1024 x 600 display and keyboard; simplified drawing of the Pi (button and LED positions approximate). Made by @0xKapri.

Sources

  1. 01Raspberry Pi 5: 85 x 56 mm, 2 micro HDMI, 2 USB 3.0, 2 USB 2.0, Ethernet, 40-pin header and 5 V / 5 A over USB-C with Power Delivery. Raspberry Pi product brief.
  2. 02Official 27 W supply: 5.1 V up to 5 A. DigiKey.
  3. 03With a 3 A supply, USB peripherals are limited to 600 mA; two presses of the power button shut the Pi down. Getting Started with Raspberry Pi 5.
  4. 04Two-colour status LED: red with power or shut down, green while booting, blinking with the microSD. Raspberry Pi documentation (issue 3505 on GitHub).
  5. 05Active Cooler: spring-loaded pins and pre-applied thermal pads, removing it is not recommended. raspberrypi.com. The fan turns on at 60 °C. Mouser.
  6. 06GPIO17 on pin 11, GPIO2 on pin 3, GND on 6 and 9. Raspberry Pi hardware documentation and NextPCB.
  7. 07'Button controlled LED' recipe and Button's default pull-up. gpiozero documentation.

On the roadmap

More labs

Lab 14