Improving output of ACS720 current sensor for AC sensing

I just ordered a current sensor based on the ACS720 for sensing mains power consumption. From what I understand, the voltage on the analog output will oscillate around 2.5V with 50Hz. Now, this causes two proplems for me: 1. I want to sense with a 3.3V device, so a peak of 5V is too much. 2. Even if I had a 5V device, I would halve my accuracy, since I would only sense over absolute values of 2.5V

So I came up with the idea of adding an appropriate absolute difference value op amp circuit. This should allow me to sense with a resolution of ~0.83W up to ~850W (240V*5A/sqrt(2)). Since I am a total noob with op amps, I googled and found this: http://www.edn.com/design/analog/4374814/Dual-op-amp-takes-absolute-difference It says it is for dc or slow circuits and I wasn't sure if 50Hz is exactly "slow", so I tried to simulate it. From the values I put in, I would have expected a rectified sine wave between 0V and 1.3V. However, it doesn't work at all, as it looks. I already tried to change the AC source to DC, but that also didn't work.

Any ideas? Error in my simulation? In the software? In the example`In my understanding? Any alternative suggestions?

Ok, got it myself. First op amp is wrong way around and one cross wasn't connected :) I had to reduce the capacitor to get it fast enough. Here is the working circuit.

Will this work in practice? I do not own an oscilloscope, so I wouldn't notice if reality kicks in at some point. Any further suggestions? I thought about a low pass filter to avoid sampling the sine with the Arduino. I could just increase the amplification to get it to the right values again. - But I wouldn't do that if it costs me too much temporal resolution. I do have two op amps left in my LM324.

There is no such thing as an ACS720

Your 3.3volt circuit won't work with an LM324. This is a low voltage opamp, but not a rail2rail opamp.

Maybe you mean the ACS712. Note that boards sold on ebay with this sensor should not be used on mains power. And the sensor itself might be ok for 110volt, but has too low isolation for 230volt AC. Google "ACS758". An external 16-bit A/D (ADS1115) might be easier than a pre-amp. Leo..

712, of course. With isolation, you mean distance between pins and traces? That makes sense. For the internal isolation the datasheet gives 2,1kV min.

While I See that the tracey and pins are really close, this is the first time I hear a warnung about it.

The datasheet also states a double insulated (not grounded?) working voltage of 184volt peak = <130volt AC.
What is the creeping distance between the low voltage tracks and high voltage tracks of those boards?
Leo…

That is for reinforced insultation. For basic it says 354V peak. I am not sure what it important here. What I find pretty strange is that even the more reputable vendors like sparkfun only state the 2.1kV and do not give any warning about mains.

Sparkfun is based in the US (110volt).
Leo…

Well it is the same for the German site Watterott that I always assumed to be relatively reputable. It is a least where I go whenever I want to pay ten times of what I pay at ali :)

I never saw those websites mention that you can use those boards safely for mains power. I think it's upto the end-user/builder to deliver a safe product.

Have a look at the OpenEnergyMonitor site. They use non-invasive clip-on current transformers. https://openenergymonitor.org/emon/buildingblocks/ct-sensors-interface Leo..

You also need to remember that mains power can have all sorts of transients on it too that go significantly higher than the RMS voltage you are working with (bad things happen when insulation breaks down in those situations - you not only let out the "magic smoke" but the "magic flames" as well - I remember seeing one at work one day where somebody managed to connect 110vac to the clock input on a JK TTL flip-flop (5v logic). Not only were 3 legs of the chip burned off, there was a big crater in the top of the plastic where the chip itself used to be :o

Okok, I am convinced and will go for the ACS758. This, though, makes me only more interested in the op amp circut, since the smallest model measures up to 50 amp, which I by far do not need and brings my resolution down even with a 16bit ADC. Will this thing work in practice? ANy improvements?

I think the total error of a Hall based current sensor is >1%, so more than 8-bits resolution is not possible. Leo..

I also just looked at that in the datasheet. 15mV noise and 60mV/A. If I am not mistaken, this gives me fricking >50W noise @240V.

That is not what I am looking for Oo

How do commercial power meters work? Mine has a display for 0.1W and gives reasonable reading for <0.5W, at least.

Post#9

I do not see any noise or accuracy ratings in the datasheet. Do you really think that will geht to 0.1W? (Not that I need that, but now I am interested.) EDIT: From what I read about emonTx, there is also not much to expect below 10W.