Emon library doesn't work if there is an error of 1-2 LSB in offset value of 512

Hello fellow members,

Happy new year to all of you.

I was working on a project which involves energy monitoring of a three phase industrial system. I need to real time monitor quantities like power factor, real power, apparent power. I have a toroidal CT of ratio 200/5 through which load current passes. the secondary of the CT is connected to ACS712 and i am using Arduino analog pins along with Emon library. At no load condition, i am getting a 1-2 LSB error and i am getting a zero load current as 0.04 A. Since i am using a CT of ratio 40 , hence without any current flowing i will get a current of 1.6 A. Hence i am not getting correct values for real power or any other electrical quantity. What am i doing wrong ? Or any modification can i do?

I do not think that the problem is as you describe in the title of this thread. The library does work in the presence of an offset. If you look at the source code, the offset is actually measured and removed. Are you allowing the filter to settle so that it gets an accurate measure of the offset? Although the filter is initialised to Vcc/2, it will take a short while to adjust if the midpoint is not exactly at Vcc/2.

I think your problem is much more likely to be noise generated either in the supply of your Arduino, or in the ACS712. I don’t know which version of ACS712 you have, according to the data sheet it could be 21 mV peak-peak, which if your input is 5 V peak-peak scaled 0-200 A rms, is 0.84 A (and that is the ACS712 alone, without any power supply noise).

There has been quite a lot of discussion here about the merits of the various options for supplying the Arduino, it might help to search for those and consider the points raised.