Jason Winters' Pico-Projects

Saturday, January 17, 2009

Real-time Web Based Power Charting

Do-It-Yourself Smart Grid Monitor

Brief project description

This post details a real-time web based household power usage chart. The end result is a live chart in a web page that updates every 10 seconds with the instantaneous power usage for my entire house. The electrical current is measured on the main lines entering my home with AC clamps. The signal is then conditioned with a simple circuit and monitored by an ioBridge module. The ioBridge module takes care of feeding the data to the internet without the need for me to host a power hungry home web server. By using ioBridge widgets with a few JavaScript API calls on my web page, I am able to chart the data with Google Charts as it is measured and make kilowatt-hour calculations in real-time.

(This chart will begin plotting in 10 seconds)


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 main component in the circuit is an Analog Devices AD8220 instrumentation op-amp. This part only comes in surface mount style packaging. I needed to use a tiny SMT-to-DIP adapter board for my circuit. Don’t feel like you need to use the exact same part. Any rail-to-rail instrumentation op-amp will work just fine. For example, the AD627 (Analog Devices) will work too and it comes in a breadboard friendly DIP package. In my circuit, I used a 16k resistor to achieve a gain of 4. Feel free to use a different resistor to get to a particular gain you need. However, any change in gain must be compensated for in the JavaScript of the webpage.

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.

Caution:
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:

I = (VoltageReading - 1) x 100 / Gain

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:

Assuming V = 110v (US homes)

P = V x I x Power Factor

As for the plotting and the use of Google Charts… I’m actually a JavaScript newbie myself. I’d rather not try to explain my patchwork of code. The source code is available for my power charting page and the embedded comments should help explain a little of how it works. Code involving the ioBridge widgets was taken from the Temperature Chart example available on their website. More information about the Google Chart API can be found here. I attempted to write the code in a way so that others could reuse it by just changing a few variables. But if you use a different circuit, you’ll need to make changes to compensate for different offset, gain and scaling.

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.

82 Comments:

  • congrats on making engadget!

    By Blogger DanShope.com, at 11:59 PM  

  • What a great project! Wondering if you can give us some idea which other appliances of yours consume significant power besides the water heater.

    By Blogger Michael S., at 1:20 AM  

  • Michael,
    I really have been surprised by plots I've seen so far. I mean, I knew the hot water heater used some power, but my jaw hit the floor when I saw how much. Our oven is the another big culprit. It's enough to make me want to start using a toaster oven instead.

    By Blogger Jason, at 1:53 AM  

  • Cool. I was wanting to do this exact thing a year ago. It's nice to see someone actually follow through.

    L.M.

    By Blogger mukelarvin, at 2:01 AM  

  • If I had half the technical skill required to pull this off, I would certainly love to play with that kind of data about my home and appliances.

    By Blogger Pies, at 2:10 AM  

  • Jason, I love what you've done and I'd like do the same but I honestly cannot be bothered.


    Can you build me the kit in exchange for a handsome bundle of cash?

    Let me know.

    Cheers,

    Mike

    mike.park87 AT Gmail DOT com

    By Anonymous Anonymous, at 3:45 AM  

  • I have been thinking of doing something like this myself.. Except I have a newer style counter, with a blinking led that blinks once for every kWh. Was thinking of just make a blink-detecting device connected to an arduino.

    Could that be an easy solution?

    By Blogger Christian Wattengård, at 5:04 AM  

  • I too woudl be willing to exchange money for a ready made solution.

    Let me know.

    Bill.marcy@gmail.com

    By Blogger Bill, at 9:18 AM  

  • I too would be interested in buying a ready made board to convert the output of the clamps to something the ioboard can use.

    krisasmith@gmail.com

    By Anonymous Anonymous, at 10:40 AM  

  • Hi Jason,

    Great project! Can you also come up with a similar gadget that will indicate how much electricity our house is consuming in monetary terms in real time instead of in terms of kilowatts? It does'nt make sense looking at the electric meter running unless it will indicate how much you gonna pay. People will tend to save or minimize electricity usage if they know the cumulative total how much they will actually pay in monetary terms instead of waiting for your electric bill to arrive after one month.

    By Anonymous Gue, at 10:49 AM  

  • I think this is great, good job! How about monitoring Gas usage? Considering how much more expensive it. Every month i am scared to look at my bill.

    Thanks
    Rich

    By Anonymous Anonymous, at 10:52 AM  

  • Gue,

    It would be a trivial change to add the costing feature.

    By Blogger Jason, at 11:08 AM  

  • Way to go, Jason! I have 4.7ky of PV solar on my roof, and *NOBODY* makes a method to monitor energy generation and whole-house consumption in an integrated manner. I could simply double your hardware, and put a set on the PV output and another on the home input and get exactly what I need.

    Thanks, pal . . .
    solar buddy at g ma1l dot com

    By Anonymous Anonymous, at 11:09 AM  

  • This design assumes that power factor can be assumed as a constant. This assumption doesn't work for the really big consumers of power in your home.

    For example, an electric water heater, stove, or dryer is mostly resistive and will have a power factor or 1.0 (or 100%). An electric air conditioner on the other hand, is an inductive load and will have a power factor of around 0.6 (or 60%).

    You can see that the measured power will be much lower for a hot water heater or higher for a motor-driven air conditioner than the actual power.

    Because the major consumers of power in the home have power factors that are significantly higher or lower than the average that this device assumes, it can give very misleading numbers.

    By Anonymous Murray, at 11:29 AM  

  • Murry,

    Yes, like I mention in this post: Using an AC clamp isn't the most accurate, but it's the safest/cheapest. That was my main objective.

    By Blogger Jason, at 11:37 AM  

  • Dan,

    I just re-read your post. Because you calibrated the device to a resistive load measured by killawatt (it has pf compensation), your device assumes that all loads are resistive. In other words, the calibration "wiped out" power factor from your formula.

    For you case, with an electric water heater, this is a good thing. For my case with gas water, heater, and dryer and electric air conditioning, it would be a bad thing because my air conditioner would read a lot lower than actual.

    It's cool that you are building gadgets. I'm just trying to point out the pitfalls.

    Best regards,
    Murray

    By Anonymous Murray, at 11:48 AM  

  • Opps, meant to say Jason, not Dan ...

    By Anonymous Murray, at 11:49 AM  

  • One more oops: My air conditioner would read a lot ** higher ** than the actual power usage.

    By Anonymous Murray, at 11:51 AM  

  • Murry,
    I still don't see how I'm canceling out the power factor measurement. I put a Kill-A-Watt on a resistive load with a power factor near 1. Then measure the same load with my system. When measuring a purely resistive load, both my system and the Kill-A-Watt should be the same. Then I calculate a "correction factor" based on the difference between the measurements. Now at this point when I put my system on say an AC unit, it would be reading too high. So I multiple my measurement by the PF of the AC unit I should be in the ball park again.

    I can understand that my numbers would be off if I used the AC unit to calibrate, since the Kill-A-Watt would be taking PF into consideration.

    But in the end, it's really a big estimate anyway since I don't actually know the combined PF of the house.

    By Blogger Jason, at 12:10 PM  

  • This may be a point of confusing.

    I'm using two numbers to adjust to readings.

    1) a correction factor that I use to "fine tune" my reading

    2)a power factor that I use to get an estimate of watts from volt-amps.

    By Blogger Jason, at 12:14 PM  

  • Oh wow, that is pretty cool! Nice project!

    RT
    www.privacy-web.us.tc

    By Blogger joshyMinor, at 12:23 PM  

  • Jason,

    It would be a lot easier if you and could spend an hour at a whiteboard!

    Your device is measuring peak amps (filtered a bit), not volt-amps. To get to watts, you are assuming:
    1. Constant voltage from when you calibrated
    2. An average power factor
    3. The current waveform is sinusoidial

    These are a lot of assumptions.

    Based on your description, I wasn't sure how you calibrated your device. If you calibrated it without pf compensation, you're OK. If you calibrated it with pf compensation, the calibration would have nulled out the pf compensation.

    My main point is that the big loads in a house don't have "average" pf: they tend to be either resistive (pf 1.0) or motors (pf 0.6). In either case, you're going to be off since you are assuming an average in the middle. If your big loads are resistive, you'd get better readings assuming a higher pf, say around 0.95.

    I think that it's more important to measure the big loads accurately because the motivation behind monitoring power is that you might change your behavior.

    By Anonymous Murray, at 12:49 PM  

  • I'm thinking of monitoring every circuit in the house. That would be a lot of clamps! Therefore these may be more practical:

    http://www.eeurd.com/pdf/pdf_104.pdf

    By Anonymous Anonymous, at 1:03 PM  

  • Agreed! If I make another version, I will probably use something similar. I don't think 20 AC current clamps would even fit inside the breaker box.

    By Blogger Jason, at 1:07 PM  

  • To continue this power factor question...
    I'm curious, how does the power company calculate this? After all, they don't know what's in your house.

    By Anonymous Thomas, at 1:10 PM  

  • just remember, cost is not the height of the graph; cost is the height of the graph x the length of the power draw. So your water heater is not that big a deal; nor, most likely, is your stove.

    Long term draws are the concern. Even a 100 amp draw is nothing if it is short.

    So what you want to look at is air conditioning, which typically runs for many hours, or draw of the furnace fan, electrical heating, etc.

    By Anonymous Anonymous, at 1:11 PM  

  • I've done something very similar for work. We use split core current transducerts (CT's) connected to a Schneider Electric digital power meter. The meter speeks ModBusTCP and we use a PC to poll it, actually them, we can query 5000 meters per minute. I like your mini set up though. Very creative in that you are able to push data from the meter to the net rather than having to poll it. There is are actual products designed to measure power and be accessed, but I have not found any that push the data, very nice.

    By Anonymous Anonymous, at 1:24 PM  

  • Finally! Someone notice that the data is "pushed" instead of polled. Most people don't see the significance of it, but pushing the data is what allows me to do this without running a PC based server 24/7.

    By Blogger Jason, at 1:31 PM  

  • Be careful if you choose to use a "current transformer". They can kill. Be sure to study up on them before putting a wire thru them

    By Anonymous Anonymous, at 1:32 PM  

  • Really Cool! I would love to implement something like this, if for no other reason than to show my daughter "This is our power consumption" and "THIS is our power consumption when you leave your stereo, tv, lights on after you leave the room...and leave the bathroom lights on.... and...." Any chance of putting together the "kits" mentioned? Maybe bundle the hardware, circuit, software etc?

    Ed

    By Blogger IRGuy, at 1:37 PM  

  • This is so freaking cool!! I will do this soon too (thanks for the AC clamp links, I couldnt find them for under $150!), but for now i made little wireless killawatts by stuffing an xbee in there. unfortunately they can only do 15A so its 'one a room' type (i use a big powerstrip). the nice thing is i can do PF calculation because its transmitting voltage & current samples at once. however, i am now thinking of maybe also adding a 'total' meter via a clamp so I can get a big picture of which rooms are using the most power. i wonder if one could use tinyDB to store longer-term data and then some other webwidget serves up graphs? I'm cheating & using a computer/python/twitter :)

    http://www.flickr.com/photos/ladyada/sets/72157612795495792/

    By Blogger Limor, at 1:47 PM  

  • forgot to also say...i never really understood home wiring but, but could you just measure the neutral wire? one less clamp :D

    By Blogger Limor, at 1:54 PM  

  • The power factor probably isn't really an issue if you're mainly concerned with calculating your costs.

    Loads with a bad power factor will require more power from the source, but are usually metered the same AFAIK. So, when your clamp says 1kW, the power company's measurement is likely the same, regardless of power factor (they measure mostly with cheap CTs as well. ;)

    OTOH, if you're worried about the environmental impact, the power factor matters, since more power is wasted in generation and transmission.

    By Anonymous Nick, at 1:56 PM  

  • Great project!!!

    I am an EE and work on the remote metering system for a utility.

    Here is some additional info that I can offer.

    Power factor is usually corrected by the utility, unless you have a lot of machines w/ motors (reactive loads... that generate VARs) just assume a unity power factor.


    Voltage isn't always 110v, I've seen it as high as 118v. This can happen when the utility is slow to correct for a changing power factor.

    2 improvements:
    1- Add another clamp to monitor voltage.

    2- (over kill) - Use complex power in your calculation...the meters I use read KVAR and KW... use them to calculate KVA in your program...
    utilities typically monitor KW (not KVA) for usage reporting.

    By Anonymous Bob, at 2:03 PM  

  • Limor: You can't measure the neutral wire, because it only carries load imbalances.

    The two hot wires (usually red/black here in North America) are out of phase with each other. Since they both share the same neutral, the current flowing out of one leg flows into the other.

    Assuming the load is identical on both legs, you'll measure 0 on the neutral.

    By Anonymous Nick, at 2:04 PM  

  • Bob:

    I'm sure you know this, but you can't measure voltage with a clamp. Of course adding a voltage meter would be trivial, but certainly less safe/easy than a current clamp.

    By Anonymous Nick, at 2:07 PM  

  • Bob,
    Those are some great tips. My AC is actually 118v, but I didn't include that detail in the write-up. I really really wanted to measure the voltage as well to get better results, but I have limited experience with high voltage circuits. My last attempt sent an arc across on my brand new oscilloscope! It survived, but now I'm very weary of messing with high voltage directly.

    By Blogger Jason, at 2:15 PM  

  • - Warning -
    Don't do this unless you are really really safe!

    Buy a cheap 10:1 transformer at radio shack or recycle something old.

    you are then dealing with (roughly)

    V/10 (The transformers are not 100% efficient)

    You can even form a voltage divider using large valued resistors to get it in the range of a small signal Analog to digital converter.

    As long as you stay away from the primary side of the transformer, nothing should fry.

    By Anonymous Bob, at 2:33 PM  

  • This should be done in a separate panel and installed by a certified electrician! There are special commercial grade coils that are certified for proper protection against fires. An example would be the gap in the bottom of the panel. It can allow flammable material to spill onto the floor or wall. Another is the connection before circuit protection devices. If you are in an apartment this is definitely illegal. And an electrical from this configuration would likely not be covered under insurance.

    By Anonymous Anonymous, at 2:51 PM  

  • Me, a certified electrician? no... but I did stay at a Holiday Inn last night!

    By Blogger Jason, at 2:56 PM  

  • I'd feel a higher level of safety with this setup than I do a $0.50 cell phone charger made in china plugged in my wall over night!

    My brother's blackberry charger almost killed him on night!!!

    By Anonymous Anonymous, at 3:15 PM  

  • That is a great project. I will point my readers to this. Good Job.

    By Anonymous J Boyer, at 4:28 PM  

  • Great project to get an idea of what is going on. I think Murray is a bit jealous of you. From what I see you did a great job and is very interesting. If it was 100% accurate I guess you would have spent several thousand rather than a minimal amount. I will give it a try.

    By Anonymous Anonymous, at 4:34 PM  

  • This is great! Add my name to your list of people wanting to exchange cash for this kit.

    originaljaybird03 AT yahoo DOT com

    - Jay

    By Anonymous Anonymous, at 5:27 PM  

  • great DIY project and nice writeup. For those who want something plug and play, check out Black and Deckers Power Monitor:

    http://www.bdonlinestore.com/product_detail.asp?T1=BDT+EM100B&.

    Not bad for $100...

    By Anonymous EricE, at 6:40 PM  

  • I found this project over a t Instructables:

    http://www.instructables.com/id/Real_time_Web_Based_Household_Power_Usage_Monitor/

    I hate when people post links!

    By Anonymous Anonymous, at 12:59 AM  

  • Great job on your project. one thought I had was an alternative to monitoring the wiring. How about monitor the power meter itself. Perhaps using a web-cam to watch the wheel spin on the meter. Would a software/camera setup would give a more accurate measure of consumption and thus expense? It also seems both safer and perhaps building code legal.

    By Blogger Avi, at 6:45 AM  

  • What is your AC/DC converter grounded to? Shouldn't it share the same reference as the utility's ground, otherwise your measurements would be off?

    By Anonymous Solo, at 11:38 AM  

  • An AC current clamp acts as an isolation transformer. So in the same way that a transformer's primary and secondary coil are not connected, neither is the utilities ground connected to the circuits. However... this isn't 100% true since circuit is power by a wall AC wall adapter.

    By Blogger Jason, at 11:44 AM  

  • About how much total did this cost?

    By Blogger IRGuy, at 3:22 PM  

  • IRGuy,
    To build a system to measure just one line (without the LinkSys bridge) It would be about $120. The wireless gaming bridge was the most expensive part at about $100. So my setup cost about $250. But really, I had most of these parts from other projects already.

    By Blogger Jason, at 3:30 PM  

  • Awesome article! I bet if you went into production making kits this woudl be very popular! -Tim

    By Blogger Tim, at 3:46 PM  

  • Impressive work! Technical note: U.S. house wiring comes in as two wires of 120V each. Because they are 180* apart, you can get 240V for your stove by connecting one to the other. Commercial buildings have three "legs" 120* apart, and the difference between any two is 208V. I suspect that there's no ground wire going all the way back to the power company.

    By Anonymous Cole Petersburg, at 7:47 PM  

  • Hi, I'm a retired analog integrated circuit design engineer, and have a few comments about the analog portion of the circuit you used. You are peak detecting the current waveform, which will create fairly large errors when rectifying loads are measured, as with computers, TV's, etc. That is in addition to simple power factor errors created by reactive loads like motors, etc. You could make fairly simple circuit changes which would avoid the peak detecting problem. The next step after that is to use a multiplier (made by Analog Devices) instead of an instrumentation amplifier, which would generate a true power factor corrected DC output. That would require connection to line voltage, but there is a safe way to do that, using a plug-in AC output wall adapter. Let me know if you want any further details.

    By Anonymous Carl Nelson, at 9:18 PM  

  • "I'm curious, how does the power company calculate this? After all, they don't know what's in your house.
    "

    The power meters the utility company installs inside/outside your house, either the old mechanical rotating disk type or the newer solid state, measure active power. They do not need to know what's in your house but they can measure/adjust for the power factor by sensing voltage and amperage and the phase shift between them (assuming the sinusoidal wave form).

    They do not use "the same cheap CTs" as some other poster mentioned.

    But all this being said, the project is truly nice and affordable. I like especially the web access part.

    Thanks.

    By Anonymous Val, at 10:53 AM  

  • Jason,

    Cool project. My electrical panel is surface mounted meaning the line comes into it form outside and is thus surface mounted as well. Can I simply place the clamp on the line coming from the meter?

    By Anonymous Anonymous, at 11:28 AM  

  • I'm no electrician... but assuming you can access the wires individually, it should work. However, if all the wires are encased in a single cable, placing the AC clamp around that bundle won't get you a reading. This is because the phases of the wires are opposite and will always add to zero.

    By Blogger Jason, at 12:33 PM  

  • Any idea where to get those individual sensors listed above? I checked Mouser and Digikey with no luck.

    By Blogger jjhall, at 2:30 PM  

  • Go Gators!

    By Anonymous Anonymous, at 8:12 PM  

  • I have a question. For 120V things, I can see how you measure the currents in the individual phases and add them up. But for 240, aren't you measuring the same current twice, since it comes in one phase and out the other?

    Wait a minute...you are measuring the current twice, so your current reading will be twice too big, but since the voltage is twice (240), the wattage still comes out. Cool!

    By Blogger Jim, at 10:17 AM  

  • Fabulous project!!!!!

    By Anonymous Anonymous, at 1:25 PM  

  • Anyone knows what are the connector type for the current transformer clamp ?

    By Anonymous Anonymous, at 10:26 AM  

  • Well today I put together the LM324 simpler circuit you referenced as mentioned in my prior post. I connected up everything and I'm getting a reading:

    http://route.dnsalias.org:83/AP/PowerMonitor.htm

    I'm still working on the formula and graphing.

    One thing I did that I'm not sure about. I tied both clamps together in series. When testing, this appears to work instead of using two inputs and adding them together. Do you see any drawback to this method?

    Todd

    By Anonymous Todd, at 8:01 PM  

  • I thought about using the clamps in series myself but decided against it. Since the clamps are measuring an AC signal on two conductors that are out of phase, I didn't think it would work all that well. But I never did actually try it.

    By Blogger Jason, at 11:20 AM  

  • You could measure voltage safely and accurately using two step-down transformers (e.g. low voltage AC-output wall-warts), plugged into different receptacles. Search for two receptacles that are on circuits connected to the two opposite phases that bring the power into your breaker box.

    If you have a small microprocessor with several reasonably speedy A/D converters, you can multiply the voltage by the current as measured many times during each power cycle. The sum of those products is the energy used, and is correct for whatever power factor is currently in effect--in fact, you can calculate the true power factor using those measurements.

    You might be satisfied by using just one voltage measurement, but heavy loads on one phase can cause voltage drop in the neutral supply wire and thus shift the midpoint, so that the other phase's voltage gets higher. So it's more accurate to measure voltage and current on both phases.

    Power factor is caused by the current waveform either leading (capacitive load) or lagging (inductive load) or in sync with (resistive load) the voltage waveform. Modern electronic power supplies or controls can cause the waveforms to be extremely distorted, so ignoring the details of current versus voltage throughout the cycle can give very misleading results.

    The power company's meter physically measures the components of current relative to voltage, so it compensates for power factors quite accurately. If you had a pure inductive or capacitive load, there could be large currents flowing, but for half the cycle the Volts * Amps would be adding and for the other half they would be subtracting, so the net power would be zero (ideally). The power company hates such loads, however, because the large currents (that you don't pay for) do cause resistive losses in the distribution system (that you don't pay for!), so they insist that large users correct their power factor (usually by using banks of capacitors).

    This is a really neat project--congratulations!

    By Blogger dbg, at 2:15 AM  

  • Hi Jason, this is an example of American resourcfulness and rich curiosity. You are to be commended.

    One question I have is if you have seen the Black & Decker Power Monitor system. It's $99 and does everything except the web feed. Considering your materials cost, have you considered hacking into the B&D device to web enable the data? The B&D device is a re-branded BlueLine Powercost Monitor.

    Since I'm not so good with the electronics as you are, I would much rather take the Black & Decker device and just hack into it (potentially with the iobridge) to feed the data to my web widget.

    By Blogger Scott, at 3:08 PM  

  • Scott,
    That's a very interesting idea. I'll look into that!

    By Blogger Jason, at 4:08 PM  

  • Dude you should sue google, they totally stole your invention.

    By Anonymous Anonymous, at 3:09 PM  

  • Jason,
    Did happen across this page?

    http://www.kondra.com/circuit/circuit3.html

    This one is way expensive because of the board he is using. But it seems like the IOBridge might work with this kind of setup as well.

    By Blogger Yoyodyn, at 6:05 PM  

  • Thanks for doing this project! Good effort, im working on a power monitor myself at the moment, Its been very useful having your project up here. Thanks!

    By Blogger Trystan Lea, at 7:31 PM  

  • is there anyone willing to help me do a quite similar project that measures the total power consumption, say for about a month, instead of having it done on an instantaneous manner.. thank you..

    By Anonymous Anonymous, at 4:03 AM  

  • sir, would you be kind enough to help me build a similar project that actually polls the data instead of pushing it? this would help in improving the project better for its long term usage instead of an instantaneous one.. thanks..

    By Blogger darwin, at 4:14 AM  

  • Great work, Jason. I've been meaning to implement this for my own (rented) home ever since reading this article a few months ago. Last night I finally got one clamp working. I think there's something wrong with my fridge, 'cause I can't believe how often it runs! (And how the noise just fades into the background).

    I'm a complete novice when it comes to electronics, so please bear with me. I've got a pair clamps similar to yours. I picked up an LM324 op-amp from Radio Shack (I know, I know) and, using 3k3 and 12k resistors, got a gain of 4.67, which should be enough to get 75A to register as 3.5v on my Arduino's ADC. The LM324 will only amplify the signal to Vcc - 1.5v, and I'm running at 5v. So far so good. Is the op-amp's gain a straight multiplier? Eg, is 10mV going to get amplified to 46.7mV with a gain of 4.67?

    I'm having difficulty understanding the capacitor in your circuit. It seems to me that it's "backwards", with the positive lead tied to ground, and the negative to the 47k resistor and ADC input. Can you explain how that works? I understand that the resistor is "leaking" the cap, but I don't understand how it charges (except perhaps from the grounded side of the clamp, but that's very small voltage...).

    What sort of resolution are you able to get? I bought a new DMM at Home Depot yesterday with an AC current-sensing clamp, so that I'd know if I was even close. Using a clothing iron and the incandescent lamp at my workbench, I'm able to measure about 0.5A with just the lamp, 12.1A with the iron, and (as expected) 12.6A with both turned on. My circuit, however, is not as responsive, however; it registers about 11A (scaling the ADC value up) which is sort of acceptable, but it doesn't "see" the 0.5A change from the lamp, either with or without the iron on. Is that a limitation in the sensitivity of my cheap clamp, or have I buggered something up (likely)?

    Thanks for the great write-up!
    Brian

    By Blogger blalor, at 7:43 AM  

  • It's a waist of time to measure voltage. Just assume a5% error. If you want to know the power factor of your home just turn everything on and use a multimeter. Find your current and voltage multiplied together is your S (or apparent power) then find your power using the meter this should be possible ha or wait an hour and check your house meter . Divide your S by p for your PF.


    Ryan

    By Anonymous Anonymous, at 6:31 PM  

  • Brian,

    That was an error in the schematic. The capacitor was supposed to be facing the other way. Thanks for pointing that out.

    It's hard to know exactly what is going on with your circuit. I tried to use the LM324 and didn't have much luck either. I'm able to see 0.5A changes on my system. I'm actually in the middle of redesigning the whole thing to incorporate power factor. You may want to take a look at Analog Devices, AD737. It does what my circuit attempts to do, but is much much better at it.

    By Blogger Jason, at 4:03 PM  

  • Thanks for the reply, Jason. The first thing I'm going to do tomorrow is turn my caps around! :-)

    I found an adjustment pot inside my clamps and cranked them both up to their most sensitive/amplified setting. One clamp is *way* off and I had to increase the gain on that channel of the LM324 to 5.9 to get it to match the other clamp, whose gain is set to about 4.6. They at least read pretty much the same right now. The next time I place an order with Digikey, I'll be sure to stock up on some better op-amps.

    Are you going to use the AD737 with your next iteration? I'm curious to see how that turns out. It looks like the perfect solution.

    I'm also on the look-out for some smaller clamp-on CTs. The off-the-shelf units I bought via eBay are nearly identical to yours, but don't fit into my crowded electric panel...

    By Blogger blalor, at 10:52 PM  

  • Jason, The comments and feedback you have been getting indicate just how useful this kit is to lots of folk, well done. Are you collecting your internal/external data and analysing it to see if you can create a management dashboard yet?

    As well as pubishing the live data set up alarms and maybe simple email/sms messages to indicate where energy management savings can be made.

    This could then lead to controlling lights, HVAC and other devices automatically.

    Once great job!

    Mark

    By Anonymous The Greenth, at 8:30 AM  

  • Jason,

    I constructed this project for one leg only so far. I used the AD627 and left the gain at 5. I am still messing around with the calibration, but was able to modify the html to accommodate only the single leg.

    Could you please explain why you biased the circuit to run from 1.0V to 5.0V, rather than from 0.0V to 5.0V? Is there some linearity issue with the op-amps or the IOBridge near 0V? Or some other reason?

    Very fun project, thanks very much for posting it!!

    Tom Lewis

    By Blogger t_lewis, at 12:30 AM  

  • Tom,

    It has been a few months so the details are a little fuzzy. But the 1 volt offset was related to the circuit not functioning correctly when the output was near zero. Sorry I can't remember the exact details.

    By Blogger Jason, at 12:35 AM  

  • Jason,

    I completed my monitor based on your solution. Thanks again. Site is www.thomaswlewis.com/?p=548.

    By Blogger t_lewis, at 1:13 AM  

  • This is a cool project, I'm trying to build one, but having the damnedest time ordering the clamps. The Steren site does not seem to have a working checkout. Any advice on how to order from them or someone else?

    By Blogger Ben, at 4:31 PM  

  • nice job
    i am going to try this out wireless

    By Anonymous Anonymous, at 2:59 AM  

Post a Comment

Links to this post:

Create a Link

<< Home