Arduino thermostat

My second major project is coming along nicely. My first was an internet laser pointer cat toy that I made with a 3D printer.

We live in northern California right on the coast. It gets chilly here, but not cold. Our house only has a wall furnace heater and poor insulation. The real major draw back to the setup is the shitty thermostat that is just a few feet from the furnace. Either the heat goes right to the thermostat and shuts it off or you turn it up and it never shuts off at all.

My solution was to put three analog sensors around the room and average them. There is also a door sensor on the front door that shuts the heat off when open. I got the "Dead on RTC breakout board" from Sparkfun.com and this allows me to program a schedule. I have a programmable main temperature to hold the room to, a temperature reduction variable for at night, what time to drop the temp and what time to bring it back up in the morning.

The existing thermostat just completes a circuit to turn the heater on, so I just paralleled a relay to it.

Source code here: http://pastebin.com/Cv4Fzy7a

IMG_0732.JPG