Tuesday, June 23, 2015

Measurement frequency versus resolution

The idea is to use the monotonically increasing values of T1 and T2 to calculate the average power consumption over the period between two subsequent measurements.

Power [W] =
Tnow [Wh] - Tprevious [Wh]
tnow [s] - tprevious [s]
* 3600 [s/h]

...where T is the energy meter value, and t the timestamp of the measurement.

My initial plan was to capture every single telegram and process it, but after the following considerations I concluded this was really bad idea:
  • What do we do with the 8640 (!) data points per day? Store them locally? Push them over the network?
  • Will we be stressing the Raspberry Pi hardware and resources if we're processing every telegram. How about CPU load and temperature, and aren't we unnecessarily burning the limited writes of an sd-card?
  • I asked myself how real-time this monitoring really needed to be... What am I trying to achieve with it?
  • What would be the resolution of the measurements anyway? Let's see: our meter values are in Wh so the smallest difference we can measure is 1 Wh. Over a timespan of 10 seconds, this would be equivalent to 360 watt.... Wait... so we can only report power consumption in increments of 360 watt? That's entirely useless!
I settled for capturing the P1 telegram every 5 minutes and generating graphs every 15 minutes. The resulting measurements are pushed to external logging services pvoutput.org and mindergas.nl, and also to my own webserver to allow me to build some dashboard around it.


This picture pretty much covers the data flow and their frequencies.
Next, we'll check out the code that is running on the Raspberry Pi to make this all happen...

No comments:

Post a Comment