# 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](https://gitea.arsenm.dev/Arsen6331/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 because the new percentage gets updated when it changes, so the actual voltage will be in the upper range of the possible voltages for that charge level. I also normalised the time between 0 and 100, and inverted that to get the "best theoretical charge level". I then used some code to go through all possible values in a linear approximation using 6 points. I calculated the loss between the linear approximation and the best theoretical charge from all the tests, and chose the linear approximation with the lowest loss.