Continuing on the trails of the battery life not being quite what was expected in the previous project log I checked the battery I used. The battery was one of these but I noticed it was a bit puffed. Discharging it overnight through a power 200 Ohm resistor yielded the following voltage curve.

The resulting 250mAh capacity perfectly accounts for the difference in runtime. I also checked a new, unpuffed 400mAh battery bought in the same batch and that one yielded 375mAh, so I'm not that worried.

As long as I have that curve I might as well check my assumptions on the voltage-to-charge-state LUT.

On the left is the measured battery remaining capacity vs battery voltage, along with a linear fit that's easy to plug into the firmware. On the right is the estimation error given by this simple linear fit with respect to the charge state reported by the fit. So if the device reports 50% charge left, the actual remaining charge is ~46%. But as the error is within 5% of the true value between 10% and 100% I'll live with the linear fit.

Comparing these values to the original LUT I was using it's obvious I was very wrong in using this chart, made specifically for high current LiPo batteries.

The measurements for my battery of battery charge state vs voltage are waaaaay off from those given in the LiPo chart.

Moving forward I'm confident that Squeak will provide a much more accurate battery level.

## Discussions

## Become a Hackaday.io Member

Create an account to leave a comment. Already have an account? Log In.