1

I just learned that a red flashing LED indicates voltage below 4.63V on a Raspberry Pi Model B+. Thus, the Pi seems to "know" about it's input voltage.

So my question is:

Is there a command to determine the voltage programmatically?

What I tried:

I tried vcgencmd measure_volts. But it yields 1.2000V, independent of the input source and the LED status. And it doesn't seem to be related to the 4.63V mentioned above.

A bit more background:

I'm powering the Raspberry Pi with a lead-acid battery built into a moving robot. After operating the robot for a while, the voltage seams to drop below a critical minimum, causing potential damage to the file system. Therefore, I'd like to detect low voltage automatically (and trigger the robot to return to the charging station).

| improve this question | | | | |
  • Have you considered just monitoring the power LED (it's GPIO 35) and taking some action if it changes state? – joan Oct 15 '15 at 8:42
  • @joan: Sounds like a simple but effective solution. Any idea how to read GPIO 35 via Ubuntu's bash? (There's no /sys/class/gpio35 on my system.) – Falko Oct 15 '15 at 9:42
  • Sorry, I have no knowledge on the Ubuntu difference to Debian/Raspbian. I'm not sure you would be allowed to export that GPIO. Use one of the libraries. If you want to use your own code look at my minimal or tiny gpio access files at abyz.co.uk/rpi/pigpio/examples.html#Misc_code. I'm not sure if the rootless access method will work on Ubuntu. – joan Oct 15 '15 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.