Author Topic: ACS712/723 learning opportunity  (Read 2582 times)

0 Members and 1 Guest are viewing this topic.

Offline woodyTopic starter

  • Frequent Contributor
  • **
  • Posts: 372
  • Country: nl
ACS712/723 learning opportunity
« on: November 22, 2017, 10:23:09 am »
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   :palm:
 
The following users thanked this post: Buriedcode

Online nctnico

  • Super Contributor
  • ***
  • Posts: 28013
  • Country: nl
    • NCT Developments
Re: ACS712/723 learning opportunity
« Reply #1 on: November 22, 2017, 11:42:48 am »
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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4193
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: ACS712/723 learning opportunity
« Reply #2 on: November 22, 2017, 11:49:56 am »
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.
 

Offline woodyTopic starter

  • Frequent Contributor
  • **
  • Posts: 372
  • Country: nl
Re: ACS712/723 learning opportunity
« Reply #3 on: November 22, 2017, 02:53:39 pm »
@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.
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1685
  • Country: gb
Re: ACS712/723 learning opportunity
« Reply #4 on: November 22, 2017, 03:08:34 pm »
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.
 

Offline fourtytwo42

  • Super Contributor
  • ***
  • Posts: 1201
  • Country: gb
  • Interested in all things green/ECO NOT political
Re: ACS712/723 learning opportunity
« Reply #5 on: November 22, 2017, 05:31:51 pm »
These ACS chips really are sensitive to outside magnetic fields, as stated in the datasheet.

Yes I also discovered this to my cost recently see post https://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 :)
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4193
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: ACS712/723 learning opportunity
« Reply #6 on: November 23, 2017, 06:32:04 am »
@Jeroen:
The DC offset does matter in this case. I do an AD conversion 5 ms after a zero crossing pulse is detected.
That only works on nice restive loads. Sample more and use a high pass filter.
 

Offline woodyTopic starter

  • Frequent Contributor
  • **
  • Posts: 372
  • Country: nl
Re: ACS712/723 learning opportunity
« Reply #7 on: November 23, 2017, 08:40:08 am »

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.
Which it isn't.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf