• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Arduino Thermostat

Not open for further replies.


New Member
I had an idea the other day to create a custom thermostat using an Arduino with temperature/humidity sensors. The whole point of the project would be to control the Heating/Cooling system and collect information about temperature/humidity levels. My initial thought is to send all the data to a computer via a serial connection.

I have very limited experience with designing electronic components but I am fairly skilled with writing code. I found some diagrams online for how a thermostat works and I need some help to confirm that this is in fact how my heating/cooling system works.

According to the document I found the 5 wires hooked up to my current thermostat do this:

* RH - This wire comes from the 24VAC transformer on the heating system.
* RC - This wire comes from the 24VAC transformer on the air-conditioning system.
* W - This wire comes from the relay that turns on the heating system.
* Y - This wire comes from the relay that turns on the cooling system.
* G - This wire comes from the relay that turns on the fan.

The problem is I don't know which one does what. They are all unlabeled and red! What testing equipment will I need? I have a voltmeter. How exactly can I determine which wire is which?

My second problem is once I've identified all the wires, how do I activate the heating/cooling system? According to the document online all I have to do is complete the circuit from the 24VAC wire of either the heating or cooling (labeled RH, RC above) with the corresponding wires (labeled W, Y) and also the fan fire (G). Does this make sense? Currently my plan to complete the circuit with the Arduino would be to hook up one of the digital pins to a relay (for a total of 3 relays). Is this the best way to do it? Or should I use a different method for completing the circuit?

My main goal is to learn more about electronics and heating/cooling systems. I thought that this project would be perfect to get my feet wet (or very cold when the furnace burns out because I screwed up.. hehe).


New Member
I'm interested in doing something like this, too. The Arduino devices are very affordable, especially as compared with other programmable thermostats.

As far as turning on and off each of the components, you ought to be able to use a relay to do that. Use the Arduino device to control relays that connect the 24V to each of the different pins. In my scenario, I only have four wires, which I assume is because the heat and A/C units are the same, so there's only one 24V transformer.

Another added benefit of using the relays (at least in my case) is that I can use a single Arduino device to control multiple zones. Between sensors for each zone and control of each of the components of each zone, I figure maybe two zones per Arduino device. The other option is that even though the HVAC units in my building service multiple rooms I could measure the temperature in each room and have the unit come on when one of the rooms gets out of range, or average the temperatures and do it that way.

My issue is this: I want to do a 7 day programmable thermostat. Is there a way or some code I can use to program a clock onto the Arduino device? I know there is a millis function - is that the actual time, or time since it's been running, etc? Also, I can use a D/C adapter or battery with the Arduino device - what happens if it gets reset, though - will that clear out the clock?


New Member
Thanks for the reply!!

I believe on the Arduino that the millis function is only a measurement of how long the device has been running. If the arduino loses power the counter gets reset. I don't think using this would be suitable to your application.

I found a fairly good tutorial on interfacing an Arduino with the Maxim DS1306 Real Time Clock which might be usefull. Check it out here: http://www.nearfuturelaboratory.com/2006/12/14/arduino-and-ds1306-real-time-clock/

You might also want to check out a gumstix motherboard. They are basically really small computers that run linux. I would imagine they would have built in clocks. Check it out here: http://www.gumstix.com/

Hope that helps!
Not open for further replies.

Latest threads

EE World Online Articles