Logging battery Amps - Printable Version +- OpenMarine (https://forum.openmarine.net) +-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1) +--- Forum: How do I...? (https://forum.openmarine.net/forumdisplay.php?fid=3) +--- Thread: Logging battery Amps (/showthread.php?tid=3091) |
Logging battery Amps - affinite - 2020-11-14 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) Thanks - Keep Safe RE: Logging battery Amps - baltika_no_9 - 2020-11-27 (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. RE: Logging battery Amps - holgerw - 2020-11-27 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=cG8moaufmQs&ab_channel=AndreasSpiess maybe better use an Hall Type sensor. but try it and happy boating Holger RE: Logging battery Amps - PaddyB - 2020-11-27 (2020-11-27, 06:16 PM)holgerw Wrote: Hello affinite, 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. RE: Logging battery Amps - affinite - 2020-11-27 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 RE: Logging battery Amps - PaddyB - 2020-11-27 (2020-11-27, 08:54 PM)affinite Wrote: Holger and Paddy 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 RE: Logging battery Amps - affinite - 2020-11-28 (2020-11-27, 09:13 PM)PaddyB Wrote:(2020-11-27, 08:54 PM)affinite Wrote: Holger and Paddy 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. RE: Logging battery Amps - PaddyB - 2020-11-28 (2020-11-28, 11:59 AM)affinite Wrote: Thanks 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. |