I have been working on a project for controlling my heater for some time now, and moving forward in making it go from a prototype to a cleaned up version. I will give a bit of history on the project.
I have a wall electric heater
http://www.homedepot.com/p/Fahrenheat-4-000-Watt-Wall-Heater-FZL4004/100192192
it has a thermostat on the front... which is just a knob, and there is no way to hook up any other thermostat so I can have it maintain a temperature in the room other than right where the heater is. I can not use a line voltage thermostat because their built in thermostat has a seperate fan control and I have to let it cool down when its done heating, not just turn off.
My only option for automation was to attach an arduino and servo to the knob so that when the heat needed to be turned off, the fan would still cool down the unit. As seen in the pictures...
I got an arduino in a project box with a servo and made a makeshift mount out of a coat hanger and zip ties... my wife hates it but I keep assuring her its a prototype to test and now I am going to make a polished project... possibly even consider mounting the servo inside the heater and belt drive the knob after I figure out if it gets to hot or not in the top section there.
Ok so part two of this project was to make a wireless carry around thermostat, but for prototype reasons, I was going to do direct line communication until I was sure that this was going to work. First a wrote a program and made a thermostat out of a 16x2 display, potentiometer, buttons and a thermistor. And spent hours trying to get the thermistor to take an accurate temperature with in a 20 degree range... that did not work as expected and at 4 in the morning when I had to work at 7 I had an epiphany. I used an old wall thermostat I had just to simply run 5 volts to it and have the relay in the thermostat provide the 5v back to an input pin... and it looks a whole lot better than a 16x2 display. The original thermostat even ran off 5v. So you guessed it, instead of going to bed I did just that with the thermostat and wrote the code.
Now the code was the easiest part for me thus far, I find it fun, and sometimes challenging. I even wrote in to have them communicate with each other constantly so there could be a fail safe mode in case one of them came off line (which would be to just turn off the heat). For the fun of it I even took one of those remote outlets and wired in the board to the remote to remotely turn off and on an outlet (with a fan) so it would run when ever the heat did. The next step was to mount everything and run a communication line. I will explain how that went.
Just to establish this is what I have on hand and I did not ant to purchase anything else until I had a working protype.
2 arduino UNO's
1 raspberry pi
1 arduino ethernet shield
Stage 1
Heater side (arduino) <-----jumpers for serial communication -----> Thermostat side (arduino)
This worked great on my desk having the boards only inches from eachother... I read online that this could work for up to make 15 feet, and if you lower the baud rate maybe a bit more... so I wired in RJ25 jacks to the TX RX ports on both arduinos and what do you know even the 15 feet of line I had there was too much noise. Scrapped that Idea.
Stage 2
Heater side (arduino w/ ethernet shield) <----- ethernet cable -----> Thermostat side (raspberry pi)
So yes I had to re write the code to work in python, learned alot of new things I have never dealt with GPIO on a raspberry pi, and never used an ethernet shield on an arduino. I kept all the serial commands that were outgoing so I could monitor and debug added in sending and recieving udp packets for them to communicate through. This actually worked great but I had to cut down on how often they checked for eachother because they were sending to many packets it would cause a delay in responding to a call for heat on and heat off. Oh and I for got to mention it only worked if the arduino was plugged into my computer, took me hours to figure out the when I plugged power in to the arduino I needed to reset it to get the ethernet shield to work.
Stage 3
Heater side (arduino ethernet) <-RJ-45 -> Router <-WiFi -> Thermostat side (raspberry pi)
This works great and now I have a carry around thermostat that doesn't have a cord hanging out the back of it.
Ok so that is the project history. I am now looking to move forward and need someone who has had experience with Xbee before wasting my money. I am looking to ditch the raspberry pi on the thermostat side because I like the arduino much better and it is better suited for this project, that wont be hard. But then I got thinking, do I even need an arduino on the thermostat? the xbee module has i/o pins can I just put the thermostat on those and tell the heater side when to turn on and off? I also got thinking that I dont need to have the thermostat and heater side communicating constantly either, the thermostat only needs to send an on command and off command and maybe recieve one reply when it is completed by the heater side, all I need to do is put on a max heater time setting on the heater side that resets anytime it receives something on the thermostat side, now I can preserve battery life for a carry around thermostat.
Then that also got me thinking, Xbee is compatible with zigbee, is there a thermostat on the market (I couldnt find one) that will already have everything built into it all I need to do is configure the heater side arduino to recieve the on and off commands.
So my two big questions are:
- Can I implement a zigbee compatible thermostat without the need for a base station.
- if not, can I program logic on an xbee module to do what I need.
My follow up question is:
3. I want to be able to comitor the serial communication wirelessly also from my computer if need be so I want to get an xbee explorer and module to plug into my computer. Can I have 3 way communication with the series one xbee modules where the heater and thermostat is multicasting out but I can also multicast or send direct to one of them. (this is assuming that a zigbee thermostat is not possible since series 1 xbee is not compatible.
And just because I would like to hear opinions on something else with this project I welcome advice on this question:
4. Battery backup? I want to be able to power the thermostat by usb set on a nightstand or desk, but if I want to move it to another room I dont want to remove power to move it from one place to another. Does anyone know any portable solutions, I would prefer not having to build a circuit for this, but if thats the only choice I hae can a low battery indicator be easily implicated.