rlogiacco / BatterySense

Arduino library to monitor battery consumption
GNU Lesser General Public License v3.0
415 stars 76 forks source link

Unsteady reading result #2

Closed nandakrpp closed 8 years ago

nandakrpp commented 8 years ago

Hello,

I'm using the library with Arduino mega to measure 2 of 6AA battery packs wired in parallel. Measured with a digital voltmeter I got 8910 millivolts which is different from the result read by the library. Here is the circuit diagram of my setup based on on-demand circuit configuration: voltmeter_batterySenseLib_0_2_schem and below is the result captured from Arduino serial monitor:

Battery voltage is 4960 (100)
Battery voltage is 60496 (0)
Battery voltage is 60496 (100)
Battery voltage is 60496 (100)
Battery voltage is 4960 (0)
Battery voltage is 14960 (100)
Battery voltage is 50496 (100)
Battery voltage is 60496 (100)
Battery voltage is 4960 (0)
Battery voltage is 60496 (100)
Battery voltage is 14960 (0)
Battery voltage is 57104 (100)
Battery voltage is 4960 (100)
Battery voltage is 60496 (100)
Battery voltage is 4960 (100)
Battery voltage is 4960 (100)
Battery voltage is 4960 (100)
Battery voltage is 4960 (100)
Battery voltage is 14960 (100)
Battery voltage is 40496 (100)
Battery voltage is 14960 (0)
Battery voltage is 14960 (100)
Battery voltage is 4960 (100)
Battery voltage is 4960 (0)
Battery voltage is 4960 (100)
Battery voltage is 4960 (0)
Battery voltage is 60496 (100)
Battery voltage is 14960 (100)
Battery voltage is 4960 (0)
Battery voltage is 60496 (0)
Battery voltage is 14960 (100)
Battery voltage is 50496 (0)
Battery voltage is 14960 (0)
Battery voltage is 4960 (0)
Battery voltage is 14960 (100)
Battery voltage is 4960 (100)
Battery voltage is 60496 (0)
Battery voltage is 4960 (100)
Battery voltage is 14960 (100)
Battery voltage is 4960 (100)
Battery voltage is 14960 (0)
Battery voltage is 60496 (100)
Battery voltage is 14960 (0)
Battery voltage is 4960 (100)

I also did a calibration using EEPROMCalibration code but having no improvement in the reading result. Any pointers are appreciated.

Thanks.

rlogiacco commented 8 years ago

Are you using Q1 to enable the sensing circuit only? Can you please post your code? I've already received some indication my calculations could have been wrong so your feedback can help me solve this issue.

rlogiacco commented 8 years ago

This should now be fixed within the latest version, thankfully to @nunonunes : I would appreciate if you can please confirm it's now working as expected considering all the values other than battery level should still be expressed in mV.

Thanks