How To Measure Battery Capacity Arduino. Float wattHours joules 36000 10000. Capacity Capacity Current PWM_Value 5 3600.

Your percent result is -4 because voltage is below 3V. The Arduino Uno ADC is of 10-bit resolution. We need to measure voltage in circuit.
Regarding the given answers.
Battery capacity tester will discharge a fully charged Lithium-Ion cell through a resistor while measuring the current flowing through the resistor to calculate its capacity. The one used here actually has a fairly high Rds on of 24 Ohm typical. I had an Arduino and an LCD panel left over from a different project so I thought Id make a standalone unit. Capacity Hour 3600 Minute 60 Second.
