How to calibrate emonTX Shield?

Hi

I bought the emonTX Shield, an Arduino Duemilanove, 2 CT sensors, a 9V power supply (this one)

I soldered all the components on the Shield and attached it to the Arduino. Now I'm using the code provided on the website to monitor the power usage of a desk lamp (examples/current_only.ino)

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

 

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

void setup()

  Serial.begin(9600);
 
  emon1.current(1, 111.1);             // Current: input pin, calibration.
}

 

void loop()
{
  double Irms = emon1.calcIrms(1480);  // Calculate Irms only
 
  Serial.print(Irms*230.0);        // Apparent power
  Serial.print(" ");
  Serial.println(Irms);         // Irms
}

I attached 2 photos of the configuration. I had to connect the Arduino and the shiled using jumper wires because the shield's pins don't enter completely in the arduino.

I uploaded the code to the board and I'm getting the following values:

When lamp is OFF

102.44 0.45
95.89 0.42
98.77 0.43
95.72 0.42
89.83 0.39
95.02 0.41
89.78 0.39
89.76 0.39
86.63 0.38
96.09 0.42
102.98 0.45

When lamp is ON

150.47 0.65
153.34 0.67
137.24 0.60
142.86 0.62
138.51 0.60
144.90 0.63
158.38 0.69
157.98 0.69
150.99 0.66
142.28 0.62
138.02 0.60
141.13 0.61
144.51 0.63
151.28 0.66

How can I get 0 when the lamp is off and the power usage (watts) when it is on?
Also, as you can see, values are changing frequently, how can I "stabilize" them?

Thank you.

hkproj's picture

Re: How to calibrate emonTX Shield?

forgot files

calypso_rae's picture

Re: How to calibrate emonTX Shield?

The library function, calcIrms(), calculates the RMS current by squaring the value of each sample that is taken.  Any noise in the system will always be converted to a positive value.  Hence I don't think you could ever expect to see 0 when there is no current flowing,  Your value will always be "noise squared".

If you were to use a voltage sensor too, and call the library function calcVI() instead, then each power contribution could be positive or negative so they would tend to cancel out.  Your zero power value would then be much closer to 0 Watts.

It might be worth trying a much larger load, such as 2000 W, to see how well your system is working at higher currents.  The first few tools on my Summary Page should help you with scaling your system to operate over the correct range, and with calibration.

hkproj's picture

Re: How to calibrate emonTX Shield?

Thank you for your fast response.

When I connect the second sensor (which I'll be using with the calcVI function), I need to connect it to the same wire as the sensor I use for current? How many turns do you suggest for a good value?

Also, I would like to know if the values I supplied as "Calibration" are correct? What should I use as "Calibration" and "Phase shift" in calcVI based on my configuration?

Sorry for my nearly-zero knowledge of electronics.

Thank you.

Robert Wall's picture

Re: How to calibrate emonTX Shield?

You have the wrong current calibration constant for the shield. There is a different example sketch for the shield as compared to the emonTx, which also has the correct port numbers. That should be your starting point. From memory, you want a number around 60 instead of 111.1

[Edit] Your photo shows something plugged in to the voltage input of the shield. If that is the power supply you bought, you have the wrong one. The voltage input requires an a.c. adapter in order to measure the mains voltage. A 9 V d.c. regulated power supply will not provide an alternating voltage proportional to the mains voltage. 

calypso_rae's picture

Re: How to calibrate emonTX Shield?

To get the right result for power, you should only clip your CT once around your chosen wire (either Live and Neutral), not several times. 

Robert Wall's picture

Re: How to calibrate emonTX Shield?

Robin, I presume he's multiplying up his load so that he's got larger numbers to work with for minimum energy cost - a 240 W load at the cost of a 60 W lamp! That's the way I test c.t's up to 250 A using only a 48 VA 6.3 V transformer to supply the current.

calypso_rae's picture

Re: How to calibrate emonTX Shield?

Maybe, Robert, but if the standard calibration values are to work, the wire must only go through the CT once.

 

Robert Wall's picture

Re: How to calibrate emonTX Shield?

hkproj:

To address the original question: What test instruments do you have? If you have a multimeter that can accurately measure current and voltage, then adjust the voltage calibration constant (if you're using the 'voltage' sketch and have a voltage sensor) so that the sketch reports the same value for the mains voltage that you measure, or if you're not using the voltage input change the "230.0" to your average mains voltage. Then, using the highest current you can measure, adjust the current calibration constant ("111.1" or "60.6" as you should have it) so that the sketch reports the same value that you measure for the current (each c.t. and input might be different by a small amount - less than 2%). Finally (and only if you have the voltage sensor and are using the 'voltage' sketch), with a resistive load, adjust the phase angle calibration "1.7" so that the sketch reports unity power factor.

If you haven't got an accurate meter to measure current or voltage, the best you can do is assume the current reading will be accurate, which it should be to within 2% if you've used a 1% burden resistor, then calculate power from the rate that your tariff meter clocks up energy and adjust the voltage calibration so that the sketch reports the same value.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.