Controlling PWR and ACT LEDs on the Raspberry Pi

All Raspberry Pi models have a few built-in LEDs; the earlier models had PWR, ACT, and networking status LEDs all lined up on the board itself; for the B+ and model 2 B, the networking LEDs moved onto the network jack itself, leaving just two LEDs; PWR (a red LED) and ACT (a green LED).

Normally, whenever the Pi is powered on—except if the power supply dips below something like 4.5VDC—the red PWR LED remains lit no matter what. If you wanted to 'disable' the LED, you'd have to put a piece of tape or something else over the LED, or get out a soldering iron and modify the hardware a bit.

Raspberry Pi model 2 B, B+ and A+

Luckily, with the Pi 2 model B, B+, A+, and Zero, you can control the LEDs in software, in a few different ways. The simplest way to change the way these LEDs work is to modify the trigger for each LED by setting it in /sys/class/leds/led[LED_ID]/trigger, where you replace [LED_ID] with 0 for the green ACT LED, and 1 for the red PWR LED.

For example:

<br />
# Set the PWR LED to GPIO mode (set 'off' by default).<br />
echo gpio | sudo tee /sys/class/leds/led1/trigger

# (Optional) Turn on (1) or off (0) the PWR LED.
echo 1 | sudo tee /sys/class/leds/led1/brightness
echo 0 | sudo tee /sys/class/leds/led1/brightness

# Revert the PWR LED back to 'under-voltage detect' mode.
echo input | sudo tee /sys/class/leds/led1/trigger

# Set the ACT LED to trigger on cpu0 instead of mmc0 (SD card access).
echo cpu0 | sudo tee /sys/class/leds/led0/trigger

I'm using this ability to turn off the bright red PWR LED on my Raspberry Pis, as I use decent power supplies and would rather save the few mW used by the LED so I can save a penny or two over the next couple years :)

If you want to disable both LEDs permanently, add the following to /boot/config.txt:

<br />
# Disable the ACT LED.<br />
dtparam=act_led_trigger=none<br />

# Disable the PWR LED.

Raspberry Pi Zero

The Pi Zero's values are opposite, and it only has one LED, led0 (labeled 'ACT' on the board). The LED defaults to on (brightness 0), and turns off (brightness 1) to indicate disk activity.

If you want to turn off the LED on the Pi Zero completely, run the following two commands:

<br />
# Set the Pi Zero ACT LED trigger to 'none'.<br />
echo none | sudo tee /sys/class/leds/led0/trigger

# Turn off the Pi Zero ACT LED.
echo 1 | sudo tee /sys/class/leds/led0/brightness

To make these settings permanent, add the following lines to your Pi's /boot/config.txt file and reboot:

<br />
# Disable the ACT LED on the Pi Zero.<br />
dtparam=act_led_trigger=none<br />
dtparam=act_led_activelow=on<br />


Thanks! I've turned off the leds on all my headless Pi's.
You probably already know this one, but you can turn off the HDMI circuits with
/usr/bin/tvservice -o
saves a little more current (I read somewhere about 28ma).

That did the job! I've started a 1-year time-lapse movie project and was getting a red arc in one corner of every photo in low light, and it's now gone away. Thanks!

Hey Jeff, great article. I've got a question, though- is sys/class/leds/led1 only defined for the model 2 B? I've tried it on a B+, and sys/class/leds only contains led0. I don't have access to a 2 B at the moment to check...

Could be... I don't have my B+ anymore to test with, though on a Pi 3 it's the same—no led1, just led0 which is the green ACT LED.

Great article, Worked great on my PI2 but for some reason not on the PI3. But have to figure it out.

The interesting thing for me was that the Pi3 kept the red light off with OpenELEC, but with Raspbian, it stays on. Once I connected the 7" touch screen to the OpenELEC Pi, the red light stays on. Not sure if this helps to determine a setting. It would sure be nice to keep the lights off on my surveillance devices.

I have OpenELEC 6.0.3 installed on my Pi3 and only the red power light seems to work. It is solid red all the time the power is on. The green activity light shows no signs of life either during boot or during a long file transfer to the SD card in the Pi3 :(

I read somewhere that: On the Pi3 the activity and power LED are no longer connected to Pi (0-53) GPIO. They are connected to an internal I2C GPIO port expander. But this doesn't mean that much to me!!

Any more info and how to get the green activity light on OpenELEC 6.0.3 would be greatly appreciated.

I just noticed that if I shut down my Pi3 OpenELEC 6.0.3 through Kodi GUI or execute poweroff command in SSH then after it powers down the green activity light is solid green until I boot my Pi3 again when it goes out.

Same here KnightAzul. When i power off my pi3 via gui or ssh, the green light turns on, the red one stays on. Actually i was expecting just the red one to be on, because the red is meant to stay on all the time. But i was not expecting the green to be constantly on after pi 3 power off via gui and i think it's a malfunction. Any comments would be appreciated.

Does anyone know the GPIO # for the ACT LED on the Pi Zero? I'm trying to make it flash to show when my script is running, but I can't seem to find the right # to control it.

as described above... no need of GPIO here.

Set the Pi Zero ACT LED trigger to 'none':
echo none | sudo tee /sys/class/leds/led0/trigger

Turn off the Pi Zero ACT LED:
echo 1 | sudo tee /sys/class/leds/led0/brightness

Turn on the Pi Zero ACT LED:
echo 0 | sudo tee /sys/class/leds/led0/brightness

I tried using your permenant solution on my Pi 2 Model B, but when I try to save the config file I am told I don't have permission. Suggestions?

The permanent solution listed above involves editing the config.txt file, so I don't think there the possibility of using a sudo command. Am I mistaken? Can I open the config.txt file in the editor window and then append the six lines of code to the bottom somehow?

No always login as root and you never need to type sudo. And delete the pi user after setting a password on root.
That way you always have super user access which is the best. And no it's not unsecure, despite what all you unix beard geeks/nerds say out there.

Short and straightforward, thanks! Applied it on my Rpi2.

the echo 0 | sudo tee /sys/class/leds/led1/brightness does not work with the new rpi 3b+. any ideas?

Correct me if I'm wrong, but if I want the ACT LED to blink on hard drive access, I should change its trigger to sdXY, right?

Thank you for this useful and helpful tutorial. !!

The procedures for model 2 B, B+ and A+ are working fine for my Pi 3 Model B+. Thanks a lot!

Raspberry Pi 3 B running Raspbian Jesse, Activity and Pwr LEDs Control:

Using the boot config for disabling Activity LED works fine, but the Power LED isn't affected:
# Disable the ACT LED.

# Disable the PWR LED.

I used the root crontab to turn the Power LED off on powerup/reboot:
sudo crontab -e

Add this line to the file:
@reboot /bin/echo 0 > /sys/class/leds/led1/brightness

It works also with the latest version of the berry. But as it is done by software the power led start burning once raspbian is powered off. But that isn't realy bad, because that way you are sure the power supply is working before booting up the berry.

Great info! Works fine with my RPi 4, haven't tried it with any of the earlier ones yet.

One question - is there any way of replicating the LEDs onto GPIO pins (ideally on the 4, but on others too if possible)? I'm building a cluster of Pis (a bush?), and would like to have some blinkenlights up front; I was going to use light pipes, but I think they'll be too fiddly to set up, so second best would be to replicate the LEDs via GPIO outputs. And no, I don't really want to risk ruining the boards by unsoldering the actual LEDs and putting new ones on flying leads...


On my Pi 2B the PWR LED will remain lit. Also in /sys/class/leds/ there is only the led0, not the led1. I have no clue how to shutdown the PWR led. Anybody knows how to, otherwise than using the above description?

This does NOT work on the oldest Raspberry B, on all my new boards like Raspi 2/3/4 works fine.
I think gonna have to desolder :(