Thermometer – Thermostat

This is a simple thermostat that i designed to use with my central heating system. When is not in use acts like a thermometer.
The prototype uses the AT90S2313 but it’s obsolete now, so i changed it with the pin to pin compatible ATtiny2313 (the photo shows my first prototype).
With the on/off switch (S1) you can turn the device on or off. With the up (S2) and down (S3) you can set the desired temperature between 10 and 40 degrees Celsius.
When you turn the device on you first see the ON sign, then you see the temperature that the thermostat is set and at last you see the current temperature. If the current temperature is lower than the set temperature, the load is connected and the decimal point of the second digit is blinking. At any time you can set the temperature of the thermostat by pressing the up or down switches.
When you press any of the up or down switches momentarily you can see the current thermostat temperature. Pressing again the temperature change. To turn off the device just press the on/off switch again.
The schematic of the thermostat is shown here:
The PCB:
The Silkscreen:



Click on the images for larger view.

The schematic and the PCB is also available in Cadsoft’s Eagle design program format:
The program for the micros is written with BASCOM-AVR
The files for ATtiny2313:


The files for AT90S2313:



If you are going to use ATtiny2313 you can omit the 4MHZ crystal and the two ceramic capacitors C2 and C3, using the internal oscillator tuned at 4MHZ. You have to omit the two resistors R12 and R13 as well.
The appropriate fuses for ATtiny2313 must be programed by you because the micro is shipped with internal oscillator tuned at 1MHZ by default.
Go to AVR Fuse Calculator, set the appropriate micro and select the settings in the menus (see the photos, click for larger view).
For internal oscillator set:
For external oscillator set:
You can program the micro on board using then 6-pin header JP1. if you use the STK500 remember to remove the VTARGET jumper or the STK500 maybe damaged.


A bug found in the placement of transistors T1, T2, T3 in PCB.
The correct is the reverse of the drawing in silkscreen. The schematic it’s ok.

For questions or comment mail to: dselecdim at gmail dot com

6 thoughts on “Thermometer – Thermostat

  1. I make this and must say that have some errors. I use ATTiny2313, without quartz 4MHz and two 22pF ceramic capacitors. I try without R12 and R13 resistor but wont work! ATTiny2313 is programmed with Config&Sec bits with sets for internal osc. Temperature is not accurate about 4C is always upper ther real temp, I check. Now he shows 29!!! but in room is only 23,74C. Another bug is with relay, he wont turn on! I rotate transistor as given important bug fix. I there some error in source code?

  2. I would like to make this thermostat. I want to know the value of the hysterezis and if it is programmable. Thank you.

  3. Has anyone written the code for this project to use Fahrenheit instead of Celsius? If so, I would surely like to have a copy.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s