A small C utility for reading battery information from selected Samsung smartphones powered by a MediaTek SoC.
The values are obtained through the following device:
/dev/MT_pmic_adc_cali
The program outputs few CSV line containing:
- timestamp (ms)
- current (raw value)
- voltage (mV)
- temperature (raw value)
gcc -O2 -o batvolt batvolt.cPrint measurements:
./batvoltPrint the CSV header:
./batvolt --headerPrint only one measurement :
./batvolt --oneExample:
timestamp_ms,current_raw,voltage_mv,temperature_raw
1752420512345,-182,4176,298
This program was developed and tested on a rooted Samsung Galaxy A14 (SM-A145R) running Android.
It may also work on other MediaTek-based devices exposing the /dev/MT_pmic_adc_cali device, although compatibility is not guaranteed.
This project is distributed under the MIT License. See the LICENSE file for details.