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).

3
  • Have you considered just monitoring the power LED (it's GPIO 35) and taking some action if it changes state?
    – joan
    Commented Oct 15, 2015 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
    Commented Oct 15, 2015 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
    Commented Oct 15, 2015 at 10:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.