I am attempting to read the current consumption (kWh) with the ACS714
Current Sensor Carrier -30 to +30A module.
My load is at 220VAC.
The module output is connected to Arduino MiniPro with ATMEGA328P micro.
The supply voltage to the ACS714 module is 5.175V DC.
I have modified the following Sketch:
int analogInPin = A0; // Analog input pin that the carrier board OUT
is connected to
int sensorValue = 0; // value read from the carrier board
int outputValue = 0; // output in milliamps
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
void loop() {
// read the analog in value:
sensorValue = analogRead(analogInPin);
// convert to milli amps
outputValue = ( ((long)sensorValue * 5000 / 1024) - 500 ) * 1000 /
66; // modified for ACS714 - 66mV / A
// print the results to the serial monitor:
Serial.print("sensor = " );
Serial.print(sensorValue);
Serial.print("\t Current (ma) = ");
Serial.println(outputValue);
// wait 10 milliseconds before the next loop
// for the analog-to-digital converter to settle
// after the last reading:
delay(1000);
}
Output with NO load:
Output with load:
Why am I getting negative readings?
What am I possibly doing wrong?
Best Regards