A couple of years ago I was lucky enough to be given a Current Cost Energy Meter like the one in the photos below. This type of device comes with a Hall Effect Sensor which goes around the Live Cable to your Electricity Meter and a display unit. The two communicate with each other using Bluetooth.
After a while using the Meter and looking at the display, I did quite a bit at home to reduce my electricity consumption, including changing light bulbs for cost efficient LED ones, I purchased one of these remote controlled plug sets to be able to switch devices (TV, Computer, Xbox etc.) off of standby when they were not being used.
I decided to see if I could capture this data and do something useful with it.
I purchased a RJ45 to USB cable from the CurrentCost Online Shop and after some “googling” managed to get it to work..
The rest of this blog is about how I used a Raspberry Pi to capture and display the electricity consumption of my house.
The Raspberry Pi automatically reads data from the Current Cost Meter, processes it, stores it, graphs the data and serves it out on the web to be viewed by a client with a web browser.
I use the following configuration/packages to achieve this:
- Current Cost Meter via the RJ45 to USB Cable sends data to the Raspberry Pi (Rev 1 Model B) running Rasbian via one of the USB Connectors.
- The data is captured, processed and stored in RRDTool using PySerial and some hand cranked Python code.
- Using automatic cron jobs RRDTool is used to create graphs which are dropped into the structure of the simple website being served by the Raspberry Pi.
- Lighttpd is used to serve the Website to my home LAN
- I have used port forwarding on my Broadband Router to enable me to view the website from the Internet i.e. work etc. The website is password protected. For reasons which will become clear!
I deliberately kept the web site design very plain and very simple to ensure that the Pi is not overloaded and also so that the site can be viewed from PC”s, iPad and also Android phone. And actually I am not very good at html!
This is what the site looks like, a front page, links for Electricity Consumption for the last 10 mins, 2 hours, 4 hours, last day, last week and Temperature in the last day (the Current Cost device has a temperature sensor in it).
And alongside are examples of the other pages of the website.
RRDTool allows to do calculations on the data, and therefore for the graphs I compute the Average and the Maximum. This is not too noticeable on the shorter timescale graphs, but you begin to notice the effect on the graphs for the last day and the last week.
Also I calculate the load factor, which is expressed as a percentage on the graph where 100 = a load factor of 1.
The Load Factor is normally at 100 until something with a motor switches on or off. This is most obvious when the Washing Machine motor switches on, but I have also seen the load factor change when the central heating pump comes on and the compressor for my two fridge/freezers.
The Current Cost display spits out a reading every 6 seconds, which means it is quite good at capturing peaks or spikes in energy usage. This means that for example it is possible to start to identify what appliances are being used in the home, by their signatures. This includes items like Kettles, Irons, Fridge Freezers etc.
The corollary of this is that, with a little bit of knowledge, it becomes possible to know if a house is occupied or not. This can be used for positive or less positive reasons. If you are on holiday you might not want to see your kettle being switched on! Equally if you are monitoring the electricity consumption of an Elderly relative or friend you might want to check that they have made their cup of early morning tea by 10am.
It is for these reasons that the website I created is password protected.
In the next blog post I will go into detail on how to setup your Raspberry Pi to monitor your electricity.