Battery level measurement? - Printable Version

+- PINE64 (
+-- Forum: PINE A64(+) (
+--- Forum: Pine A64 Hardware, Accessories and POT (
+---- Forum: Lithium and RTC Ports (
+---- 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.