OpenMarine
Logging battery amps - Printable Version

+- OpenMarine (http://forum.openmarine.net)
+-- Forum: OpenPlotter (http://forum.openmarine.net/forumdisplay.php?fid=1)
+--- Forum: How I did it (http://forum.openmarine.net/forumdisplay.php?fid=6)
+--- Thread: Logging battery amps (/showthread.php?tid=1448)

Pages: 1 2 3 4


Logging battery amps - PaddyB - 08-31-2018

This was a bit of a surprise! Fitted an INA219 current sensor just across the battery monitor shunt not expecting too much, but turns out it's really quite accurate. No calibration tweaks, just multiplied the mV across the shunt by 10,000 to get to amps and it tracks very well against the battery monitor and a DC clamp meter so maybe accurate down to +/- 100mA or so. Sends the reading as signalk to Openplotter where it gets logged in InfluxDB and viewed on Chronograf.  I'll stick it up on github at some point & post a link. 

Been watching this more than youtube  Cool Big Grin

current = shuntvoltage * -10000;  

[Image: mCP65hw.png]

[Image: Ij9RANx.png]


RE: Logging battery amps - Saqqara - 08-31-2018

Can it measure both charge and discharge?


RE: Logging battery amps - PaddyB - 08-31-2018

(08-31-2018, 03:40 PM)Saqqara Wrote: Can it measure both charge and discharge?

Yes, have a look at the lower graph in the top image, the current goes from negative to positive, the charger was turned on.


RE: Logging battery amps - Saqqara - 08-31-2018

Alright, I will follow in your shoes! I'll hit you up for that code once the parts arrive on the slow boat.

Good excuse to play with the ESP8266.


RE: Logging battery amps - SkipperEarly - 09-01-2018

Great solution - pls keep sharing! I have a ESP32 WiFI + Battery laying around and will try to use this.
BTW What resistance (kOhm) have you used for the stunt?


RE: Logging battery amps - PaddyB - 09-01-2018

(09-01-2018, 03:09 AM)SkipperEarly Wrote: Great solution - pls keep sharing! I have a ESP32 WiFI + Battery laying around and will try to use this.
BTW What resistance (kOhm) have you used for the stunt?

Main existing battery monitor shunt looks like maybe 0.1milliOhm, shunt in the INA219 is 0.1Ohm.


RE: Logging battery amps - keithwhite - 09-14-2018

(08-31-2018, 07:58 AM)PaddyB Wrote: This was a bit of a surprise! Fitted an INA219 current sensor just across the battery monitor shunt not expecting too much, but turns out it's really quite accurate. No calibration tweaks, just multiplied the mV across the shunt by 10,000 to get to amps and it tracks very well against the battery monitor and a DC clamp meter so maybe accurate down to +/- 100mA or so. Sends the reading as signalk to Openplotter where it gets logged in InfluxDB and viewed on Chronograf.  I'll stick it up on github at some point & post a link. 

Been watching this more than youtube  Cool Big Grin

current = shuntvoltage * -10000;  

[Image: mCP65hw.png]

[Image: Ij9RANx.png]

Hi 

I'm planning to copy this, did you remove the 0.10 Ohm Shunt on the Board to get this to work ?

Thanks

Keith


RE: Logging battery amps - PaddyB - 09-14-2018

(09-14-2018, 01:16 PM)keithwhite Wrote: I'm planning to copy this, did you remove the 0.10 Ohm Shunt on the Board to get this to work ?

Thanks

Keith

0.1Ohm INA219 shunt resister is still there, on paper makes very little difference & seems plenty accurate with it still there, though probably will remove it at some point


RE: Logging battery amps - keithwhite - 09-15-2018

(09-14-2018, 04:55 PM)PaddyB Wrote:
(09-14-2018, 01:16 PM)keithwhite Wrote: I'm planning to copy this, did you remove the 0.10 Ohm Shunt on the Board to get this to work ?

Thanks

Keith

0.1Ohm INA219 shunt resister is still there, on paper makes very little difference & seems plenty accurate with it still there, though probably will remove it at some point

Thanks, time to get soldering  Smile


RE: Logging battery amps - gypsylyon - 10-17-2018

Excellent work
another possibility is to connect the INA219 directly to the Raspberry, because the connectivity is done by i2c.
Here is a tutorial on how to do it
https://www.rototron.info/raspberry-pi-ina219-tutorial/