Verification of Calibration Values & Output Readings

I adjusted the Voltage+Current calibration values in my .ino sketch.

Short Version: Voltage and real power match my Kill-A-Watt readings, but Apparent Power and Power Factor do not align. Does this matter? (I’m guessing no)

First, the sketch:

#include "EmonLib.h"
EnergyMonitor emon1, emon2;

const float cal_current = 60.6;
const float cal_voltage = 124.24;
const float phase_shift = 1.7;
const byte volt_pin = 0;

void setup()
{  
  Serial.begin(9600);
  
  emon1.voltage(volt_pin, cal_voltage, phase_shift);  // Voltage: input pin, calibration, phase_shift
  emon1.current(1, cal_current);       // Current: input pin, calibration.
  emon2.voltage(volt_pin, cal_voltage, phase_shift);  // Voltage: input pin, calibration, phase_shift
  emon2.current(2, cal_current);       // Current: input pin, calibration.
}

void loop()
{
  readPower(emon1, "1: ");
  readPower(emon2, "2: ");
}

void readPower(EnergyMonitor emo, String prefix){  
  emo.calcVI(20,2000);         // Calculate all. No.of half wavelengths (crossings), time-out
  Serial.print(prefix);
  emo.serialprint();           // Print out all variables (realpower, apparent power, Vrms, Irms, power factor)
  
  float realPower       = emo.realPower;        //extract Real Power into variable
  float apparentPower   = emo.apparentPower;    //extract Apparent Power into variable
  float powerFActor     = emo.powerFactor;      //extract Power Factor into Variable
  float supplyVoltage   = emo.Vrms;             //extract Vrms into Variable
  float Irms            = emo.Irms;             //extract Irms into Variable
}

Note, I’m in the USA ~120v

Kill-A-Watt Says:

  • Real Power: 171W
  • Apparent Power: 193W
  • Voltage: 120.3V

As calibrated in the sketch above, I got the Real Power & Voltage to align. So, readings from EmonLib are like:

  • Real Power: 171W (+/- 1)
  • Apparent Power: ~230W
  • Voltage: ~120.3V

Point is, voltage and real power match, but Apparent Power is misaligned (Power Factor is misaligned too). Does this matter?

Have you tried calibration with a larger load?

See the FAQ for info regarding calibration with a load that’s too small.

Nope, thanks for the pointer. I’ll try it out and read the FAQ.

If you don’t have a larger load handy, you can pass multiple turns of the wire through the CT. e.g. with a 100 Watt lamp, and 10 turns through the CT you should read 1000 Watts.

To get better results, try to calibrate at the mid-point of your measurement range.

Oh, I have larger loads handy.

As long as they are resistive e.g. not a motor, you should be good to go.

Yeah that’s possibly a problem. I read a little about that after I got deep into this project.

Some of the things I’d like to monitor are tools in my wood shop. Air compressor motor, large bandsaw (actually, the brake, not the motor, so I should be good there), and dust collector primarily. But, it would be quite nice to see roughly how much it costs to spend 8 hours out there. Oh well, that’s another topic that I haven’t explored real deep yet.

That part is OK. During calibration is when you need a resistive load.

So, if you don’t have a large non-reactive load, pass 20 turns through the CT and use a 100 Watt light bulb.
That’ll give you the same results as if you were using a 2 kW resistive load, e.g. an electric space heater w/o a motor.

Aha, this makes sense.

If you’re not using the ‘shop’ c.t. and a.c. adapter, your
phase_shift = 1.7
will be wrong, and you’ve got the order you did things in wrong. You need to get voltage first, then current or apparent power (i.e. voltage × current) to match, then adjust phase_shift to make real power match (or make real power = apparent power with a resistive load).

As you’re measuring largish motors - yes, but it’s probably not all that critical, as their power factors are likely to be good-ish. Certainly, it’s something I would want to get as close as I could. When it gets really misleading is with small motors with power factors that are really poor (0.5 or worse) and some power supplies that can appear even worse than that.

Oh, that totally answers my question then. So the phase_shift is what is responsible for helping balance these numbers. That helps a lot

The calibration instructions are written in the order they are for good reason.

If you have a permalink to the calibration instructions, It would be helpful to add that to the Arduino sketch comments.

(this is no excuse for me not reading the instructions, but it would help future users who jump the gun like me)

Looking at the comments in the example code, it seems like that second param is the only one that’s calibration related.

void setup()
{  
  Serial.begin(9600);
  
  emon1.voltage(2, 234.26, 1.7);  // Voltage: input pin, calibration, phase_shift
  emon1.current(1, 111.1);       // Current: input pin, calibration.
}

No, there are three calibration parameters there, “234.26”, “1.7” and “111.1”. If you look at the ‘production’ sketch, they are possibly more evident:

const float Ical1=                90.9;                                 // (2000 turns / 22 Ohm burden) = 90.9
const float Ical2=                90.9;                                 // (2000 turns / 22 Ohm burden) = 90.9
const float Ical3=                90.9;                                 // (2000 turns / 22 Ohm burden) = 90.9
const float Ical4=                16.67;                               // (2000 turns / 120 Ohm burden) = 16.67

float Vcal=                       268.97;                             // (230V x 13) / (9V x 1.2) = 276.9 Calibration for UK AC-AC adapter 77DB-06-09
//float Vcal=276.9;
//const float Vcal=               260;                             //  Calibration for EU AC-AC adapter 77DE-06-09
const float Vcal_USA=             130.0;                             //Calibration for US AC-AC adapter 77DA-10-09
boolean USA=FALSE;

const float phase_shift=          1.7;