Measuring Voltage over shunt

Hey,

to measure the energy output of a solar system, i have a shunt installed over which i want to measure the voltage drop with an arduino. Does the Arduino have to be on the same potential as the shunt? This would be 24V the measured Voltage drop is between 10 and 100mV.

Thanks alot

one pole of the shunt to arduino ground, the other pole of the shunt to an arduino analog in pin.

Is the shunt located on high side (positive) or negative? In first case you can use a specialized IC like the INA219 that will read for you current, voltage and power.

Ciao, Ale.

Yeah... It's the ground you have to be careful about... If one end of the shunt isn't already grounded you don't want to short it to ground by connecting the Arduino's ground. (The Arduino does need a "ground reference" in order to measure voltage.)

joschwe:
Does the Arduino have to be on the same potential as the shunt?

This would be 24V the measured Voltage drop is between 10 and 100mV.

Yes. The shunt has to be in the negative/ground line of the solar panel, and Arduino ground has to be connected to the solar panel side of the shunt.

Bad resolution.
If you measure that with default Aref (~5mV per A/D value), then you will only have 20 A/D values across the measuring range.

Switching to 1.1volt Aref will improve things five times.

This board measures high-side, has an onboard 3A shunt, and onboard 12-bit A/D for voltage and current.
Current capability can be increased by adding an external shunt.
Clones available on ebay.
Leo..

Most of the Atmega chips, but NOT the Atmega 328, can measure the differential voltage between two analog pins and neither of those pins needs to be at Arduino GND - provided, of course, that Arduino GND is not connected to the shunt circuit at all.

Those Atmega chips also include amplifiers if needed to boost a very low voltage across a shunt.

The Mega, Leonardo/Micro and Attiny's can all do this.

...R

Robin2:
Most of the Atmega chips, but NOT the Atmega 328, can measure the differential voltage between two analog pins and neither of those pins needs to be at Arduino GND - provided, of course, that Arduino GND is not connected to the shunt circuit at all.

Those Atmega chips also include amplifiers if needed to boost a very low voltage across a shunt.

The Mega, Leonardo/Micro and Attiny's can all do this.

Both shunt voltages have to fall withing GND and VCC.
I think it's safer to keep one terminal of the shunt connected to ground.

The INA219/169 can measure outside that GND VCC range.
Leo..

A five meter 4mm^2 cable from the "-" of the solar cell to the "-" of the inverter can easily drop 200mV or more, so you need to be careful where ground is connected to it. Arduino is not especially good for measuring 10mV to 100mV. You could I suppose rig an op amp to increase from V_shunt x10 or x-10 to get something in the 0 to 1 Volt range.

Wawa:
Both shunt voltages have to fall withing GND and VCC.

To the best of my knowledge it is only necessary that the difference between them does not exceed 5v (assuming a 5v Arduino). But one of them could be at 1000v and the other at 1004v.

The voltage across a current-measuring shunt is usually less than 1v and probably a lot less.

...R

if one pole of the shunt is connected to arduino ground and the other pole to an analog pin (and the rest of the circuit is isolated from the arduino, forgot to mention that part), then all you are doing is measuring the voltage across the shunt.

I attached a photo of the whole control box.

I want to know the voltage drop over the copper shunt in the middle.
There are already 2 cables on + and - of the shunt installed.
I tried to connect them with a analog/digitizer to a raspberry pi but it destroyed the pi...
So now I my plan is to connect the arduino and send it with an optocoupler to the pi.

unfortunately i never used an arduino before and have to finish this as an university project pretty soon...

so far I guess i would connect the ground somehow to a 24V source - not sure how
and one pole of the shunt to an analog pin.
Also i have to protect it with a diode somewhere I guess.

Image from Reply #10 so we don't have to download it. See this Image Guide

...R

What voltage, relative to GND, is on the shunt?
What is the range of current that the shunt has to measure?
What is the voltage across the shunt for the different currents?

You can take all these measurements with your multimeter

Will the Arduino be powered from the system that it is measuring or can it be powered completely independently?

Whatever you did that destroyed your RPi will also destroy an Arduino so be careful not to repeat it.

...R

Robin2:
What voltage, relative to GND, is on the shunt?
What is the range of current that the shunt has to measure?
What is the voltage across the shunt for the different currents?

You can take all these measurements with your multimeter

Will the Arduino be powered from the system that it is measuring or can it be powered completely independently?

Whatever you did that destroyed your RPi will also destroy an Arduino so be careful not to repeat it.

Voltage relative to ground: 24V
current range : 1-40A
voltage across shunt : 10mV/1A

it can be powered independantly.
I think the pi got detsroyed because it wasn't grounded properly

From your figures the voltage across the shunt will vary from 10mV to 400mV (and the shunt resistance is 0.01 ohms). Another way of thinking about it is that when the voltage on one side is 24v the voltage on the other side will be 23.99v when 1 amp is flowing.

If you have a voltage divider on each end that reduces the max from 24v to (say) 4.8v (divide by 5) the voltage on the other side would be 4.798v. If the Arduino treats 5v as 1023, it would show 982 for 4.8v and 98.2 (rounded up) for 4.798v. In other words it does not have sufficient resolution.

That is why I think you need to use an Atmega chip that can measure the differential voltage across the shunt.

...R
PS. I hope some checks my maths

Robin2:
To the best of my knowledge it is only necessary that the difference between them does not exceed 5v (assuming a 5v Arduino). But one of them could be at 1000v and the other at 1004v.

Wishful thinking.
No, pin voltages have to be within GND and VCC.
Leo..

Which atmega would be suitable to measure the potential between the shunts?

Hi joschwe

You could try a hall effect sensor - Allegro make a series eg the ACS712, which offer very high isolation, so you you fiit them on either the high or low side.

Be nice if there was a shield - there must be many people with this problem.. perhaps I'll design one.

regards

Allan.

Yeah
I think a Hall Effect Sensor is a good idea so far.
I was surprised that its so hard to do this with the arduino- I always thought it was used for voltage measuring

Hi,
This is very important, before we go any further, it is essential that you please post a copy of your complete circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

There is a lot of wiring and is that a charge controller in black?

If you have no circuit diagram, then now is the time to draw one.

Tom..... :slight_smile: