I have some trouble to read correct ampere value from the sensor.
The circuit has sensor output on ADC1_3* ( 39 ) and I have a car lamp of 12V 40W,
and with a multimeter I can read a current of 2.61A. If I go with the multimeter on pin 39 I can read a voltage of 2.766V with load and 2.502V with no load. I following same example and write the following code, but the result return me value between 138.15 and 141.08 . Where am I wrong ?
float getAnalogAmp()
{
//Measuring Current Using ACS712
int sampling = 250;
double mVperAmp = 100; // use 185 for 5A Module, 100 for 20A Module, and 66 for 30A Module
float ACSoffset = 2470.345;
double RawValue = 0;
double V = 0;
double Amps = 0;
for(int i=0; i<sampling; i++)
{
RawValue += analogRead(ADC_AMP);
delay(1);
}
RawValue /= sampling;
V = (RawValue / 1023.0) * 5000; // Gets you mV
Amps = ((V - ACSoffset) / mVperAmp);
Serial.print( "Amps:");
Serial.println( Amps );
return Amps;
}