Summary of A m -Controller Based Thermostat Using Atmel AT90S8535 microcontroller
The project designs a microcontroller-based thermostat using an Atmel AT90S8535. It measures temperature via an analog thermistor circuit, converts readings using ADC and fixed-point math, and controls a heating device. The system features an LCD for displaying current, target, min/max temperatures, and time, alongside a keyboard for user input to set parameters and clear data.
Parts used in the Microcontroller Based Thermostat:
- Atmel AT90S8535 microcontroller
- Analog thermistor-based temperature sensitive circuit
- Liquid Crystal Display (LCD)
- Keyboard
- Heating device
- Calibration setup circuit
- Thermometer
- Timer1 module
Introduction The goal of our final project was to design a thermostat using an Atmel AT90S8535 microcontroller. The thermostat was to compute the current temperature once per second and then send an on/off signal to a heating device which would then regulate the temperature to a desired target temperature. In addition, the thermostat was required to keep a time of day clock, as well as record the maximum and minimum temperature values that have occurred.

Setup We accomplished our goal by using an analog thermistor-based temperature sensitive circuit whose output voltage was inversely proportional to the temperature of the system. In order for the microcontroller to obtain the current temperature, the thermistor voltage was input to the ADC of the 8535 and then converted to a temperature using a simple linear equation involving fixed point mathematics. In addition, the thermostat also required the use of both an LCD and a keyboard for the purpose of user interaction. Specifically, the LCD performed the following display functions:
- display the current temperature
- display the target temperature
- display the min and max temperatures
- display the time of day
- displaying keyboard input for verification
The keyboard was used for:
- setting the target temperature
- setting the time of day
- selecting the view min/max mode
- clearing the min/max values
As you can see, this project combined many if not all of the concepts taught over the course of the semester. These include timing, use of a keyboard (including debouncing it), use of an LCD, fixed point mathematics, analog circuit design and analog-to-digital conversion.
Thermistor Calibration
The first step in creating a thermistor based temperature controller is the calibration of the thermistor, that is figuring out how the amount of voltage drop across the thermistor corresponds to its temperature. To come up with this data we used the calibration setup circuit shown in Figure 1. We then heated the thermistor up from 30 to 90 degrees Celsius (since this setup did not have a safe method for cooling the thermistor to down below ambient temperature) and recorded both the voltage across the thermistor and its temperature. These values are plotted in Figure 2. We accurately knew the temperature of the thermistor because our calibration setup included a thermometer which was thermally coupled to the thermistor. Find our experimental data in Appendex 1. One complication which arose in this part of the project was that because the thermistor is not a perfect device per se, it requires on the order of ten or so seconds for its resistance to accurately respond to a change in temperature. Because of this effect, there was a thermal lag which existed between the thermistor and the thermometer used to know its temperature. Nonetheless, we found that the way to minimize this source of error was to take calibration data both during a heat up cycle a cool down cycle. This is effective in minimizing this source of error because the thermal lag is effectively canceled out by the fact that during the heat up cycle there is a positive thermal gradient between the thermometer and the thermistor while during the cool down cycle there is a negative thermal gradient. Therefore we were able to accurately obtain values correlating the voltage drop across the thermistor to the thermistors temperature. We then converted these analog voltages (Vread) to 10-bit binary values such as would appear at the output of the ADC using the following equation:
For more detail: A m -Controller Based Thermostat
- How does the microcontroller obtain the current temperature?
The thermistor voltage is input to the ADC of the 8535 and converted to a temperature using a linear equation involving fixed point mathematics. - What functions does the LCD perform in this project?
The LCD displays the current temperature, target temperature, min and max temperatures, time of day, and verifies keyboard input. - Can the user set the target temperature on this device?
Yes, the keyboard is used for setting the target temperature as well as the time of day. - Does the system record minimum and maximum temperatures?
Yes, the thermostat records and stores the maximum and minimum temperature values that have occurred. - How was the thermistor calibrated in this project?
The thermistor was heated from 30 to 90 degrees Celsius while recording voltage and temperature to correlate voltage drop with temperature. - What method was used to minimize thermal lag errors during calibration?
Data was taken during both heat up and cool down cycles so that positive and negative thermal gradients would cancel out the error. - How often does the thermostat compute the current temperature?
The thermostat computes the current temperature once per second using Timer1 with specific clock division and compare/match values. - What happens if the new temperature exceeds the stored min or max?
A comparison routine replaces the current min or max values in memory if the new temperature exceeds them. - Can the recorded min and max values be reset?
Yes, a button option allows the user to reset the min and max temperatures at any time. - What reference voltage was used for the ADC conversion?
A reference voltage (Aref) of 4.5V was used for converting analog voltages to 10-bit binary values.
