ACS712/723 learning opportunity - Page 1
Forum section: electronics / projects

author: woody
author_rank: Frequent Contributor
timestamp: November 22, 2017, 10:23:09 am
content: I am working on a device to measure main AC current using an ACS712. I don't need very high accuracy, just to make sure that the current stays in between some values. Outside these values the device switches the AC off. The switching is done with a (12V) relay.In the first version I used an Omron relay. I found that the output of the ACS which, when measuring AC, should swing proportionally around 0,5 Vcc (2.5V), was off by -100mV. Did not think a lot about that, blamed the opamp circuit that amplified the ACS output and corrected this in firmware.Then, for my second prototype, I used a Finder relay and the newer ACS723 (with build-in opamp). To my surprise the ACS output was now off by +80mV. I started to blame the ACS. I started to blame the AC line. I started to blame the weather. I started to poke a screwdriver in my PCB to short out the ACS's bandwidth selection pin to see if that made a difference. As soon as I moved the screwdriver next to the ACS the device detected an overcurrent situation and switched off the relay.Then it occurred to me: the screwdriver is magnetic. But so is a relay coil. The coil of my relay sits 20 mm from the ACS723. Enough to influence the reading of the ACS. One coil is would one way, the other the other way around. So two different offsets. These ACS chips really are sensitive to outside magnetic fields, as stated in the datasheet. RTFM. Time for a tinfoil hat for the relay, or, more likely, a PCB redesign.The worst thing about all this is that I had already noticed that before the relay was activated the output of the ACS was 2.5V. Only after activating the relay the output was pulled higher or lower depending on which relay I used. I'm getting too old for shit like this

author: nctnico
author_rank: Super Contributor
timestamp: November 22, 2017, 11:42:48 am
content: There are two important things to know when using these sensors:- load the output with 4.7 kOhm- provide an accurate power supply (like a 0.1% reference) if you want some accuracy from them.

author: Jeroen3
author_rank: Super Contributor
timestamp: November 22, 2017, 11:49:56 am
content: The magnetics of the relay or screwdriver do not matter when measuring AC, since these will give you DC offset.However, it might have an effect on the linearity, and the offset could push it out of range.

author: woody
author_rank: Frequent Contributor
timestamp: November 22, 2017, 02:53:39 pm
content: @ntcnico:Accurate power supply is not that important. After all, .5 Vcc is also .5 Vcc for the ADC in the MCU. What turned out to be important is noise. The original design had a SMALL SMPS but that was less than ideal.@Jeroen:The DC offset does matter in this case. I do an AD conversion 5 ms after a zero crossing pulse is detected. This gives me the 'top (or bottom) of the current sine' value, assuming that the PF is not too bad. When there is a DC offset this influences the measurement.

author: Buriedcode
author_rank: Super Contributor
timestamp: November 22, 2017, 03:08:34 pm
content: Thanks for posting this - all too often people post problems with no solutions, but now theres a nice documented record int he forum about problems/solutions using this device.

author: fourtytwo42
author_rank: Super Contributor
timestamp: November 22, 2017, 05:31:51 pm
content: Quote from: woody on November 22, 2017, 10:23:09 amYes I also discovered this to my cost recently see posthttps://www.eevblog.com/forum/renewable-energy/news-from-the-gti-design-workbench-lcl-issues/There is supposed to be a version that is "less" sensitive but I have not seen it available to buy.In my case I have changed over to current transformers, maybe physically larger but at least you can rely on there output

author: Jeroen3
author_rank: Super Contributor
timestamp: November 23, 2017, 06:32:04 am
content: Quote from: woody on November 22, 2017, 02:53:39 pmThat only works on nice restive loads. Sample more and use a high pass filter.

author: woody
author_rank: Frequent Contributor
timestamp: November 23, 2017, 08:40:08 am
content: Quote from: woody on November 22, 2017, 02:53:39 pmWhich it isn't.