So I am developing an application in which I need to detect the current flowing through a wire.. I am using an ACS712 sensor.. Circuit diagram is attached..
The load I am using is a 200W bulb. I am representing it here using a 220 Resistor. The AC Mains(230V) live wire is connected to the Resistor(bulb) and the ground is connected to the other pin of the ACS712.
Here is the code I am using:
/*
Measuring Current Using ACS712
*/
const int analogIn = A0;
int mVperAmp = 185; // use 100 for 20A Module and 66 for 30A Module
int RawValue= 0;
int ACSoffset = 2500;
double Voltage = 0;
double Amps = 0;
void setup(){
Serial.begin(9600);
}
void loop(){
RawValue = analogRead(analogIn);
Voltage = (RawValue / 1024.0) * 5000; // Gets you mV
Amps = ((Voltage - ACSoffset) / mVperAmp);
Serial.print("Raw Value = " ); // shows pre-scaled value
Serial.print(RawValue);
Serial.print("\t mV = "); // shows the voltage measured
Serial.print(Voltage,3); // the '3' after voltage allows you to display 3 digits after decimal point
Serial.print("\t Amps = "); // shows the voltage measured
Serial.println(Amps,3); // the '3' after voltage allows you to display 3 digits after decimal point
delay(1000);
}
I know that this is not the correct formula to measure AC current but I am just trying to get an initial read here.
Now the problem is when the load is not plugged in then I get a raw value of around 520.. But as soon as plug in the load, the Serial monitor of my Arduino just STOPS printing anything. Is the sensor not outputting any value?
Any help would be appreciated..