I am designing an AC energy metering circuit. The circuit has to measure voltage, current, power, power factor and energy used for two channels (from the same source). The HLW8032 transmits 24 bytes with information on the above quantities every 50 ms.
I have designed a circuit based on this chip following the example application circuit given in its datasheet. A difference, however was in the shunt resistor. I have cut a rectangular piece of copper, drilled some holes and I am using it as my shunt.
To calculate energy usage, the resistance of the shunt should be known. I arrived at this value by connecting a resistive load, measuring the current and getting the appropriate current data values from the chip. The formula given in the datasheet involves
current = (some data in a register/some other data in a register) * (a factor related to shunt resistance)
working back using the current I measured from my multimeter, I got a value of 0.145 mΩ.
Now the actual problem: energy measurement.
The chip has a register that holds a count relating directly to the energy consumed, e.g. 950 counts for 10 Whr. (formula for number is given in the chip's datasheet )
When actual loads are connected the circuit works as expected, measures power, current and energy consumed. When there is no load connected, the register increments, indicating that there is a tiny load connected. Working back from the pulses I estimate it to be ~3 W. The current values at no load also do not make sense. It gives current values as high as 0.5A but at a very low power factor, so not significant power is contributed from that i think.
My concern is that this will lead to huge errors as the energy usage accumulates.
Is this because the shunt is a custom piece of copper? Or is it because the shunt value is too low? Is there a problem with copper-solder joints (thermal emf? Seebeck effect?)? Is this because of noise and will disappear when shielded? should no wire be close to the shunt?
I tried cleaning all the residual flux from the chips in case they caused some leakage/interference but still no change.
Another issue is that the rate at which it counts up at no load is different for each chip. and the value for a particular chip has a strong degree of variation. This rules out the possibility of just subtracting a certain number of counts per hour. What can I do to solve this issue.
The circuit is as follows. the only difference is that I have a relay just before the load.
An English datasheet for the chip is on LCSC
https://datasheet.lcsc.com/lcsc/2307271600_Hiliwei-Tech-HLW8032_C128023.pdfMy implementation is on an etched pcb, handsoldered
The chip BL0937 is pin compatible with HLW8032 on the AC side, Using it in the schematic shouldn't make a difference. Also ground and neutral are connected (bodged after printing)