Home     Contact     Forum     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Tech-BLOG     RSS     Terms of services     Privacy policy  
 Home     Contact     Forum     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Tech-News     RSS   

PCB Fabrication
31 March 2010
Author: Giorgos Lazaridis
A Simple yet Reliable Thermostat


The circuit on a breadboard

When someone learns about the Schmitt trigger, i believe that a thermostat is the first application that comes into his mind. The Schmitt trigger works exactly as a common thermostat would do. If the temperature exceeds a specific point - the "High threshold", it will arm a relay until the temperature falls below the "Low threshold". The difference between high and low threshold is called "hysteresis". The only difficult thing is how to choose the right components as there are many parameters. This circuit is an implementation of a thermostat with a Schmitt trigger. I will show you how to make one, and how to choose the correct component values to change the settings of the thermostat: High threshold, Low threshold and Hysteresis.






The circuit

First of all, i will show you a circuit that i made for my PC cabinet. The circuit can be adjusted from 22.5oC up to 50oC and has a hysteresis of around 2oC. If for example the circuit is adjusted to 30oC, the relay will be armed when the temperature exceeds this point (30oC), and it will be disarmed when the temperature falls bellow 28oC (30-2).

So, let's see the circuit:





Starting from R1 and R2, this is the temperature measuring twin. R1 is a 10K NTC thermistor. Along with R2, they make a voltage divider. The voltage output of this divider will change according to the temperature change. This voltage is then driven directly to the inverting input of the 741, a normal configuration for a single power supply Schmitt trigger using OP-Amp. The output of the 741 drives the PNP power transistor. The output is reversed and the load is directly driven from this transistor.

As i said before, the circuit can be adjusted form 22 to 50 oC. This means that when R5 is turned completely to the left (0 ohms), the load will be actuated above the 22oC, and when it is completely right (max resistance) it will be actuated above 50oC. I chosen these values because i plan to install this circuit in my PC cabinet. This range will fit my needs. Nevertheless, i will explain how you can select parts yourself, in order to change the range and hysteresis at your will.




Can i change the relay with something else?

The circuit was originally designed to control a fan. The transistor can handle up to 600mA load

Well luckily yes, you can. I used the 2N2907 that can handle up to 600mA. So, you can simple remove the relay and instead put a 12V buzzer. Or better, you can put a PC fan! Well OK, you got me! This is exactly what i had in mind from the beginning of this project. Usually, PC fans will not draw more than 350mA. This is about half of what the transistor can provide, so a PC fan can be easily controlled. Just remember to put the positive wire of the fan on the collector of the transistor, and the negative to the ground, like the following schematic:





The positive goes to A and the negative to B. Same is if you use a buzzer that has polarity! Positive to A and Negative to B




Bill Of Materials (First circuit)
Resistors
R1NTC 103 10 KOhm NTC Thermistor
R2Resistor 4.7 KOhm 1/4 Watt 5% Carbon Film 
R3Resistor 100 KOhm 1/4 Watt 5% Carbon Film 
R4Resistor 5.6 KOhm 1/4 Watt 5% Carbon Film
R55 KOhms potentiometer
R6-7Resistor 2.2 KOhm 1/4 Watt 5% Carbon Film 
Integrated Circuits
IC1LM741 Operational Amplifier 
Transistors
Q12N2907 General purpose amplifier and switching transistor 



Set different temperature range and threshold

I have to warn you that this is a little bit stiff if you do it for the first time. If you are not interested in changing the setting of the above circuit, just skip this step.

First of all, you need to know some more details for the thermistor. You need to know actually, how the resistance changes in relation to the temperature. Luckily, i had ran an experiment with this thermistor. You can find this experiment here. I discourage you though to run such a detailed experiment yourself. Instead, you need to make sure that the thermistor you have changes linear. If it is not, then you will probably fail to calculate the circuit. You can have this info from your thermistor vendor.

Then, you need to know the resistance of the thermistor in room temperature. This value, corresponds to the resistance of the component when the temperature is 25oC. You can also learn this information from your vendor. Usually, this info is printed on the thermistor. A 10K thermistor for example (like the one that i use), will have 10K resistance in room temperature.

Finally, you need to know the slope of the change. That would be the hardest part if you are not in a laboratory... What you really need to know is the resistance of the thermistor in another temperature. So, either put it in the refrigerator, or put it somewhere hot. 10-20 degrees above or below room temperature is the place where you should put it. Put your imagination to work. When you do find the resistance in this specific temperature, then draw the characteristic of the thermistor as i explain in the thermistor experiment.

Now that you have the characteristic of the thermistor, you can easily calculate the various resistance values for various temperatures of the thermistor. I explain in the experiment how to use the line equation calculator to do this.

Now it is time to decide the upper and lower temperature limits. Suppose that you want to narrow the temperature settings (and thus increase the stability and accuracy). Suppose that you want to be able to set the circuit from 20 up to 40oC, and the hysteresis about 4oC. First of all, you need to calculate the thermistor resistance value for these temperatures. In my case:

20oC = 12.174 Ohms
40oC = 5.454 Ohms

Now you need to run some tests to find the best R2. The best R2 is the one that will generate the biggest voltage difference for these values, while it will not be too big or too small to cause problems. It should be minimum 1/10 of the thermistor nominal resistance and not bigger than 10 times the thermistor's nominal resistance. In my case, it should be between 500 ohms and 100 KOhms. Use the Voltage Divider Calculator to solve for V2, and speed up the process. I will use a resistor 2.2 KOhm to have a reasonable voltage output. The voltage outputs will be:

20oC = 1.8 Volts
40oC = 3,45 Volts

I want a hysteresis of 4oC. I have to express this value in voltage difference. According to our previous calculations, from 20 to 40 degrees, the voltage difference is 1.65 volts. Thus, for 4 degrees it is 0.33 volts.

Now you have everything to start playing with the Schmitt trigger. You have a very handy tool for this, the Schmitt trigger calculator for single power supply OP-Amp. Each resistor value change will have a particular effect on some values, while on the others they will have only a slight affect. RFB for example (R3 in my circuit) usually changes the hysteresis. Thus, i will use a rather big resistor to have so small hysteresis (0.33V). Thats a good point to start with.

First to calculate R4 R5 and R6. I will start with the minimum voltage level. In that case, R5 is 0 as the potentiometer is fully turned to the left. Use the calculator and fool around until you find some values for those resistors, that - along with R3, will give a V High near 1.8 volts and a V Low about 0.33 volts lower... you need time and experience. The more you play with, the more you understand what is going on. I suggest you use resistor values that do exist. If you do not know them by heart, then advice the Standard Resistor Calculator.

I came up with the following results: R4=10K, R6=6.2K, R3=220K. Possibly you may find other values. That is NOT wrong. They may also be correct. There are many ways to solve an electronic problem, and sometimes this is the biggest problem in electronics. Now for the potentiometer. During this step, you may come to the conclusion that the values you found for the 3 resistors may be wrong. Unfortunately, you will need to calculate resistor pairs... Now, there are very certain potentiometer values. I suggest you try the 1K, 2.2K, 4.7K, 10K, 22K, 47K and 100K. What you have to do is, to add every time the value of a potentiometer to the value of R6. If the result of V High is close to 3.45 volts and the result of V Low close to 3.15, then you are finished. Now let's see my resistor pair... Using a 10K potentiometer i get the following values:


V High = 3.53V and V Low = 2.91 Volts.

Are these values OK? let's see. According to my thermistor experiment, 3.53V corresponds to around 41oC and 2.91 corresponds to 35oC. The High value is ok, the hysteresis is changed too much though. So i have to recalculate the resistors with a larger R3 in order to have less hysteresis. This is the point where you need experience and patience... And some luck.





Relative pages
  • Dr.Calculus: Standard resistor values calculator
  • Experimenting with a thermistor
  • The Schmitt Trigger Circuit
  • The power connectors used for PCs since 1981
  • How the relays work
  • The simplest DC motor linear rpm controller
  • High accuracy humidity and temperature sensor
  • PIC Thermometer and thermostat circuit, designed for etching baths
  • High accuracy temperature meter
  • Low cost medium accuracy PIC temperature meter




  •  Rate this article!


    Comments

  • At 17 May 2012, 14:40:20 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @uhuru I explain in the document


  • At 17 May 2012, 11:27:44 user uhuru wrote:   [reply @ uhuru]
    • Suppose i wanted to turn on a piece of equipment if the temperature falls below 37.5d celcius and turn off above this with a hysterisis of plus or minus 0.5d celcius what value components would i use.


  • At 6 May 2012, 16:30:08 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Marco Oh well, that won't be an easy job to do. You will need to prototype it on a breadboard and do some tests first. And use my online calculator for the schmitt trigger to help in the dr.calculus pages.


  • At 6 May 2012, 12:11:34 user Marco wrote:   [reply @ Marco]
    • Hey! Really nice project. I am planning to make it myself in order to power a cooling pad fan. The only thing is that I would like to power it via USB, an since that means 5V instead of 12V, I was wondering if the same parts would still be compatible. Could you give me a hint about this?

      Thanks and great material!


  • At 11 March 2012, 10:28:20 user neer wrote:   [reply @ neer]
    • hey great circuit thanks for sharing it!!! well m stuck and need help with calculations my thermistor has resistance of about 100ohms at 30'c and i want the fan to come on at about 40'c and hysteresys could be 2-4'c what changes in resistor will i need to make can u do me the calculations and tell as i have no idea about it.(my thermister is ntc100d-9 type).


  • At 26 November 2011, 14:34:00 user Paul wrote:   [reply @ Paul]
    • Hi what is best values for 50 to 90 degree control using a 10k thermister


  • At 25 October 2011, 0:39:55 user Kammenos wrote:   [reply @ Kammenos]
    • @keyboard22 the max current this transistor can get is 600mA. Use a larger transistor (for example a TIP142) to get bigger current


  • At 24 October 2011, 7:25:16 user keyboard22 wrote:   [reply @ keyboard22]
    • what is the output current that is produced? can it be increased to 0.8 amps?


  • At 21 July 2011, 10:36:38 user Kammenos wrote:   [reply @ Kammenos]
    • @Gon exactly the opposite of what i do now. connect a heater to the NC contact of the relay.


  • At 19 July 2011, 19:21:39 user Gon wrote:   [reply @ Gon]
    • What would you do if you want to maintain a higher temperature than the surroundings (for example you want to keep the living room at 20 C while it's freezing outside)?
      Is that easy to implement?


  • At 16 June 2011, 1:15:50 user Kammenos wrote:   [reply @ Kammenos]
    • @ramy this is a thermostat circuit, so the potentiometer's function is to set the temperature where the thermostat output will be HIGH or LOW. It is the same like the thermostat in the air condition or the heating apparatus in houses.


  • At 16 June 2011, 0:18:21 user ramy wrote:   [reply @ ramy]
    • what is the function of the potentiometer?????


  • At 20 March 2011, 23:23:44 user tualatin1 wrote:   [reply @ tualatin1]
    • i used a 10 k resistor on r2 and it lowered the start temperature of the fan so it suited me better for my purposes


  • At 24 January 2011, 1:43:21 user Kammenos wrote:   [reply @ Kammenos]
    • jefdeal, regarding the voltage divider. The problem is i think that i am not 100% used to the english way of representing numbers. I had some errors, for example the number 12.174Ohms is not correct, it should be 12174Ohms or 12,174Ohms, but not with dot. (i changed it). Use 12174 or 12.174 KOHMS in the voltage divider.
      Also i fixed the 500 ohms. You are right, it is 1000. But keep in mind that the 1/10 is a rule that can be changed according to your needs. The 1/10 is just a good start.
      This is a very good circuit to start with, is simple in making and hard in calculations. Assemble it on a breadboard and have some different resistor values to change and notice the results. Get a resistor pack from ebay of other supplier, and a couple different potentiometers.


  • At 24 January 2011, 0:55:33 user jefdeal wrote:   [reply @ jefdeal]
    • There is a problem with your \\\"Voltage Divider Calculator\\\". Solving for V2 enter these values. V1=12V, R1=12.174Ohms, R2=2.2KOhms. You will get V2 as 11.93. If you change R2 from KOhms to Ohms you will get the 1.8V as specified on the page. I am very interested in modifying this circuit, but this will only be the second circuit I have built. If I am wrong here please explain, otherwise please let me know what must be corrected to allow the R2 value to fall within the 1/10 to 10 times window of the value of the thermistor. Also if you have a 10K thermistor wouldn\\\'t the 1/10 value be 1KOhms and not the 500Ohms stated?


  • At 8 July 2010, 12:47:57 user Kammenos wrote:   [reply @ Kammenos]
    • I really do not follow you herctrap. Connecting a NPN instead of a PNP, will reverse the operation of the circuit (of course). If you mean output the voltage between the NPN emitter and the ground, then it will be 12V minus the VCE. This depends on the transistor you use. Check the specifications. The 2N2907 has approximately 0.8V voltage drop for the fan load (less for the relay).


  • At 8 July 2010, 10:07:20 user herctrap wrote:   [reply @ herctrap]
    • if we had connected an NPN transistor istead of PNP

      collector at +12v
      Base on the signal (5V)
      and emmiter the output

      then the output is 5V and not 12V

      but what about the PNP?

      thanks


  • At 13 June 2010, 13:42:46 user kennytham wrote:   [reply @ kennytham]
    • electronics thermostat automatic fan control


  • At 16 April 2010, 9:51:19 user The Seeker wrote:   [reply @ The Seeker]
    • brilliant! well done. excellent work and good explanation. 10/10


     

      Name

      Email (shall not be published)

      Website

    Notify me of new posts via email


    Write your comments below:

          






    delicious
    digg
    reddit this Reddit this
    Faves

    Search PCB Heaven


     HOT in heaven!



    PCB Heaven chirps on Follow me on Twitter

    TAGS cloud

    System Monitoring  Computer  Temperature Controller  Temperature Monitoring  Thermostat  Automation  Sensor  Thermometer  Electronic Circuit  Switching 



    NEW in heaven!



    New Project: How to make a professional-like panel label

    Random Circuits!
     LED Fade-In Fade-Out Dimmer
     LED Off Delay with dimming effect



     Home     Contact     Forum     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Tech-News     RSS   

    Site design: Giorgos Lazaridis
    © Copyright 2008
    Please read the Terms of services and the Privacy policy