Author Topic: The truly smart, truly programmable thermostat  (Read 1872 times)

nick

  • Full Member
  • ***
  • Posts: 174
The truly smart, truly programmable thermostat
« on: March 06, 2009, 02:24:57 PM »
If you've followed my other projects you know I am working on monitoring the energy usage of my house.  The long-term goal is to model the energy usage so that it can be predicted using environmental variables.  The idea is that once you can predict energy usage you can reduce usage by intelligently curtailing it when you know comfort won't be affected.  For instance, if you turn the thermostat down at night modeling would allow you to pick the proper time, given the outside temperature, to turn it back up so that it's at the right temperature when the building's occupants are active.  If you log the actions of the thermostat it also allows you to collect detailed statistics about energy usage and temperature conditions.

A piece of this project is having a thermostat that can be controlled by the ioBridge.  Conceptually this is very simple.  The simplest thermostats -- like the round Honeywell units you see in a lot of older houses -- are just a switch that closes at a certain temperature and opens at a slightly higher temperature.  This is very easy to model with the ioBridge: take a temperature sensor and a relay board, and write a simple script that monitors the temperature sensor and opens and closes the relay board appropriately.


However, there is a serious problem with this approach: reliability.  In my testing I found that it was very difficult to make a program monitoring the ioBridge reliable.  There are just too many points of failure between my computer, my web server, ioBridge's servers, the ioBridge, and all of the network connections in between.   Having a thermostat fail is bad news; at best it means you waste energy and at worst you could freeze your pipes or damage your heating system. 

(I'll throw in a plug here that if ioBridge had HTTP GET on events, monitoring programs like this could be designed in a much more reliable way.)

I came up with a simple solution to provide a fail-safe.  I added a second relay card to my design.  This relay would switch control of the heating system between the installed thermostat and my ioBridge-based thermostat.  If my thermostat failed, I could just switch control back to the wall-mount thermostat.

OK, but how do I know when my thermostat has failed?  How can the ioBridge know that the control program has stopped?  I modified my program to send a "keep-alive" message every time it checks the temperature.  The keep-alive is turning one of the digital output pins on and off again.  I then put a circuit between the control relay and the digital output pins that turns the relay on when it gets a keep-alive, and turns it off it doesn't get another keep-alive within five minutes.

I implemented the circuit using an arduino board, it's very simple, about a dozen lines of code.  I did it that way because that's what I had around, there's a million ways you could do a circuit like this.  I wanted to do an even simpler circuit using a transistor and a resistor/capacitor network, but I just didn't have the right pieces in my junk box.  I also thought about using a 555 timer, but I had the arduino.

The fail-safe thermostat is connected to the normally closed part of the relay so that if the ioBridge loses power altogether we go back to manual control.

OK, so that's the basic setup for heat.  What about cooling?  Most thermostats control three things: heat, cooling, and fan.  The ioBridge supports four relays, so you can use one for the fail-safe, one for heat, one for cooling and one for the fan.  In some systems the power supply for the cooling is different than for the heat, but since the relay board is DPDT it can control two circuits at once, and one fail-safe can control both heat and cooling power.  Being able to control the fan intelligently would allow you to do clever things like detecting an imbalance in the temperature between rooms and running the fan to even things out.

Let me know what you think.

Nick

iobridge

  • Administrator
  • Hero Member
  • *****
  • Posts: 669
    • ioBridge Support
Re: The truly smart, truly programmable thermostat
« Reply #1 on: March 06, 2009, 11:26:28 PM »
I like the idea of a backup plan.

24/7 internet connections to the house are hard to find. There is always an outage (when you don't want one the most).

The GET Url action is coming. It's on my very long list. It will help in those scenarios.

Nice project. Are you going to blog some circuits and/or photos? Would love to see the setup.
ioBridge Support
Community Team

Frenze

  • Newbie
  • *
  • Posts: 1
Re: The truly smart, truly programmable thermostat
« Reply #2 on: June 10, 2009, 11:27:28 PM »
            I agree to you. I have my own programmable thermostat it because it controls the temperature in day and night.




_________________
Thermostat

temcocontrols

  • Newbie
  • *
  • Posts: 1
Re: The truly smart, truly programmable thermostat
« Reply #3 on: July 07, 2010, 11:20:27 PM »
Not sure if I am allowed to plug my communcating thermostats here... ;) But it would be interesting to tie one into an IOBridge and see where things lead. The stats are under $30 each.  www.temcocontrols.com

tuma0650

  • Newbie
  • *
  • Posts: 8
Re: The truly smart, truly programmable thermostat
« Reply #4 on: July 11, 2010, 10:41:57 PM »
I have my IOBridge set up to work in my garage workshop. It will work in two simple modes. I have a relay hooked up to the digital out and this is connected directly to the heaters 24v thermostat control wires.  I have the relay hooked up to be failsafe in both on and off by having the relay switch control between two simple thermostats. One is set to my fail high temp of 70 degrees and the other thermostat is set to my fail low temperature of 50 degrees. I can set the temperature to anything I want (between the two fail temps)using the onboard programming.  On = high thermostat  off= low thermostat.  Or I can use the dashboard to simply switch between the two thermostats for "occupied" or "setback" mode.

noelportugal

  • Newbie
  • *
  • Posts: 35
    • http://blogs.oracle.com/noelportugal/
Re: The truly smart, truly programmable thermostat
« Reply #5 on: July 16, 2010, 03:24:52 PM »
@Nick I am interested as well as how are you monitoring power usage. Are you using Jason's example?

I am seriously looking at some commercial alternatives that would allow me to collect data. So far the closest thing I can find is TED and Current Cost, but neither look that easy to hack (if I wanted to get raw data and not their data-to-send to usb).

-Noel
« Last Edit: July 16, 2010, 09:07:24 PM by noelportugal »