openenergymonitor / EmonLib

Electricity monitoring library - install in Arduino IDE's libraries folder then restart the IDE
openenergymonitor.org
GNU Affero General Public License v3.0
596 stars 422 forks source link

calculations ECS1030-L72 sensor? #38

Closed AbrahamYu closed 4 years ago

AbrahamYu commented 7 years ago

My Energy Meter parts List

image

Code

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

void setup()
{  
  Serial.begin(9600);  
  emon1.current(0, 111.11);             // Current: input pin, calibration.
}

void loop()
{

    double Irms = emon1.calcIrms(1480);  
    Serial.print(Irms*220.0);         // Apparent power
    Serial.print(" ");
    Serial.println(Irms, DEC);          // Irms
    delay(1000);
}

8.5w lamp measurement

but output data : 137.87 0.6266713142 140.01 0.6364147663 138.00 0.6272707462 137.44 0.6247273445 135.22 0.6146469116 137.73 0.6260547637 139.02 0.6319146156 138.40 0.6290988445 137.97 0.6271401405 139.11 0.6323106288 138.62 0.6300705909 139.56 0.6343578338 141.37 0.6425902843 141.72 0.6441868782 140.05 0.6366049766 139.36 0.6334630012

What's the problem????????

jamipraveeen commented 7 years ago

you are measuring power and current r8!! Inorder to measure power we need both voltage sensor and current sensor.As power is product of voltage and current

On 22 May 2017 8:03 a.m., "AbrahamYu" notifications@github.com wrote:

My Energy Meter parts List

[image: image] https://cloud.githubusercontent.com/assets/17170221/26290368/f21f5486-3ee1-11e7-8ee9-454c294937e0.png

Code

include "EmonLib.h" // Include Emon Library

EnergyMonitor emon1; // Create an instance

void setup() { Serial.begin(9600); emon1.current(0, 111.11); // Current: input pin, calibration. }

void loop() {

double Irms = emon1.calcIrms(1480);
Serial.print(Irms*220.0);         // Apparent power
Serial.print(" ");
Serial.println(Irms, DEC);          // Irms
delay(1000);

}

8.5w lamp measurement

but output data : 137.87 0.6266713142 140.01 0.6364147663 138.00 0.6272707462 137.44 0.6247273445 135.22 0.6146469116 137.73 0.6260547637 139.02 0.6319146156 138.40 0.6290988445 137.97 0.6271401405 139.11 0.6323106288 138.62 0.6300705909 139.56 0.6343578338 141.37 0.6425902843 141.72 0.6441868782 140.05 0.6366049766 139.36 0.6334630012

What's the problem????????

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openenergymonitor/EmonLib/issues/38, or mute the thread https://github.com/notifications/unsubscribe-auth/ATN6yc8xIJtWB2tFmop2Aw7uDEvcnfDNks5r8PPjgaJpZM4Nh0WI .

AbrahamYu commented 7 years ago

@jamipraveeen adding 9v adapter and change code

adapter
input - AC100~240V 50/60Hz 0.2A output - DC9V 0.5A

image

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

void setup()
{  
  Serial.begin(9600);

  emon1.voltage(1, 234.26, 1.7);  // Voltage: input pin, calibration, phase_shift
  emon1.current(0, 111.11);       // Current: input pin, calibration.
}

void loop()
{
  emon1.calcVI(20,2000);         // Calculate all. No.of wavelengths, time-out
  emon1.serialprint();           // Print out all variables
}

but ... -0.16 0.37 3.90 0.09 -0.45 -0.13 0.37 3.81 0.10 -0.36 -0.12 0.33 3.80 0.09 -0.37 -0.12 0.35 3.85 0.09 -0.35 -0.12 0.34 3.99 0.09 -0.34 -0.14 0.35 3.87 0.09 -0.41 -0.14 0.35 3.85 0.09 -0.40 -0.12 0.35 3.78 0.09 -0.35 -0.16 0.34 3.80 0.09 -0.46 -0.14 0.35 3.86 0.09 -0.38 -0.14 0.35 3.88 0.09 -0.40 -0.13 0.32 3.74 0.09 -0.40 -0.14 0.35 3.86 0.09 -0.40 -0.15 0.33 4.00 0.08 -0.46 -0.13 0.34 3.84 0.09 -0.39 -0.12 0.35 3.89 0.09 -0.36 ...

8.5W lamp measurement output data....????

jonathanrjpereira commented 6 years ago

@AbrahamYu In the first image, the ECS1030-L72 has a CT Ratio = 30A/15mA = 2000. You also mentioned that the burden resistance connected is 120ohms. Hence the CT Sensor Calibration value = CT Ratio / Burden resistance = 2000/120 = 16.66 Change the calibration value from the default 111.11 to 16.66

In order to calculate Apparent Power, you multiplied Irms by 220.0V. Did you measure your mains supply and then use this value? In the second image & code, you set the voltage to 234.26V. Set the voltage calibration values to the value of your mains AC supply read by your Multimeter.

jonathanrjpereira commented 6 years ago

@AbrahamYu In the second image & code, you mentioned an AC-DC adapter with specifications:

adapter input - AC100~240V 50/60Hz 0.2A output - DC9V 0.5A

But Open Energy Monitor measures the AC voltage using an AC-AC adapter & hence it requires scale down & offset circuit so that there is no negative component.

OEM - Voltage Sensing - AC-AC Adapter

You must set the voltage calibration value to the value read by the multimeter at the AC mains supply. Adjust the phase shift value so that Real & Apparent Power are equal for a resistive load.

Calibration