I want to measure current using XIAO ESP32S3 and SCT-013-030 Non-invasive AC Current Sensor Clamp Sensor by using this schematic:
I have connected 50w bulb and on my multimeter 0.2A is valued and I am not able to get value on ESP32S3, I am using this code by Emonlib:
#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
}
Looking forward to measure current with XIAO ESP32S3! Thanks!