# Measuring Shunt on 48V nominal battery charger

I am using an ESP8266 with an ADS1015 with a 50A/50mV shunt. I have the shunt connected to A0 and A1 for differential reading. However when current is going over the shunt, I get -1 readings from the ADS1015. The ground reference for the ESP8266/ADS1015 is NOT shared with the shunt. I am worried if I do share ground reference that I will damage the ESP8266 and/or ADS1015 (as me how I know). What is going on? Do I need to share ground reference with a voltage divider? Another solution? I am getting ready to go non-invasive because this is driving me nuts. Thanks.

The ADS is the wrong chip for measuring shunt voltage high-side (in the + line).
It's inputs must stay between ground and supply of the chip (0-3.3volt in this case).
48volt in the inputs could have fried the ADS, and possibly the ESP8266 too.
You might be lucky if you haven't shared grounds yet.

Breakout boards with an INA169 can convert high-side shunt voltage to low-side.
Then the A/D of the ESP8266 can be used to measure INA output.
Leo..

Hey Wawa,
The shunt is on the low side. Also I am trying to measure current at around 30A between 44.0 and 57.4V DC, so the INA169 won't work.

Which end of the shunt is connected to which AIN?

whoinow:
Hey Wawa,
The shunt is on the low side.

Then the INA216 or INA226 could work.
Are you measuring uni-directional of bi-directional currents.
Have to watch out to not exceed negative (below ground) voltage limits of the chips.
The ADS could work with a shunt in the ground line, but a voltage divider must be used to lift it's inputs above ground.
Sensitivity could be a problem with the ADS. Shunt voltages are not that high.

whoinow:
Hey Wawa,
Also I am trying to measure current at around 30A between 44.0 and 57.4V DC, so the INA169 won't work.

30A with an external shunt (parallel to the internal one) is not a problem.
But the INA169 is designed for high-side, uni directional.

You get better answers if you provide all the details.
Leo..

Wawa:
Then the INA216 or INA226 could work.
Are you measuring uni-directional of bi-directional currents.
Have to watch out to not exceed negative (below ground) voltage limits of the chips.
The ADS could work with a shunt in the ground line, but a voltage divider must be used to lift it's inputs above ground.
Sensitivity could be a problem with the ADS. Shunt voltages are not that high.
30A with an external shunt (parallel to the internal one) is not a problem.
But the INA169 is designed for high-side, uni directional.

You get better answers if you provide all the details.
Leo..

This is a battery charger I am building so I am measuring unidirectional current out of the charger. Can you give me more detail on the voltage divider you mentioned? Where should it go exactly? The ADS1015 board I am using has an adjustable gain, which I have set to 16X right now, so that should be enough to measure the shunt accurately as possible with this hardware. I am trying to stay with the ADS1015 breakout board since its mounted into a custom board I already designed/printed/stuffed. The shunt is 50A/50mV.
Attached is a simple diagram of my setup. Note that 24V is coming into the "control board" which houses the ESP8266 and ADS1015. There is also a 24V to 5V converter (TSR 1-2450E). I use the 3.3V pin on the ESP8266 as Vcc for the ADS1015.

JCA34F:
Which end of the shunt is connected to which AIN?

A0 is on the negative side of the shunt, A1 on the positive side. Or differently said, if you look at my diagram above, A0 is connected to the PSU side and A1 is on the battery side,

Your diagram flows in the wrong direction.
Should be read from left to right, like writing.
I read that it starts with the battery, and ends at mains voltage.
Your text says otherwise, a battery charger.

The ADS1015 must have (both) it's inputs between GND and VCC,
so ESP and ADS ground must only be connected to shunt negative to ensure that.
That makes measurements single-ended, even though you are trying to use differential.
That brings resolution down, even with max PGA, to ~500 points across 50A, so a 100mA resolution.

I think you could do much better with an INA226, which is made for shunt sensing.
Leo..

Wawa:
Your diagram flows in the wrong direction.
Should be read from left to right, like writing.
I read that it starts with the battery, and ends at mains voltage.
Your text says otherwise, a battery charger.

The ADS1015 must have (both) it's inputs between GND and VCC,
so ESP and ADS ground must only be connected to shunt negative to ensure that.
That makes measurements single-ended, even though you are trying to use differential.
That brings resolution down, even with max PGA, to ~500 points across 50A, so a 100mA resolution.

I think you could do much better with an INA226, which is made for shunt sensing.
Leo..

Ok, so if I join the ground on the ADS/ESP to the ground of the shunt (boost converter side), then connect the other side of the shunt (battery side) to A0 of the ADS and use single-ended, it should work without damaging anything, just with less precision?
If I were to use a INA226 dev board, would I just remove the resistor on the board and use my shunt? The datasheet says it works from 0-36V, so I assume that is just the voltage sense and it would work with the voltages I have described for current sense?