2

Is it possible to check how much power is left on the battery powering my Raspberry Pi zero using the terminal?

  • What sort of battery pack? LiPo, for example, might need to be treated differently to NiCad. – joan Feb 20 '16 at 9:34
4

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.

Circuit for Raspberry Pi battery monitoring

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.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.