Revision B - These instructions are for Revision B of the hardware. If you have the components for the Revision A build, please see the Revision A instructions. As always, this is an open source hardware project built mostly by amateurs and there are no warranties, so build at your own risk.
The primary goals for this revision was to simplify the assembly process and reduce the requirement for special machines in order to make it a viable project for a wider audience. I believe this has largely been accomplished by going to a printed circuit board which has eliminated the need for a laser cutter, etching solution, a drill press and a lot of time.
The only remaining peice of specialized equipment that is still needed is a 3d printer. A 3d printer is no longer a requirement either. You can order a print from here and even pick it up locally in most major cities.
Here are the parts you will need for this project and their price at the time these instructions were published:
- 1x – 6 Pin Terminal Block – $1.08
- 1x – Bridge Rectifier – $0.91
- 2x – Break-Away Male Headers – $0.38
- 3x – Relays – $3.24
- 3x – Transistors – $0.27
- 3x – Diodes – $0.15
- 1x – 100uf Capacitor – $0.10
- 2x – 10uf Capacitor – $0.14
- 1x – 0.1uF Ceramic Capacitor – $0.10
- 4x – 100kOhm Resistors – $0.40
Total: $67.30 (Plus $20 for circuit boards)
Step 1 – Order the Circuit Board(s)
You will need to order your circuit board(s) from a third party shop. The cheapest option I have found so far is OSH Park, which will print 3 copies of the board for $20. You only need one copy for this project, so I’d suggest selling your extra copies at this thread or buying a single print from there.
If you decide to order prints, you will need to download the Gerber files. Just upload the zip file to OSHPark (or another shop) and they’ll guide you through the rest. It takes about 2-3 weeks for OSH Park to deliver the boards if you go this route.
Step 2 – Update the Firmware
This section of the instructions is for Windows users. See this page for instructions on how to install the firmware on other platforms.
By it’s nature of being an open source project that changes frequently, the potential for encountering a bug is higher with this thermostat than with static, simpler thermostats you’d buy at a store that undergo far more testing. While your furnace is in control of the more dangerous aspects of your heater/AC, a major bug in your thermostat could still cause your house to get very hot or very cold while your gone which could be very bad for your pets or pipes. The firmware code provides a second layer of protection against scenarios like this, by overriding the commands from your Android device whenever the temperature falls outside of a safe range of 45F – 95F and turning on/off your heater/ac until the temperature returns to a safe range.
Download IOIODude an extract it to a folder on your computer. Also download the IOIO driver and the Revision B Firmware and place them in the same folder. Use a wire to jumper the boot pin on the IOIO-OTG (next to pin 34) to one of the ground pins. Then connect the IOIO-OTG to your PC using a Micro-B USB cable. The yellow status light should come on. With it still connected to your computer, disconnect the cable jumpered to boot and you should see the yellow light flash a few times indicating it’s ready.
The Add New Hardware wizard should pop up and prompt you for a driver, but if not go to Devices & Printers, right click on the IOIO, choose Properties, then Hardware and Properties again and click the Update Driver button. Browse to the ioio.inf file you downloaded a moment ago and select it. You will receive a warning about this driver not being signed. Continue and once the driver is installed you should see a COM number next to the IOIO-OTG in Devices and Printers.
Open up a command prompt by pressing Windows-R and typing cmd and pressing enter. Navigate to the IOIODude folder you extracted a moment ago. Run the following command to verify you can communicate with the IOIO, replacing COM20 with the COM port shown in devices and printers:
ioiodude --port=COM20 versions
If it is successful then run:
ioiodude --port=COM20 --reset write thermostat-rev-b.ioioapp
The firmware has now been updated and you can disconnect the device.
Step 3 – Assemble the Board
Solder the Header Pins to the IOIO-OTG
You will need to break off a set of 3 headers, one set of 2 headers and two individual headers. Connect the set of 3 headers to pins 5-7 on the IOIO-OTG. You’ll need to mount these to the front of the IOIO-OTG, with the short end poking through to the back and solder them into place. Connect the 2 headers to the inner most VIN and GND pins in the same way. Connect the individual headers to the middle 5V pin and Pin 43 on the board and solder them in place. Try to get these as straight as possible. If you don’t have a solder aid, pressing the pins into a piece of styrofoam is a good way to keep them straight while you solder.
You’re going to want to start with the smallest parts (diodes, resistors, transistors and temperature sensor) and work your way up to the largest parts when you connect these components. The silk screen layer on the board shows where each one goes. For every component except for the temperature sensor you’re going to want to mount it as close to the board as you can and trim off the leads, but on the temperature sensor, connect it as high as you can so you can bend the leads later to position it.
The direction doesn’t matter on the resistors or the ceramic capacitor, but it does on the transistors, diodes, other capacitors, rectifier and temperature sensor, so be careful to face them the right way. Again, the silk screen layer on the board indicates which way they should face. Also, the temperature sensor looks very similar to the diodes so make sure you don’t get them mixed up.
This part is a bit challenging. Take the IOIO-OTG board with the attached headers and line them up with the back side of the thermostat board. It’s easiest if you start with headers 5-7 first and then angle it down and use a pair of needle-nose plyers to align the remaining headers. Once you get them all slid through the holes, adjust them so just a little bit of each pin is sticking through and then solder them from the front side of the thermostat board. It’s a pretty tight fit, but do-able.
Step 4 – Prepare Your Phone
In order for the phone you will be using to communicate with the IOIO-OTG board, you will need to enable USB Debugging. To do this, go to Settings -> Applications -> Development and check Android Debugging. You will also need to download the Android Thermostat server and client applications from the Google Play store. The server communicates with the IOIO and controls all of the thermostat opperations, but has no real interface. The client application provides the interface for the thermostat and can also be run on another device to remotely control the thermostat.
Step 5 – Create the Case
Print and Clip
Download the STL files and print them on a 3D printer. If you don’t have access to a 3D Printer you can order a print here for roughly $20. (black ABS plastic recommended) When the print is finished, there will be round tabs at the corners of the case and lid. These help hold the parts to the print bed while printing and are not needed. Just clip them off with a pair of scissors.
Glue on the Cap
One limitation of 3D printers is they can’t bridge large gaps like what is needed with the right arm piece that conceals the USB cable. That is why it is necessary to glue the cap onto the right arm. This is the only step that requires glue. One side of the cap is slightly longer than the other, so arrange it so that it fits nicely on the end of the right arm and stick them together with superglue.
Assemble the Lid
Place the gear into the hole in the lid, then insert the right arm (with the cap) on the side of the case without the lip and the left arm, on the side with the lip. The tall parts on each arm will face out toward the front of the lid, on the side oposite of the gears. Slide both of these pieces in half way until the first tooth on each arm touches a tooth on the gear. Then push both pieces all the way in together. These two sides will now move in tandem with each other to keep your phone centered on the case.
Place the Board in the Case
Technically you don’t need to do this until after you put the case on the wall, but it’s probably best to do a practice run before hand. Connect the two USB cables and plug in the USB-OTG (the smaller one) cable into the IOIO. Run the cabled on the back side of the board, it should fit nicely in the space right next to the IOIO. Flip it over and place it in the case as shown, with the USB connectors and cable running underneath the board and coming out of the slit on the right side of the case. Finally, bend the temperature sensor down at a 90 degree angle so that it is sticking just outside of the android logo on the bottom of the case.
Place the Lid on the Case
Slide the lip of the lid into the groove on the left side of the case. You may have to fold the USB-OTG cable up slightly, but it’ll fit. On the right side of the case, make sure the USB cable is sticking out the slot and then push the two tabs on the lid into the two holes on the case to lock it into place. Pull the arms out a little bit and place your phone on the lip. Connect the cable and slide the arms back in. You can push any excess cable back into the case so that none is showing.
Step 6 – Connect the Thermostat to Your Furnace
Now that you know how to assemble the case, it’s time to hook everything up to your furnace. Turn off the power to your furnace first and disconnect your old thermostat. Feed the furnace wires through the opening on the back of the case and screw the case to your wall. Slide in your board with the USB cable tucked under and feed the USB cable out of the small hole on the right side. Loosen each of the screw terminals and feed in the wires according to color. The letters on the board indicate the color of wire. There are two terminals for red wires R(ed)H(eat) and R(ed)C(ool). Some systems will have separate wires for each while others will have a single red wire. If you have a single red wire, plug it into RH and use a small jumper wire to connect RH to RC. Place the lid on the case and connect the phone as shown before. Turn the power back on to the furnace.
Step 7 – Configure
You will need to set up your schedules, zip code and other preferences. There is some heat generated by the switching regulator and depending on the air flow where you mount the thermostat you may need to adjust the temperature readings by a few degrees. This can be done via the Equipment Settings screen. Be sure to wait until your phone is fully charged and has been connected for at least 15 minutes in order to get a good starting point for the calibration. You thermostat is now ready to be used!
If you have any questions or comments please stop by our subreddit.
NOTE: There are some risks involved in building your own thermostat. Safety has been a big concern of mine while building this and there are several safety measures taken such as using relays that fail open, limiting the allowable temperature range and the need for a cyan power line restricting availability to modern furnaces with built in safeguards. I have no formal training in this area though. BUILD AND USE AT YOUR OWN RISK.