Monday, January 28, 2013

Water Heater Power Control

In the last post I talked about how short burst of high power usage can be OK, but long periods of high power usage can kill me.  Remember, I'm on demand billing where they average the usage across every sixty minute period and charge me a ton of money if I let my peak period usage get too high.  I discuss this extensively on my Power Usage page <link>.  I've managed to keep it at or under 2Kw for quite a while and saved a lot of money on power bills.

However, the water heater has been a continuing problem.  I have a solar water heater for the house and it will make hot water for free if there is sun.   One wouldn't think that is a problem here in Arizona, but occasionally we get several days of overcast weather and that means no hot water.  The water heater works great if there is sun, even if it's 30F outside.  The collector temperature goes up to 150F pretty quickly and that's enough to create plenty of hot water.  When the weather is overcast and especially when it's rainy, the collector won't generate any hot water and I have to rely on a heating element inside the device as a back up.  Obviously, I don't want that heating element drawing power during the peak period because it will pull at least a couple of Kw and mess up all my work saving power.  I actually had this happen once <link> and it cost me a whole lot more than the water was worth.

At first, I had an Intermatic timer that worked quite well, but since I live in the realm of power failures, it wouldn't stay on time.


If I lived where the power was more reliable, this would have been fine, but I often lose power during thunderstorms and sand storms, so I looked for another solution.  Since I had X10 controls in the house to operate the outside lights, I went with that solution.  Yes, I could have gotten a digital timer for the water heater that has a built in clock with battery backup to keep the time, but I had already given up on a $60 device and I didn't want to spend that much again.  I got an X10 appliance module from an ebay vendor, a contactor from an A/C supplier, and an electrical box from a neighbor and built a remote control for the water heater.  Frankly, I didn't save any money, but I had remote control and my light timers for the house could turn the power on and off to the water heater.

X10 sucks.  Sure, that's a little severe, but if you're using it for anything that isn't monitored all the time, you have trouble.  X10 will false, fail to receive, and just refuse to work.  In unattended circumstances, this will turn on lights, leave them on when they're not supposed to be, and turn them off for no reason at all.  Same with water heaters.

So, last Saturday I decided to turn on the water heater for the day to get enough hot water for a nice long shower.  It wouldn't turn on.  I even changed the appliance module, but nothing seemed to work.  It was chilly, and raining, but I turned off the breaker, dried off, and bypassed the stupid thing to force the water heater on.  Then, I started reprogramming my Garage Controller <link> and House Controller <link> to take over this job.  I had two unused relays in the garage controller and lots of memory on the House Controller, so a little rewiring and programming and I had control of the power to my water heater.

I use regular text transmitted from XBee to XBee to control and monitor status for the various controls I've built around the house, so every 15 seconds or so, the garage transmits: 'garage,closed,closed,off<cr>'
with the items being the two garage doors and the water heater, so it knows the state of the garage devices.  To change the state of the heater, I have the controller transmit, 'waterheateron', or 'waterheateroff'.  Using text like this allows me to debug things with a sniffer <link> that I can watch the various devices with.  I can also transmit the commands by hand using the XBee X-CTU configuration tool.  All of my household commands are sent in broadcast mode so they can be seen by any device.

I also added items to the web interface the House Controller supports so that I can see the state of power to the water heater using a web browser.  There's also a button to turn the power on and off as needed.  This means the house controller can schedule power to the heater as needed with the garage controller having final say in the situation.  For example, I have the water heater hard coded to turn off just before the peak billing period and back on just after.  This keeps the water heater off when the prices are high.  If the power fails, the water heater defaults to off; I may change that if it becomes a problem.  Here's a picture of the Garage controller with the new wires in it from the water heater:

And here is the electrical box that houses the contactor that actually controls the power to the water heater:


I still have one relay left in the Garage Controller, wonder what I'm eventually going to use it for.


Saturday, January 19, 2013

Speaking of Electrical Appliances

My previous post on my electricity usage got me to thinking about appliances and how they use power.  This is a chart of my usage today.  The spikes are my electric range.  I cooked a pork butt roast (actually, it's the shoulder of a pig) in a Dutch Oven at 275 for most of the day.  I do this so the meat is really tender and just falls apart.  This gave me an opportunity to examine how efficient the oven is over a long period.

Turns out, it's not too bad.  As long as you keep the door closed and don't constantly check it to see how it's doing, the device works pretty well.  Notice on the left there is a wide spike of about 5Kw to initially heat the oven; then spikes at about 15 minute intervals.  There is a double spike at just before 2PM when I opened the door to check on it.  These spikes use a lot of power, for a very short time.


I don't have an easy way to measure the usage over all since the levels change so much, but it looks like the oven is very efficient.  Those little spikes, when expanded are less than two minutes long and shouldn't cause to much usage.  They look really huge, but actually they don't represent much power.

Unlike the compressors for the heat pumps on the house which run for hours at a time in the winter and intervals measuring several minutes in the summer, this is an extremely short period.  I need to measure some of the other appliances that really chew up the power, I may be able to reduce my power bill even more.  Things like cooking in the morning during the week to build up some heat in the house to help during the after noon may work well.

But, winter is almost over for me.  Notice that it got up to 82F today; this is the middle of January.  I just love Winter in the desert.

Monday, January 14, 2013

Alternatives to Cosm (Pachube), Part 3

Found another one to try out.  The site thingspeak.com has apparently been around a couple of years, but didn't turn up on any of my searches.  I stumbled across it today and had to go try it out.  After a number of false starts and some serious reading, I managed to create a data store and put some data in it.  Then began the laborious task of modifying my House Controller to send data to it.

You'd think I'd be getting pretty good at this by now, but I tried for two hours to get data to upload to the site with zero success.  Then, in typical form, I went back to beginning, found my silly mistake and got it to work.  This site works like Cosm.com in that you construct a POST and include the data to send it.  They use fixed field names field1, field2, etc. instead of numbers and the data doesn't have to be constructed in a JSON format, just named as parameters.  I'm using something on the order of:

("field1=%d&field2=0.%d&field3=%d.%02d&field4=%d.%02d&field5=%d&field6=%d")

to send the data (hope you understand printf).  This is actually easy to understand and could work quite nicely.  Yes, they have embeddable charts.  Here is a daily chart of my power usage with their facilities:


The extremely cool thing about their charts is that, if you set them up for it, they are dynamic.  That means new dots will appear in the chart as my house updates the data on their site.  If you put your mouse on the chart and move it around, each of the datapoints will be highlited and the actual data will be shown.  This is really a nice way to chart the data. They don't have the ability to zoom in on the data or subset it by manipulating scrollbars or highliting areas, but the ease of making charts if phenomenal.

There are a number of other features to play with.  They even let you record a status for the data being sent. This is a text field that can be retrieved and displayed.  So, I could display, "Currently Offline" on a feed that was having trouble if I wanted to.  There's also an API for location data for things that move and an interface to twitter for people that like that kind of thing.  I haven't found any use for a twitter interface at all, but someone must like it since it turns up all over the place.

The site supports JSON data retrieval so it can be used in a plugin.  This is different from the emoncms.org site.  Security of one's data is a serious concern, but it's not much use to put data out there if you can't get it back to be used.  That's the most serious problem I ran into with emoncms.  The fact that you can get the most recent data back gives you the ability to do this:
This is an iframe that contains an AJAX query that fills in the value for a SteelSeries gauge.  I have this on a cloud server so that I can use it anywhere by just pointing to it.  The site, thingspeak.com, takes care of automatically updating it, so this is updated periodically with the data my house sends up.  I could (relatively) easily construct a AJAX query that would feed into the Google chart API and produce one of their great charts with zoom and everything.  That is currently left as an exercise for the student.  Wait long enough and I'll probably do it.

So, I've researched and actually set up data stores on several of the repositories out there.  They each have something unique to offer and seem to do the job of holding, displaying, and supplying data.

Try them out and have fun.

Part 2 of this effort <link>
Part 1 of this effort <link>

Friday, January 11, 2013

Let's Examine My Power Usage

After a couple of years of monitoring my power closely and installing various devices to check, examine, and control this usage; what have I learned? Let's walk through a typical Friday. I choose Friday because it's a weekday where the power company enforces demand billing and it's winter and getting cold here in the desert. I'll do something similar in the summer as a comparison. First, here is a graph of the power usage for the last 24 hours:

Yes, at 10PM last night I had spikes in my usage; I was doing laundry.  The spikes are the clothes dryer switching it's element on and off to dry the clothes.  Notice that the spikes are hitting around 7.5Kw?  That's a heck of a lot of power.  I do the drying at night in the winter to save some of the heat inside the house; not all of it gets blown out the vent into the air.  Immediately to the right of the dryer, the heater kicked on and stayed on until 1:15AM.  The heater uses around 4Kw, and since it was cold, stayed on for quite a while.  Then there was a low period for a couple of hours with only the recirculation fans running before the heater kicked on again and ran until almost 9:00AM.  Notice that the temperature took a quick upward climb at the same time?  That's when the sun finally came up over the mountain to my East and hit the house.  There was another period after 10:00AM where the wind got up and the cold breeze caused the heater to kick on again.  When it was getting close to noon, the heater came on, but the peak demand controls I have built into the house kicked in and shut it off at noon.  From noon to 7:00PM the demand is held low, less than 2Kw to save cost.  Then at 7:00PM, the recirculation fans kick back in and start equalizing the house out again.  The huge spike just after 8PM is me making a pizza.  The narrow spikes in the period from noon to 7:00PM is me doing a little welding in the garage.  Yes, I have projects that aren't electronic and require the use of tools bigger than a soldering iron.

Some people may criticize me for the amount of power I use, but I didn't create these appliances that pull 10Kw doing some task.  It takes a lot of power to run an electric clothes dryer, electric oven, microwave; people just don't think about it until the bill comes in.  I've seen consumption at my house exceed 20Kw.  When I have a cold evening and both heaters are on, I have clothes in the dryer, and decide to bake cookies, the usage can easily top 20Kw in short intervals.  Do you realize that is more than 200 amps coming in the power lines?  And this is not an unusual thing for people to do.

Now, do you understand why I have automated controls in place to keep this in check?  Heck, I complained to one of my neighbors about my power bill coming it at around $117 last month.  I actually thought they were going to attack me.  It seems their bill for last month was a little over $350.  

A couple of months ago the power company wanted me to install a smart meter to, "better control my power usage".  I asked them to pull up my records and take a look at them over the phone.  The 'Energy Usage Advisor' was astounded at the controlled usage my bill reflected.  I asked him to show me an example of what their smart meter with household controls could do....crickets chirping....  No, they couldn't show me anything that even came close to the level of control I already have, and I ain't even close to being done with the project.  See, the power company wants to control the temperature inside my house, limit the usage of large appliances, and put special controls on my swimming pool to "Save me money and lower my carbon footprint".  Yep, I'm going to let that happen (not).

I'm not going to get into one of my lectures about letting a corporation control anything inside my house.  How things like 'carbon footprint', 'impact on environment', and 'delayed usage' I consider to be buzz words that let them get into and try to control my life for their benefit.  Heck, if they had built the power plants back when they were cheaper, before inflation and needless regulations force prices to skyrocket, we might not be in this mess.  But, no, they wanted to delay it as much as possible.  

Needless to say, I don't have a smart meter at my house.  If I did, these smart meters use Zigbee communications to control things.  Heh, heh, I have a full dozen Zigbee devices in my house; how long would it be before I was feeding them the data I wanted them to see.

Have a nice day power company 'Energy Usage Advisor'.