Instructables

Arduino home energy monitor shield

FeaturedContest Winner
Picture of Arduino home energy monitor shield
Although products are becoming more and more available for monitoring your home power usage, I'm one of those idiots who can't leave well enough alone and who would rather shell out $100 and hours of my time in order to save $20 and learn something in the process.  Building on the fine work of Trystan Lea and others at OpenEnergyMonitor.org as well as various and sundry web sources and acquaintances the result is a self-contained Arduino shield for monitoring the energy usage of your home using clamp on current transformers, an ethernet shield, and an Arduino. The resulting Energy Monitoring Shield has a built in switching power supply and with mains voltage (120VAC in the US) to the board can do power factor correction as well.  With mains voltage to the board it is also more dangerous than your typical home electronics project and as such has been rejected for distribution by commercial maker outlets like adafruit and sparkfun.  So take that as a warning, and if in doubt, keep one hand in your pocket and out of puddles when handling the board.

In simple terms, the power monitor shield provides an AC to DC power source for the Arduino and Ethernet Shield, samples the AC voltage waveform for power factor correction, and uses the current transformers to measure current draw of branch circuits in your home breaker box.

Features:
* Connectors for easy integration with clamp on current transformers
* Built in 120VAC to 5VDC switching power supply for powering Arduino and Ethernet Shields
* Monitor up to 5 branch circuits at once, of which up to 3 can be two wire single phase 240VAC
* Power factor correction for power measurements
* Code interfaces with Pachube (now COSM) internet of things for data presentation
* Makes your breaker box a mess

DISCLAIMER:  This project requires working with 120 and/or 240VAC, which can kill or seriously injure you if you are not careful.  Please be aware of and follow all applicable safety practice, electrical code, and Geneva Convention guidelines.
 
Remove these adsRemove these ads by Signing Up
mfadiga4 months ago

i already got this one in the picture, that is 220v-9v. can i use it?

trasformatore.JPG
jmengel (author)  mfadiga4 months ago
Should be fine. Not going to fit the holes in the PCB files but you can use wires from the PCB to the transformer. Just have to tweak the calibration parameters.
mfadiga jmengel4 months ago
So i can use this transformer without changing any other other hardware component? It's also fine for the arduino power suply?
jmengel (author)  mfadiga4 months ago

You may need to change the divider resistors that feed AC voltage to the Aurduino (R2 and R19) depending on the actual output of your transformer. You just need to keep the signal from saturating the ADC input.

Also, as discussed, the burden resistors for each current transformer input will need to be altered to match the current transformers you end up using.

mfadiga4 months ago
Hi,
First of all sorry for my English because I'm italian.
I want to make a project similar to yours but i need to use 220v instead of 120v.
I found this on internet http://iq-technologies.net/projects/power/025/ can i use it?
jmengel (author)  mfadiga4 months ago

In hardware, all you will need to do to change the circuit for 220VAC is to swap in a transformer with a different winding. For example:

http://www.digikey.com/product-detail/en/3FD-310/M...

You will also need to adjust some of the parameters in the code. But that will be easier.

mfadiga4 months ago
Hi,
First of all sorry for my English because I'm italian.
I want to make a project similar to yours but i need to use 220v instead of 120v.
I found this on internet http://iq-technologies.net/projects/power/025/ can i use it?
I'm having a failure every two days atm updating Cosm - it hangs at the update, seemingly at random. Did you ever get to the bottom of what was causing the locking up on yours? I'm thinking of rewriting the code without the Cosm plugin to add some extra connection checking.
I've been trying things for weeks now, to no avail. My shield is a clone by the way, don't know if that makes a difference.
Yours exasperatedly, Duncan
jmengel (author)  duncangallimore8 months ago
I did not get to the bottom of the lock up, although it was more on the scale of weeks/months rather than every day or two so I just live with it, and I got tired of messing with it. Did you heatsink the ethernet chip?
zapro1 year ago
Great build, but please - add some isolation between neutral/phase and make isolation between neutral/phase and the ground plane. Add a fuse for that mains transformer too, if the transformer fails shorted you will have full house current cooking your PCB... That PCB layout is a recipe for disaster :-/
jmengel (author)  zapro1 year ago
Looking over the PCB, I can see that it might make sense to increase the spacing between the mains traces and the ground plane. Also a fuse is not a bad idea. The case the PCB is housed in is a metal case grounded to the main panel. The transformer itself is not rated as an isolation transformer but does isolate the rest of the PCB from mains unless it fails in short across the primary to secondary. So again, I'm not sure how to add isolation.
zapro jmengel1 year ago
You need some isolation between parts that is in contact with line voltage, that is - isolation to components on low-voltage side, groundplane, case etc.

If your PCB is mounted on plastic standoffs there is nothing to mention about placing the standoffs, but if the PCB is slit into some kind of grooves in the box, so the groundplane and metal box is actually touching, you need make a 8mm spacing between the high voltage and the edge of the PCB. The recommended spacing between your live parts and other components and/or groundplane is 8mm too. Please have a look at this picture: http://www.tablix.org/~avian/blog/images/blog/20070408t202730-img_2621-m.jpg

See the spacing between the two sides ? That is for safety. The only connection between the sides is a optoisolator and the transformer (which is internally isolated)

A fuse is a good idea, too.
jmengel (author)  zapro1 year ago
Can you elaborate on a proper method to isolate? I am an ME with only enough EE to be dangerous, as you point out.
davebe2 years ago
Have you looked at the AC waveform you are getting from the transformer?

I've been looking at an energy monitor, but found that transformers distort the voltage waveform.

See http://www.rotwang.co.uk/projects/energy_monitor.html for details
jmengel (author)  davebe2 years ago
I have not looked at the AC waveform out of the xformer. I'll take a look and post the result. Nice write up on the power monitor you are building.
russ_hensel2 years ago
Nice, but a lot of cost in the audio jacks, I think people can find a cheaper alternative and save.
jmengel (author)  russ_hensel2 years ago
Being able to swap between circuits is quite handy so the jacks are a must. You do not want to solder your current transformer leads to the PCB. In any case, the SMT jacks are just $1.04 each in qtys of 10. If you want to find a cheaper jack, go for it, my only requirement was SMT. The current transformers are the main cost at ~$10 each.

The cheapest alternative is to turn off the main breaker, tape a sheet of paper with "0 Watts" written on it to the computer screen and go for a walk. Savings!
Boost2 years ago
Nice! I would want to make one of these but for 240V 50Hz (and 400V 3-phase). Any pointers?
jmengel (author)  Boost2 years ago
You'll need to alter some of the calibration numbers and be sure your current transformers and burden resistors are rated for 240V. You'll also need to select a transformer suited for 240VAC. Check at openenergymonitor.org and in their forums as there is sure to be someone who has already done what you propose.

I can't help you on the 3-phase front. In theory you'd just need to modify the power monitor shield to use 3 current transformers per input, placing all in series. Getting power factor data will be more challenging. Again, probably someone at openenergymonitor.org has done this.
jmengel (author)  jmengel2 years ago
To clarify, by transformer I mean the step-down transformer for single phase voltage measurement and power factor correction which is also used to power the device. You'll need a transformer that steps the 240V 50Hz down to 6VAC.
randofo2 years ago
Cool. How long has this been installed? Have you noticed anything interesting yet?
jmengel (author)  randofo2 years ago
I've had a version of this installed for about 2 years. I use it for monitoring solar production and for tracking HVAC usage among other things. In terms of interesting things, I've found out which branch circuits have significant vampire loads on them and tracked down a few gross offenders that now get switched off via a surge strip when not in use.