Saturday, January 12, 2013

Preparing for ThermostatPi - a Raspberry Pi controlled thermostat

I am starting to prepare for my next Raspberry Pi project - I'm giving it the very unoriginal name of "ThermostatPi" - essentially it will be a Raspberry Pi Thermostat.

There are many of these types of projects I've found on the net, but I haven't yet found one that will do exactly what I want. You see, many of the projects out there use simple SSR (solid state relays) to turn on/off a central boiler. This obviously isn't going to work for me since we have a wall-mounted aircon.

So I want a device that has a built-in thermometer and an IR transmitter so I can adjust incrementally the temperature.

I got some inspiration from the following sources:

Controlling a heat pump with Raspberry Pi and USB IR Toy

This guy is using a Raspberry Pi and a IR transmitter to control a heat pump. He uses a Google Calendar for the scheduling and operation. However, it doesn't have a thermometer (and I am not interested in using Google Calendar, but email). But, the essential component, the IR Toy (module with infrared receiver AND transmitter) built in, controlled over USB. And he got it working on a Raspberry Pi.

Raspberry Pi Thermostat

This guy uses a DS18B20-compliant single wire thermometer sensor to communicate temperature readings to the Raspberry Pi. But, he uses SSRs to control the actual airconditioning units.

I did some shopping last night. I found this great website, Seeed Studio which is actually a Shenzhen-based "open hardware facilitation company", and they have all kinds of great toys that they build in house, including the IR module. So, I bought the following:

USB Infrared Toy v2
The product is described as "Assembled USB infrared remote control receiver/transmitter v2 designed by DangerousPrototypes.com. Use a remote control with your computer, view infrared signals on a logic analyzer, capture and replay remote control buttons, and play TV POWER codes."(The emphasis is mine - the ability to capture IR signals will be essential so I will be able to theoretically operate any IR unit.)

One Wire Temperature Sensor
This is just a simple DS18B20 digital thermometer sensor. I chose to get one on a wire so I can position the thermometer sensor away from the actual Raspberry Pi/IR transmitter if need be.

Here's a good resource from the University of Cambridge on how to interface with a thermometer with a Raspberry Pi: http://www.cl.cam.ac.uk/freshers/raspberrypi/tutorials/temperature/. And later on, in case I want to integrate an analog light sensor (for controlling temperature differently during the day from the night): http://www.raspberrypi-spy.co.uk/2012/08/reading-analogue-sensors-with-one-gpio-pin/  - but this is a phase 2 I guess.

So now, the wait game begins. I'll need to wait for it to be shipped. And no doubt it will arrive at my office early in the week so I'll probably need to wait a few days before I can really get started. I suppose I can get a head start on the code...

Photo Credits: http://www.seeedstudio.com

7 comments:

  1. The 21th century handyman! - Yao

    ReplyDelete
  2. Is there a basic how-to anywhere on the initial setup of the IR Toy on the Pi? Just received my IR toy and I'm wondering what the setup is. Thanks--Chris

    ReplyDelete
  3. Politorpheus, I only followed the instructions from their site, but check out this blog post: http://www.cdrum.com/2013/02/php-library-for-receiving.html

    ReplyDelete
  4. Documentation: https://bitbucket.org/cdrum/phpirtoy/

    ReplyDelete
  5. Hi Chris

    For anyone interested in IR protocols - we have just launched a Crowdfunding campaign on IndieGoGo for AnalysIR - IR Decoder & Analyzer (Arduino & Raspberry Pi). Currently we support 17 IR protocols and are looking for more to add as part of the campaign. Suggestions Welcome!

    You can find out more about the Campaign on http://bit.ly/1b7oZXH or Screenshot via www.AnalysIR.com

    ReplyDelete
  6. Now that you have all the hardware, maybe you be interested in this software project which interfaces with the same thermometer and is able to steer the heater.

    http://blog.digitalhigh.es/home-automation-python-project/

    ReplyDelete