For one of my projects, I wanted some external LED indicators of my Raspberry Pi’s status. I wired up a pair of LEDs with a resistor attached to each. Then, I plugged them into the ground pins and GPIO 13/21.
Device Tree Setup
Next, I altered the
/boot/config.txt and appended the following lines:
# activity LED on gpio 21 (physical pin 40) dtoverlay=act-led,gpio=21 # "online" indicator LED on GPIO 13 (physical pin 33) # this one's set to blink in a heartbeat pattern, but could # be changed trigger on disk activity or stay on. dtoverlay=gpio-led,gpio=13,trigger=heartbeat,label=statusled0
Other trigger types for gpio-led can be found in this stack overflow post
Full documentation for the device tree overlay setup can be found here: https://github.com/raspberrypi/linux/blob/rpi-5.10.y/arch/arm/boot/dts/overlays/README
Some approaches for a constant status led (ab)use the
gpio-poweroff overlay which interrupts proper shutdown procedures, but
I 3d-printed a custom faceplate that I could mount inside a standard keystone-sized hole: /3d-prints/keystone-led-indicators. After some leds and some soldering, it looks pretty nice!
On the next restart, the LED on GPIO 21 will perform the functions of the onboard status LED, and the LED on GPIO 13 will activate based on it’s trigger.
2021-08-11- Initial Revision
2021-09-10- Added links to 3d-printed keystone plate with slots for a pair of leds
Found a typo or technical problem? file an issue!