Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] how to design a thermostat without Microcontroller?

Status
Not open for further replies.
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

:thumbsup: 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.
 

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
 

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.
 

Hi,

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

Klaus
 

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
 

Hi,

next step: the according voltages...

Klaus
 

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.
 

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

uc5u_thermo.png
 

Hi,

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

Klaus
 

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.
 

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 37°C and the accuracy is not too important. I want when the temperature reaches to 37°C the light bulb be turned OFF and once the temperature goes below 37°C 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.
 

Hi,

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

Klaus

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

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

- - - Updated - - -

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 37°C and the accuracy is not too important. I want when the temperature reaches to 37°C the light bulb be turned OFF and once the temperature goes below 37°C 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.7°C. 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.8°C. since I want to modify the uploaded thermostat so that has a hysteresis and therefore the temperature remains fixed between 37.2 and 37.7°C.

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

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?
 

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.
 

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.
 

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.
 

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.
 

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.
 

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 https://www.ti.com/lit/ds/symlink/lm50.pdf which was mentioned in an earlier post (page 11).
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top