Tuesday, February 11, 2014

Using the Iris Smart Switch to Measure Appliance Power

Since I finished the example of how to operate the Iris Smart Switch with a Raspberry Pi, I couldn't wait to hook it to something and do something real with it.  I decided to measure the power usage of my refrigerator.  First, about the refrigerator:  It's a refrigerator only, it doesn't have a freezer section; I have a separate freezer in the kitchen also.  There's a reason for this besides showing off.  Out here in the sticks where a trip to the grocery store is a major undertaking, we don't go very often.  That means plenty of food storage; I have a pantry, an upright freezer and separate refrigerator in the house and a chest freezer in the garage.  Yes, I can go about two weeks before I even have to go for bread and milk.  This makes things like a shopping list that is up to date a valuable skill.  I keep it up to date and every time I'm forced into town, it goes with me.  I don't want to waste a trip.

Anyway, I put together some code and read the switch, recorded the readings in my database and updated Xively with the data.  Then I suck the accumulated data from Xively and graph it to see what the appliance is doing.  I didn't implement the ability to turn the switch on and off since who wants to shut their refrigerator off??  Here's a days worth of data on the refrigerator:

Notice how it's only on for a short amount of time and that, other than the spike when the compressor starts, it doesn't use much power?  It's on roughly 15 minutes, and off for about 30 minutes in repeating cycles.  Here is an expansion of a portion of it:

The large spike on the first 'hump' is where the compressor kicks on.  It takes a lot of power to get the compressor going, but it drops off rapidly.  The granularity of the readings is only a minute, and if I was graphing every few seconds, you would see spikes on all the humps.  However, this is an accurate representation of what is happening overall.  Notice that the 550W spike is short and that the current draw decreases over time.  The average usage is probably around 110W or so for the period where the compressor is on.  That's the amount of energy used by some incandescent bulbs !  Let's see what a door open does to the chart:

Notice that the power usage jumps (the hump on the right) to 300W when the door is open?  It's pretty sobering that the power used by the lights when the door is open is actually more than the power used to keep the darn thing cold.  Now see why they say to close the door to save energy?  They just didn't tell us that the power loss was due to the bulbs, not the fact that we're warming up the fridge.  I'll probably get arguments from the energy nerds out there, but for my appliance, this is true.  Or, at least it is right now; I plan on getting LED bulbs to take care of that silly problem in the next couple of weeks.

Of course, there's the compressor kicking on right after I closed the door because I left the door open for a couple of minutes and it had to recover the temperature.  That's why the hump for the lights is on the far right, I actually went over and opened the door to get this reading.

All in all though, the fridge is not a huge power consumer.  It's less than running a 100W bulb all the time.  Actually, it's probably close to a 40W bulb since it's off twice as long as it's on in any given period.

Let's review.  I hacked into the Lowe's smart switch using an arduino (it's what I had to play with)<link>, ported the code to python so I could run it on a Raspberry Pi <link>, and then hooked it up to an appliance and learned that it was actually doing a good job.  Actually better than I expected.  Was it worth it?  Of course it was.  Now folks out there can take my example and measure their own appliances to compare them to their own expectations and needs.

Soon, I'll get another Smart Switch and put it in the circuit for the freezer and see how much power it uses.  I expect it to be higher than the fridge because it has the same set of lights, a bigger compressor and the circuitry for auto defrost.  Auto defrost is a real power monger since it actually warms up some areas of the appliance and drains the water out to be evaporated away.  I also want to see how often it cycles since it could happen that the compressor on the freezer and the compressor on the fridge could overlap their cycles.  That would cause a spike in power usage for the overlap period, which in turn, could cause my demand usage to rise.  That's the kind of thing I want to keep track of.  Demand billing is a painful thing because a simple mistake in power usage could double your monthly power bill.  I have a long discussion about my experiences here <link>.

Now, go out and get your own system of monitors running.  Take control of your house.

Addendum: As anyone can tell, I'm all about measuring things around the house to keep it under control, Power, time, temperature, runtime, etc are awesome tools to get your bills under control. But I also have calipers, micrometers, rulers and that kind of thing.

But with a smartphone, a whole new realm opens up. Take a look here for some stuff that I never even knew existed until I started looking for it.


And that's just the beginning.


  1. One interesting note about the IRIS switch is that when viewed in the network using XCT-U, that the switch comes up as a router. This raises the interesting question about it's use as a range extender in certain situations?

  2. I don't know for absolute certain, since I only have one of them, but I think it will. Remember though it has to share the network that it's a router in, so for me, I wouldn't do that with the other XBees I have. It would route another similar switch though.

    That makes it somewhat useful.

  3. Thanks for posting your experiences with the xbee and iris switch. I had uses some of you original arduino code as a guide to getting mine working with a pcduino and ended up using the same xbee library. I went with SQLite for tracking the power readings and CherryPy for the webserver portion. So far everything is working great and I'm eyeing some of the other Zigbee devices. Any chance your next project would involve the Zigbee door lock Lowes is selling? Although, I should probably look at some sort of authentication on my system first, after being startled awake in the middle of the night when Google' search bot hit my page and started flashing the bedroom lights...

  4. If I'm reading it correctly, the door locks are Z-wave, not ZigBee; that's a totally different animal and takes different hardware to talk to it. That doesn't mean I won't ever look at it, but it does mean that I can't do it the same way as I did this one.

  5. Some of the locks are ZigBee others are Z-Wave, I wish Lowes had gone all ZigBee, would love to have a local source of ZigBee switches and outlets. I have no interest in the Z-Wave as it appears to be completely closed source.

    1. I'm not fond of Z-wave either, but it looks like all the manufacturers are going with it. I can't find single reasonably priced wall switch in ZigBee. There's a couple out there at $80, but that's ridiculous for a wall switch.

    2. Concur, that's actually my weekend project this weekend. Trying to set up the arduino to act like an end device, this project is going to monitor the garage door and open and close as required, but following that I want to do a light switch. I was hoping to just purchase the light switches, but for what they want for them its cheaper to build, especially if you want dimming capability and have several switches in the same junction box.