rpi4.local
Posts: 25
Joined: Thu Jun 04, 2020 8:20 am

Question about Raspberry Pi 4 LED design

Wed Jun 17, 2020 7:00 am

Now, that's a short one:

Why are the activity LEDs acting the way they act? I want to understand the design decision, as I would have done it totally different: I'd have only the green LED(s) light up when the Pi is up and running, having the green LED maybe flash on storage or (heavy) cpu activity. I'd have the red LED glow, once the Pi is in the "shutdown" state.

Now, as we all know, the red LEDs glow all the time and the tiny green LED which is supposed to show if the Pi is up or in shut down mode is very hard to spot, especially when using a non-transparent case with a tiny gap for the LED light.

So, help me to understand this design decision, thanks. It's always good to learn.

User avatar
bensimmo
Posts: 4577
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Question about Raspberry Pi 4 LED design

Wed Jun 17, 2020 7:23 am

All Pis have the Power LED (the red one).
I believe since the B+/A+ designs it acts on monitoring the 5V input line to show power in (red being a good old traditional colour for power on and is much better then the blinding bright blue you see on some consumer electronics). I will also flash to show under power.
So probably tradition.

the green is an activity led, to show activity and red was taken.


Something like that, maybe ;-)

They Pi was not designed to be in a case at the start, only later did they make a case for it. If needed get the case designer to pipe the light out better.

as a side you do have some control using
act_led_... and pwr_led_... dtparam setting in config.txt
https://github.com/raspberrypi/firmware ... ays/README

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Question about Raspberry Pi 4 LED design

Wed Jun 17, 2020 7:38 am

bensimmo wrote:
Wed Jun 17, 2020 7:23 am
All [sic] Pis have the Power LED (the red one).
Not the Zeros. They have a single green LED.
The B+, 2B, A+, 3B, 3B+ and 4B all have two LEDs.

There's some controls in /boot/config.txt that change the way the LEDs are used.

There's docs in /boot/overlays/README

Code: Select all

       act_led_trigger         Choose which activity the LED tracks.
                                Use "heartbeat" for a nice load indicator.
                                (default "mmc")

        act_led_activelow       Set to "on" to invert the sense of the LED
                                (default "off")
                                N.B. For Pi 3B, 3B+, 3A+ and 4B, use the act-led
                                overlay.

        act_led_gpio            Set which GPIO to use for the activity LED
                                (in case you want to connect it to an external
                                device)
                                (default "16" on a non-Plus board, "47" on a
                                Plus or Pi 2)
                                N.B. For Pi 3B, 3B+, 3A+ and 4B, use the act-led
                                overlay.

        pwr_led_trigger
        pwr_led_activelow
        pwr_led_gpio
                                As for act_led_*, but using the PWR LED.
                                Not available on Model A/B boards.

On my Zeros I use

Code: Select all

dtparam=act_led_activelow=on
so the green LED winks on SDCard access and is off when the system is dormant.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

fruitoftheloom
Posts: 23132
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Question about Raspberry Pi 4 LED design

Wed Jun 17, 2020 7:42 am

rpi4.local wrote:
Wed Jun 17, 2020 7:00 am
Now, that's a short one:

Why are the activity LEDs acting the way they act? I want to understand the design decision, as I would have done it totally different: I'd have only the green LED(s) light up when the Pi is up and running, having the green LED maybe flash on storage or (heavy) cpu activity. I'd have the red LED glow, once the Pi is in the "shutdown" state.

Now, as we all know, the red LEDs glow all the time and the tiny green LED which is supposed to show if the Pi is up or in shut down mode is very hard to spot, especially when using a non-transparent case with a tiny gap for the LED light.

So, help me to understand this design decision, thanks. It's always good to learn.

Why do you need to know the design decision, it is what it is..


If you want it different you can order 5K Raspberry Pis customised to your specifications:

https://www.element14.com/community/doc ... on-service
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

User avatar
bensimmo
Posts: 4577
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Question about Raspberry Pi 4 LED design

Wed Jun 17, 2020 8:02 am

Maybe just to learn?
Curiosity?
Education.. big part of RPF mission ;-)
Engineering and Product design are just as important as typing some code in.



yeah, that zero led is green isn't it. odd how you don't notice after a while.

rpi4.local
Posts: 25
Joined: Thu Jun 04, 2020 8:20 am

Re: Question about Raspberry Pi 4 LED design

Wed Jun 17, 2020 8:12 am

fruitoftheloom wrote:
Wed Jun 17, 2020 7:42 am
rpi4.local wrote:
Wed Jun 17, 2020 7:00 am
Now, that's a short one:

Why are the activity LEDs acting the way they act? I want to understand the design decision, as I would have done it totally different: I'd have only the green LED(s) light up when the Pi is up and running, having the green LED maybe flash on storage or (heavy) cpu activity. I'd have the red LED glow, once the Pi is in the "shutdown" state.

Now, as we all know, the red LEDs glow all the time and the tiny green LED which is supposed to show if the Pi is up or in shut down mode is very hard to spot, especially when using a non-transparent case with a tiny gap for the LED light.

So, help me to understand this design decision, thanks. It's always good to learn.

Why do you need to know the design decision, it is what it is..


If you want it different you can order 5K Raspberry Pis customised to your specifications:

https://www.element14.com/community/doc ... on-service
As I said, I wanted to understand the design decision and that's all. Questions are allowed on this forum, right?

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Question about Raspberry Pi 4 LED design

Wed Jun 17, 2020 9:02 am

rpi4.local wrote:
Wed Jun 17, 2020 8:12 am

As I said, I wanted to understand the design decision and that's all. Questions are allowed on this forum, right?
The hardware design is proprietary, some parts belong to Broadcom. It is NOT open hardware, so don't be surprised when your hardware design questions are rejected, ignored or prohibited. (Prohibition is always used when folks ask about extending WiFi range and adding external antennae.)
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
bensimmo
Posts: 4577
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Question about Raspberry Pi 4 LED design

Wed Jun 17, 2020 9:32 am

fruitoftheloom
It is a question and thought process.
No demand, no you must do it this way. Just a simple in the engineering room or classroom style question. Letting them think for themselves how they would do it, then asking somebody why they did another way to see it from a different perspective. It's not an I know better, it's an I think different when I look at it now. It's the sort of thing we teach and encourage children to do in school nowadays. (not saying rpi4.loacal is a child, but I do teach and have been an engineer in the laser and semiconductor industry)


I should hope Broadcom don't own the rights to which colour LED you must use to indicate something.

It'll be down to the RPT engineers and designers to really explain their thinking though.

User avatar
Burngate
Posts: 6290
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Question about Raspberry Pi 4 LED design

Wed Jun 17, 2020 9:36 am

rpi4.local wrote:
Wed Jun 17, 2020 7:00 am
... I would have done it totally different: I'd have only the green LED(s) light up when the Pi is up and running ... I'd have the red LED glow, once the Pi is in the "shutdown" state.
Interesting, isn't it?

If the designers had wanted to indicate "it's shut down properly, so you can safely remove power" then they may have done what you suggest.
But that isn't what they wanted - they wanted to indicate "5v is good, and has been for the last few ms"

Rather more low level, hardware-wise, than you're suggesting - power supplies are not under the control of the designers, and as we all know notorious for not providing the volts and current they claim, but monitoring the volts at least allows the Pi (and its user) to be aware of the problem.

Why would I want to know when it's shut down?
All I need to do is tell it to shut down, then make myself a coffee, safe in the knowledge that that it will have had time to do that by the time I come back.

drgeoff
Posts: 10676
Joined: Wed Jan 25, 2012 6:39 pm

Re: Question about Raspberry Pi 4 LED design

Wed Jun 17, 2020 9:43 am

A lot of decisions - in the widest context not just engineering - boil down to "there wasn't any particular reason at the time to do it one way or any other". Later when a reason to do it differently emerges the potential benefit is too small to justify making the change.

rpi4.local
Posts: 25
Joined: Thu Jun 04, 2020 8:20 am

Re: Question about Raspberry Pi 4 LED design

Wed Jun 17, 2020 10:30 am

DougieLawson wrote:
Wed Jun 17, 2020 9:02 am
rpi4.local wrote:
Wed Jun 17, 2020 8:12 am

As I said, I wanted to understand the design decision and that's all. Questions are allowed on this forum, right?
The hardware design is proprietary, some parts belong to Broadcom. It is NOT open hardware, so don't be surprised when your hardware design questions are rejected, ignored or prohibited. (Prohibition is always used when folks ask about extending WiFi range and adding external antennae.)
English is my third language, maybe I wasn't clear enough about my intentions. I'm aware that some of the design is protected/patented IP. I was asking about why the Pi 4 would show a bright red light when powered on and has a tiny and dim green light to show activity, instead of having a green light when the Pi is on and a red light to show, that it's in sleep/shutdown state. That's all.

But it's not that important, I just wanted to understand what the reason for the colour scheme of the leds was. No idea why some responses I got were so harsh.

rpi4.local
Posts: 25
Joined: Thu Jun 04, 2020 8:20 am

Re: Question about Raspberry Pi 4 LED design

Wed Jun 17, 2020 10:35 am

@Burngate

Thank you, that was helpful.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26442
Joined: Sat Jul 30, 2011 7:41 pm

Re: Question about Raspberry Pi 4 LED design

Wed Jun 17, 2020 10:52 am

There's always cost to take in to account. It may be that green LED were cheaper than red ones when the Zero was designed, and on that device, cost is everything. It could only be a 0.1c difference per part, but when you make millions of them, it all adds up.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

User avatar
davidcoton
Posts: 4909
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: Question about Raspberry Pi 4 LED design

Wed Jun 17, 2020 2:33 pm

There are no standards or conventions for colours of indicators on general electronics or IT equipment, so every designer makes his/her own decisions.

Before LEDs, power indicators were commonly neon lamps in a red plastic housing, although amber and green were also available.
In the alarm (fire and intruder) industries, it used to be normal to use red only for alarms, yellow for warnings/status, and green for normal conditions. This was a bit limiting in some cases, I'm sure the advent of blue LEDs (and possibly orange too) is welcome in differentiating status indications.

With this background I, personally, would use green for PowerOK and yellow or blue for SD access. But that is not to say the design of the Pi is wrong.
Signature retired

emma1997
Posts: 774
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Question about Raspberry Pi 4 LED design

Wed Jun 17, 2020 8:57 pm

rpi4.local wrote:
Wed Jun 17, 2020 7:00 am
I'd have the red LED glow, once the Pi is in the "shutdown" state.
...
help me to understand this design decision, thanks.
I wonder what went into the design decision to light up indicators on consumer gear when the unit is shutdown? And turn it off when the unit on. What was going on inside their little heads? Fortunately not as common these days so I guess they may be coming to their senses.

I like the way Pi does it better than that. However it would be nice if the hardware guys used bigger resistor on the red one so the green one is actually visible (I'm running out of Wet-n-Wild black nailpolish and Walgreens don't carry it now).

Also would be nice if it actually went out when the unit is in shutdown mode so it's obvious when safe to remove power. I suspect it's possible with some secret overlay codes but too worn out from the the last couple to even Google. lol

LTolledo
Posts: 3321
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Question about Raspberry Pi 4 LED design

Wed Jun 17, 2020 10:30 pm

Why is traffic stop light RED?
why is traffic caution YELLOW?
why is traffic go light GREEN (BLUE in some areas)?
why is power switch gear power on indicator light WHITE (or AMBER)?
why is floppy disk access light RED?
why is LCD/LED computer monitor backlight has to be WHITE?

why is everything being questioned? :mrgreen:
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

User avatar
davidcoton
Posts: 4909
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: Question about Raspberry Pi 4 LED design

Wed Jun 17, 2020 10:33 pm

LTolledo wrote:
Wed Jun 17, 2020 10:30 pm
Why is traffic stop light RED?
...

why is everything being questioned? :mrgreen:
  1. I thought a red light meant Go. No wonder my vehicle got dented. :lol:
  2. Why is :mrgreen: Mr Green green?
Signature retired

User avatar
rpdom
Posts: 17029
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Question about Raspberry Pi 4 LED design

Thu Jun 18, 2020 5:35 am

LTolledo wrote:
Wed Jun 17, 2020 10:30 pm
Why is traffic stop light RED?
Why are EXIT lights Red in the US and Green in the UK?
(I think it is because Red means Stop to many people and Green means Go and if there is a fire or something you really want to Go! Although red show up better through smoke...)
Unreadable squiggle

cleverca22
Posts: 581
Joined: Sat Aug 18, 2012 2:33 pm

Re: Question about Raspberry Pi 4 LED design

Fri Jun 19, 2020 9:18 pm

Burngate wrote:
Wed Jun 17, 2020 9:36 am
If the designers had wanted to indicate "it's shut down properly, so you can safely remove power" then they may have done what you suggest.
But that isn't what they wanted - they wanted to indicate "5v is good, and has been for the last few ms"
i believe all models of pi will blink the act led 10 times after a complete halt, then you can safely unplug it
once you know to look for it, its pretty obvious, 10 blinks with a steady pacing, not the fast eratic blinking of normal activity

but i do agree that its not obvious if it was shutdown 10 seconds ago (and you just had your head turns) vs just idle, though you could just reprogram the red led to do something different when its running

Code: Select all

root@raspberrypi:~# cd /sys/class/leds/led1/
root@raspberrypi:/sys/class/leds/led1# echo timer > trigger 
root@raspberrypi:/sys/class/leds/led1# ls -l
total 0
-rw-r--r-- 1 root root 4096 Jun 19 22:17 delay_off
-rw-r--r-- 1 root root 4096 Jun 19 22:17 delay_on
now its blinking on&off constantly, to show that its alive!

emma1997
Posts: 774
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Question about Raspberry Pi 4 LED design

Fri Jun 19, 2020 11:04 pm

Yes,missing the 10 blinks or forgetting that they ever happened. That is exactly why IMO the current behaviour is less than useful. When it's on missing a few ms of voltage drop is great but that has no point when the unit is off.

I'd personally be most interested in whether it's safe to remove power than anything else.

Is there a way to have it simply go out instead of flash when shutdown using that class/LED stuff? Preferably from the CLI instead of python or other coding. Searching didn't reveal too much on the subject.

cleverca22
Posts: 581
Joined: Sat Aug 18, 2012 2:33 pm

Re: Question about Raspberry Pi 4 LED design

Sat Jun 20, 2020 2:41 am

emma1997 wrote:
Fri Jun 19, 2020 11:04 pm
Yes,missing the 10 blinks or forgetting that they ever happened. That is exactly why IMO the current behaviour is less than useful. When it's on missing a few ms of voltage drop is great but that has no point when the unit is off.

I'd personally be most interested in whether it's safe to remove power than anything else.

Is there a way to have it simply go out instead of flash when shutdown using that class/LED stuff? Preferably from the CLI instead of python or other coding. Searching didn't reveal too much on the subject.
its not really feasible to change what it does when it shuts off, so the most you can do is configure linux to so something different, using the triggers i gave above, you can make the red led do many things, including just stay off

with some code, you could maybe invert the low-voltage thing, so the red light comes on to signal bad (low voltage) and is normally off

then solid red means linux isnt running, and you can likely unplug it

emma1997
Posts: 774
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Question about Raspberry Pi 4 LED design

Sat Jun 20, 2020 3:08 am

Thanks for the replies. Maybe having it blink so fast when on that it appears very dim and go bright with shutdown might be better than the current situation. Staying fully off when on, aside from just rubbing me the wrong way, would look exactly the same as power removed so not that great.

However, even after half hour google, I'm still not sure what 'triggers/hooks' actually are (barely have a handle on device tree overlays) or what your 'code' is doing. I have some competence with C and Asm but not so much in Linuxland. Is that part of a C or Python program or part of a config file or entered at bash?

cleverca22
Posts: 581
Joined: Sat Aug 18, 2012 2:33 pm

Re: Question about Raspberry Pi 4 LED design

Sat Jun 20, 2020 11:50 am

emma1997 wrote:
Sat Jun 20, 2020 3:08 am
Thanks for the replies. Maybe having it blink so fast when on that it appears very dim and go bright with shutdown might be better than the current situation. Staying fully off when on, aside from just rubbing me the wrong way, would look exactly the same as power removed so not that great.

However, even after half hour google, I'm still not sure what 'triggers/hooks' actually are (barely have a handle on device tree overlays) or what your 'code' is doing. I have some competence with C and Asm but not so much in Linuxland. Is that part of a C or Python program or part of a config file or entered at bash?
if you run cat on that trigger file, you can see a list of valid triggers
you can then echo one of them back into trigger to change it, and some triggers will magically add more files to the directory, to configure it further

its all part of the LED subsystem in linux, which you can probably google for more info

emma1997
Posts: 774
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Question about Raspberry Pi 4 LED design

Thu Jul 02, 2020 1:23 pm

A quick update for anyone who wants an easy solution for safe-poweroff indicator (aka pilot light). No special software or convoluted procedures. Mine works by putting an active high LED on GPIO12 and enabling pullup .

ie dtoverlay=gpio-shutdown,gpio_pin=2,active_low=1,gpio_pull=up

Lit when Pi is running indicating not safe to power off .

I encountered this accidentally because that pin is one of the GPIO push buttons I use to emulate key presses. There was already a dim green LED there so that particular button can be easily located in the dark. Also functions as a quick diagnostic checker for overlay install and button function. I noticed it was on when Pi was running/idle but off when halted (default state is pd). Perfect!

You could also use one of the normally pu pins and set it for pd or low-out with an active low LED. When halted it will go back to pu/off. I chose the other way so it's compatible with my active low push buttons.

Return to “General discussion”