EmonLib at no load doesn't give zero current readings

Hello, I am building an energy meter for a project.
I used ACS712 5A module,
this is the code I used

// EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3

#include "EmonLib.h"                   // Include Emon Library
EnergyMonitor emon1;                   // Create an instance

void setup()
{  
  Serial.begin(9600);
  
  emon1.current(A0, 5.405);             // Current: input pin, calibration.
}

void loop()
{
  double Irms = emon1.calcIrms(1480);  // Calculate Irms only
  Serial.print("current is");
  //Serial.println(Irms*230.0);
  //Serial.println(" ");
  Serial.println(Irms);  // Irms

I used current callibration at 5.405 because ACS712 has 185mV/A and from the openenergy I found that for a voltage type sensor Current/VOltage will give the current callibration constant.

The problem is, at no load it gives these readings

current is 0.13
current is 0.13
current is 0.13
current is 0.13
current is 0.13
current is 0.13
current is 0.13
current is 0.13

and when I am using a load, 75 watt lamp it gives these readings

current is 0.36
current is 0.36
current is 0.35
current is 0.36
current is 0.36
current is 0.36
current is 0.36

and using a clamp meter i found the current to be 0.42 Amps.

I have been going crazy, I would extremely appreciate if someone would help me and tell me how to get zero current readings at no load.

does it work properly when you use this demo code?

void setup() {
  Serial.begin(9600);
}
 
void loop() {
 float average = 0;
 for(int i = 0; i < 1000; i++) {
     average = average + (.0264 * analogRead(A0) -13.51);//for the 5A mode,  
//   average = average + (.049 * analogRead(A0) -25);// for 20A mode
// average = average + (.742 * analogRead(A0) -37.8);// for 30A mode
   delay(1);
 }
 Serial.print("Current :");
 Serial.print(average/1000);
 Serial.println("A");
}

Is the power source you intend to read AC or DC?

I did use this demo code and I just got '0', nothing else. I intend to use it for AC measurement and I have provided a DC bias.

I don't know much about analog voltage, specially if it is AC. But the example code should rule out that the problem may come from the software. It most likely means that there's a hardware issue that you are having. Perhaps you could share a photo of your setup and someone that knows more, could provide a better answer.

there are at least two ways to get the raw signal. a CT using a pair of resistors and chopping the full wave into a half wave, and tieing to the Arduino ADC.

this is so low tech it is almost silly. there is zero circuitry for any compensation or adjustment.
a recriprical circuit might balance out the reading, but I fear it has more to do with your reference voltage.

another way is to use an instrument op-amp circuit and have the ability to get a very strong signal, have control over both zero and span, but needs more than just a simple board layout.

what you did not say, is what is the ADC reading at full circuit power ? are you trying to use 0-10 counts as the whole span of the ADC ?

lastly, back in the industrial control days, when we were using op-amps to stupid silly gains, we had a process level at which point it was agreed we would not bother to go. so, we had a separate zero-dropout circuit. once the reading dropped into that range, ( amplification was like 10,000:1 of air pressure), we just displayed 0.00000 on the display. we were reading air pressure and if a knat farted next door, the reading would jump. conversation (air pressure with altering vibrations) was a PITA, you could not talk when calibrating and breathing could be plotted.

as an after thought, you could have a second reading, one that is 0-.1 amps, limit the top so it does not exceed your ADC, and only read the very small signal on a second channel. similar to old cars that used to have a dual display fuel gauge.

hammad426623:
I did use this demo code and I just got '0', nothing else. I intend to use it for AC measurement and I have provided a DC bias.

Please post your circuit diagram.