dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6740
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Under-voltage warnings

Sun Jul 20, 2014 4:08 pm

The B+ has an under voltage detect trigger which results in the power led going off when voltage drops below about 4.65V.
The signal is also available on a gpio line (GPIO35).

Latest firmware update will display a warning symbol in top right of display when this is detected.
It will also disable turbo mode while the warning is displayed to try to reduce the chances of crashing.

I've also added a warning symbol to the existing over-temperature condition (> 85'C), which also disabled turbo mode.

Currently the symbols are:
Red square: over-temperature
Rainbow square: under-voltage

As usual you can override the behaviour in config.txt if you understand the risks:
avoid_warnings=1 removes the warning overlay.
avoid_warnings=2 additionally allows turbo when low-voltage is present.

For testing you can make the temperature warning trigger more easily with "temp_limit=50".
You can probably trigger the under-voltage check by using an insufficient power supply (perhaps USB socket from PC), or a dodgy micro-usb cable from ebay.

Run rpi-update and report back if it behaves as expected.
You will need a B+ to test the under-voltage state. The over-temperature should work on any Pi.


EDIT: with firmware from 12 September 2016 or later, the warning symbols have changed:

Image
Under voltage

Image
Throttling arm due to temperature (80-85'C)

Image
Throttling arm and gpu due to temperature (85+'C)

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

Re: Under-voltage warnings

Sun Jul 20, 2014 5:12 pm

Nice. :)

(We are getting closer to the LED that comes on when you have forgotten to power up the RPi. :lol: )
Quis custodiet ipsos custodes?

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 15056
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Under-voltage warnings

Sun Jul 20, 2014 5:24 pm

We are getting closer to the LED that comes on when you have forgotten to power up the RPi. :lol: )
And a LED that comes up when the battery starts to fail that powers the LED that comes on when you have forgotten to power up the RPi. :D

notro
Posts: 755
Joined: Tue Oct 16, 2012 6:21 pm
Location: Drammen, Norway

Re: Under-voltage warnings

Sun Jul 20, 2014 5:41 pm

If there's a short under-voltage dip, does the icon stay or does it go away when normal voltage is back?

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 15056
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Under-voltage warnings

Sun Jul 20, 2014 5:46 pm

Note that dips can be very short, but can still be fatal by "flipping a bit" in memory, in this way they can also indirectly cause SD-card corruption.
It would be best if under-voltage warnings were taken seriously, and do not disappear in the same blink of an eye they may last.

It would be best to program the GPIO35 so a brownout causes an interrupt, and to keep the error flag visible until cleared by the user.

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

Re: Under-voltage warnings

Sun Jul 20, 2014 5:57 pm

mahjongg wrote:And a LED that comes up when the battery starts to fail that powers the LED that comes on when you have forgotten to power up the RPi. :D
Battery not required. Works from Ragiant Energy (TM) from angry user. The more furious the user that the RPi is not working, the brighter the LED. :lol:
Quis custodiet ipsos custodes?

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Under-voltage warnings

Sun Jul 20, 2014 6:18 pm

dom wrote:The B+ has an under voltage detect trigger which results in the power led going off when voltage drops below about 4.65V.
The signal is also available on a gpio line (GPIO35).

Latest firmware update will display a warning symbol in top right of display when this is detected.
....
You can probably trigger the under-voltage check by using an insufficient power supply (perhaps USB socket from PC), or a dodgy micro-usb cable from ebay.
My B+ has two wifi modules connected to it, a TP-Link TL-WN727N and an Edimax EW-7811Un. Voltage measured between J8/39 and J8/2, as TP1-2 appear to have disappeared, is 4.88V. No adjustments to the B+ config to increase USB current.

I am running my B+ from a USB socket on my laptop, an Asus 8943G. No sign of any undervoltage problems. :o :D

Must find a crappy laptop or USB cable to see what happens :lol:


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6740
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Under-voltage warnings

Sun Jul 20, 2014 6:21 pm

notro wrote:If there's a short under-voltage dip, does the icon stay or does it go away when normal voltage is back?
The icon persists for about 3 seconds. It actually fades out, so you should be able to distinguish a blip every couple of seconds from a continuous under-voltage condition.

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Under-voltage warnings

Sun Jul 20, 2014 6:53 pm

A silly question perhaps, but will the icon appear if using CLI or SSH with CLI? I would think not but ....


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

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

Re: Under-voltage warnings

Sun Jul 20, 2014 7:10 pm

MrEngman wrote:A silly question perhaps, but will the icon appear if using CLI or SSH with CLI? I would think not but ....


MrEngman
I suspect the icon(s) is/are inserted by the GPU and the OS and X are blissfully unaware.
Quis custodiet ipsos custodes?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6740
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Under-voltage warnings

Sun Jul 20, 2014 7:33 pm

drgeoff wrote:I suspect the icon(s) is/are inserted by the GPU and the OS and X are blissfully unaware.
Yep.

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Under-voltage warnings

Sun Jul 20, 2014 7:47 pm

dom wrote:
drgeoff wrote:I suspect the icon(s) is/are inserted by the GPU and the OS and X are blissfully unaware.
Yep.
Sorry, that doesn't mean anything to me. Taking a guess I presume this means I need a display directly connected to the Pi and I won't see them if using SSH.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

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

Re: Under-voltage warnings

Sun Jul 20, 2014 7:51 pm

MrEngman wrote:
dom wrote:
drgeoff wrote:I suspect the icon(s) is/are inserted by the GPU and the OS and X are blissfully unaware.
Yep.
Sorry, that doesn't mean anything to me. Taking a guess I presume this means I need a display directly connected to the Pi and I won't see them if using SSH.


MrEngman
Yes, they are only on the video output from HDMI or composite port. GPU is the graphics processing unit which "draws" everything that appears on those video outputs.
Quis custodiet ipsos custodes?

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Under-voltage warnings

Sun Jul 20, 2014 8:09 pm

Thanks, that makes sense. And I've learnt a little more about the PI :)


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

paulie
Posts: 276
Joined: Thu Jan 19, 2012 6:51 pm

Re: Under-voltage warnings

Sun Jul 20, 2014 8:49 pm

dom wrote:The B+ has an under voltage detect trigger which results in the power led going off when voltage drops below about 4.65V.
The signal is also available on a gpio line (GPIO35).

Latest firmware update will display a warning symbol in top right of display when this is detected.
It will also disable turbo mode while the warning is displayed to try to reduce the chances of crashing.
For anyone running headless, is it worth writing these errors to e.g. /var/log/syslog ?
Perhaps a software switch to write/not write them to log file...
It has been my custom to use Xeyes

User avatar
blachanc
Posts: 466
Joined: Sat Jan 26, 2013 5:03 am
Location: Quebec,canada(french)

Re: Under-voltage warnings

Sun Jul 20, 2014 9:56 pm

paulie wrote: For anyone running headless, is it worth writing these errors to e.g. /var/log/syslog ?
Perhaps a software switch to write/not write them to log file...
or maybe having a routine that display a message in all terminal like a shutdown signal does.
having it in /var/log is good, but if you do not monitor it, I suppose you won't see it.
(I honestly have no clue if this is feasable or not)

ben
Autism/Asperger syndrome: what is your score on this quiz?
http://www.raspberrypi.org/forums/viewtopic.php?f=62&t=70191

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6740
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Under-voltage warnings

Sun Jul 20, 2014 10:02 pm

paulie wrote:For anyone running headless, is it worth writing these errors to e.g. /var/log/syslog ?
Perhaps a software switch to write/not write them to log file...
This particular scheme is running on the GPU, so not easy to add to /var/log/syslog.

However the GPIO is visible from the ARM (and events like a falling edge can be triggered), so an ARM app could be written to notify you through your favorite means.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 15056
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Under-voltage warnings

Mon Jul 21, 2014 9:41 am

I would not recommend writing to the SD-card just when a brownout is happening, as it could strongly increase the chance of sd-card corruption!

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

Re: Under-voltage warnings

Mon Jul 21, 2014 10:13 am

dom wrote:The signal is also available on a gpio line (GPIO35).
Should I take this to mean that (on the Raspberry-Pi-B-Plus-V1.2-Schematics.pdf, top right) PWR_LOW_N also feeds GPIO35, which is set as an input?

mikerr
Posts: 2831
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK

Re: Under-voltage warnings

Mon Jul 21, 2014 10:33 am

I don't suppose it's possible to turn off the red power light by software is it ?

I ran my B+ undervoltage and quite liked the "stealth mode" with the red light off ;)
Android app - Raspi Card Imager - download and image SD cards - No PC required !

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6740
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Under-voltage warnings

Mon Jul 21, 2014 10:52 am

mikerr wrote:I don't suppose it's possible to turn off the red power light by software is it ?

I ran my B+ undervoltage and quite liked the "stealth mode" with the red light off ;)
Running something GPU heavy (like hello_triangle2) will make it more likely that the power light will go out.
It's a bit like a software switch...

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

Re: Under-voltage warnings

Mon Jul 21, 2014 10:55 am

mikerr wrote:I don't suppose it's possible to turn off the red power light by software is it ?
One of the things I might try when my + arrives - set GPIO35 to o/p, low

hippy
Posts: 14447
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Under-voltage warnings

Mon Jul 21, 2014 11:13 am

mikerr wrote:I don't suppose it's possible to turn off the red power light by software is it ?
It should be looking at the circuit and knowing that it also connects to a GPIO line.

This mechanism could also be used to detect brownouts and then flash the LED continually until reset which might be helpful in some situations.

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Under-voltage warnings

Mon Jul 21, 2014 11:20 am

Burngate wrote:
mikerr wrote:I don't suppose it's possible to turn off the red power light by software is it ?
One of the things I might try when my + arrives - set GPIO35 to o/p, low
Just what I was thinking. I think you are possibly correct in thinking signal POWER_LOW_N connects to GPIO35 set as an input otherwise how could the Pi determine power is low and display the icon indicating it is.

I think there should be no issue if GPIO35 is set as an output active low, not so sure though if it gets set high. Depends on whether there is a resistor between GPIO35 and signal POWER_LOW_N. I would expect there is but it's not shown on the schematic.



MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

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

Re: Under-voltage warnings

Mon Jul 21, 2014 11:28 am

My reading of the info we've got is that it should be okay.
The APX803 can handle 20mA max according to its datasheet. If the GPIO is connected at the FET gate, the 470R will limit that to 7mA extra.

So we should be able to switch the LED on, even without power ... hang on ... err ...

Return to “Advanced users”