C++ notes

Group MSc project on "Visualisation and Analysis of Domestic Electrical Energy Consumption"

I'm hoping to organise a Computer Science MSc group project on "Visualisation and Analysis of Domestic Electrical Energy Consumption". One aim of the project is to produce an open-source app tol help people save energy by producing useful and interesting visualisations (pretty graphs) of their energy usage. The ultimate aim is to produce something a bit like Google Powermeter. But better ;)! The full spec of the group project is available here.

I'd be really eager to hear any comments / suggestions at this (very) early stage to try to make the project both lots of fun for the students and also useful to the community. Some specific questions might be:

  • Do you currently use a tool to visualise your energy use? (Such as Current Cost's website or Cosm or or something similar?)
  • Are there any specific statistics / visualisations that you'd be particularly interested in?
  • Would you be interested in being able to share details of your energy use with select friends to compare progress?

(To give a bit of context: Group projects run for the duration of the spring term (11 weeks starting Jan 2013). I'm a PhD student in the computing department so I'll be supervising the project but the detailed design is up to the MSc students. Groups usually consist of 5-6 MSc students. There are no guarantees that a group will actually want to do the project, of course!)

Ensuring the fan runs on my HP ProBook 6450b laptop

I have an HP ProBook 6450b laptop which runs Ubuntu 12.10 and Windows 7. It had a tedious and potentially expensive problem: when running Linux, the CPU fan would fail to turn on until the CPU temperature reached 105℃. This was dangerously hot. I wrote about the problem in detail on the Ubuntu Forum, including links to my conversations on the linux-acpi kernel list.

After spending about a month trying to find a software fix for this problem, I decided it was time to get the soldering iron out to fix the problem. Here's what I did:

Insulating our bedrooms

Back in February, we insulated the two bedrooms in our end-of-terrace Victorian solid-walled house. This blog post attempts to document the process, including lots of photos. The detailed plans for this project (including some CO2 calculations and a complete shopping list) are described in a previous blog post. A quick re-cap of the plans:

  • Our upstairs walls are not damp so we can just attach the insulation directly to the plastered wall, we didn't bother with wooden battens.
  • Use Fermacell instead of plasterboard. Fermacell is much stronger than plasterboard, so it should be possible to hang shelves directly from the Fermacell.
  • 65mm insulation + 12.5mm Fermacell
  • Use 160mm "frame-fixing" screws to mechanically secure the Fermacell to the brick. These come with their own wall plugs. To use, just drill straight through the Fermacell + insulation + brick, then hammer the wall plugs into place and screw in the long screws (i.e. you don't need to pre-drill the wall and then try to align holes in the insulation with holes in the wall).

In total it took about three weekends to install the insulation for both our bedrooms, MUCH less time than it took to insulate our living room. (This time does not include the time taken to plaster and decorate, which we had done by some excellent local decorators - I just installed the insulation & Fermacell.)

On to the details...

Buying and installing a smart meter


I'd like to install a smart meter so I can collect whole-house readings of real and reactive power and voltage once every five seconds for my PhD work on disaggregation. For several months I've been prodding my utility company to replace my "spinning-disk" meter with a smart meter but this isn't going to happen any time soon, even if I offer to pay for the hardware and installation. The existing spinning-disk meter is owned by the utility company so I can't touch it. So my plan is to hire an electrician to install a smart meter downstream of my spinning-disk meter. This blog post is just my notes about smart meters (which to buy? how to communicate with it? etc.)

DIY EcoManager Nanode code is feature-complete!

Hurray! At long, LONG last the embedded C++ code for my DIY EcoManager is feature-complete! It's hard to believe that it's been a full two months since I started on this mission to build a DIY Current Cost receiver. Back then I thought it'd only take a couple of weeks! The last two months have been spent writing over 3,000 lines of C++, scratching my head lots over the EcoManager protocol and how to use the RFM12b wireless module. Oh, and blowing up my laptop of course. And I've met some really smart folks who are trying to do similar projects; without whom I honestly wouldn't have been able to get this project done. I've also really gotten into using the wiki and issue tracker features on github: the integration between commits, the issue tracker and the wiki is great.

The next step is to write a Python script to log the data coming from the Nanode and keep track of which IAMs are connected to which appliance. And then either build an Open Energy Monitor to measure both real and reactive power for my whole house, or pester Ecotricity to get me on their smart meter trial.

And then, once I've got all my data logging kit quietly collecting data, I'll finally be able to get cracking with my "proper" work of doing smart meter disaggregation!

Deleted Current Cost protocol documents

I'm really sorry but I'm afraid I've had to remove the Current Cost protocol details from the GitHub wiki for my rfm_edf_ecomanager project.

Current Cost got in touch a little while ago. (My blog had showed up on one of their Google Alerts). They were very friendly and were genuinely interested in the work I had been doing. But they did request that I delete two wiki pages which describe the workings of the Current Cost protocols (reverse engineered by a group of us). So I have deleted those two pages.

The open-source advocate in me did consider defiantly keeping the documentation online. But I think the pragmatic, diplomatic and polite option is to comply with Current Cost's wishes. To start with, they have been very friendly (they haven't served me with a formal take-down notice or anything like that). And the smart metering world appears to be quite small so it would be a big mistake to annoy one of the major players! To be honest, I'm somewhat relieved that we're allowed to keep the code online.

rfm_edf_ecomanager code now works with the Arduino IDE

Just a very quick update: my rfm_edf_ecomanager C++ AVR code now should compile within the Arduino IDE.

Current Cost and EDF EcoManager RF protocols almost fully decoded

Thanks to the enormous help of Graham Murphy, Matt Thorpe and Paul Cooper, the wiki pages for the EDF EcoManager RF protocol and the Current Cost RF protocol are nearing completion. Of course, jump in if you have anything to add. Anyone with a github account can contribute.

And my EDF EcoManager C++ AVR code is ticking along. Still some distance from being usable "in the field" but getting there.

One quick random thought: for those of us who have been tinkering with the Current Cost RF protocol, it appeared rather odd that the data is "manchesterised". It occurred to me this afternoon that we can take advantage of this structure in the data to validate the data. A little more discussion on the wiki.

UPDATE 30/10/2012

Current Cost have asked me to remove the protocol documentation from the wiki. More details here.

EDF EcoManager wiki

I've started a wiki page for technical details of the EDF EcoManager protocol. Please feel free to edit!

UPDATE 30/10/2012

Current Cost have asked me to remove the protocol documentation from the wiki. More details here.


Subscribe to RSS - blogs