I want to remotely monitor various parameters on my 2003 55’ cruiser. Many of them relate to power - on/off, AC/DC, consumption, etc. The vessel has a generator, inverter, and can be connected to shore power. Feeds are 240VAC with 50A breakers.
I am at the start of this project. I have reviewed the electrical system on the vessel and found a couple of items I would like to tap into as opposed to adding new hardware if I can…which is where I could use some guidance.
First is house battery current. There is a large shunt across which a meter is connected displaying DC amps. Was wondering if I can just tap off that same shunt to feed information into an Arduino with the appropriate conditioning or will that screw-up the meter reading? I would be paralleling the Arduino circuitry to the meter.
Second is AC current - there are 4 current transformers rated 100A to 5A.
Again, meters are connected directly to their output side. Wondering, again, if I can tap those same outputs with appropriate conditioning circuitry to feed an Arduino. These transformers are downstream of the power source selector switches.
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?
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.
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?
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.
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.
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?
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?
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.
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 …
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.
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.