Skip to content

Instantly share code, notes, and snippets.

View FintasticMan's full-sized avatar

FintasticMan

View GitHub Profile

Methodology

To gather the battery data, I ran the 3 PineTimes running stock InfiniTime 1.11. I connected them to a Linux device with ITD. I then set up a constant load on the PineTime, either with the heart rate monitor on and the torch on max, or with the heart rate monitor and screen both off. I then used the itctl watch batt command to monitor when the battery percentage advertised by the watch changed.

I used the following formula to convert the percentages back to the voltage: 3200 + (reported_charge * 10 + 5) * (4180 - 3200) / 1000. This is just a linear interpolation of reported_charge + 0.5 between 3200 mV and 4180 mV (min. and max. voltages respectively). The reason for the + 0.5 is that the Bluetooth characteristic gets updated when the percentage changes, so the actual voltage will be in the upper range of the possible voltages for that percentage.