Do-It-Yourself Smart Grid Monitor
Brief project description
Not so brief project description
Ever since I started paying for my own utility bill, I’ve been interested in my household power usage. Years before the Kill-A-Watt was introduced, I was measuring the power consumption of individual appliances in an attempt to figure out exactly where my money was going. Of course, back then I used a very low-tech way of doing it. I turned off and unplugged everything in the house, then went outside and timed how long it took my power meter’s “wheel” to make one revolution. Then I turned on appliances, one at a time, and re-timed a power meter wheel revolution. With a little simple math, I was able to convert the time differences into watts and get a pretty good idea of power usage of every appliance.
These days, EVERYONE is interested in lowering their household electrical consumption. One way to help do that is by tracking and understanding power usage real-time (not a month later when you get the electric bill). The following will describe the details involved in making a real-time web based household power usage chart.
There are a few ways to measure electrical power. The way I chose might not be the most accurate but it achieves two of the main criteria for this project. It had to be cheap and I didn’t want to screw with my home electrical wiring to make it work. I did not want make an electrical connection with main power wires. The idea of interfacing directly to 220v makes me nervous. I could have used a Kill-A-Watt but it is only good for one outlet. Plus there is no way to get at the actual data, just look at it. I’ve also seen commercial power meters for this kind of thing. Since those meters can cost over $1000, I didn’t want to go that route either.
For this project, I used an AC clamp. With an AC clamp, it is possible to measure the current traveling through a wire without physically touching it. Basically it is a simple transformer where the wire of interest acts as the primary coil and the AC clamp is the secondary coil. Most AC clamps are integrated into a multi-meter. I used a stand-alone type for my project. It outputs 10mV per ampere and is intended to be connected to a multi-meter. All you do is multiply the voltage reading by 100 to get the current in the wire. These can be found for $20 or less on Ebay. Mine were made by Steren, model MUL-285. The great thing about using an AC clamp is that I was able to do all of my prototyping without ever turning the power off.
The only issue with an AC clamp is that the mV output is also AC. This isn’t a problem for a multi-meter since it can be set for measuring AC voltages. However, the ioBridge module is expecting a DC voltage on its analog input pin. Therefore a little signal conditioning is required to convert the AC RMS value into a DC equivalent. The circuit I used was my own design and used components I had on hand, so I’m almost certain that it’s less than ideal. After I was done soldering it up, I found a simpler circuit here. You may want to try it instead.
The other part of the circuit is a “leaky” peak detector made with a diode, resistor and capacitor. Its purpose is to translate the AC wave peaks into a DC voltage level. The 47k resistor causes the leakiness. Since the voltage level updates 60 times per second, adding that resistor increases the system’s response time.
The potentiometer is used for offset calibration. I used a 15-turn pot for the best accuracy. To calibrate, power the circuit, make sure the AC clamp is not on any wire and measure the circuit’s voltage output. Adjust the potentiometer until 1.000v is reached.
Don’t touch ANYTHING inside the breaker box! The beauty of using an AC clamp is that it’s designed for this sort of thing. Just clip it on a line you’re interesting in measuring and put the cover back on immediately. Touching the wrong thing in there will kill you. I don’t assume any responsibility if someone injures themselves trying to recreate this.
To access my particular breaker box, I just removed the front panel by unscrewing the four screws in the corners.
I used two converter circuits in my setup. In most US homes, the electricity comes in as 220v on 3 main lines. Some appliances, like ovens and clothes dryers, are connected to these 220v lines directly. However, by using just one of the lines, the power is reduced to 110v for all the wall outlets. Usually, a home’s electrical wiring is divided into two sections. One line (known as a leg) powers one section of the home and the other line powers the other side. To get the total power usage in my house, I put an AC clamp on both legs and added the measurements together.
If you are interested in monitoring a single breaker or maybe a single appliance, this method will still work. Just put the clamp on the wire coming out of the breaker. I measured single appliances by splitting an extension cord and clipping the clamp around the wire. (It is necessary for the clamp to be places around a single wire only. Clamping all the wires of an AC electrical cord simultaneously won’t give you a reading.)
To fine tune the scaling factor for converting measured DC voltage to AC current I used a Kill-A-Watt and a portable space heater. I first measured the current draw with the Kill-A-Watt. I then did the same thing my setup, using the clamp on a modified extension cord. Assuming the Kill-A-Watt was accurate, I saw that my readings were about 7% off and adjusted accordingly.
Getting the data to the web was probably the easiest part of this entire project. I just connected the outputs of my converter circuits to the I/O ports of an ioBridge module. The module was connected to my home network using a LinkSys wireless gaming bridge. That saved me from running another Ethernet cable to the electrical panel.
I then went to ioBridge.com and made two analog input monitor widgets, one for each leg of power to be monitored. I embedded these two widgets in my webpage to track the readings. My ioBridge module also monitors the inside and outside temperate.
To convert the voltage reading to current, use the following formula:
To convert this to Watts, the math gets a little fuzzy. A number called the “Power Factor” is needed. The power factor is different for different appliances. Some appliances use voltage and current in phase with each other. This is the case with a heater for example. An electric heater would have a high power factor, maybe 90%. Other things, like computers, use power differently and their voltage/current demands are not in phase. In these situations, the power factor is lower, maybe 35% to 50%. Your entire home is a combination of all these devices with differing power factors. In order to calculate power usage in watts from voltage and current, you’ll need to make a guess at the power factor. Most people use 60% as a good estimate for a home’s average power factor. I used 75% in my calculations. To get power use the following:
There are a few features of the chart that I’d like to point out. First, it automatically updates every 10 seconds. It will continue to add more points for an hour. After an hour, data older than an hour will be scrolled off the chart to make room for new data. This limitation is because of the way Google Charts works. A Google Chart is created through the use of a URL. Since a URL is limited to 2048 characters, there is a limit on the amount of data that can be plotted at once. The other thing I want to mention about the chart is that it will automatically scale the Y-axis.
In this effort to track and minimize power usage, you may be wondering about the electricity consumed by the ioBridge module the LinkSys wireless bridge. Together they use a mere 5 watts! That is considerably less that running a home web server to publish this data.
After using this setup for a few days, I’m amazed at how much power our hot water heater uses (as you can see in the picture below).
Special thanks to Steve for suggesting this as a potential application of ioBridge hardware/software.
And yes… I do know “The Energy Detective” exists. I don’t believe the T.E.D. will publish data directly to your web page without a server running in your home. Besides… it wouldn’t be a very good DIY project if I didn’t actually do it myself.
PS: If you add a comment that includes a link, I probably won’t publish it. Most times, the links are thinly-veiled attempts to plug other products or services.