Computer Controlled HVAC Thermostat

From Catholicpenguin

Overview of the Problem

At least in southern regions of the US like Texas, a house or apartments AC and heating system is typically the single largest energy user, and the biggest contributer to the electric bill. Yet, for most homes and apartments, these systems are still controlled by extremely simple thermostat devices void of any of the technologically advances of the last half a century.

A typical home HVAC (Heating / Ventilation and A/C -> abbreviation for your heater / air conditioner) system is controlled by a simple thermostat consists at its core of a strip of metal wound into a spiral. When heated or cooled, the metal expands or contracts slightly. Spiraling the metal strip allows for greater length and a correspondingly larger net expansion or contraction.

Inside of a typical HVAC thermostat, showing mercury blob.
Enlarge
Inside of a typical HVAC thermostat, showing mercury blob.

Attached to the end of this spiral is a small blob of mercury encased in glass. Two wires poke through one side of the glass. The spiral is mounted in the thermostat such that the blob is at the top of the vertically mounted spiral. When in heating mode, as the metal contracts, glass blob tilts, causing the mercury to flow to the end of the glass where the wires protrude. The mercury connects the wires and the heater turns on. When the temperature increases, the metal expands, tilting the glass blob the other direction, causing the mercury to flow to the other end of the glass, opening the connection between the wires, and stopping the heater. The same process occurs in reverse for cooling.

This system works and is cheap, but has several disadvantages. Aside from the public health hazard of millions of homes storing large amounts of mercury, the thermostat is imprecise and requires manual adjustment for any change; it cannot automatically change from heating to cooling as conditions change, or shut itself off noone is home, for example. Industrial systems have long since switched to using computer controlled thermostat systems which are capable of the above functions and more, but such technology has by and large not reached average households.

This is starting to change. If you stroll through the hardware isles at Wal-Mart or Lowes, you'll see many models of digital thermostats at reasonable prices ($10-$100), offering primarily the ability to stored preprogrammed temperatures depending on the time of day. Although these systems are gradually starting to catch on, we can do more; much much much more.

The Solution

Right now, one can by a La Fonera 802.11 wireless router for $40 plus shipping. Included in this tiny box is an Atheros SOC with a high speed ARM processor, megabytes of SRAM and Flash memory, 802.11 wireless, and more. It comes running an easy to extend version of embedded Linux. Open sources software writers have already extended this devices functionality to communicate over I2C, with SD cards, etc. With such a device or something similar, it's finally time to bring the household thermostat to the Internet age.

The advantages of doing so are numerous. In addition to all the abilities of existing digital thermostats such as storing preset temperatures for different days, etc, such a thermostat could automatically switch from heating to cooling as the outdoor temperature changed. For maximal energy savings, such a sensor could interact with sensors to detect when no-one is home, and automatically raise / lower temperatures to save energy. Further, since it is a relatively simple to program the thermostat with the energy usage of the HVAC system, the thermostat can exactly know how much electricity it is consuming, and how much the consumer will have to pay. The user could then have the option of choosing to spend only so much money per month on energy, and have the thermostat automatically distribute the consequential temperature constraints across the month to meet that target cost. External data, such as historical weather data from the last few years from NOAA, could be easily retrieved and analyzed, allowing the thermostat to make better planning decisions on how to best distribute cooling or heating energy over a month to reach a desired cost.

With the reliability problems of the electric grid due to overloading, such thermostats could monitor the HVAC supply voltage and intelligently space out the HVAC system operation to help the electric grid during peak periods.

Since the system would be internet enabled, robust maintenance would also be possible to implement. At the simplest level, this could consist of sending an email when it's time to change the filter, but could go so much farther. By monitoring cooling rates relative to outside air temperature, the thermostat could easily determine system performance, and notify the user or repair shop when faults or sub-optimal performance is detected. If users consent, such reports could also be sent back to the manufacturer, allowing fault determination and improvements in future systems. Safety related maintenance concerns including carbon monoxide sensing could also be easily implemented, with added enhancements like the ability to call 911 or other emergency services if levels keep rising.

The beauty of such a system is that almost all of the above can be implemented in software, and since such systems run commercially known and friendly to program in Linux operating systems, such software no longer need consist of expensive to write custom assembly code for microcontrollers.


Example temperature graph for a cold winter night (2/19/08 - College Station)
Enlarge
Example temperature graph for a cold winter night (2/19/08 - College Station)


Prototype Implementation

A partial prototype implementation was created using the GPIO ports on the Fonera to interface with a standard HVAC system. At regular intervals, a script on the Fonera uploaded the current temperature and state of the system to a website, where the temperature graph (seen above) was created. The Python scripts for accomplishing this can be found in their last working state here.