### Current offset and linearity issues

Hi all.
I am currently building and trying to decide how to use my emon-system.
I have soldered an emontx and made a simple test sketch to see how it works, and I am having some offset/linearity problems with the current sensors.
I have connected three sensors to the emontx, all three are hooked around a current-carrying wire, and I am pushing various loads through that wire.
I have a good quality power meter on the same outlet as reference.

These are my measurements:
0/40
10/50
30/70
50/70
1000/1000
80/100
225/230
170/180
85/105
100/115

As you can see, the difference starts at app. 40 watts, falling to 0 watts at 1 kW.

Is the emontx just somewhat imprecise at low power, am I missing some calibration constants somewhere, or should I just try to compensate/"work around it" with a bit of math?

My sketch: (based on the github samples):

// EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3

#include "EmonLib.h"                   // Include Emon Library
EnergyMonitor emon1;                   // Create an instance
EnergyMonitor emon2;                   // Create an instance
EnergyMonitor emon3;                   // Create an instance
//EnergyMonitor emon4;                   // Create an instance

void setup()

Serial.begin(9600);

emon1.current(0, 111.1);             // Current: input pin, calibration.
emon2.current(1, 111.1);             // Current: input pin, calibration.
emon3.current(3, 111.1);             // Current: input pin, calibration.
//  emon3.current(4, 111.1);             // Current: input pin, calibration.
}

void loop()
{
double Irms1 = emon1.calcIrms(1480);  // Calculate Irms only
double Irms2 = emon2.calcIrms(1480);  // Calculate Irms only
double Irms3 = emon3.calcIrms(1480);  // Calculate Irms only
//  double Irms4 = emon4.calcIrms(1480);  // Calculate Irms only

Serial.print(Irms1*230.0);        // Apparent power
Serial.print(" ");
Serial.print(Irms2*230.0);        // Apparent power
Serial.print(" ");
Serial.print(Irms3*230.0);        // Apparent power
Serial.print(" ");
//Serial.print(Irms4*230.0);        // Apparent power
Serial.println(" ");

}

### Re: Current offset and linearity issues

What you are seeing is almost certainly noise pickup, probably from the digital section of the processor. Remember the full scale current, if you are using the standard YHDC 100 A c.t. represents 24 kW so 40 W represents 0.16% of the maximum reading, and remember, the analogue to digital converter has only 1024 steps. If you look at the Building Blocks section, you will find this page about measurements at low currents: Measurement implications of ADC resolution at low current values

### Re: Current offset and linearity issues

Thanks.

I think I get the point as described on that page, although I don't really understand the examples.

So there was also some information about that. This site has an incredible amount of information, but it seems to take a while to learn where to look.

### Re: Current offset and linearity issues

Hi,

I am having a very similar problem. Even if the source current is switched off completely (or the CT is empty, i.e no wire gong through), I am measuring a current of around 250mA. If I multiply that with 230V then this means I am measuring about 50W, which is a lot more than nothing.

However, if I unplug the current transformer then the measured current goes down to 0.

Any advice would be much appreciated!

Regards,

Frank

### Re: Current offset and linearity issues

Are you using an emonTx, and if so which one? The V2 was susceptible to noise from the processor getting into the inputs; that problem has been much reduced in the V3. But it doesn't sound like that is your problem. My immediate thought is there is some voltage pickup getting in to the current input, your first move might be to put the c.t. on the neutral rather than the line. If it's already on the neutral, then that theory is probably wrong. The next thought is are there any high-power radio transmitters nearby? I've not seen any reports of problems where this turned out to be the cause, but it's worth asking. Are you measuring real power or apparent power? The way the maths works means that noise and interference gets rectified if you're calculating rms current and hence appears much larger, whereas if you use the voltage and calculate average (real) power directly, the noise being essentially random tends to average towards zero.

### Re: Current offset and linearity issues

HI Robert,

Thanks for your note. I am using the TX shield with an Arduino Uno. I have four CTs, and they all do the same, with or without wire going through them. There is actually a Wifi access point right behind the wall, just one meter away. Just to be sure I will check the measurements with the wifi access point switched off tomorrow.

I am actually measuring the rms current only, which according to what you are saying could be the cause. I shall also try to look into that tomorrow. However, if that is the problem, then how do I measure three times rms power with the shield since it only has one voltage input jack?

Thanks again,

Frank

### Re: Current offset and linearity issues

Do I infer you have a 3-phase supply? I believe the emon range was designed primarily for the UK where a three phase supply to domestic premises is extremely rare. You can get a reasonable approximation by using the 3-phase sketch (download from Github) to measure real power across 3 phases, though as I explained very recently in another thread, it is an approximation and depends on the phase voltages being balanced.

### Re: Current offset and linearity issues

Hi Robert, sorry for taking so long to get back you. I have been traveling. Yes, here in the Netherlands where I live the standard household supply is 3x25Amp. I have also measured the voltages of the 3 phases sporadically a few times and it seems to be very stable (i.e. 230V +/- 2-3V), so whatever I would be going to measure on the voltage side would be adding more inaccuracy compared to simply assuming the voltage to be constant.

The one big uncertainty here is that we have an electric car, and when it charges it easily draws power of around 3-4kW. Then the voltage will probably drop, however, I still need to test that.

I think I shall use the one voltage input for monitoring that phase in the longer run to see if my line of argumentation holds true for my connection. For other users, especially those living on the countryside, this might be a less suitable approach as the voltage in you area depends on the quality of the grid in that area and especially so on the network transformer that takes the voltage from the mid-voltage grid down to 400V/3x230V. Most modern transformers automatically set the voltage to a fixed value.