Developing a thermostat for a heat pump that only has a timer

The heat pump which cools [Chris LeBlanc’s] home lacks the sort of control he was looking for. It’s just got a timer, which switches it off automatically. He wanted to the ability to schedule the cooling cycle like you would with a thermostat-driven arrangement. He ended up build his own controller to automate the cooling process.

The heat pump came with an IR remote control which provides the access point for the project. [Chris] set out to emulate the remote protocol which saved him the trouble of having to crack open the unit and wire in a controller. He went with the IR Toy from Dangerous Prototypes as this device is able to record and transmit IR signals — it’s basically a universal remote for your USB port. His Raspberry Pi, seen to the left, controls the system. It’s connected to the red IR Toy board via a USB hub which is used to interface a WiFi dongle as well. The system works alongside Google Calendar to allow [Chris] to schedule his home’s cooling just by adding an appointment. A Python script queries the calendar, then selects and sends the appropriate IR command. He shows off the build in the clip after the break.

Of course, if you don’t have an O-scope I guess this is easier! I don’t have a Pi (shame on me), but I was wondering how fast it can sample? The posted tutorial uses Arduino, but maybe the Pi can do better if the frequency of this heat pump’s receiver is >> 37kHz (again, like in the tutorial I mentioned)??

It is very difficult because of the OS. There’s going to be a lot of jitter in the time between samples, even with the recent RTOS release for the pi (not sure though, someone can correct me if this isn’t true). There isn’t the same kind of low-level access to the hardware that you get with a microcontroller. You could do it, it would just be very tough.

In the spirit of hacking things for fun this makes sense but so does hammering a nail with a pipe-wrench.

I’m an A/C contractor and this is the Rube Goldberg of programmable t-stats, “Raspberry Pi controls the system”? This is a heat pump not a centrifugal chiller. Sorry for the rant but there are a zillion other cheaper/clever ways of doing this with the parts you probably already own.

Thanks for positive comments, I appreciate it. I’ll try to respond to some of them:

Of course you could have done this with some ultra-low power device, but I wanted to use a Raspberry Pi. The Pi will serve several functions (low power file server, ssh server, etc.). Being able to ssh into the pi and send commands is great, why would I want some dedicated device instead? The Pi only uses around 2 watts which sounds pretty low to me.

@jimstiernberg: Good idea. I actually used a couple bits of software and homebrew hardware to sample the IR codes. Simply having the codes is one thing, but I needed to retransmit them reliably. I looked at a lot of different options but the USB IR Toy was the easiest but still gave me the ability to tweak it. I tried a couple other ones like the IguanaIR but it wasn’t up to the task.

I was thinking of using the GPIO pins to control a IR LED, but the Pi can only do 5 KHz which isn’t enough for this setup. The IR Toy worked really well for this application. The whole point was to get it done quickly and easily so I used off the shelf components.

@pete: A “wall wart” (I assume you mean a plug computer) would cost a lot more than a raspberry pi and uses almost the same amount of power. The heat pump isn’t designed to have the power cycled like that and would probably void the warranty. The heat pump isn’t plugged into the wall, it’s wired directly to the circuit breaker. Sounds like a hassle and not something I’d want to do for my first hack. The unit has a built in thermostat, so I don’t see why you would hook one up externally. The point is to control when it turns on and off and what temperature it’s set at which is why the google calendar seemed like a good fit.

@ken: Wow, not sure if you meant to but that came off pretty damn rude. See the above info for why I hooked it up to a Pi. Also, if the goal is to be able to control it when I’m away from home, how would I do this with stuff I already have? I’d love to know but I doubt you have anything useful to say.