During the winter, our bedroom can get very warm. Inevitably, we end up closing both vents in the room and then several hours later open the vents because we are freezing. I decided to automate this process.
Originally I had envisioned having a small temperature sensor across the room which would relay open and close commands wirelessly to the motorized vent. Given the unreliable results from the light switch controlled outlet project, I abandoned that idea. Instead, I decided to put the temperature sensor on the same board as the vent motor controller.
I purchased a Vent-Miser programmable vent. These vents have a programmable timer and will open and close the vent depending on the time of day. All I cared was that it was a motor controlled vent.
The motor is controlled with a PIC16F1824 micro-controller and the temperature is read using one of the analog to digital inputs fed by a TC1047A temperature to voltage converter. The PIC spends most of the time asleep allowing it to conserve energy. Once a minute it wakes from sleep, takes a temperature reading and decides whether or not to open the vent. With the temperature sensor inside of the furnace register, there are some wild temperature swings when the furnace is on. To compensate for this, the PIC looks for the minimum temperature over a ten minute period. Then, depending on the minimum temperature, it makes a decision about whether or not the vent should be open. Currently, if the temperature is over 73 degrees it will close the vent and if it is under 70 degrees it will open the vent. This was done to prevent the vent from opening and closing sporadically due to noise on the temperature sensor.
The entire circuit is powered by a 9V battery. Using very imprecise measurements, I estimate a lifetime of just over two years. This of course depends highly on how often the vent opens and closes.
If you would like detailed schematics or code, please let me know and I will post them as well.