Add emon lib for a later non invasive current sensor.

This commit is contained in:
Henrik Ekblad
2014-08-17 22:27:08 +02:00
parent 426123333c
commit 5d43706492
5 changed files with 417 additions and 0 deletions
@@ -0,0 +1,20 @@
// 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
}