-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 3677
- Joined: Mon Sep 29, 2014 1:07 pm
- Location: Cambridge
Re: Under-voltage warnings
Yes - the red LED and the lightning symbol are both driven from the same under-voltage signal at the same threshold, they just have different sampling and persistence characteristics. If you were to put a 'scope on the LED you would see it dipping, even if you can't see it.
Re: Under-voltage warnings
Thanks @jamesh and @PhilE for your comments.
right now im getting solid red power while lighting bolt appears n disappears every ~5mins, running from a PDU to a 12v 2.5A powersupply handling 5 Pis. Gonna go get an upgraded powersupply cheers.

Re: Under-voltage warnings
Hello, I would like to ask, is there any way to read the status of the red led so I can detect voltage drops?
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 5708
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Under-voltage warnings
You can use
See: viewtopic.php?f=63&t=147781&start=50#p972790
Code: Select all
vcgencmd get_throttled
Re: Under-voltage warnings
Thanks for your reply. I checked your solution but didn't work. Despite there is or no under-voltage the returned value is alwaysdom wrote:You can useSee: viewtopic.php?f=63&t=147781&start=50#p972790Code: Select all
vcgencmd get_throttled
throttled=0x50005
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 5708
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Under-voltage warnings
Is the PWR LED lit up when you run this?
Have you got any custom configuration that alters the PWR LED state?
Have you got any custom configuration that alters the PWR LED state?
Re: Under-voltage warnings
I am not sure that I understood your question. I would like to mention that when raspberry is on under-voltage (so red led is off) the vcgencmd get_throttled command returns always 0x50005 which is ok. On the other side, when the voltage is ok (so red led is on) the previous command returns sometimes 0x50005 (under-voltage indication) and sometimes 0x50000 (voltage is ok indication). Any ideas about that? Also, I should mention that when I run the command vcgencmd get_throttled the red led is blinking (until the command return).dom wrote:Is the PWR LED lit up when you run this?
Have you got any custom configuration that alters the PWR LED state?
- FTrevorGowen
- Forum Moderator
- Posts: 6061
- Joined: Mon Mar 04, 2013 6:12 pm
- Location: Bristol, U.K.
- Contact: Website
Re: Under-voltage warnings
AIUI (@dom can confirm/correct, no doubt) red PoWeR led blinking is the "proper" under-voltage signal (off, I suspect, means that it's "extremely" under-voltage <<4.6V). So, when just vcgencmd get_throttled is running the voltage is fluctuating around the threshold, hence the blink, which, again, AIUI, has a "hardware time constant" associated with the threshold sensing circuitry, and the variation in the command's response (and, similarily, the "lightning bolt" icon) which has a (different?) software "time constant"**.hmmy92 wrote:I am not sure that I understood your question. I would like to mention that when raspberry is on under-voltage (so red led is off) the vcgencmd get_throttled command returns always 0x50005 which is ok. On the other side, when the voltage is ok (so red led is on) the previous command returns sometimes 0x50005 (under-voltage indication) and sometimes 0x50000 (voltage is ok indication). Any ideas about that? Also, I should mention that when I run the command vcgencmd get_throttled the red led is blinking (until the command return).dom wrote:Is the PWR LED lit up when you run this?
Have you got any custom configuration that alters the PWR LED state?
Trev.
** As observed during boot-up when using a power-bank or USB-port as a power source when the threshold-detection was introduced with the B+ by both @jamesh and myself. Once fully-booted, for those particular "setups" blinking ceased. It's quite likely that there's been some "fine-tuning" of those "time-constants" since then, of course.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's & P400. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm
- HawaiianPi
- Posts: 6216
- Joined: Mon Apr 08, 2013 4:53 am
- Location: Aloha, Oregon USA
Re: Under-voltage warnings
If it blinks when you run the command then something is wrong. It really seems like you have a power problem.hmmy92 wrote: ... Also, I should mention that when I run the command vcgencmd get_throttled the red led is blinking (until the command return).
I never see my red LED blink or otherwise change state, and my Pi3 always returns:
Code: Select all
vcgencmd get_throttled
throttled=0x0
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?
lots of pop-ups...and where is that annoying music coming from?
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 5708
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Under-voltage warnings
If the power drops below the voltage threshold are brief (e.g. a few milliseconds) then you won't spot it on the LED.
But get_throttled has some persistence (matching the visible warning symbol) so it will show any undervoltage events that occurred recently (~ 1 second).
But get_throttled has some persistence (matching the visible warning symbol) so it will show any undervoltage events that occurred recently (~ 1 second).
- FTrevorGowen
- Forum Moderator
- Posts: 6061
- Joined: Mon Mar 04, 2013 6:12 pm
- Location: Bristol, U.K.
- Contact: Website
Re: Under-voltage warnings
Thanks for that info. @dom - it clarifies the "time constants". [Slightly O.T.] One of the tricks I used to use to improve "detectivity" of LED's used for measurements of transmission through laser-drilled holes in metal sheeting was to use short (~1uS) pulses of quite high currents (but with a low mark-space ratio to keep the average power down) together with a phase-locked loop reciever. That worked in quite brightly (summer sunlight) lit labs. However, at low rep-rates, IIRC, the flicker was sometimes perceptible by some folks.dom wrote:If the power drops below the voltage threshold are brief (e.g. a few milliseconds) then you won't spot it on the LED.
But get_throttled has some persistence (matching the visible warning symbol) so it will show any undervoltage events that occurred recently (~ 1 second).
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's & P400. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm
Interpreting get_throttled=0x10000 or 0x30000
How should I interpret get_throttled=0x10000 or 0x30000 ?
This post seems to imply under-voltage and throttling come together
(I added hex views)
79.5C 0x10000 4.936v or
78.5C 0x30000 4.852v or
74.6C 0x20000 4.925v
when my preferences allowed too much processor use.
This post seems to imply under-voltage and throttling come together
(I added hex views)
I am running boinc with two seti@home and one einstein@home and have seen one minute status checks show:0: under-voltage (0xX0001)
1: arm frequency capped (0xX0002 or 0xX0003 with under-voltage)
2: currently throttled (0xX0004 or 0xX0005 with under-voltage)
16: under-voltage has occurred (0x1000X)
17: arm frequency capped has occurred (0x2000X or 0x3000X also under-voltage occurred)
18: throttling has occurred (0x4000X or 0x5000X also under-voltage occurred)
under-voltage occurs when voltage drops below 4.63V. The Pi is throttled
arm frequency capped occurs with temp > 80'C
over-temperature occurs with temp > 85'C. The Pi is throttled
Throttling removes turbo mode, which reduces core voltage, and sets arm and gpu frequencies to non-turbo value.
Capping just limits the arm frequency (somewhere between 600MHz and 1200MHz) to try to avoid throttling.
If you are throttled and not under-voltage then you can assume over-temperature. (confirm with vcgencmd measure_temp).
79.5C 0x10000 4.936v or
78.5C 0x30000 4.852v or
74.6C 0x20000 4.925v
when my preferences allowed too much processor use.
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 5708
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Interpreting get_throttled=0x10000 or 0x30000
0x10000 means low voltage has occurred
0x30000 means low voltage has occurred and arm frequency has been capped (due to temperature over 80'C).
Normally low voltage will trigger throttling of turbo, but that can be disabled with "avoid_warnings=2". Are you using that setting?
Re: Under-voltage warnings
Nice code (both bash and C). One question, from where was I supposed to learn that GPIO35 is a flag for under-voltage? (besides someone saying it on the forum
Thanks for filling me in!
Roberto

Thanks for filling me in!
Roberto
gordon@drogon.net wrote: ↑Mon Jul 21, 2014 12:12 pmTried to write a little program to use the wiringPi ISR function on it, so I could log brown-outs, but it's not working )-:
I can poll for the pin change and that works fine:
(yes, I'm doing something to deliberately trip low-power - don't ask)Code: Select all
pi@raspberrypi ~/wiringPi/examples $ while true; do echo -n "`gpio -g read 35`" ; done 000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000^C
but my little test program isn't picking it up.
I'm wondering if something in the kernel isn't passing interrupts back to userland on the 2nd bank of gpio pins?
The program is:
It works fine is I use pin 17 then toggle it using gpio -g mode 17 up ; gpio -g mode 17 down (uses the internal pull-up/down to trigger the interrupt)Code: Select all
#include <stdio.h> #include <time.h> #include <wiringPi.h> #define LOW_POWER 35 /* * lowPower: * This is an ISR that waits for the low-power signal going low and * prints the result. ********************************************************************************* */ void lowPower (void) { time_t t ; time (&t) ; printf ("%s: LOW POWER DETECTED\n", ctime (&t)) ; } /* ********************************************************************************* * main ********************************************************************************* */ int main (void) { wiringPiSetupSys () ; wiringPiISR (LOW_POWER, INT_EDGE_FALLING, &lowPower) ; for (;;) delay (1000) ; return 0 ; }
The B+ has the latest kernel/firmware from apt-get update/upgrade rather than rpi-update if that makes a difference.
-Gordon
- Burngate
- Posts: 6427
- Joined: Thu Sep 29, 2011 4:34 pm
- Location: Berkshire UK Tralfamadore
- Contact: Website
Re: Under-voltage warnings
... see this thing on my head? I sometimes talk through it.
See below.
So I've deleted this post, and removed my hat.
See below.
So I've deleted this post, and removed my hat.
Last edited by Burngate on Sat Sep 02, 2017 5:22 pm, edited 2 times in total.
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 10566
- Joined: Wed Dec 04, 2013 11:27 am
- Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
Re: Under-voltage warnings
https://github.com/raspberrypi/firmware ... t-blob.dts as described in https://www.raspberrypi.org/documentati ... uration.md
Look for pin_define@POWER_LOW for your flavour of Pi. Do note that it is not always gpio 35!
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
Re: Under-voltage warnings
So i recently had a host of problems related to the fact that the power supply on my headless Pi had degraded. As soon as I hooked up a LCD to it, and saw the lightning bolt, I understood what was happening. Is there some way that I can occasionally check a register that would tell me, for example, if the lightning bolt condition had occurred on this bootup?
thanks
thanks
- davidcoton
- Posts: 5865
- Joined: Mon Sep 01, 2014 2:37 pm
- Location: Cambridge, UK
- Contact: Website
Re: Under-voltage warnings
Did you read the rest of this thread before posting? There is a link that explains the
command and its output, which includes a latched low-voltage flag.
Code: Select all
vcgencmd get_throttled
Location: 345th cell on the right of the 210th row of L2 cache
Re: Under-voltage warnings
Apparently not enough, thanks for explaining, this does exactly what I needed.davidcoton wrote: ↑Thu Dec 28, 2017 7:02 pmDid you read the rest of this thread before posting? There is a link that explains thecommand and its output, which includes a latched low-voltage flag.Code: Select all
vcgencmd get_throttled
-
- Posts: 10
- Joined: Mon Apr 30, 2018 9:13 am
Re: Under-voltage warnings
Hi guys. I am using RPi 3 B and I want to catch the low voltage event in an interrupt. Can you please help me if you have found something. In older version it was possible by GPIO 35. But now it is not possible I guess.6by9 wrote: ↑Mon Aug 28, 2017 8:07 pmhttps://github.com/raspberrypi/firmware ... t-blob.dts as described in https://www.raspberrypi.org/documentati ... uration.md
Look for pin_define@POWER_LOW for your flavour of Pi. Do note that it is not always gpio 35!

-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 5708
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Under-voltage warnings
Not possible - it's not on a dedicated gpio line, but through an I2C gpio exapander.ankushnag14 wrote: ↑Fri May 04, 2018 7:28 amHi guys. I am using RPi 3 B and I want to catch the low voltage event in an interrupt. Can you please help me if you have found something. In older version it was possible by GPIO 35. But now it is not possible I guess.![]()
You'll need to poll with vcgencmd get_throttled or from the kernel:
https://github.com/raspberrypi/linux/pull/2397
-
- Posts: 10
- Joined: Mon Apr 30, 2018 9:13 am
Re: Under-voltage warnings
Thanks for the information. The link you gave is to poll using vcgencmd get_throttled. How do we poll from the kernel??dom wrote: ↑Fri May 04, 2018 9:18 amNot possible - it's not on a dedicated gpio line, but through an I2C gpio exapander.ankushnag14 wrote: ↑Fri May 04, 2018 7:28 amHi guys. I am using RPi 3 B and I want to catch the low voltage event in an interrupt. Can you please help me if you have found something. In older version it was possible by GPIO 35. But now it is not possible I guess.![]()
You'll need to poll with vcgencmd get_throttled or from the kernel:
https://github.com/raspberrypi/linux/pull/2397
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 5708
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Under-voltage warnings
The link includes a python file that polled the kernel sysfs file. It looks like this is the location:ankushnag14 wrote: ↑Fri May 04, 2018 1:02 pmThanks for the information. The link you gave is to poll using vcgencmd get_throttled. How do we poll from the kernel??
/sys/devices/platform/soc/soc:firmware/get_throttled
Re: Under-voltage warnings
This file in the Linux repo might help? Does some throttled status grabbing via mailboxes.
https://github.com/raspberrypi/linux/bl ... pberrypi.c
https://github.com/raspberrypi/linux/bl ... pberrypi.c
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.
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.
-
- Posts: 10
- Joined: Mon Apr 30, 2018 9:13 am
Re: Under-voltage warnings
I have a small question regarding under voltage indication of Raspberry Pi. Could you please let me for how many seconds or milliseconds the indication will be there on the screen after the under voltage event has occurred.jamesh wrote: ↑Fri May 04, 2018 2:56 pmThis file in the Linux repo might help? Does some throttled status grabbing via mailboxes.
https://github.com/raspberrypi/linux/bl ... pberrypi.c