Finished, working, functional home energy monitor!

I have spent some time over the last couple of weeks working on getting a finished energy monitor for the house together and installed in a more permanent way. I managed to finished the build yesterday and it's now working away logging energy consumption data, giving some informative readouts and nice looking graphs :)

I decided on having a real time display that can be mounted in some ware visible with a cable running to the main unit that holds the sensor electronics situated near were the mains comes in to the house. The main unit also has a USB pen data logger in it to store detailed data. I also wanted to send data to be graphed on the net and so I have another box near my router that has a second arduino and an arduino ethernet shield in it. The ethernet box is connected to the main unit with a wireless xbee connection.

Its quite a complex setup and a bit pricey but I wanted to learn about each element and since I had bought a couple of arduinos, xbee's etc I thought I'd through it all together and make something with lots of crazy and useful things going on in it...

Here are some pics of the setup:

The display unit consisting of 4 large green led 7 segments. On the right is a 6 mode – mode chooser so that you can select by turning the potentiometer (bottom – right) whether the display shows real power, apparent power, power factor, RMS Voltage, RMS Current, frequency or cumulative kWh used. The display is connected to the main unit by a cable that goes through the wall at the back of the display.

The main unit is the small box in the far left of pic with the white CT sensor wire crossing the shelf over to the sensor clipped on to the main mains wire on the right.

The ethernet unit connected to the router, the small box on top of the larger box houses the xbee and can be detached if one wanted a wire connection instead.

A screenshot of the web based graphing that can be seen live here.
Graphing is done using flot – a very nice piece of software.
I'd like to thank John from for his work and help on logging using the ethernet board although he is using open flash charts much of the implementation is very similar.

For more pictures of the setup check out the picassa album here.

Over the next two weeks I hope to document it the setup. I hope to manage a section every couple of days in the order of the features below:

Main Features
  • Voltage measurement with step down AC to AC adapter,
  • Current measurement with CT sensor.
  • Power for sensor board provided with same AC to AC adapter used for voltage measurement.
  • Calculation of Real power, Apparent power, power factor, RMS voltage, RMS current, frequency, cumulative kWh.
  • Display unit consisting of large green 7 segment display, 6 mode – mode chooser and red/green led indicator to indicate when grid is below and above 50Hz.
  • USB pen data logging using VDIP1 board
  • Xbee wireless link from sensor unit to the Ethernet unit.
  • Ethernet board for logging and graphing on internet.
  • Flot based graphing on website.

Block diagram of the setup:

Micro Maker Fair Wales

Myself and Suneil will be exhibiting the energy monitor and wind turbine at Micro Maker Fair Wales in Chapter arts center in Cardiff tomorrow and Saturday 11am - 4pm. The Maker Fair is a part of the may you live in interesting times festival, read more about it here:

Come along if your in the area!

7 segment display and more internet stuff

Finally got the 7 segment display I've been meaning to build for a while built, its great being able to see power usage without having to have the computer on and the big green digits are really nice and clear.

Here's a video of it in action with a bit on pachube and appspot at the end:

CT sensor with Display and Internet from Trystan Lea on Vimeo.

I using a MAX7221CNG driver chip with four 1" green digits, following the tutorial (a very good tutorial I may add!) on the arduino site by wayoda here:

Here's the arduino sketch I used in the above video:

and after playing about with ladyada's python code from tweet-a-watt Im now using python on the computer side.

Here's the python script that outputs values to terminal, a file, pachube and google appspot:

Feels like things are coming together :)

Ive got an asus rooter on order and an arduino ethernet board to play about with so hopefully will not need the computer to be on all the time for data logging soon. Id also like to have a look at enclosures for the display to make things look nice.


Got a pachube feed going. See the gadget on the side ->

To check out my pachube feed page in more detail:

From pachube's website:

"Pachube is a web service available at that enables you to store, share & discover realtime sensor, energy and environment data from objects, devices & buildings around the world. Pachube is a convenient, secure & scalable platform that helps you connect to & build the 'internet of things'."

Internet connectivity and xbee wireless - what a day!

Decided to have a go at getting my xbee's to work this morning so that data can be sent wirelessly from the sensors to the computer.

Followed ladyada's tutorial here:

and it works!

I then thought id have a go at following her tweet-a-watt internet connectivity tutorial using google appspot and visualizations here:

also works! great tutorials!

Here's a couple of minutes of realpower measurements graphed with google visualizations:

and the last 10 power values:

I had to modify a couple of things to get it all to work with the Mains AC: non-invasive method, I will post up a how to and source code soon as I can.

Next id like to try to use the Asus wifi router to remove the computer altogether that ladyada details here:

and Ive got components for a 7 segment display on order.

Hall effect sensor circuit diagram

The circuit is an inverting amplifier circuit. The 100k pot level shifts the input signal. It can be set so that the output lies within the arduino's 0 to 5V input range. The 1k pot sets the amplification factor. By varying both pot's it is possible to set the current measurement range of the circuit. Note the output is inverted so that when the current increases the signal input to the arduino decreases from 5V to 0V.

Experiments with a hall effect current sensor

Thought Id have a go at using a hall effect sensor to measure current. A hall effect sensor can measure DC and AC current, Ive had a go at the DC and it seems to work quite nicely, its also quite a bit cheaper than the other DC current measuring method I detail here, which is always good!

Here's a pic of the setup:

I bought the hall sensor from farnell here.

It requires a supply voltage of between 6 and 12. Its output is centred around Vcc/2. The output voltage increases about 50mV per Amp when the supply voltage is 12V. When measuring DC current the output looks like this:
0.0A - 6.0V
1.0A - 6.05V
2.0A - 6.10V

I've used an inverting amplifier to invert the signal about a set voltage so that the voltage going to the Arduino's analog in is between 0 and 5V. I will upload the circuit diagram and further details soon when I get a chance.

So far it looks like a promising method.

OpenCO2Monitor collaboration

A couple of days ago I was contacted by Ronic Concepcion and Ymreb Momville from the University Southeastern Philippines who are undertaking a technical research project called OpenCO2Monitor as a part of their BS Information Technology degrees.

Their project will be a collaboration with this project using the Mains AC:Non-invasive method of energy monitoring to supply energy consumption information to their software.

From their blog:
"OpenCO2Monitor is an open source software which is capable of monitoring CO2 emissions on a house/building. When the emitted CO2 reaches danger levels, the software will automatically sound an alarm and show a message dialog on the computer screen tell the user what to do.

OpenCO2Monitor is not only capable of monitoring CO2 levels but also monitoring the electric energy consumption of a house/building. It is also capable of showing your current monthly bill based on the Davao Light and Power Company generation charge per kilowatt hour.

OpenCO2Monitor also shows how many number of full grown trees a house/building should have in its surroundings to offset its CO2 Emissions. It also displays the house/building’s current contribution to temperature rise.

OpenCO2Monitor uses the Mains AC:Non-invasive method from to read the Kwh Usage of a house/building."
All really useful information that aims to help the user to "save money and energy while lessening their contribution to greenhouse gasses."

36 hours of house electrical energy use monitoring

Here are some KST graphical outputs of whole house electrical energy use over about 36 hours using the non-invasive method.

The large peaks is water heating. The small ones may be the fridge switching on and off.

zoomed in a bit.. a few hours:

Im quite happy with this method now, its nice, simple and safe.