1
\$\begingroup\$

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:

  1. calculating pulses count (with an ISR) in the last 5 seconds
  2. 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?

\$\endgroup\$
4
  • \$\begingroup\$ 2000 pulses per kWh is 2 pulses per watt hour. Maybe that was your mistake? \$\endgroup\$
    – Andy aka
    Commented Dec 17, 2019 at 16:05
  • \$\begingroup\$ Sorry, I wrote badly in the post. Is 1p/0.5Wh as reported on the DDS238 case. I edited the post \$\endgroup\$
    – Noisemaker
    Commented Dec 18, 2019 at 10:23
  • \$\begingroup\$ sometimes I got a difference above 200W that doesn't sit right to me. How can you have a difference of 200 watts when you are calculating watt hours? \$\endgroup\$
    – Andy aka
    Commented Dec 18, 2019 at 10:41
  • \$\begingroup\$ I don't calculate W hours, I want to calculate a sort of real-time "istantaneus" consumption in W. So I configured a small time interval (5s). \$\endgroup\$
    – Noisemaker
    Commented Dec 18, 2019 at 12:39

1 Answer 1

1
\$\begingroup\$

Using method 1, you have a fundamental limitation that if you make your sample interval too short, you will get poor accuracy.

2000 pulses/kWh means a 1kW load will cause 0.55 pulses per second (or 1.8 seconds per pulse). A 100W load will only give pulses every 18 seconds. So if you are counting pulses in 5 second intervals, you will get apparent fluctuations >200W in your readings, just because of how those pulses fit into the time intervals.

Method 2 will give you the (mean) power between pulses. But you have to design the system to handle arbitrarily long intervals. You don't actually have any new data to display until you get the next pulse.

\$\endgroup\$
2
  • \$\begingroup\$ Maybe I can extend time interval to 10s or 15s and in addiction calculate the average value on last 2 or 3 measurement, this should smooth fluctuations. \$\endgroup\$
    – Noisemaker
    Commented Dec 18, 2019 at 12:41
  • \$\begingroup\$ @Noisemaker I have corrected some bad maths above, and the problem is worse than I thought. Yes, longer intervals and averaging would help. \$\endgroup\$
    – Simon B
    Commented Dec 18, 2019 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.