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+ (and beyond)
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
0 for the green ACT LED, and
1 for the red PWR LED.
# Set the PWR LED to GPIO mode (set 'off' by default). 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
# Disable the ACT LED. dtparam=act_led_trigger=none dtparam=act_led_activelow=off # Disable the PWR LED. dtparam=pwr_led_trigger=default-on dtparam=pwr_led_activelow=off
Note: The method for disabling the power LED was updated following a firmware change that fixed a
pwr_led_triggersetting on the Pi 3B+ and 4; see this GitHub issue for details.
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:
# 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
To make these settings permanent, add the following lines to your Pi's
/boot/config.txt file and reboot:
# Disable the ACT LED on the Pi Zero. dtparam=act_led_trigger=none dtparam=act_led_activelow=on
As a footnote, I'm using these capabilities on my onboard-led-setup script for the Raspberry Pi Dramble project.
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
saves a little more current (I read somewhere about 28ma).
I just checked, and it does indeed save ~30 mA. Thanks!
haw to cut off hdmi? but i use kali linux at RPI? thanks
Can I put this line in my Pi 3B+ config.txt on my Home Assistant server? If not, is there another solution to switching off the HDMI power consuming circuitry? Thanks
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!
NuBe here. How would I put these lines in a Python script
Thanks in advance for any help.
How did it turn out? Is it something you can post a link to?
You'll probably never see this comment.
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
led0which 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.
It seems like you can only control one of the two LEDs on the Pi 3. I'm looking into this.
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.
Pi 3 B here - Jeff's instructions worked as written - YMMV?
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?
@Michael - you may need to use
sudobefore the editor command so the file can be saved successfully.
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.
It's not April 1, but I'll leave the parent comment. But it's better to not log in as root, or to elevate to root for convenience as needed using
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?
It works on 3a+.
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?
How would we reset the led to turn back on.
How would I reset the LED trigger.
echo off | sudo tee /sys/class/leds/led1/trigger
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 on my Raspberry Pi 3B, thank you
Hello - many thanks for the crontab-line. This is the only way - at my raspi 3B - to disabling both LEDs with the lines:
@reboot /bin/echo 0 > /sys/class/leds/led0/brightness
@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 :(
Yeah, the original board doesn't have a way via software to disable the LEDs, as far as I can tell.
Worked great on turning of the power led on my pi 2 B. Thanks!
In Debian 10, the ACT and PWR LEDs are disabled on the PI-4b, at least for me they are. I found a way to turn them on, but it is user specific ( echo 1 > /sys/class/leds/PWR/brightness ). However, I have not been able to figure where the LEDs are being disabled during bootup. They are on at power on then turn off as Buster boots. I'd like to re-enable them.
Does anyone know how to do this?
The echo commands work great on Raspberry Pi 4B (8Gb) for enabling/disabling the LEDs. Tested first in CLI, then set it up as a Scheduled Job in OMV5 for my Pi NAS to disable LEDs for night time and enable for day time. Thanks!
I just used these 3 commands for my Pi Zero (however "0" is off, "1" is on - opposite to what is above) in small script that turns LED off for the night and on for the day
however, when I turn it on, LED is always on - never blinking anymore (until reboot) - btw after sending "none" to trigger it only adds it - it does not replace all other entries there
2021-07-04 works on Raspberry Pi 3a+ running latest Debian lite, thanks a lot
There must have been an update to Raspian Buster a few months ago. On a Pi Zero W I now have to send 0 to the brightness file to turn the ACT LED off. The LED can be turned back on by sending any number (well, I tried 1, 50 and 255 and they all worked). There is a max_brightness file that contains the value 255. Maybe this is the new "correct" value to use.
FYI, this method is no longer working after kernel update 5.15.56-v8+
Good catch! I've updated the instructions with the recommended new way:
It's been 7 years and you still keep this article up-to-date! I was confused when my PWR LED turned back on after a firmware update. I come here, and what do I see? A note explaining how that happened! Jeff, you're amazing!
You can tell which articles I refer back to often, because I usually keep them updated over the years :D
Just tried this on 3b w/ raspbian 11 bullseye, needed to alter to
echo 0 | sudo tee /sys/class/leds/PWR/brightness
Good to find the tip, thks Jeff.