
Using external activity and power LEDs
Introduction
On the Raspberry Pi 5, the former green activity LED and red power LED are combined into a single multi-function LED. It is no longer wired directly to simple GPIO pins. If you want to relocate this LED to an external housing or add your own indicators, you must assign free GPIO pins and configure the operating system to drive them with the desired functions.
This document describes how to connect and configure one LED as an activity indicator and another LED as a power indicator to freely selectable GPIO pins.
The instructions are based on Raspberry Pi OS (Debian Bookworm) and work with the Raspberry Pi 5.
Hardware requirements
Raspberry Pi 5 with the latest Raspberry Pi OS (Bookworm).
Two LEDs (e.g., 5 mm or 3 mm) and suitable series resistors (47–330 Ω).
Two free GPIO pins on the 40-pin header (e.g., GPIO 23 for the activity LED and GPIO 17 for the power LED).
Connection cable or breadboard.
Wiring
Activity‑LED (grün):
GPIO 23 (pin 16) → LED anode → series resistor → LED.
LED cathode → GND (e.g., pin 6).
Power‑LED (rot):
GPIO 17 (pin 11) → LED anode → series resistor → LED.
LED cathode → GND.
Note: The LEDs must not draw more than 16mA per pin. With the resistors mentioned, you are on the safe side.
Update system
Some settings are only available with the latest kernel versions. Therefore, update your system first and reboot it:
sudo apt update && sudo apt full-upgrade
sudo rebootSet up external Activity LED
The external activity LED should take over the flashing of the built-in ACT LED. This is done via the device tree overlay gpio-led and a trigger mmc0.
Open the file
/boot/firmware/config.txt(on older systems/boot/config.txt):
sudo nano /boot/firmware/config.txtAdd the following line under the pi5 section (or at the end of the file) to configure the LED as a disk activity indicator:
# External Activity LED on GPIO 23
dtoverlay=gpio-led,gpio=23,label=diskled,trigger=mmc0gpio=23specifies BCM pin 23.label=diskleddetermines the device name in/sys/class/leds/.trigger=mmc0ensures that the LED flashes when the SD card is accessed.
Save the file and restart the Pi:
sudo rebootAfter restarting, you will find a new LED device:
ls /sys/class/leds
# → ACT default-on diskled …
# Test: manually switch on and off
echo 1 | sudo tee /sys/class/leds/diskled/brightness # LED an
echo 0 | sudo tee /sys/class/leds/diskled/brightness # LED aus
# Display available triggers
cat /sys/class/leds/diskled/triggerAlternatively, you can change the trigger at runtime, e.g., echo heartbeat | sudo tee /sys/class/leds/diskled/trigger for a pulse display.
Set up external Power LED
The red PWR LED on the Pi-5 board cannot be rewired; therefore, you should create your own LED using the gpio-led overlay. You can achieve a permanent glow with the default-on trigger.
Add the following line to
config.txt(also under[pi5]or at the end of the file):
# External Power LED on GPIO 17 (always on)
dtoverlay=gpio-led,gpio=17,label=pwrled,trigger=default-on,active_low=0Explanations:
gpio=17uses BCM pin 17 (pin 11 on 40 pin connector).label=pwrlednames the device.trigger=default-onensures that the LED is lit as long as the kernel is running (including boot and shutdown phases).active_low=0means "active high" – the LED lights up when the GPIO pin is high. If your LED is connected in reverse (anode to 3.3 V, cathode to pin), setactive_low=1.
Restart the Pi:
sudo rebootAfter restarting,
/sys/class/leds/pwrled/should exist and the LED should be lit. You can check this as follows:
ls /sys/class/ledsOn my system it gave this output:
ACT default-on diskled input6::capslock input6::compose input6::kana input6::numlock input6::scrolllock mmc0 mmc0:: mmc1:: PWR pwrledDisplay trigger of the power LED:
cat /sys/class/leds/pwrled/triggerOn my system it gave this output:
none rc-feedback kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock timer oneshot heartbeat backlight cpu cpu0 cpu1 cpu2 cpu3 [default-on] input panic actpwr mmc1 mmc0 rfkill-any rfkill-none rfkill0 rfkill1Here you can watch it live.
red LED: Power Indicator
green LED: Block device activity
Because this is needed for my NeXTcube mini project, I designed two small PCBs. One for the 40 pin GPIO outlet on the Raspberry Pi and one which just holds the two activity LEDs. The PCB for the Raspi has different sockets. Each one is connected to a specific GPIO port.

