Custom Thermostat

Here I will describe the main points of building your own thermostat.  It is much simpler than I thought it would be.  First, take a look at the pre-existing thermostat:

Pre-existing Thermostat Details

Pre-existing Thermostat Details

The pre-existing thermostat is a bit overly complicated.  The RC and 4 terminals are for the supply voltage.  Some systems have two separate power sources one for heat, one for cool.  I only have the one power source, so it was connected to both terminals.  There are then 3 other terminals, one for heat, cooling and fan.  Really all that must be done to turn on a system is to short the +24VDC to the system you want running (RC or 4 shorted with Y turns on AC, short to W turns heat on).  That’s it!

To make your own thermostat, all you need is a few relays with a USB/serial connection.  I found a decent cheap relay board with serial/USB connection here for about $50.  Basically, you’ll need to split your +24VDC line into 3, run one to each of the NO terminal on 3 of the relays, then connect the Y, W and G lines to the common (middle) terminals on the 3 relays.  You can then control each of the three systems by turning the relays on and off via software (Forum).

Obviously, you’re going to need to know what the temperature is in the house, so you’ll also want to buy some temperature sensors.  I found some very cheap sensors here for $8.80/each; I bought two.  Now onto the problem of getting useful information out of these devices.  They come only with Windows software, which is less than useless (outputs temperature on screen, logging via CSV).  After a bit of searching, I found that someone had already written a perl script for these devices, which works fantastically.  You simply plug in the device, run the script and it outputs the temperature as sensed by the device.  If you are like me, you have linux boxes scattered about the house, simply attach one of these devices in the rooms you want to monitor and you now have a fully functional programmable mutli-zone thermostat.

Obviously, you will need to write some software to control all of this.  I wrote all the required code in PHP of all languages in about a week in my spare time.  The software covers such things as sanity checks (we don’t want heat and AC running concurrently), temperature maintenance, etc.  I then threw together a GUI web interface and text-only (for my phone) and now I can control things via a browser.  I added some cronjobs for when I wake up, go to work, get home from work and go to sleep, just to simplify maintaining reasonable temperatures throughout the day.

Depending on what other resources you have available, you can get pretty crazy with this.  I’ve got Asterisk (Open source VoIP server) running on a server at work which I’ve setup extensions on to control the thermostat by phone.  So, if I have a phone or a browser, I can control the thermostat.

While it might have taken more thought, code and time, the end cost was about $80USD.  A far cry from the alternatives available at prices at and above $300.  None of these pricey models have anywhere near the features of this custom built thermostat.

Custom Thermostat

Custom Thermostat (Heat currently running)

Thermostat GUI (I know the date is fscked)

Thermostat GUI (Heat currently running)

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>