Thermostataliciousness

Posted 2010.12.23 9.43 in Computers/Internet/Technology by Stephanie

Last night I got the bluetooth wireless module hooked up and tested it out. It works! My prototype thermostat can be wirelessly queried and controlled!

The bluetooth module is the little red thing at the left edge of the breadboard. It talks serial to the microcontroller and talks wireless to the computer. As far as the computer is concerned, it’s just a standard tty serial port. It’s fairly seamless!

In the above screenshot you can see some debugging info that comes over every 15 seconds, plus I sent the ‘run program’ command (rp) and the DIY Thermostat responded accordingly!

Geeky techy stuff below the fold.

The debug info ‘current time’ and ‘target time’ are obviously not normal hours:minutes. To make it easier, I just count the day in minutes. Then to save space, I only count 10-minute chunks. So instead of having to track 24 hours and 60 minutes, that becomes 1,440 minutes. Then to save some memory, instead of a 16-bit integer I fit the time into an 8-bit byte, by only counting 144 10-minute periods.

I think most programable thermostats must do similar things, the last few I’ve had only let you set a temperature change to the nearest 15-minutes. Some other details – I’ve programmed the firmware to do a 5-2 x 4 cycle. That is, there are two ‘day’ settings, one for weekdays and one for weekends, and there are four temperature changes per day. I’ve seen some of the fancier thermostats do 5-1-1 (weekdays, plus sat and sun as separate days) or even allow all seven days to be individually programmed. Likewise, I’ve seen ones that have more than 4 temperature periods per day.

While it wouldn’t be difficult to have all those bells and whistles, I don’t need them, personally. My routine has it that one ‘weekday’ range and one ‘weekend’ range work fine, and four temperature changes per day is enough. Actually on the weekends, I only need two.

Anyhow, so the debug info on the screen shows the current time at 110 which translates to between 18:20 and 18:29. The target time is 143 which translates to 23:50 – that means that the next scheduled temperature change comes at ten minutes before midnight. That’s when we go to overnight mode, and the temperature drops to 62F.

The current temp in celcius is displayed, which is the ‘raw’ data from the Chronodot. It reads in C with 1/4 degree accuracy. I change it to Farenhiet in the software. The secondstime is a way for me to keep other functions timestamped. Such as Timeout Delta, which I use for protecting the furnace and A/C from cycling too fast.

See, it’s bad for them to get switched on and off too often, so any time a relay is turned off, that starts a timeout countdown. No matter what buttons you press or what the temperature readings say, the system will not turn the relays back on until the timeout has passed. I’ve got it set for 10 minutes which I believe is a safe delay – it means at worst, the system could trigger 6 times in a single hour, which I seem to remember was a suggested maximum.

I also use the timeout timer to impose a shorter (2-minute) delay, when switching modes. I.e. when turning on the system, or switching from heat to cool, etc. It’s probably not a big deal, but it felt like a good idea.

Finally, at the bottom of the screenshot, you can see a 2-line readout that is almost identical to what appears on the thermostat’s LCD display. See, when I make the remote control, it will be able to mirror exactly what is on the main thermostat display.

So now the next step is to leave the breadboard behind and build the actual thermostat. Oh and although the bluetooth module is tested and working, I don’t think that will be the permanent solution. I’m looking at something else called xBee which would let me create a sort of mini-network, where I could have one in the thermostat, one on my home server, and one in the remote-unit that I’ll eventually build, and all three will be able to talk to each other. But first things first – build the actual thermostat. Then test it. Then install it. So, swapping bluetooth to xBee is like, four steps down the line.

One Comment

  1. Kim Link says:

    I want one!

Leave a Comment