This repository has been archived by the owner on May 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 118
Battery Monitoring
Gal Zaidenstein edited this page Sep 20, 2018
·
4 revisions
The battery Monitoring in MK32 is based on measuring the voltage of the battery
and fitting the battery percent to a voltage-discharge rate graph:
* This is currently implemented using an approximation between max and cutoff voltage values. * It is important to note that for a better fit a table holding the voltage and corresponding battery percent would be better.
- This method of implementing battery monitoring is currently used with a 2C 3.7V LiPo Battery.
- The battery is connected via a voltage divider to an analog pin on the ESP32 where R1= 47[kOhm] and R2=22[kOhm].
* I have not tested the accuracy of this method.
- If you are using a 2C 3.7V LiPo Battery use a voltage divider as stated above to connect to an analog pin of your choice.
- In order to enable battery monitoring uncomment
BATT_STAT
in keyboard_config.h. - Set
BATT_PIN
to the adc1 channel corresponding to your selected gpio pin. - If you would like to modify the resistors and battery type please modify battery_monitor.h accordingly. Please make sure you have an understanding of what you are doing before doing so.