mandulaj/PZEM-004T-v30

Current direction

Closed this issue · 2 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 ?

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.

Closing as duplicate of #2