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.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Logging battery Amps
#1
I want to monitor battery current In/Out using an INA219 and my existing NASA BM1 100A/50mV external shunt.
Data to be fed into an ESP8266 running ESPEASY and then on to OpenPlotter via MQTT

Ive read Paddyb's thread in "How I did it" but I'm a little unclear on a couple of points...

1) Can you draw a heavy load through an external shunt in parallel with the onboard without blowing the onboard shunt?
If the load is drawing say 50A (e.g. battery charging) doesn't 50A get pulled through the (parallel) shunts thus destroying the (3.2A) on-board shunt?
I know the simple answer is to remove the on-board shunt but I note above that Paddy just "piggy-backed" the INA219 onto the external shunt - I'd like to understand why that didn't result in Blue smoke !

2) Unfortunately although INA219 is supported in ESPEASY it doesn't have a calibration option to support external shunts. 
Has anyone used ESPEASY with an INA219 and an external shunt and if so how did you calibrate the external shunt?
Did you simply use a formula in ESPEASY ? and if so do you have the formula for a 100A/50mV or a 50A/75mV shunt (yes I know I'm lazy)  [Image: rolleyes.png]

Thanks - Keep Safe
Reply
#2
(2020-11-14, 11:30 AM)1) Can you draw a heavy load through an external shunt in parallel with the onboard without blowing the onboard shunt? Wrote: Yes easily, the resistance of your (for example) 100A/50mV shunt (0.0005Ω) is so tiny compared to that of the onboard shunt that almost all of the current will flow through the parallel shunt. Indeed at the maximum current of 100A only about 0.5A will flow through the onboard shunt with the remainder through the parallel shunt. The external shunt will self destruct first. To draw the maximum 3.2A through the onboard shunt would require a total of over 643A through the parallel pair.  


2) Sticking with the 100A/50mV external shunt then to calibrate you would need to multiply the current indicated by the INA219 by a factor of around 201 to give the true current through the parallel pair. For instance a current of 60.3A would result in a voltage across the parallel pair of approximately 0.03V. Of the current, 0.3A goes through the onboard shunt and 60A through the parallel shunt.

It means you’re operating the onboard shunt over quite a small part of its voltage range, you’re using around 0 to 0.05V of its total 0 to 3.2V range. Whether it is linear over that range is hard to say I don’t know the device. I would say it’s better to remove the onboard shunt and use just the external one.  Your multiplier then is 200 and you’d be using more of the range of the shunt.

The calibration ratio (if you remove the onboard shunt) is equal to the ratio of (resistance of original onboard shunt)/(resistance of new external shunt). In this case above it's 0.1/0.005 = 200.
Reply
#3
Hello affinite,
as baltica-no9 writes you can go with you internal big shunt. but there is another problem to solve:
this chip measures only current and voltage, so you get only the power FROM the battery, if you want also to
measure the INPUT to the battery you will need another chip connected the other side around!

take an look to this swiss guy: https://www.youtube.com/watch?v=cG8moauf...reasSpiess

maybe better use an Hall Type sensor.

but try it and happy boating
Holger
Reply
#4
(2020-11-27, 06:16 PM)holgerw Wrote: Hello affinite,
as baltica-no9 writes you can go with you internal big shunt. but there is another problem to solve:
this chip measures only current and voltage, so you get only the power FROM the battery, if you want also to
measure the INPUT to the battery you will need another chip connected the other side around!

take an look to this swiss guy: https://www.youtube.com/watch?v=cG8moauf...reasSpiess

maybe better use an Hall Type sensor.

but try it and happy boating
Holger

The ina219 measures  both ways so oit will measure power going into the battery and out, but only current as it's connected to 0v. 
[Image: 7xsWNjQ.png]
Reply
#5
Holger and Paddy
Thanks for the advice
I only want the device to measure Current (In and Out) as I already have an ADS1115 measuring voltage.
 
I've been experimenting with the INA219 (with the onboard shunt removed) this afternoon.
I've also tried amplifying the shunt voltage using an AD620 Millivolt Amplifier which is adjusted for enough gain to give 3.3v (at Full Scale - 100A) and then measured in differential mode by an ADS1115. That seems to work well so I'll compare with the INA219 over the next few days

Regards
Steve
Reply
#6
(2020-11-27, 08:54 PM)affinite Wrote: Holger and Paddy
Thanks for the advice
I only want the device to measure Current (In and Out) as I already have an ADS1115 measuring voltage.
 
I've been experimenting with the INA219 (with the onboard shunt removed) this afternoon.
I've also tried amplifying the shunt voltage using an AD620 Millivolt Amplifier which is adjusted for enough gain to give 3.3v (at Full Scale - 100A) and then measured in differential mode by an ADS1115. That seems to work well so I'll compare with the INA219 over the next few days

Regards
Steve

Don't think you need to amplify the voltage, the INA already has a high quality amp built in so can measure down to micro volts. The gains are adjustable, or should be when instantiating  an instance of the library >

GAIN_1_40MV = const(0)  # Maximum shunt voltage 40mV
    GAIN_2_80MV = const(1)  # Maximum shunt voltage 80mV
    GAIN_4_160MV = const(2)  # Maximum shunt voltage 160mV
    GAIN_8_320MV = const(3)  # Maximum shunt voltage 320mV
    GAIN_AUTO = const(-1)  # Determine gain automatically
Reply
#7
(2020-11-27, 09:13 PM)PaddyB Wrote:
(2020-11-27, 08:54 PM)affinite Wrote: Holger and Paddy
Thanks for the advice
I only want the device to measure Current (In and Out) as I already have an ADS1115 measuring voltage.
 
I've been experimenting with the INA219 (with the onboard shunt removed) this afternoon.
I've also tried amplifying the shunt voltage using an AD620 Millivolt Amplifier which is adjusted for enough gain to give 3.3v (at Full Scale - 100A) and then measured in differential mode by an ADS1115. That seems to work well so I'll compare with the INA219 over the next few days

Regards
Steve

Don't think you need to amplify the voltage, the INA already has a high quality amp built in so can measure down to micro volts. The gains are adjustable, or should be when instantiating  an instance of the library >

GAIN_1_40MV = const(0)  # Maximum shunt voltage 40mV
    GAIN_2_80MV = const(1)  # Maximum shunt voltage 80mV
    GAIN_4_160MV = const(2)  # Maximum shunt voltage 160mV
    GAIN_8_320MV = const(3)  # Maximum shunt voltage 320mV
    GAIN_AUTO = const(-1)  # Determine gain automatically

Thanks
I was only amplifying the voltage when measuring shunt voltage drop with the ADS1115
With the INA219 I'm using ESPEASY where there doesn't seem to be an option to adjust the gain.
I'll look again this afternoon.
Reply
#8
(2020-11-28, 11:59 AM)affinite Wrote: Thanks
I was only amplifying the voltage when measuring shunt voltage drop with the ADS1115
With the INA219 I'm using ESPEASY where there doesn't seem to be an option to adjust the gain.
I'll look again this afternoon.

Good chance you won't need to, just using the default library values I calibrated mine by trial and error using a DC clamp meter and tweaking a calibration constant I had programmed in, not sure if you can do that with espeasy though? 
Mircopython library doesn't seem to return such stable values on my setup now though.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)