Closed AlexXZero closed 1 year ago
0% is set to 3.5V, because you shouldn't discharge the battery too deep. ~This filtering causes the percentage to be overreported~ (It's the 0% at 3.2V change). SAADC has features to reduce noise. Let's try these before adding software filtering. https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fsaadc.html
Sometimes I noticed that battery percentage might drops to 5-10%, then stay at the same level during a full day. During a little investigation I found that this behavior is related to noise in voltage measuring data. This PR should improve showing battery percentage by using low pass filter for battery voltage.
There is some data which I measured and used for comparing old and a new versions: Clear plot: Findings: Source data: battery.csv
On the plot you can see blue line is old data and orange line is a new data.
Summary of improvements: