This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Logging battery amps
#1
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]
  Reply
#2
Can it measure both charge and discharge?
  Reply
#3
(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.
  Reply
#4
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.
  Reply
#5
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?
  Reply
#6
(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.
  Reply
#7
(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
  Reply
#8
(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
  Reply
#9
(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
  Reply
#10
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/
  Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)