Summary of my energy monitoring code

This is just a quick summary of the code I've been working on recently. The ultimate aim of all the code is to measure the whole-house electricity consumption and the consumption of individual appliances as cost-effectively as possible.

View on Flickr

  • rfm_edf_ecomanager - C++ code for running on a Nanode (an Arduino clone with easy wireless support and networking). This code allows the Nanode to talk directly to multiple Current Cost whole-house sensors (CC TXs) as well as to multiple EDF Transmitter Plugs (CC TRXs). This code aims to capture data from the sensors as reliably as possible. For example, it learns when each CC TX is due to transmit and ensures that it stops polling the CC TRXs for a short window of time around the CC TX's ETA. You talk to the Nanode over the serial port. You can send simple commands. It sends data back to the PC in a simple JSON format.
  • rfm_ecomanager_logger - A Python script for communicating with the rfm_edf_ecomanager Nanode system. rfm_ecomanager_logger provides a command-line tool for "pairing" sensors with the logging system; assigning human-readable names to those sensors and then logging the data in a REDD-formatted form. Again, the emphasis is on reliable logging. It attempts to restart the Nanode if it dies. It goes to quite a lot of effort to make sure we correctly time stamp data (which is surprisingly difficult, especially given that the Nanode doesn't have a real time clock).
  • babysitter - A Python module for "babysitting" a logging system. Sends an email if a sensor dies or if rfm_ecomanager_logger fails. Also sends a "heartbeat" email once a day with some stats and a graph produce by powerstats:
  • powerstats - Produce stats and graphs from REDD-formatted power data. Mainly used for checking the health of sensors.
  • snd_card_power_meter - System for recording voltage and current waveforms at 96 khz, 20 bit per channel using a PC's sound card. Saves down-sampled high frequency data and also calculates real power and apparent power.

Also, I wrote a long guide to setting up a complete logging system which uses all the code listed above and is based on a small, low-cost, low-power Intel Atom system running Ubuntu Server.


Eagerly awaiting the Sound Card Power Meter! Going ahead with RPi?
Always wonderful to see well documented and reusable code (and to add to that Python :-) ).

Glad you like the code! (And wow, that was a quick response to my blog post!)

I did tinker with an RPi but decided to go with low-cost and low-power Intel Atom systems. I'll add a note to the blog post about the Intel Atom systems...

Add new comment