Open source Android thermostat

Put that old Android phone to good use by mounting it on the wall as a smart thermostat. This open source hardware and software project lets you replace your home’s thermostat with an Android device which adds Internet connectivity and all that comes with the increase in computing power.

The brunt of the hardware work is taken care of by using an IOIO board which makes it easy to interface any Android device with the simple hardware which switches your HVAC equipment. We’ve been waiting for the launch of the new IOIO design and if it comes in at a lower price as has been rumored that makes this project in the price range of the least expensive of programmable thermostats (assuming you already have an Android device to devote to it). Simply etch your own board to host the relays and voltage rectifier and you’re in business.

There is a client and server app, both free in the Play Store. The server runs on the wall-mounted device with the client offering control via a network connection. The features of the system are shown off quite well in the video after the break.

31 thoughts on “Open source Android thermostat”

*PLEASE* be careful with hacking on your home heating system! Mistakes have the potential for freezing your pipes, killing your pets and plants, burning down your house, or even killing someone!

Thermostats look simple, but I designed them for a living for Honeywell and Robertshaw — a lot of effort goes into making them safe. Here are just a few concerns:

1. You need a fail-safe turn-on device (usually a mechanical bimetal switch at around 40 deg.F) to call for heat. Otherwise, your pipes can freeze if the thermostat fails.

2. You need a fail-safe turn-off device (again, often bimetal). Otherwise, it can overheat your house if the thermostat fails on.

3. Furnaces have elaborate fail-safe protection so they can’t turn on the gas flow without proving the burner has lit. They typically try to light a few times, and then “lockout” to require human intervention to check it and fix the problem. The lockout is reset by removing the call for heat, and then re-establishing it. If your thermostat does this on its own, it can DEFEAT the safety lockout, and flood your home with unignited gas!

What would qualifies as “Modern”? I have a combination heating/cooling system at home, with brand new central air and original (70s era) gas-fired baseboard heat. I thought about getting one of those Nest thermostats, but rolling my own would be fun.

Thanks for posting leeahart. I think we all accept a certain level of risk by building any of the devices listed here, but if there are reasonable ways to mitigate that risk, I certainly want to investigate them. I’d be interested in talking to you quite a bit more on this if you’re willing. Could you email me at jeremy [at] thermostatmonitor.com?

There are a few safeguards to help address these problems already, such as automatically relaunching the application on bootup, limiting the target temperature range from 50-90, using relays that fail in the open state and the need for a cyan aux power line which limits this thermostat for fairly modern furnaces with better safeguards. The thermostat is unaware of if the furnace is successfully doing it’s job or not and will continue to leave the heat relay closed until the temperature increases over the set point rather than continually attempting to cycle the system, so I don’t think there’s any risk of scenario #3.

I haven’t seen purely mechanical shut-offs in any of the other electric thermostats I’ve looked at, but this sounds like a great idea if there’s a practical way for hobbiest to achieve it. I would really like to talk to you about that. The fire risk would be strictly from an electrical problem unless I’m missing something. I don’t think this risk can be totally eliminated with everyone creating their own boards, but I’d love to hear any input you have to help mitigate it.

1 & 2 are very easily implemented, if desired. I am relatively certain that these ‘features’ aren’t built into all thermostats other than by means of minimum and maximum setpoints. Further, I would pose that a system such as this could be more effective because they could notify the homeowner of the fact that the temperature has varied by more than 10 degrees from the setpoint.

3 should not really be an issue either. At least on my furnace resetting the thermostat will not reset the furnace controller in case of an error condition. It is required to remove line voltage from the furnace to reset the error condition. I would expect that to be standard lest someone would simply turn the stat off, and back on, to the same end as you proposed.

While setting this type of system up to a single stage HVAC system is fairly straight forward, setting this up to a multistage system would be a bit more complicated programmaticly. Making certain the stages are called in the correct order (and in some cases timinig), that the reversing valve is properly set…

Another concern, that is more likely to be overlooked in home systems is the need for the thermostat to handle the time delay (normally 5 minutes) before calling for the compressor to turn on (cycle delay). Either due to power outage or normal cycling of the system. This delay is needed to prevent the compressor trying to start when the pressure differential is too great. Some compressors have this circuitry built into them, some systems expect the thermostat to handle this.

I have an arduino controlling my HVAC system. It monitors temperature in every room, calls for blower, heat, A/C and even has a programmed ‘anticipator’ that uses the outside temperature and history to stop the call for heat / cool to prevent temperature under / overshoot. It also controls the blower speed (when not heating or cooling) to allow for quieter operation when not heating or cooling.

Your concerns are valid, but is is there a know failure rate for programmable thermostats and temperature sensing components they use? There’s that chance the a bi metal coil thermostat could fail, have they included fail safes over the years? Automated gas appliances in buildings that use pilot lights use burner of pilot light not on fail safes that are totally integral to the furnace, no doubt that the case for electrical ignition. AFAIK thermostats never had a role to play in burner not on fail safe methods, why bring that up as a potential hazard with DIY programmable thermostats? Any furnace that allows access to the burner fail safe via consumer accessible low voltage or data lines would be a result of poor engineering, and probably doesn’t exist.

I think some of you guys are missing the point. The problem isn’t that the user will set too high or low of a temp. The biggest problem is that the Android will turn the furnace on (or off), and then CRASH. Then the furnace will remain in that state (on, or off) indefinitely. How often does a bimetallic strip ‘fail’, compared to the frequency of software/hardware working together fail?

Another solution (not as good as failsafes) are to have a ‘watchdog’, which is capable of detecting whether Android has crashed and rebooting if so.

Well, someone should have told the designer of the Honeywell thermostat that cost our family a $6000 repair bill, because it had no backup low temperature switch It was a battery powered programmable thermostat that, when it’s battery died while we were on vacation, failed to turn the furnace while the temperature was below 10F outside. Burst pipes all over the house….

Thank you caerdeee. You perfectly illustrated my concern. A thermostat that is not fail-safe can lead to costly failures!

Let me guess: This was a thermostat with the Honeywell nameplate on it, but built in China, after Honeywell was bought out by GE and all its US thermostat operations were outsourced. That “happysizing” cost me my job!

@Lee Hart:
Honeywell was never purchased by GE… Anyone who follows mergers and acquisitions knows this. That potential deal occurred way back in the late 90′s and was kiboshed by the EU…. So any downsizing that occurred at honeywell after that was a result of something else… if you ever actually worked there.

really, huh, there is very little you are going to do with the thermostat that could hurt the furnace. worst thing is probably short it out.

almost no common thermostat have these fail safes you are talking about. not even the more expensive digital ones. if a standard thermostat fails there is nothing that is going to turn your furnace on at any temperature like you are suggesting.
and your other concerns. there is absolutely nothing in the thermostat that could bypass any of the safety options of the furnace. including the glow plugs. and the safety start for when there is no gas flow or if the chimney is plugged (the furnace will stop trying to start and lock out) all that is built into the main furnace board.

agreed, the HVAC codes and safety standards have been sifted thru quite thoroughly over the years. this was done not only to protect the people who get to feel warm (or cooler) but also to prevent the lawsuits that could ensue if slipshod work or design was passed off to the general public. what many novice designers often fail to understand is, the accumulated years of experience and vast knowledge (millions of man-hours) that precedes them, in nearly all products. ( aka ‘dont redesign the wheel and call it ’rounder’) by the way, i designed a new nail yesterday, anyone interested in buying my design for a trillion bucks? errr, i didn’t think so!

I doubt I’d try to wire this to an old 70’s style furnace, but the furnace I currently have has it’s own controller with it’s own set of diagnostics and safety features that remain isolated from the thermostat itself. I’d definitely give this a go on a modern setup.

Actually, a 70’s system would be more easily suited to control by a home made system. They normally had a dumb mechanical stat that used a mercury switch to open or close the circuit for the call for heat or A/C. They were simple 4 wire setups. Many newer systems are 5 or 6 wire and the thermostat has to control multiple stages of heating and cooling.

OK anyone who has surplus of Android phones that as a computer to this degree, and don’t know what to do with them all please sell one to me at a poor boy price :) Only functionality through the USB port or Bluetooth is important, I can’t afford the data plan to use as a phone.

@Zee exactly what I’ve been doing! After connecting a reprap to my 3d printer (see previous hackaday post). I was digilently building a raspberry pi based thermostat. With same feature of being able to switch on/off the heating while at work!

It doesn’t have a fancy touchscreen just a + and minus button. But it will have a fancy web interface so you can connect with your android tablet or pc to the thermostat.

Just wondering. How did you integrate the charger for the android phone? I’m guessing you need to have mains nearby the android to charge it 24/7 otherwise it will loose it’s power.

Still great write-up and neat idea. But I’m missing the schematics for the board that contains the temp sensor and the relays or mosfets to do the switching on github I only see sources for the android apps (maybe I’ve overlooked them though…).

Most modern furnaces provide a cyan wire with 24vac auxiliary power for thermostats. I’m using this to power the IOIO which provides power to the phone over USB. The wiring details are on the assembly instructions page at AndroidThermostat.com.