Tapping existing metering hardware on boat for power measurements

Welcome, Tim to the OEM forum.

When you say meter, I take it that you mean an ordinary analogue panel meter that has just those two wires to it (either from the shunt or from the c.t.) - something that resembles this

or is it a digital one?
If all 4 are analogue, then it should be relatively simple, but if there’s anything else connected to any of them, then we really need to know exactly what those are to ensure that there are no unwanted or even dangerous side effects from making connections to them.

How would you be intending to power the Arduino? And what would you also connect to it?

Thank you for the quick reply Robert.

Yes, they are analogue meters. Here is a shot of the full breaker panel.


DC meters are top left and AC meters (two voltage/one current each side) in the center between the breakers. Nothing else appears to be connected to any of them but I plan on powering down the entire vessel and tracing wires to be sure.

1 Like

When you do that, look for any details on the meters themselves. What I’d hope to see on them is a voltage rating - probably 75 mV or 150 mV - on the back or the label but maybe on the front, as well as the current scale on the front.
Also, does the d.c. shunt have a voltage or a resistance rating on it?

will do on meter specs.

Arduino(s)/Pi will be powered from house batteries 12vdc probably with buck converter although I have a couple 12vdc to USB mini plug units left over from other work that I might also apply. There will be several “digital” inputs - 12vdc on/off status that I plan to level shift to 3.3v. I will 3-4 ESP8266 boards throughout the boat as it is too difficult to run wires into various compartments. Current plan has 1 in Engine room, 1 at helm, 1 in salon, and probably one more in the rear cockpit.

She’s a big girl - Boat has 13 large AGM batteries - some config’d at 24vdc and some 12vdc (4 engine start, 2 house, 2 inverter, 1 generator, 2 stern thruster and 2 bow thruster). Lots of things to monitor - 5 bilge pumps, 4 high water sensors, smoke/fire/co, Frig/freezer temps, compartment temps, ice maker temps, GPS position, motion detection and on and on. Just limited by how much I want to do. I do not plan any “control signals” to the boat but might add some remote lighting controls in the future.

Our experience with ESP8266s is mixed. My colleague Brian (@borpin) recommends a Raspberry Pi Zero W instead - more reliable, he says.

The reason for asking about the power was because of the battery shunt. As the Arduino power will probably be common to one side of that battery one way or another (unless your converter is completely isolated on the input side - which conflicts with your 12 d.c. inputs) then depending on which pole of the battery the shunt is in relative to the common, you could have an isolation problem with the millivolt shunt input.

5 posts were split to a new topic: ESP8266 - questions about possible problems & reliability

Robert,
I hadn’t considered Pi zeros but I’m still in the investigation stage so appreciate the thoughts.

I did some more digging. Pictures worth a 1000 in this case.

At the top level, one great thing about my boat’s wiring is every conductor is separate as you can see here. It is also very neat to fairly easy to trace wires. So I can easily get to individual wires.

That being the case, I think it will greatly simplify my situation to just add clip-on CTs to get AC current vs tapping into the existing CTs (On the left in the pic.). Would you concur?

So then I am just looking to get AC voltage and DC V/A.
AC voltmeter:


Seems I could just tap across where this meter is connected at the source selector switch - sources being one of three independent shore power feeds or the generator.

DC Volt Meter


Seems I could just tap across where this meter is connected at the house battery selector switch

DC Ammeter connected directly to the shunt below (100A/50mV)

DC Shunt


If my above suggestions are correct, then it comes down to tapping into the DC shunt to get to DC current. How would I do that?

Regarding powering the various processors…the house batteries feed a selector switch which is then directly connected to the shunt. The other side of the shunt then feeds all the 12VDC loads on the boat. There is a common negative for all 12VDC loads. So I was planning on powering the processors from the “downstream” side of the shunt just as all other loads are powered on the boat. Will that be a problem?

Thanks again.
Tim

apology for the big photos - haven’t found a preview button or way to resize once in a post…

That was my thinking from the start, but I thought it was worth checking to see if your idea was viable.

I think a small isolating transformer (aka a.c. adapter) giving you anything above 1.6 V followed by a voltage divider - just like we do for normal mains - is the easiest.

This is the tricky one. As one side of the battery is common to the Arduino common, for the voltage it’s a simple matter of dividing the voltage down and putting it straight into the Arduino ADC.
The shunt is in the other pole of the battery, and so you’ll need an op-amp having differential inputs that can accept a voltage above the op amp’s supply voltage (unless you feed the Arduino from the battery side of the shunt, in which case equal to), in order to amplify and shift the shunt voltage down into the Arduino ADC’s operating range. As it is, if your Arduino is a 5 V one, the ADC input is 0 - 5 V and shunt gives you 0 - 50 mV, so you need a gain of 100 to use the full range of the input. That’s not straightforward if, as I suspect, you have a fairly large temperature range over which you expect to operate (I’m thinking thermal drift, etc). A 3.3 V Arduino would ease matters slightly. You probably don’t need the full 1024-step resolution, so it should be possible to trade resolution for stability by reducing the gain - a resolution of 0.5 A is still probably better than you need, and would help the stability significantly. I’m thinking in terms of a specialist high-side device designed for the automotive applications.
I don’t know your skills in this area, but I have the feeling you might well be up to this?

Thank you Robert.

I get the “drift” no pun intended (well maybe a little) re. the DC current situation. If I am reading this correctly, I would be using the differential op amp to pick-off the voltage differential across the shut then condition to get it into the 3.3v arduino. It’s been quite a while since I worked with op amps so another skill to dust off. If you can point me to an appropriate link that might be related to this situation to get started I would appreciate it.

I’m looking for a single supply, voltage difference amplifier. And I’m struggling. The Texas INA149 will work on a single supply, it can handle an input voltage way above what you need, and shift the voltage down into the Arduino’s range, but it’s unity gain, so you need another stage of amplification to get a decent output for the Arduino.

Been looking into this as well. Still dusting off cobwebs on analog electronics.

Would an instrumentation amplifier fit the bill? Instrumentation amplifier - Wikipedia

High impedance buffers on the front end with gain from second stage? Article references TI part IN129.

This looks interesting as well: INA220 data sheet, product information and support | TI.com

If I an reading it correctly it do high side (my case correct?) and low side measurements with input voltages up to 26V. Says it supplies current, voltage and power measurements digitally on I2C bus. Still investigating …

SOrry for the bonbardment but learning as I go…Here is a similar part on a board from ADaFruit. Seems it would work…?

If you use any op.amp (i.e. one not specifically designed for this job with closely matched resistors on-chip), you will have a problem with matching the resistors so that you maintain common-mode rejection. You don’t want the zero to move about as the battery voltage changes, for example.

Simplifying Current Sensing (Rev. A) is worth looking at.

The INA220 does look appealing, I think it will do the job for both voltage and current, but you’ll need to write the software to extract and process the data.
The INA260 isn’t ideal. From the above link: TI’s INA250, INA253 and INA260 devices feature a current-sense resistor integrated inside the same package as the current-sense amplifier. You’ve already got your shunt, you’d have its 2 mΩ shunt plus the resistance of the connections in parallel with your 0.5 mΩ shunt, I’d hate to have to estimate contact resistances etc to work out how the current would share between them. And the calibration of your ammeter would then be wrong - by an equally hard to estimate amount.

But if Adafruit has done the software for that, what you’d need for the INA220 is probably almost a clone thereof.

really appreciate your insights Robert. I’ll do some more digging today.

Did some more digging and found this Adafruit product. Overview | Adafruit INA219 Current Sensor Breakout | Adafruit Learning System. Has shunt on board vs onchip with the previous product so I can remove it and use boat’s shunt. They have a library for the device so should be straight forward. Will keep you posted and open to comments.

Thanks

Tim

That sounds good. It was 1:42 am local when I last posted - that’s why I didn’t look any more :wink:

1 Like

You are a good man Robert! :innocent:

Hello. I found this post while looking for a voltage/current logger using my Pi4. I am curious how did this project turn out and if I can learn more about it to make it work with my battery.

I have a basic battery monitor (coulomb counter) that uses 350A rated shunt. I also have Pi4 onboard for SignalK and N2K, etc. Would like to read low-side shunt and input into Pi4 via I2C interface. It looks like the adafruit little board could do that but I am really confused about the amperage limitations. In theory I could be having as much as ~100A going through the shunt. Would it fry the INA260 board?

Any pointers are greatly appreciated.

Val