+ Post New Thread
Page 3 of 6 FirstFirst 1 2 3 4 5 ... LastLast
Results 41 to 60 of 104
  1. #41
    Advanced Member level 5
    Points: 14,829, Level: 29
    schmitt trigger's Avatar
    Join Date
    Apr 2013
    Posts
    2,464
    Helped
    799 / 799
    Points
    14,829
    Level
    29

    Re: how to design a thermostat without Microcontroller?

    Quote Originally Posted by barry View Post
    Boy, talk about over-engineering. You would think the OP asked how to design an interstellar spacecraft from the responses here.
    1) get a temperature sensor.
    2) connect it to a comparator with hysteresis.
    3) connect the output of the comparator to a relay
    4)done
    No need to overcomplicate things.

    The only requirement that I would add is that the comparator should have a somewhat stable reference voltage.
    If the supply voltage is already regulated, this can be good enough for a non-critical application, like the OP's request.
    My batteries are recharged by "Helpful Post" ratings.
    If you feel that I've helped you, please indicate it as a Helpful Post



  2. #42
    Member level 5
    Points: 881, Level: 6
    Dr_Mohammad's Avatar
    Join Date
    Nov 2016
    Location
    Khorramabad, Iran
    Posts
    90
    Helped
    0 / 0
    Points
    881
    Level
    6

    Re: how to design a thermostat without Microcontroller?

    Quote Originally Posted by KlausST View Post
    Hi,


    Why vague? It's just mathematics. All input values should be known or (in doubt) measurable.

    Klaus
    I think using 2 potentiometers for the feedback's circuit is a good choice. what's your idea?
    Hope is a good thing, maybe the best of things and no good thing ever dies (The Shawshank Redemption).



  3. #43
    Super Moderator
    Points: 77,106, Level: 67
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,621
    Helped
    3559 / 3559
    Points
    77,106
    Level
    67

    Re: how to design a thermostat without Microcontroller?

    Hi,

    Believe it or not, in the past 20 years of electronics developmemt I did not use a pot this way, I calculated the part values.
    It is faster and cheaper.

    If it does not work with the calculated values, then you know you did something wrong.

    Klaus
    Please dont contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  4. #44
    Member level 5
    Points: 881, Level: 6
    Dr_Mohammad's Avatar
    Join Date
    Nov 2016
    Location
    Khorramabad, Iran
    Posts
    90
    Helped
    0 / 0
    Points
    881
    Level
    6

    Re: how to design a thermostat without Microcontroller?

    Quote Originally Posted by KlausST View Post
    Hi,

    Believe it or not, in the past 20 years of electronics developmemt I did not use a pot this way, I calculated the part values.
    It is faster and cheaper.

    If it does not work with the calculated values, then you know you did something wrong.

    Klaus
    thanks Klaus, I will make it today.

    But, could you please describe again the calculation of feedback resistors for keeping temperature almost steady? (i.e. below 37.7 C the relay should be switched ON, when temperature reaches to 37.7 C the relay goes to OFF-state; when drops to 37 C, the relay should be ON again).

    THANKS FOR YOUR INFINITE KINDNESS.
    Hope is a good thing, maybe the best of things and no good thing ever dies (The Shawshank Redemption).



  5. #45
    Super Moderator
    Points: 77,106, Level: 67
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,621
    Helped
    3559 / 3559
    Points
    77,106
    Level
    67

    Re: how to design a thermostat without Microcontroller?

    Hi,

    Please do some calculations in your own.
    What are the LM35 temperatures at your expected switching points?

    Klaus
    Please dont contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  6. #46
    Member level 5
    Points: 881, Level: 6
    Dr_Mohammad's Avatar
    Join Date
    Nov 2016
    Location
    Khorramabad, Iran
    Posts
    90
    Helped
    0 / 0
    Points
    881
    Level
    6

    Re: how to design a thermostat without Microcontroller?

    Quote Originally Posted by KlausST View Post
    Hi,

    Please do some calculations in your own.
    What are the LM35 temperatures at your expected switching points?

    Klaus
    The incubator's temperature must be fixed at 37.7 C.

    below 37.7 C the relay should be switched ON (the relay turns a heater ON or OFF), when temperature reaches to 37.7 C the relay goes to OFF-state; when drops to 37 C, the relay should be ON again
    Hope is a good thing, maybe the best of things and no good thing ever dies (The Shawshank Redemption).



  7. #47
    Super Moderator
    Points: 77,106, Level: 67
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,621
    Helped
    3559 / 3559
    Points
    77,106
    Level
    67

    Re: how to design a thermostat without Microcontroller?

    Hi,

    next step: the according voltages...

    Klaus
    Please dont contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  8. #48
    Advanced Member level 5
    Points: 17,084, Level: 31
    Achievements:
    7 years registered

    Join Date
    Nov 2012
    Posts
    3,128
    Helped
    772 / 772
    Points
    17,084
    Level
    31

    Re: how to design a thermostat without Microcontroller?

    below 37.7 C the relay should be switched ON (the relay turns a heater ON or OFF), when temperature reaches to 37.7 C the relay goes to OFF-state; when drops to 37 C, the relay should be ON again...
    This is not a good specification. You must provide some interval. For example, the heater on if the temp <37.7C and heater off if the temp is >37.8C.

    If you reduce the interval to zero, the relay will chatter incessantly. Just think this like logic levels: it is zero (say) if the voltage is <3V and it is one if the voltage is >5. The undefined range between these two limits constitute hysteresis.

    You have given two values when the heater should turn on: below 37.7C and also 37C; this is inconsistent and cannot be implemented.



  9. #49
    Member level 5
    Points: 881, Level: 6
    Dr_Mohammad's Avatar
    Join Date
    Nov 2016
    Location
    Khorramabad, Iran
    Posts
    90
    Helped
    0 / 0
    Points
    881
    Level
    6

    Re: how to design a thermostat without Microcontroller?

    Quote Originally Posted by c_mitra View Post
    This is not a good specification. You must provide some interval. For example, the heater on if the temp <37.7C and heater off if the temp is >37.8C.

    If you reduce the interval to zero, the relay will chatter incessantly. Just think this like logic levels: it is zero (say) if the voltage is <3V and it is one if the voltage is >5. The undefined range between these two limits constitute hysteresis.

    You have given two values when the heater should turn on: below 37.7C and also 37C; this is inconsistent and cannot be implemented.
    the incubator's temperature for incubation should be 37.7C. the shown relay in the circuit will switch a heater ON or OFF. we assume the incubator's temperature=T.

    if T<37.7C, then the relay should be ON (i.e. the heater is ON too). when T=37.7C the relay should be switched OFF; therefore the relay should remains OFF until T drops to 37.2C. when T<=37.2 relay goes to ON-state again. summarily, the hysteresis is 0.5C.

    Click image for larger version. 

Name:	uc5u_thermo.png 
Views:	4 
Size:	160.5 KB 
ID:	153114
    Hope is a good thing, maybe the best of things and no good thing ever dies (The Shawshank Redemption).



  10. #50
    Super Moderator
    Points: 77,106, Level: 67
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,621
    Helped
    3559 / 3559
    Points
    77,106
    Level
    67

    Re: how to design a thermostat without Microcontroller?

    Hi,

    I kindly ask for some effort on your own and for "stable" requirements, not 1C ... 0.7C ... 0.5C hysteresis change with every post.

    Klaus
    Please dont contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  11. #51
    Advanced Member level 5
    Points: 24,065, Level: 37
    barry's Avatar
    Join Date
    Mar 2005
    Location
    California, USA
    Posts
    4,616
    Helped
    1021 / 1021
    Points
    24,065
    Level
    37

    Re: how to design a thermostat without Microcontroller?

    At the risk of stirring up an already overwrought discussion, you also have to consider the environment. For example, if it's very drafty the temperature may drop very quickly which means that the relay is going to be constantly turning on and off, and you may have a lot of overshoot and undershoot of temperature. If this is the case, then maybe a relay-controlled temperature is not the proper approach. Also, if the heater is not powerful enough you might turn it on at some temperature but the actual temperature may continue to drop for a while before it starts to rise.

    Asking for 0.5 degree accuracy might be more than your light bulb system can provide.



  12. #52
    Advanced Member level 5
    Points: 34,741, Level: 45
    Achievements:
    7 years registered Created Blog entry Created Album pictures
    SunnySkyguy's Avatar
    Join Date
    Sep 2007
    Location
    Richmond Hill, ON, Canada
    Posts
    6,718
    Helped
    1677 / 1677
    Points
    34,741
    Level
    45
    Blog Entries
    7

    Re: how to design a thermostat without Microcontroller?

    Dr Mo said "I provided a box which the heating source (40W light bulb), a little DC motor for rotating eggs and a thermostat embedded in.
    the temperature in the box should be around 37C and the accuracy is not too important. I want when the temperature reaches to 37C the light bulb be turned OFF and once the temperature goes below 37C the light bulb be turned ON.
    "

    The critical question is how variation is there between the egg surface and air temperature surrounding it and the where the temperature is sensed? Given that this heat is a combination of radiant and convection, the temperature difference will most likely exceed your "not too important" spec. Therefore more distributed bulbs with same total heat and/or a fan to reduce temperature swing is necessary. A solid state switch is necessary for bulb unless you use an inrush current limiter (ICL) NTC component for reliability. Then you can use 0 hysteresis.
    A best design is easily achieved with good test specs
    A better question deserves a better answer.
    ... so include all your acceptance criteria ( values, % tolerance) and assumptions in your question or any design.

    ... Tony Stewart EE since 1975
    - slightly north of Toronto



  13. #53
    Member level 5
    Points: 881, Level: 6
    Dr_Mohammad's Avatar
    Join Date
    Nov 2016
    Location
    Khorramabad, Iran
    Posts
    90
    Helped
    0 / 0
    Points
    881
    Level
    6

    Re: how to design a thermostat without Microcontroller?

    Quote Originally Posted by KlausST View Post
    Hi,

    I kindly ask for some effort on your own and for "stable" requirements, not 1C ... 0.7C ... 0.5C hysteresis change with every post.

    Klaus
    yes you're right. but after doing some researches & simulations I find that the best hysteresis is 0.5C. excuse me brother.

    now with 0.5C, what are the value of feedback resistors?

    - - - Updated - - -

    Quote Originally Posted by SunnySkyguy View Post
    Dr Mo said "I provided a box which the heating source (40W light bulb), a little DC motor for rotating eggs and a thermostat embedded in.
    the temperature in the box should be around 37C and the accuracy is not too important. I want when the temperature reaches to 37C the light bulb be turned OFF and once the temperature goes below 37C the light bulb be turned ON.
    "

    The critical question is how variation is there between the egg surface and air temperature surrounding it and the where the temperature is sensed? Given that this heat is a combination of radiant and convection, the temperature difference will most likely exceed your "not too important" spec. Therefore more distributed bulbs with same total heat and/or a fan to reduce temperature swing is necessary. A solid state switch is necessary for bulb unless you use an inrush current limiter (ICL) NTC component for reliability. Then you can use 0 hysteresis.
    it's just a tiny box which maximum 10 eggs embedded in. with that uploaded circuit, 4 chicks born but many of them have died in eggs
    I think the unstable manner of relay cause to chicks wastes. because when the temperature has reached to 37.7C. the relay frequently switches the heating source ON & OFF. The temperature was fixed for 2 early days, but after passing days, the temperature itself has been changing. in the last week, the temperature dropped to 36.8C. since I want to modify the uploaded thermostat so that has a hysteresis and therefore the temperature remains fixed between 37.2 and 37.7C.

    i.e.if T<37.7C, then the relay should be ON (i.e. the heater is ON too). when T=37.7C the relay should be switched OFF; therefore the relay should remains OFF until T drops to 37.2C. when T<=37.2 relay goes to ON-state again. summarily, the hysteresis is 0.5C.
    Hope is a good thing, maybe the best of things and no good thing ever dies (The Shawshank Redemption).



  14. #54
    Advanced Member level 5
    Points: 17,084, Level: 31
    Achievements:
    7 years registered

    Join Date
    Nov 2012
    Posts
    3,128
    Helped
    772 / 772
    Points
    17,084
    Level
    31

    Re: how to design a thermostat without Microcontroller?

    yes you're right. but after doing some researches & simulations...
    Good.

    Now you also need to provide some "margins" for the settings. As you have given an exact value for the set temp (37.7C) can I assume that it can be 37.7+/- 0.1C?

    So the relay gets off at 37.7+/- 0.1C and it again turns on 37.2+/-0.1C, right?

    I assume that the environment is cooler than 37C so that only need an heater to keep the temp.

    I see that you are using an LM35 as the temp sensor. It is good, cheap and simple. But it does not provide 0.1C accuracy. According to the datasheet, it is around 0.5C.

    It just means that if you set the temp at 37.7C, it can be anything from 37.2 to 38.2C (with 99% confidence).

    I see that you are using a LM358 as the comparator. It is a good and classic way you have made this circuit.

    Now I do not see how you are setting the temp (obviously by RV1 but how do you ensure that the temp is the correct setting?).

    I do not see (or understand) how you are controlling the hysteresis?



  15. #55
    Member level 5
    Points: 881, Level: 6
    Dr_Mohammad's Avatar
    Join Date
    Nov 2016
    Location
    Khorramabad, Iran
    Posts
    90
    Helped
    0 / 0
    Points
    881
    Level
    6

    Re: how to design a thermostat without Microcontroller?

    Quote Originally Posted by c_mitra View Post
    Good.

    Now you also need to provide some "margins" for the settings. As you have given an exact value for the set temp (37.7C) can I assume that it can be 37.7+/- 0.1C?

    So the relay gets off at 37.7+/- 0.1C and it again turns on 37.2+/-0.1C, right?

    I assume that the environment is cooler than 37C so that only need an heater to keep the temp.

    I see that you are using an LM35 as the temp sensor. It is good, cheap and simple. But it does not provide 0.1C accuracy. According to the datasheet, it is around 0.5C.

    It just means that if you set the temp at 37.7C, it can be anything from 37.2 to 38.2C (with 99% confidence).

    I see that you are using a LM358 as the comparator. It is a good and classic way you have made this circuit.

    Now I do not see how you are setting the temp (obviously by RV1 but how do you ensure that the temp is the correct setting?).

    I do not see (or understand) how you are controlling the hysteresis?
    thanks for your attention.
    I answer your questions one after another. I mark my answers by *.

    As you have given an exact value for the set temp (37.7C) can I assume that it can be 37.7+/- 0.1C? So the relay gets off at 37.7+/- 0.1C and it again turns on 37.2+/-0.1C, right?

    *yes.

    I assume that the environment is cooler than 37C so that only need an heater to keep the temp.

    *yes. the environment temperature is cooler than incubator's temperature.

    I see that you are using an LM35 as the temp sensor. It is good, cheap and simple. But it does not provide 0.1C accuracy. According to the datasheet, it is around 0.5C.

    *if you have any suggestion for substituting LM35 in this circuit, I will do it. the temperature should kept 37.7C. maximum 38 is acceptable too but it is a risk.

    Now I do not see how you are setting the temp (obviously by RV1 but how do you ensure that the temp is the correct setting?).

    *the temperature is set by rotating RV1 with a screwdriver. to set the temperature by RV1 I wait till the incubator's temperature reaches to around 37C and the I turn the RV1 so that the relay goes to OFF state.

    I do not see (or understand) how you are controlling the hysteresis?

    *the biggest and annoying part of this circuit is that it has not a hysteresis mechanism. more so for this reason I posted this thread. when the temperature reaches to around 37C, the relay frequently switches the heating source ON & OFF and it nerves me.

    thanks a lot.
    Hope is a good thing, maybe the best of things and no good thing ever dies (The Shawshank Redemption).



  16. #56
    Advanced Member level 4
    Points: 6,247, Level: 18
    kripacharya's Avatar
    Join Date
    Dec 2012
    Location
    New Delhi
    Posts
    1,209
    Helped
    182 / 182
    Points
    6,247
    Level
    18

    Re: how to design a thermostat without Microcontroller?

    Depending on the physical setup an location of temp sensor vis-a-vis heating element, there will actually be a substantial hysteresis already in-built. The challenge is actually on how to minimise this hysteresis if you want to achieve tight temp. control.



    •   AltAdvertisement

        
       

  17. #57
    Advanced Member level 5
    Points: 17,084, Level: 31
    Achievements:
    7 years registered

    Join Date
    Nov 2012
    Posts
    3,128
    Helped
    772 / 772
    Points
    17,084
    Level
    31

    Re: how to design a thermostat without Microcontroller?

    Please refer to the diagram in post 49.

    As per the datasheet, the output of the sensor is 10mV /C; hence to get an accuracy of 0.1C, the reference voltage must be stable to 1mV. The datasheet also says that the sensor is accurate to +/-0.5C. So the reference stability is important.

    As you are using a simple voltage divider for the reference voltage, the power supply voltage must be very stable; 5V supply must have very little noise (less than 10-20mV). Better to use a zener and use that for reference.

    As the relay is driven from the same supply, the noise in the power supply cannot be fully eliminated. You need to use capacitors to filter the noise.

    My suggestion: use a regulator to get the 5V to the circuit; power the relay from the unregulated but filtered supply.

    Put the reference voltage to the non-inverting input. Calculate the voltage divider to get 370mV and use a trimmer (low noise) to calibrate (+/- 2C).

    To introduce some hysteresis, use another voltage divider to connect the output to the non-inverting input so that when the output is high (say 4V) the reference voltage is lifted by 10mV.

    Use a small capacitor to filter noise and prevent the relay from chattering.



  18. #58
    Super Moderator
    Points: 259,331, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    45,280
    Helped
    13774 / 13774
    Points
    259,331
    Level
    100

    Re: how to design a thermostat without Microcontroller?

    Depending on the physical setup an location of temp sensor vis-a-vis heating element, there will actually be a substantial hysteresis already in-built.
    The temperature differences observed with an on-off or "bang-bang" controller due to process transfer function are not hysteresis, but they are unavoidable, see discussion in post #7. The OP seems to accept these effects by requiring a controller with 0.7 or 1K hysteresis. I believe it's more instructive to realize the concept than to continue endless discussions about the dos and don'ts.

    Knowing that the final temperature band will be considerably larger than the controller hysteresis may lead you to the decision to implement only minimal (e.g. 0.1 K) hysteresis, just sufficient to prevent relays chatter. But that's also one of the lessons to learn with the project.

    I see a confusion between accuracy and resolution. LM35 has specified 0.5 K accuracy, but the resolution and repeatability is much better. As long as you don't rely on it's absolute temperature reading, it's perfectly suited for the planned temperature controller.

    Regarding hysteresis setting, the calculation has been explained in this thread three days ago, just go to implement it.



  19. #59
    Member level 5
    Points: 881, Level: 6
    Dr_Mohammad's Avatar
    Join Date
    Nov 2016
    Location
    Khorramabad, Iran
    Posts
    90
    Helped
    0 / 0
    Points
    881
    Level
    6

    Re: how to design a thermostat without Microcontroller?

    Quote Originally Posted by c_mitra View Post
    Please refer to the diagram in post 49.

    As per the datasheet, the output of the sensor is 10mV /C; hence to get an accuracy of 0.1C, the reference voltage must be stable to 1mV. The datasheet also says that the sensor is accurate to +/-0.5C. So the reference stability is important.

    As you are using a simple voltage divider for the reference voltage, the power supply voltage must be very stable; 5V supply must have very little noise (less than 10-20mV). Better to use a zener and use that for reference.

    As the relay is driven from the same supply, the noise in the power supply cannot be fully eliminated. You need to use capacitors to filter the noise.

    My suggestion: use a regulator to get the 5V to the circuit; power the relay from the unregulated but filtered supply.

    Put the reference voltage to the non-inverting input. Calculate the voltage divider to get 370mV and use a trimmer (low noise) to calibrate (+/- 2C).

    To introduce some hysteresis, use another voltage divider to connect the output to the non-inverting input so that when the output is high (say 4V) the reference voltage is lifted by 10mV.

    Use a small capacitor to filter noise and prevent the relay from chattering.
    Special thanks to you for valuable concerns. but I have still some questions.

    for power supply, I used full-wave rectifier with 470uf capacitor which a 7805 Regulator fixes the output voltage to 5V. But where the Zener should be connected? what are it's specifications? (voltage and type and ...).

    do you mean I connect the output of LM35 to non-inverting input of LM358? and where did 370mv come from?

    to introduce 0.5C hysteresis, what are the value of the voltage divider's resistors? (feedback)

    finally, you said use a small capacitor for preventing relay from chattering; so where that capacitor should be connected? what is its capacity?
    thanks too much.
    Hope is a good thing, maybe the best of things and no good thing ever dies (The Shawshank Redemption).



  20. #60
    Advanced Member level 5
    Points: 17,084, Level: 31
    Achievements:
    7 years registered

    Join Date
    Nov 2012
    Posts
    3,128
    Helped
    772 / 772
    Points
    17,084
    Level
    31

    Re: how to design a thermostat without Microcontroller?

    for power supply, I used full-wave rectifier with 470uf capacitor which a 7805 Regulator fixes the output voltage to 5V. But where the Zener should be connected? what are it's specifications? (voltage and type and ...).
    Also use ceramic capacitors close to the input and output pins of the regulator (also a 10uF tantalum capacitor to the output); the output of 7805 is unlikely to be exactly 5V.

    Also use a diode in series with the input pin of the regulator. Run the relay with the unregulated source (input pin of the regulator).

    For the time being, you can forget the zener. Use another ceramic capacitor close to the power pin of the comparator.

    do you mean I connect the output of LM35 to non-inverting input of LM358? and where did 370mv come from?
    Yes; but this will invert the output. 370mV comes from 37C will correspond to 370mV of the sensor output. With R1 as 100K, use a fixed resistor of 6.8K in series with a 2K trimpot to adjust fine range. This will also take care of the small variations of the 5V supply. You can use the trimpot to adjust the voltage at 377mV.

    To introduce the hysteresis, you connect one resistor 2.2M from the output to the non-inverting input. When the output is 4V (approx) this will add about 10mV to the input (370mV +10mV=380mV). When the output is zero, this will add zero.

    Also add one 0.01uF ceramic cap to the output (other end to the ground)- this will filter out some noise.

    You have another free opamp on the same IC; use the spare one to make one unity gain inverting buffer and again use another 0.01uF capacitor as a high pass filter. That can be used to drive the transistor.

    Use another 0.1uF capacitor in parallel with the diode across the relay coil. That may help the regulator from voltage spikes.

    By the way, incubators also need a source of moisture (you need to put some wet newsprint in the box).

    See http://www.ti.com/lit/ds/symlink/lm50.pdf which was mentioned in an earlier post (page 11).



--[[ ]]--