Tagged ‘arduino thermostat

I settled on the arlington single gang recessed AC receptacle with a PacTec WM-56 enclosure mounted over top flush against the wall. While I wait for shipping I started soldering the components onto the prototype shield. It’s going well but making the connectors is a tad time consuming. I’m just using 22awg hookup wire and some male & female board headers, with shrink tube around the joints. It’s a little jenky but it’s never going to be unplugged/plugged so I’m sure it will be fine. Next time I’ll get a prototype board without the headers and solder jumpers from the arduino pinouts to the circuit on the shield. I’m running out of money on this project though so this will have to do.

IMG_0005.JPGIMG_0002.JPGIMG_0007.JPG

Finished!

The arduino thermostat is now mounted on the wall and it looks great. The white paint was definitely a good choice as it matches the rest of the wall plates.

As far as I know (without testing my heat cycling code) everything functions well. The LCD backlight auto adjust is a nice touch, I’m really happy I threw in that extra dollar for the light sensor 😉

I do need to fix a few small things, the temp graph has a 1px line to the left and the temperature needs to be calibrated, but that will be easy now that I’ve cut a USB access hole so I can update the software without removing it from the wall.

Here’s pics of my progress this week – most of my time was spent on the electrical & drywall work. I did accidentally cut the hole too high (you can see why in one of the pictures below, the thermostat for the bedroom was in the way to mount this deep 4″ box) so I had to do some patch work… But it gave me a LOT more room to work and fish wires.

IMG_0046.JPGIMG_0049.JPGIMG_0056.JPGIMG_0059.JPGIMG_0060.JPGIMG_0065.JPGIMG_0066.JPGIMG_0067.JPGIMG_0072.JPGIMG_0075.JPGIMG_0077.JPG

View all photos at Picasa Web Albums

Well I had to bust out some modifications to the code today (again, very pleased I cut that USB hole!) to control temperature over-shoot, allow me to view the temp before rounding, and to add a larger font for the manual mode temp set screen.

The over-shoot was a problem I originally anticipated, but commented out in the code because I wasn’t sure if it was necessary. It is. When I have both the electric baseboard and the gas fireplace on, the temperature rises too fast for the [designed] 5 minute relay interval. This caused the temp to briefly surpass the set temperature for about 10 minutes until the room started cooling back down.

Here’s how I’ve controlled the over-shoot:

At the start of each cycle, I calculate the difference between the current temperature, and the last cycle’s temperature. If this number is positive (temp is rising) then I check it against the difference between the set temperature and the current temperature – to find how long until we’ll reach our target.

If that time is less than 5 minutes, I set a timer to expire exactly when that target will be reached. The timer then calls the heat off function.

Testing this revealed a shocking 100% accuracy. With the buffer set to 0 and the temp set at 21, the heat turned off at exactly 21.00 degrees. In practice I have a buffer of .35 degrees, to allow the temp to rise in this case to 21.35. I chose to do this so that the heaters would remain off for longer, but the display would still round to the desired set temperature.

I’ve also posted the code here, due to requests from members of arduino.cc 🙂