Hello! I have a question, will this work if I plan to use multiple CT sensors?
#include "EmonLib.h"
// Include Emon Library
EnergyMonitor emon1, emon2, emon3;
// Create an instance
void setup()
{
Serial.begin(9600);
emon1.current(1, 111.1); // Current: input pin, calibration.
emon2.current(2, 111.1);
emon3.current(3, 111.1);
}
void loop()
{
double Irms1 = emon1.calcIrms(1480); // Calculate Irms only
double Irms2 = emon2.calcIrms(1480);
double Irms3 = emon3.calcIrms(1480);
Serial.print(Irms1*230.0); // Apparent power
Serial.print(" ");
Serial.println(Irms1); // Irms
Serial.print(" ");
Serial.print(Irms2*230.0);
Serial.print(" ");
Serial.println(Irms2);
Serial.print(" ");
Serial.print(Irms3*230.0);
Serial.print(" ");
Serial.println(Irms3);
}
Note: I got the raw code here: How to Build an Arduino Energy Monitor - Measuring Mains Current Only — OpenEnergyMonitor 0.0.1 documentation. And I only adjusted the codes based on what my limited knowledge in programming.