Tagged ‘controlling an arduino with IR

For this project I chose a graphic LCD so that it would look reasonably presentable when mounted. The display is 128×64 and there’s already a powerful library written for the arduino that allows me to use bitmap images images, a variety of fonts, and to draw lines, rectangles, etc. Controls for this thermostat will be 100% IR (infra-red) with no hard buttons. I plan to program the specific functions into my logitech harmony remote for control from my sofa 🙂

Development on the user interface has gone quite well and is mostly complete. The main screen, calendar & clock programming, EEPROM storage, IR input, and interrupt timers are functioning well. I chose to implement three modes of operation: Manual, Automatic, and Ad-hoc. Manual mode will control the temperature to the set value indefinitely, Automatic will follow a 7 day programmable schedule, and Ad-hoc will follow a custom schedule outside of the programmed week.

Even though this is an embedded application and the code won’t see any other hardware or heating systems, I’ve tried to write the software to be scalable. The settings screens for schedule and clock setup both use a common functions for drawing user interact-able quadrants, input, and cursor movement. Originally I wrote the main screen to be drawn once and refreshed entirely when updating a single value… unfortunately this didn’t perform to my satisfaction. The refresh rate it pretty good but not quite good enough to redraw the entire screen without it looking obvious, so I broke apart the main screen into separate functions for each value/variable.

The system will allow me to choose either gas heat (from the fireplace), electric heat, or both. The electric option includes a “economy” mode that will only use the electric heat when the temperature differential is greater than 4 degrees (to assist in bringing the room temperature up to the set value faster). The fireplace can also be locked on, for visual purposes.

I haven’t completely wrapped my head around how I’m going to cycle the heaters, I have a basic idea of how the room will heat up but I’m not sure how complicated I should make this. Right now I’m leaning toward a slope calculation for temperature rise only, as to correctly time the first off cycle to not overshoot to set temperature. Next to that I know I don’t want to constantly be cycling the sytem because it it driven by two relays, one at the arduino and one in the baseboard heater itself. Probably 5 minutes will be my minimum “on” time.

I just received the RTC and temperature sensors in the mail today so I’ll get started with those soon. Here’s a vid of the user interface as it is now.

MVI_0044.AVI.wmv