Real-time Web Based Household Power Usage Monitor by jasonT
Featured

Step 10: Google Charts and Website Integration

SampleChart.png
Since describing how to use Google Charts and javascript could be an Instructable of its very own, I'm not going to cover that in much detail. Basically, I ripped off a few other examples I found on the web and modified them to fit my needs. I'm providing a link to the source code of my original power charting webpage. If you make the system as I have described, then you should be able to replace the ioBridge widget embed code(s) in my html with your own.

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.

Happy power monitoring!
 
Remove these adsRemove these ads by Signing Up
rkincaid says: Jan 29, 2009. 1:15 PM
Would it be possible to just measure the neutral wire and only use one ac clamp?
ham4fun says: Feb 10, 2009. 6:07 PM
No, because dryers or other 220V equipment won't pass any current through the neutral wire.
legless says: May 24, 2009. 9:40 AM
Huh? What?
threadabort says: Sep 3, 2010. 1:56 PM
Dryers and 220V equipment use the difference between the two others wires. The neutral wire is at 0v. So, let's say you want 240v. 60 times a second you will have a configuration that looks like this: start of cycle: black wire - +120v Red Wire -120v half cycle: black wire -120v Red Wire +120v As you can see, you would get 240v by using the black and red wire since they are 240v apart at their peaks (AC). The rest of the house uses either the black and neutral wire or the red and neutral wire. And that is why they usually say your house is on two different phases.
jenkinch says: Jan 14, 2012. 10:38 PM
Is this why you can just measure the red and black wire, add that up and get your energy consumption? I figured you would have to account for the the voltage going thought the neutral separately otherwise the 240v would be accounted for twice.
legless says: Sep 18, 2010. 3:12 PM
You have a weird way of wiring stuff in your country. You want to try testing the idea that there is no current in a neutral wire from any appliance in my country by grabbing it and you will likely have a whole new hairstyle if you live. Of course all of our mains equipment runs off 220V-240V here. Houses here are normally just supplied by a single phase coming from a supply in the street that is multiple phases. If you want power from a second phase for some reason is taken from another in the street supply. You could also get 415V 3-phase power connected if required here.
lrdforster says: Jan 1, 2012. 10:37 AM
I just come across your instructable and had a look. I found both it and the comments interesting reading. Power factor is interesting and needs a simple measuring solution.

Many years ago when I was an apprentice I recall seeing an analouge Power meter which compencated for power factor. As I recall it had a voltage coil and Current coil combined in such a way they gave a Power reading.

The Idea was as the current signal is out of phase with the voltage one rotating force would work against the other rotating force, Calibration was done in 2 parts, 240 vac and zero current moved the needle to 0 Watts increase in current the rotated the coil back up the scale.

Using tis principle and two conditioned analouge signals one AC volts the other ac amps into two op amps respectively and combine those outputs in a multiplying opamp should give a representative Power Output with Power factor included. ie when current or voltage is momentarily 0 the power is 0.

Multiplication requires 2 logerithmic amplifyers and a summing amplifier. for those who didnt know. Op amps are good at analouge maths. once comleted then digitise using an ADC
lrdforster says: Jan 1, 2012. 1:51 PM
circuit attched quite simple remember it releys on analouge measurment and simaltanious readings. The output would need to be calibrated with known inputs and powerfactor
ScreenHunter_02 Jan. 01 21.45.gif
thecolorblue says: Apr 21, 2009. 9:41 PM
I love this idea but I am really worried about opening up my fuse box to set it up (esspecially, since a lot of the technical stuff went over my head). Even if this setup is only 40% accurate, its a great example of what someone could do with a iobridge. This looks like a great weekend project and maybe another weekend just playing with google visualizations api. With more money, do you think it would be possible to make this more accurate?
jasonT (author) says: Apr 22, 2009. 1:22 PM
Actually yes, I am working on an update that will address the "power factor" errors.
J,R,D, Ltd says: May 20, 2011. 7:40 PM
How has progress on the update gone?
thermoelectric says: May 23, 2009. 8:52 PM
Ooh, I can't wait to see how you do that. It will be really hard unless you can "correct" the misalignment of the current draw. This might give you some ideas (schematic down the bottom...)

I've been watching your live graph and it's amazing how many times it can peak at nearly 4kw's. What draws that much power?

BTW, Great instructable, when I try to do it I will use CT's. I doubt I will use the ioBridge because there isn't much of a DIY factor to that (It's also partially because I'm too young to have a paying job...)
Electron Wizard says: Jan 24, 2009. 12:38 AM
While this can be a worthwhile project, there are some serious "gotcha's" that will limit is usefulness. Power is the flow of energy per unit time. One Watt is the flow of one Joule of energy past a point in one second of time. The circuit as designed is a positive peak detector with a time constant of about 0.5 seconds. This results in a snapshot of the current when it is at its positive maximum, and so we can only really calculate an energy flow at this instant. We are making many assumptions about what is occurring during the rest of the waveform period, and these assumptions can quickly lead us astray. One gotcha is discussed in the article; this is power factor. If the voltage maximum does not occur at the same instant as the current maximum, this will give us an error in our power reading due to our assumptions. The power factor will correct for this, but it assumes that both the voltage and the current are sinusoidal. The power factor varies as various devices are turned on and off, and thus we would have to know the correct power factor for all the devices and if they are running or not in order to make corrections. Switching power supplies and lighting dimmers create a non-sinusoidal current waveform causing errors that cannot be corrected for in this design, another gotcha. Here's an example: A common technique for lighting dimming is called phase cut-on, which turns off the current at its zero crossover point, and then turns it on after a delay that is constant for every cycle. If the dimmer was adjusted to supply half power to the lighting load, the current would be blocked after every zero crossover until the voltage was at its maximum, and then turned on. At that time the current would go to the same maximum as if there was no dimming. The circuit would respond to the same peak and would give the same power reading even though power was reduced by 50%! An accurate power meter has to detect the instantaneous power and integrate it over the unit of time, keeping track of the sign of the power. This is why they are so expensive. Any accurate meter would have to know the polarity of the voltage and the direction of the current. One last reality check. This design cannot differentiate between power flowing out and power flowing in. A power meter that gives the same reading for 1000 W as for -1000 W has some serious limitations. If you replaced your house loads with generators, could your power meter tell the difference? If not, can you really trust it? (The power company meter turns backwards if you put power into their line.) I appreciate the authors desire to generate an inexpensive display of power usage, and many of the ingenious ways he implemented it, but it will only give a broad generalization of power usage, which may be good for things like telling when your air conditioner is going on and off.
james.mcglashan says: Nov 20, 2009. 4:52 PM
hey man that is the longest comment ive ever seen if i waned to write some thing like that i would make a new fourm and link to that topic. hehe instead if having a very long detailed comment.
heltones says: Aug 14, 2009. 12:20 PM
You are correct for all of these points, but I think you paint a bleaker picture than necessary. I agree that the power factor issue is a big gotcha. However, that can be estimated and/or short-term measured (seasonally, depending on HVAC equipment) to get a fairly reasonable idea of how to modify the apparent power to get real power. For that matter, the voltage is not a constant either, so it should be measured. It's generally 118-126 V at my house, with a long-term average somewhere around 122.5 V. That is another bit of uncertainty this method incurs. The average residential monitoring application (at least in the US) will not suffer greatly from lighting dimmers and switching power supplies. These are generally a small percentage of the load at any given time. I'd guess the clamp errors are greater, especially at low currents draws. There is a lot to be gained by a better understanding of the magnitudes and time of energy use and what's going on in one's residence. I think this project is great in both means and ends, despite the limitations. The system really needs to be repeatable more than it needs to be accurate to Watt (or Wh) to give good feedback to the home occupant(s) about energy use. It has the potential to still be more useful than the monthly kWh reading from the electric utility that comes another two weeks after that month ends. I just wanted to add a bit more positive spin to the measurements, because I think they still have a lot to offer.
jasonT (author) says: Jan 24, 2009. 9:21 AM
(removed by author or community request)
Electron Wizard says: Jan 24, 2009. 1:40 PM
Jason; I'm sorry if I gave the impression that I didn't like your design. I came across your project while conducting a search, and now that I have had time to browse instructables, I fully agree with your characterization that simple and inexpensive are key elements. However, it was never my intention to dismiss your project, in fact I admire the ingenuity of it. I just wanted to point out the difficulties of measuring power. I would not be surprised to see an overall error of 30%, or even of 60% if measuring a dimmed load. This does not mean that the project is not useful. The ability to see loads turning on and off is very valuable. I would love to have a record of how my air conditioner is cycling so that I could see if my trials to reduce the demand are working, since power to run air conditioning is very costly. Monitoring an air compressor would be valuable, as would being able to see when your teenage came in late last night, or if lights are being left on. Lastly, my wife would certainly agree with your observation that my discussions are much too longwinded. She is often chiding me about this. Good luck with your projects, I am looking forward to seeing more of them.
jasonT (author) says: Jan 25, 2009. 11:50 AM
It's all good, no problem. I'm going to look into making a new circuit to that does a true RMS to DC conversion. That should help a little with the error. It'll take me a little longer to figure the power measurement with instantaneous voltage factored it. But I'll give it a shot!
geo says: Feb 14, 2009. 2:16 AM
Hi Jason-- Analog Devices has several analog multiplier chips you will want to look at. Sadly, you will find that they're expensive as chips go. The "low cost" ones can be had for eight bucks at Digi-Key, though...
MrFick says: Jan 24, 2009. 7:33 PM
As a High School Teacher of Physics, I am delighted to see this project, as well as the criticism. I, myself, would first be reactionary, but then would really listen to what others have to say, and how my design may be improved. Technology (maybe by way of someone else's Instructable, and maybe even E.W.'s help), may make this more accurate. Please continue the Scientific Process!
sweavo says: Jan 22, 2009. 5:43 AM
Great instructable! I would never have considered ioBridge and google charts, and would have got bogged down in drawing charts on my home webserver. Awesome stuff, thanks!
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!