I have a DDS238 AC power meter with 2000 pulses/KWh (1p/0.5Wh) and I want to calculate the real-time power consumption and play an alarm if the value exceed a specific value. I'm using an ESP8266 by now, and I tried two different approaches:
- calculating pulses count (with an ISR) in the last 5 seconds
- calculating the time interval between two pulses
I tested it with a hot air blower and both method give me bad results compared with a plug power meter, sometimes I got a difference above 200W. In addiction to this the method (2) may hang if no pulses detected.
So I would ask you how can I calculate the power consumption in a better way? I need a wide interval in the method 1) for example?