Getting wrong values from Grove - 10A DC Current Sensor (ACS725) with Arduino

Deer Community, I hope you can help me out.
I am very new to Electrical domain. I have bought new Grove - 10A DC Current Sensor (ACS725) to measure the DC current and watts usage. so I have tried to run the sample program which is given by Grove team in link https://wiki.seeedstudio.com/Grove-10A_DC_Current_Sensor-ACS725/
but I am getting -4.62mV -17.49mA values.

Thanks in Advance
Gopi

Hi @gopinathyadavstudies
Do you have completed the calibration? Could you take photos of your hardware connection and the output data of the serial monitor and send them to us?

Hi @jiachenglu,
Thanks for your response. I have listed my environment, what is objective also attached the pics of circuit.
Objective:
To measure the Voltage, Current and watts of a lightbulb/hair dryer/ any appliance.

For that I am using Grove 10 DC current sensor to measure the current usage.
I have tried the sample program (which is given by Grove team) to make sure my board and current sensor are working fine as well as to calibrator. But I am getting values in minus in randomly.
I have attached my circuit pics and Arduino program.

Environment:
Country: USA
Current type: DC current

Circuit explanation :

  1. I hooked 10 A DC current sensor to my extension card ( ref image 2)

  2. Serial print
    21:42:34.580 -> initialValue: 322.27mV
    21:42:34.614 -> 1.01mA
    21:42:34.614 ->
    21:42:36.665 -> initialValue: 322.27mV
    21:42:36.665 -> 1.01mA
    21:42:36.698 ->
    21:42:38.713 -> initialValue: 317.38mV
    21:42:38.746 -> -17.49mA
    21:42:38.746 ->
    21:42:40.761 -> initialValue: 317.38mV
    21:42:40.795 -> -17.49mA
    21:42:40.795 ->
    21:42:42.840 -> initialValue: 322.27mV
    21:42:42.876 -> 1.01mA
    21:42:42.876 ->
    21:42:44.886 -> initialValue: 322.27mV
    21:42:44.922 -> 1.01mA
    21:42:44.922 ->
    21:42:46.964 -> initialValue: 322.27mV
    21:42:47.001 -> 1.01mA
    21:42:47.001 ->
    21:42:49.015 -> initialValue: 317.38mV
    21:42:49.052 -> -17.49mA
    21:42:49.052 ->
    21:42:51.074 -> initialValue: 322.27mV
    21:42:51.109 -> 1.01mA
    21:42:51.109 ->

  3. Ardunio program

Blockquote
#ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE
#define RefVal 3.3
#define SERIAL SerialUSB
#else
#define RefVal 5.0
#define SERIAL Serial
#endif
//An OLED Display is required here
//use pin A0
#define Pin A0

// Take the average of 500 times
const int averageValue = 500;

long int sensorValue = 0;
float sensitivity = 1000.0 / 264.0; //1000mA per 264mV

float Vref = 322; //Vref is zero drift value, you need to change this value to the value you actually measured before using it.
void setup()
{
SERIAL.begin(9600);
}

void loop()
{
// Read the value 10 times:
for (int i = 0; i < averageValue; i++)
{
sensorValue += analogRead(Pin);

// wait 2 milliseconds before the next loop
delay(2);

}

sensorValue = sensorValue / averageValue;

// The on-board ADC is 10-bits
// Different power supply will lead to different reference sources
// example: 2^10 = 1024 -> 5V / 1024 ~= 4.88mV
// unitValue= 5.0 / 1024.01000 ;
float unitValue= RefVal / 1024.0
1000 ;
float voltage = unitValue * sensorValue;

//When no load,Vref=initialValue
SERIAL.print("initialValue: ");
SERIAL.print(voltage);
SERIAL.println(“mV”);

// Calculate the corresponding current
float current = (voltage - Vref) * sensitivity;

// Print display voltage (mV)
// This voltage is the pin voltage corresponding to the current
/*
voltage = unitValue * sensorValue-Vref;
SERIAL.print(voltage);
SERIAL.println(“mV”);
*/

// Print display current (mA)
SERIAL.print(current);
SERIAL.println(“mA”);

SERIAL.print("\n");

// Reset the sensorValue for the next reading
sensorValue = 0;
// Read it once per second
delay(1000);
}[quote=“gopinathyadavstudies, post:1, topic:252227, full:true”]

Thanks in Advance
Gopinath Yadav A R

Deer Community, I hope you can help me out.
I am very new to Electrical domain. I have bought new Grove - 10A DC Current Sensor (ACS725) to measure the DC current and watts usage. so I have tried to run the sample program which is given by Grove team in link https://wiki.seeedstudio.com/Grove-10A_DC_Current_Sensor-ACS725/
but I am getting -4.62mV -17.49mA values.

Thanks in Advance
Gopinath Yadav A R

Those appliances you want to measure operate on AC current. This is a DC current sensor.

Difference between ac & dc:

I am afried that I am in the USA and here current is DC current.

Thanks
Gopinath Yadav A R

It must be a special place you have, I mean it’s 120 volts ac / 60hz used in the USA

Sorry, but that’s wrong. Every place in the world uses AC for their general power net. DC is used for small electronic appliances (anything that requires a transformer basically takes AC current and changes it to DC for the appliance). Please look at the video I linked.

The wiki page of your DC sensor specifies:

The Grove - 10A DC Current Sensor (ACS725) can measure the DC current up to 10A and has a base sensitivity of 264mV/A. This sensor do not support AC current, if you want to measure the AC load please check the:
https://www.seeedstudio.com/Grove-5A-DC-AC-Current-Sensor-ACS70331-p-2928.html

I see from your photo that you are running the multisocket’s power cable via your sensor. This means you are using AC electricity before it gets converted to DC. So you either need to get an AC sensor, or you need to put your DC sensor after the appliance’s transformer.