PZEM-004T-v30 icon indicating copy to clipboard operation
PZEM-004T-v30 copied to clipboard

Current direction

Open jjtoard opened this issue 2 years ago • 1 comments

Hi, I want to use the PZEM-004T to measure the power from and to the grid. It woud be nice if this could be added to the code.

I created somethins myself with sct-013 and a ZMPT101B. I can measure current and voltage and if the most part of the current sinewave is the opposite from the voltage sinewave, I consider this negative. I'm not that technical but this looks to do the trick. What this solution doesn't do correctly is the powerfactor so my power calculations are off when having capacitive and inductive load like airco, induction cooking, ...

Could the current direction be added to this project ?

jjtoard avatar Mar 16 '22 17:03 jjtoard

Hey @jjtoard, the method you use for determining the power flow is essentially correct. Maybe a more precise definition is that the power flow is negative if the phase between the current and the voltage is more than 90deg or less than -90deg....

But as was mentioned earlier, the problem is we don't control the software doing the actual voltage, current aggregation. This is done internally in the PZEM chip by it's firmware which we can't modify.

This library only interfaces with the chip to get the voltage and current amplitudes and the power factor, which is the cosine of the phase. If the power factor is negative, your power flow is reversed. However the PZEM only provides the absolute value of the power factor so the power direction is lost.

mandulaj avatar Mar 21 '22 06:03 mandulaj

Closing as duplicate of #2

mandulaj avatar Feb 02 '23 13:02 mandulaj