I want to display the battery percentage of a flooded lead acid battery.
I know that the percentage of the charge can be achieved from the voltage of the battery, bot only of the battery was free for at-lease an hour from either discharge or charge.
Below I have attached the terminal voltage chart of the lead acid battery
But I am worried that the terminal voltage under load will not show the actual battery voltage.
How can I display the percentage under load and free from load..?
The display will constantly be fluctuating..
It's difficult. When the battery has been resting You pick up the initial data.
During load You can integrate the current drawn from the battery and calculate reminding battery capacity. That way heavy commercial battery powered fork lift trucks are built.
The phone probably integrates the current and voltage to get total charge or energy delivered, and compares that to a model for the battery capacity.
If the load is variable, the battery voltage has no fixed relation to the state of battery charge. For example, when a fully charged 12V automotive battery is cranking an engine, the voltage may drop to around 6V.
And they don't manage when the battery has deteriated a bit. After a running low on battery, cutting off and the charger is applied I've seen negative percentage......
Know Your battery and judge what time is left when the reading shows lower numbers.
I've built one modified it to use an 16bit ADC and it seems to work really well.
I've got a battery load tester where I used an 22Ah battery where I set the load to 1.1amps and after an hour it took 1.13Ah out of the battery, Charged it back up to 100%, Set the current draw to 5amps which you would expect the battery to last 22/5=4.4 hours but it only lasted just under 2.7 hours.
There is something known as peukert's law where you take more then 1Ah out of a battery this has an major effect on the actual runtime of the battery. When you use this calculator like this one Peukert Number Battery Life Calculator (csgnetwork.com)
Using the Manufacturer's 80% Discharge Time you can see that it should last just under 3 hours which is close enough for what I need. Even though mine only lasted 2.7hrs has the age/quality of the battery plays a major part in it.
The link for the cheap battery monitor use's the peukert's factor for charging and discharging the battery to calculate runtmie left and battery percentage.