-
Notifications
You must be signed in to change notification settings - Fork 1
Power Meter
The objective is to measure power, power factor and display in a web page.
- I have a [STC013](https://www.banggood.com/AC-100A-SCT-013-000-Non-invasive-Split-Core-Current-Transformer-p-91743.html https://www.banggood.com/PZEM-022-Open-and-Close-CT-100A-AC-Digital-Display-Power-Monitor-Meter-Voltmeter-Ammeter-Frequency-p-1356031.html), googled around and just used the solution as is from Open Energy Monitor. The original code and circuit is in the following link.
- I have one ESP8266, only has a ADC, so the change was just minor
- https://openenergymonitor.org/forum-archive/node/54.html
#include <ESP8266WiFi.h>
#include "EmonLib.h" // Include Emon Library
EnergyMonitor emon1; // Create an instance
void setup()
{
Serial.begin(9600);
emon1.current(A0, 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
}
The code indeed proposes a parameter for that.
I used the PZEM-022 that I already have in my mains.
I will report for now in VA, estimating the potential to be 230. This is the apparent power.
I will later measure the potential and the Power Factor.
So, i changed the line in the code to:
emon1.current(A0, 97); // Current: input pin, calibration.
USed some old examples, and collecting for now in my mobile in the app MQTT Dash. Code here: power_meter_v0.ino
I am already doing that for other data, so hopefully not to difficult. ongoing 26 Jan
plan...
plan
plan...
#6 - Measure Power factor plan...