PINE64
Battery level measurement? - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4)
+--- Forum: Pine A64 Hardware, Accessories and POT (https://forum.pine64.org/forumdisplay.php?fid=32)
+---- Forum: Lithium and RTC Ports (https://forum.pine64.org/forumdisplay.php?fid=44)
+---- Thread: Battery level measurement? (/showthread.php?tid=4213)



Battery level measurement? - HugoRabson - 03-08-2017

Does the board offer a way to measure the battery's output voltage? It would be good to estimate the remaining battery charge.


RE: Battery level measurement? - xalius - 03-08-2017

You can read battery status running Linux just by reading info from sysfs (/sys/class/....) files. You get current, voltage, remaining percentage (the PMIC has a learning battery gauge) and other things...


RE: Battery level measurement? - pfeerick - 03-08-2017

I wrote this script a while ago to show the various battery bits... if you ignore the colour bits, it shows the sysfs paths for the different stats you can show. It uses bc (sudo apt-get install bc) to show the battery voltage as a decimal number.