ThermostatPi - Controlling airconditioning with the Raspberry Pi and USB IR Toy - First Release!

Finally got around to getting the first release of my current project up!


It’s called ThermostatPi and it makes use of a Raspberry Pi, a USB IR Toy 2 (see my library here), your bargain basement DS18B20 One Wire Temperature Sensor, some Blu-Tack, and a few other miscellaneous wires and such.

In it’s current form, it monitors temperature, and allows the user through a web browser control the wall mount airconditioner over IR. The code contains a command line tool to store presets. (In my case, my air conditioner is complicated, and I couldn’t extract individual button clicks, but instead, the complete configuration of whatever is on the remote at the time.


I wrote everything in PHP. I used Foundation for the web framework. I used RRDTool for charting.

Right now, there are two major screens. First is the current temperature with historic graph.

The next tab is there the controls are shown.

 You see to the right are the last 6 or so commands run. I use SQLite3 to store the history. (I plan to add settings to the db as well down the road).

Using Foundation’s alerts, I show immediate feedback after button presses.

It also works on Mobile, thanks to Foundation.

I have a cron running to update the history charts each minute.

Lastly, I use dyndns so I can access it from my mobile phone. Makes it simple to turn on the air con when I’m on the way home!


This is pretty self explanatory. I have the DS18B20 chip plugged into the GPIO pins.

And lastly, the IR Toy is positioned to point at the air con using Blu-Tack. Thank goodness for Blu-Tack!

 Next Up

I want to start building some intelligence into it. I want to set a temperature, and have it attempt to maintain that temperature. We’ll see how that goes.