Help with shunt current sense design for AC

Thread Starter

n4mwd

Joined Mar 21, 2016
50
I am currently trying to build a circuit capable of measuring AC current, voltage and waveform using a shunt resistor. The measurements will be collected by an MCU and displayed on a small screen.

The AC is 60 Hz 120 VAC from an inverter and not mains. Even still, I want to have some sort of galvanic isolation without the use of a transformer. I was thinking of capacitive isolation because optoisolators can go bad over time.

For current measurement, I will be using a simple shunt resistor. I was thinking about something like the schematic below. The inputs to the mcu and current sense chips are galvanic isolated using capacitors. Would something like this work? What is a good value for the capacitors at 60 Hz? Is this circuit something that will give good accuracy? Will the AC waveform transferred over a capacitor be true at the MCU? Better yet, is there a chip somewhere that will do this using shunt differential measurement? I found a few that might work, but unfortunately they came in packages too small to hand solder.

1605017969850.gif
 

ronsimpson

Joined Oct 7, 2019
3,037
If you move the shunt to the "N" and not "L" then the voltage dividers can go away. Right now any errors in the voltage dividers will appear on the output of the Current Sense IC.

Also there will be errors because "N" is not the same as "ground" that the micro sits on.
 

crutschow

Joined Mar 14, 2008
34,428
Use a current transformer as Ian0 suggested for current, and a low voltage (e.g. filament) transformer for the voltage/waveform.

You can use a precision op amp rectifier to generate a DC voltage from the voltage transformer for the MCU.

A bridge rectifier will work to generate an accurate DC from the current transformer, since its current output will cancel the offset of the rectifier diodes.
But a precision op amp rectifier would work for that also.
 
Last edited:

Ian0

Joined Aug 7, 2020
9,814
I’ll recommend this little circuit as it interfaces to the filament transformer and biases the input voltage to the centre of the MCU supply. A ”12V” transformer (which is actually 15V off load) interfaces with R1=39k, R2=5.6k
Also, never underestimate how much voltage at a very low impedance a current transformer can deliver when there is a surge current through it!
Although a 1Amp current transformer with a 1Ω load looks super convenient for a MCU on a 3.3V supply, that input needs some SERIOUS protection.
 

Attachments

Ian0

Joined Aug 7, 2020
9,814
I forgot to mention that the filament transformer can also generate the power for the rest of the circuitry.
Unfortunately, that tends to spoil the accuracy! Unless, either, it’s only a tiny amount of power, or it’s a very constant amount of power, even then it tends to knock the top off the waveform and spoil the rms calculation.
 

crutschow

Joined Mar 14, 2008
34,428
Unfortunately, that tends to spoil the accuracy! Unless, either, it’s only a tiny amount of power, or it’s a very constant amount of power, even then it tends to knock the top off the waveform and spoil the rms calculation.
I would think the electronics would take a small and constant amount of power.

That may lower the peak slightly due to the transformer winding resistances, but you want to measure the average value of the waveform (using an LP RC filter) to determine the RMS value, which is not as sensitive as using the peak value.
That value is also much less sensitive to noise and waveform distortion (especially from an inverter) than the peak value.

And the average output would likely need to be calibrated anyway, due to the transformer tolerances.
 

Ian0

Joined Aug 7, 2020
9,814
I would think the electronics would take a small and constant amount of power.

That may lower the peak slightly due to the transformer winding resistances, but you want to measure the average value of the waveform (using an LP RC filter) to determine the RMS value, which is not as sensitive as using the peak value.
That value is also much less sensitive to noise and waveform distortion (especially from an inverter) than the peak value.

And the average output would likely need to be calibrated anyway, due to the transformer tolerances.
If the electronics takes only a small amount of power, then a series resistor between the bridge and smoothing capacitor prevents most of the distortion.
Off-load transformers are extremely consistent because it's just a turns ratio, and Lmag remains constant until it starts to saturate.
 

Thread Starter

n4mwd

Joined Mar 21, 2016
50
Thanks for the replies. I don't really want to use inductors for the circuit. The inverter itself has an AC measuring circuit on its integrated display, but the builder's thought it was necessary to grind off the part numbers. Essentially, the Line side of the inverter runs though two 0.004 ohm chip resistors in parallel (0.002 ohms combined) and then to the AC outlet on the inverter. The two sides of the resistors are tapped and go to diodes, capacitors and other resistors. I haven't been able to completely trace the circuit. And then they are all fed into a SOIC-8 chip (no readable numbers). From that, it goes into three opto-isolators which connect to an MCU. My best guess is that the mystery chip is a specialty chip of some kind that measures both current and voltage and outputs it as SPI to the mcu. There is no waveform display. I added that myself because the display I have does color graphics.

If anyone is interested, I'm building a portable solar power pack and the above circuit is part of an all-in-one meter system that measures current, voltage and calculates wattage and efficiencies. I originally had planned to simply cut the existing AC meter display out of the inverter and use that as a second display, but then it dawned on me that I could just put all the meter electronics on one board and one graphical display.

Any ideas what the mystery chip could be? Would my circuit above work at all? If not, then what is wrong with it? Again, this is connected to an inverter and not mains. Their could be some small surges from inductive appliances, but nothing big.

Below is a photo of the display board that came with the inverter.

1605058024622.jpeg
 

Thread Starter

n4mwd

Joined Mar 21, 2016
50
If you move the shunt to the "N" and not "L" then the voltage dividers can go away. Right now any errors in the voltage dividers will appear on the output of the Current Sense IC.

Also there will be errors because "N" is not the same as "ground" that the micro sits on.
I think what you are referring to is low side current shunts. Everything I've read says that they are more prone to noise than high side shunts.

Is the noise that you are referring to higher or lower than 60Hz or both?

As far as consistent errors because of inaccurate parts, I'm thinking that could be reduced with either trimpots or in the MCU. The exception is the waveform display. On that I want to display the waveform errors.
 

Ian0

Joined Aug 7, 2020
9,814
So you think that the 120V from your inverter is somehow not as dangerous as the 120V from the mains?
In Britain and Europe, exactly the same safety standards apply to the output of an inverter as to mains equipment, so there would have to be isolation which withstands 1500V between output and earth.
 
Last edited:

Thread Starter

n4mwd

Joined Mar 21, 2016
50
So you think that the 120V from your inverter is somehow not as dangerous as the 120V from the mains?
In Britain and Europe, exactly the same safety standards apply to the output of an inverter as to mains equipment, so there would have to be isolation which withstands 1500V between output and earth.
I'm hoping a capacitor, especially a physically larger through hole part, will have no problem blocking a surge of 1500V from the inverter. Worst case, I can use optoisolators. Both transformers and capacitors can transmit a brief surge as the result of a lightning strike on the mains transmission wires. This has to be handled by additional circuitry. Optoisolators are the only 100% isolation that I know of, they are incapable of transmitting a surge, but they go bad over time.
 
Top