hi guys, im new here so pls bear with me. i just want to know the code to calculate the instantaneous current for our current sensor SCT-013-030 that is connected to arduino uno r3 and ac single phase motor with 1.5hp. here’s the code that we are currently using:
#include "EmonLib.h" //Include Emon Library
#define VOLT_CAL 148.7
#define CURRENT_CAL 111.1
EnergyMonitor emon1; //create an instance
void setup()
{
Serial.begin(9600);
emon1.voltage(1, VOLT_CAL, 1.7); //Voltage: input pin, calibration, phase_shift
emon1.current(0, CURRENT_CAL); //Current: input pin, calibration.
}
void loop()
{
emon1.calcVI(20,2000); //Calculate all. No.of half wavelength (crossings), time-out
float currentDraw = emon1.Irms; //extract Irms into Variable
float supplyVoltage = emon1.Vrms; //extract Vrms into Variable
Serial.print("Current: ");
Serial.println(currentDraw);
}