Emonlib at no load doesn't give zero current reading

I see this issue has been posted a number of times including the one I stole my tittle from but yet I do not see a solution to any of them.

I am using the current_only.ino program as supplied in EmonLib and get the exact same results as described in a previous forum post with the same title by hammad426623.

As hammad426623 posted I also get a current of 0.13 A with no load.

In other words, with a 120V source it is telling me that the "no load" is consuming around 30W. Or, if I were measuring with a 240VAC source it would be 60W.

And I have spent a number of days now tinkering with little improvement. For example, I have carefully soldered these parts directly to my uno with the electrolytic capacitor in parallel with a 0.1 ceramic and even tried a 10uf ceramic.

If this is the way it is then I do not see this as being very useful. So I have two questions:

  1. Is this as good as it works or what am I doing wrong.
  2. Is there any code someone has done that does work properly that can also measure real power and pf etc.?

Thank you .

Welcome to the forum!

For accurate measurements all sensors require calibration. You can calibrate your setup using standard loads, after reading this tutorial.

You will probably need to estimate a slope and background correction.

What kind of current sensor do you use? Is it a hall effect sensor by any chance? Note that hall effect current sensors are easily thrown off by magnetic fields, even fairly weak ones.

I am using the common SCT013 100A/50mA which requires an external burden resistor which is 10 ohms.

And I am using the program "current_only.ino" exactly as shown in the examples directory of EmonLib.

And I have followed a few websites on calibration and come to the conclusion that the issue is not the circuit but how the library EmonLib determines the midpoint or zero VAC. Please review this schematic here:

And imagine the current transformer requires an external Burden resistor as suggested in this schematic. Now remove the current transformer so that only the Burden resistor is present. In this situation only the midpoint or bias point is present to the ADC input. In other words, no signal which means no load current.

In this scenario I expect the current output to be zero but it is not, instead it wanders around 0.13 A and higher. I have played with the hardware doing things like soldering more directly to the UNO 328 and added an additional 0.1uf bypass capacitor and while I have improved it I am not able to achieve better than 0.13A.

Now if I calibrate the circuit, for example I used this: "emon1.current(36, 199.5);" then it works as expected with higher currents but has an increasing error at lighter loads due to this issue where zero load results in 15.6W (0.13A) at 120VAC or if I was using 230Volts it would indicate 30W with no load.

I hope this is more clear without being too wordy.

Did you read this FAQ entry?

A zero offset error of 0.13A is insignificant compared to the 100A full scale for that CT. You usually can't expect 0.1% accuracy from hobby projects.

Thank you for your reply jremington.

But that 0.1% accuracy is only good for full current readings of 100A. So this is at 100A and I need to add this to the accuracy of the CT which is 1% so the total accuracy is 1.1% which I agree is very good.

But that 0.13A is a constant meaning that anything below 100A will have a progressively larger error.

For example:
At 50A the error becomes: 1% + ((0.13/50)*100) = 1.26%.
Then at 10A the error becomes: 1% + ((0.13/10)*100) = 2.3%
Then at 1A the error becomes: 1% + ((0.13/1)*100) = 14%

Now, what if I use the SCT013-005 which measures up to 5A?
Now full scale starts at 3.5% error (1% + 2.6%) and degrades much more rapidly making it unacceptable very quickly.

If the offset is approximately constant, simply subtract that value from all subsequent readings. That is what is meant by calibrating the sensor.

That sensor will have a different set of calibration constants.

Thank you for this suggestion which I will try when I get a chance.

Sorry not to respond sooner but I have been busy. I have googled some more and my suspicions are correct. The ADC in both the ESP8266 and ESP32 are poorly designed resulting it excessive noise due to the WiFi.
Please see this link for more information:

Don’t forget the A/D only resolves to one part in 1024 , or 0.1% - so you can’t expect to read better than 100mA anyway ( actually less ) , add to that noise , component tolerance, CT performance at low current , your bias not being spot on ( so you have a voltage when there is no current, R1 andR2 not identical ) you are expecting too much , this is hobby stuff - make any reading less than say 200mA zero.
You might be better off with a more appropriately ranged CT and a better circuit .
BTW a domestic electricity meter doesn’t have the accuracy you seek