Is it possible to check how much power is left on the battery powering my Raspberry Pi zero using the terminal?
1 Answer
This isn't too difficult, although you're going to need a couple of additional components. There's a good walkthrough of the process at raspi.tv. The example there sends an email to a gmail account when the battery voltage dips low enough, but it should be trivial to remove that and add your own code to print to the terminal.
The setup used has the battery simultaneously hooked up to a 5V regulator to feed to Pi, and a voltage divider which feeds the ADC which feeds GPIO pins. A Python script monitors the input from the ADC to determine when the battery voltage drops below a cutoff point.