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