Measuring AC mains current using ACS712?

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..

So, 230 live connected to one side of resistor, other side to IP+, 230 neutral connected to IP-, is that correct?
If you remove the load, does the Arduino resume printing? What is the wattage rating of that 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.

No, a thousands times no. Stop. Right now. Before you hurt yourself.

Nothing from mains connects the the Arduino in any way, that is your problem. I’m surprised you didn’t blow something up.

Mains hot to load lamp:1
Load lamp:2 to acs712 ip:1
Acs712 ip:2 to mains neutral

And just use the library. There is no need to reinvent the code wheel.

The ACS712 is rated to 184V peak for reinforced isolation level - that's not enough for
230V mains, unless the device is double-insulated, according to my limited understanding,
as the basic isolation rating is > 300V.

Why not use a CT? Much less noisy too, and many are clamp on (no physical contact
to mains at all).