AC Current Sensing in a circuit with a Dimmer

Hello,
I have the requirement to measure the AC current thru a resistive loaded circuit driven a Dimmer.

My current testing is as follows:
(1) I have an ACS712 and have used the Arduino ACS712 library plus sample examples to measure the AC current thru a 200w resistive load at 240v therefore about 0.8A . I also have a quality BRYMEN AC RMS Multimeter in series with this simple circuit and the measurements I get from the BRYMEN and the Arduino sample application are consistence.

(2) However when I insert a Dimmer into this simple circuit the reading produced by the Arduino/ACS712/Sample application are often 20% or 30% or more off compared to the BRYMEN RMS multimeter. It is also interesting to note that as I turn the dimmer down at about the mid point the current reading produced by the Arduino/ACS712/Library/Sample application increase rather than decrease.

I therefore conclude that the ACS712 Library is not properly sampling/integrating what is a Triac chopped up, now un pure sine wave. Anyone have an ideas or alternative sensor/library and or other arduino solution for AC RMS current measurement please?
many thanks imk

Show the measured values on Serial Monitor or Plotter. Store a sample in a buffer array so that the ADC is not slowed down by the Serial transfer. With a scope you can better compare both wave forms.

You gotta average over time. The current wave form is partial sine waves. Do the rms calculations with a randomized (but short) delay (use millis) to prevent your sample rate from beating with the pulses. Or put in an ammeter display with an output of some type.
Yes i know sample time jitter is bad for RMS calculation but if randomized it just adds noise. If the sample frequency and the line frequency hetrodyne you'll get all sorts of crazy artifacts.

1 Like

Use a current transformer and run that into one of Analog Devices' RMS to DC converters. They have a cheap one that's under $10.

This would likely go better if you posted the code you are using. I doubt the problem you are seeing is in the library. Your true RMS Responding RMS Indicating meter is giving you the true RMS value of the waveform which when you start using the dimmer is not a true RMS sine wave. You now have a phase fired triac waveform.

You may wish to give this a readstrong text.

The library, as you observed, works just fine. Just fine for a true sine wave but not for the output of a phase fired dimmer. You may also want to read this: The root mean square (RMS or rms) of a periodic waveform: Vrms/Irms.

If you want to accurately measure true RMS current from a less than true sine wave you want a true RMS reading current sensor,

Ron

Hello all and many thanks for the replies, they are much appreciated.
Well after three days of testing i can say with much certainty that this noisy data I am getting from the ACS721 library is caused by the RBD Dimmer library as it interrupts the ACS712 library during its 20ms 50hz sine sampling period.

The problem is not so noticeable on a simple resistive like load (incandescent 200w light bulb upto a 2k heating element) when using an arduino external dimmer (light dimmer). But when I do the dimming with the RBD Dimmer library running it the same Nano the ACS712 library output has a jitter amount proportional to the power setting. I guess this is due to where the RBD library slices the mains cycle compared to where the ACS712/ADC library is in it sampling function.

It is also interesting to note that long text string sent to serial out cause the RDB Dimmer library to momentarily dim the load. I guess the serial library maybe on a higher priority interrupt that the RDB Dimmer library and causing it it to miss a few cycles.

So what I am going to do next is to rectify the ACS712 output via an op amp with an integrator on its output and measure it as DC then use map() . I'll post result when the LM358's arrive :slight_smile:

Again many thanks imk

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.