Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Need help with temperature controller

Status
Not open for further replies.

jjsoong

New Member
Hi everyone,
I have built a temperature controller. However, I wish to add some time delay for the relay to trigger off.As when the temperature drop to the boarder line, the relay will turn on and off in high speed.
So,what should I do to make 10 secs of time delay,so the temperature will be more "stable"

Attachment is my circuit design
 

Attachments

  • lab..jpg
    lab..jpg
    171 KB · Views: 237
Hi everyone,
I have built a temperature controller. However, I wish to add some time delay for the relay to trigger off.As when the temperature drop to the boarder line, the relay will turn on and off in high speed.
So,what should I do to make 10 secs of time delay,so the temperature will be more "stable"

Attachment is my circuit design

hi,
R4 the 4.7meg hysteresis resistor is too high a value, try a 100K thru 1meg.
 
hi,
R4 the 4.7meg hysteresis resistor is too high a value, try a 100K thru 1meg.

There is a resistor missing at the non-inverting input of opamp U1B. The required hysteresis is normally derived across a voltage divider. The bottom leg of the divider is missing.
 
@Mike...
I screenshot the wrong file

@ericgibbs
I will try to replace 4.7Mohms resistor to 100k tomorrow,but I have try with 1Mohms...it doesnt like it(it wont trigger off the relay even when the temperature different for 2 degree celcius)
 

Attachments

  • screenshot..JPG
    screenshot..JPG
    75.2 KB · Views: 193
Just out of curiosity, are you trying to make this a variable temperature control?

If you want an easy way to keep the relay's coil energized, you could use a 555 timer.
 
@Mike...
I screenshot the wrong file

@ericgibbs
I will try to replace 4.7Mohms resistor to 100k tomorrow,but I have try with 1Mohms...it doesnt like it(it wont trigger off the relay even when the temperature different for 2 degree celcius)

There is a lot wrong with this circuit. There is no value of R4 that will fix it.

The root cause of your problem is how you are supplying power to the opamp. The current that flows through R3 (~10mA) also flows through R1. The drop across R1 causes the voltage out of the LM35 to jump as the opamp switches, causing the instability in the relay.

I do not understand why R1 and D2 are there. They are not needed.

I do not understand what D5 and D6 are supposed to be doing, except causing the output from the LM35 to be erratic.

I do not understand the function of U1A; it is not needed.

U2 should be set up as a 5V reference with respect to ground, and used to regulate the voltage for the setting pot as well as the LM35. Only a single opamp is needed. The hysteresis around that opamp should be about 0.5% of the output swing.
 
Here is what I cobbled up. I think it fixes all the problems. Note that everything that matters is powered off the TL431 (~5V). I varied the supply voltage from 10V to 15V with no detectable change in the trip point. Note the tricky way the hysteresis is determined. The voltage at V(B) is clamped by the Vbe of the NPN transistor, and that is what determines the amount of positive feedback. Doing it this way makes it independent of supply voltage.

By varying R8 from 0Ω to 10K, the temperature set point changes from 0degC to 50degC.
Relay picks-up on Temp rise; if you need it the other way, use another transistor as an inverter, or just wire the load to the normally-closed contact on the relay.
 

Attachments

  • LM35thermostat.png
    LM35thermostat.png
    45 KB · Views: 199
@Mike,
Is there any simple way to just modify the value for the resistor of my circuit instead of modify the whole layout of the board?
 
@Mike,
Is there any simple way to just modify the value for the resistor of my circuit instead of modify the whole layout of the board?

hi,
Repost the correct/latest screen capture of your circuit.
 
hi Mike,
I do not understand what D5 and D6 are supposed to be doing, except causing the output from the LM35 to be erratic.
The basic LM35 works over a tempr range of +2C thru +150C, by adding the diodes the working range becomes -55C thru +150C.
AAesp02..gif
The 18K shown in the App is required, the OP is not showing this resistor. The Vout is then taken across the LM35.

Ref LM35 App.

The circuit shown in your LTsim will not work below +2C.


hi jjsoong.
Please state the temperature range and required temperature switching pints.
 
Last edited:
As I said above,

 
As I said above,

I saw and understood that, the comment was mainly for the benefit of the OP.

I was trying to explain the function of the two diodes that you had queried.

Again we are both in the dark regarding the temperature/range the OP is actually trying to achieve.;)
 
well,I need to set the temperature as low as 5 degree celcius..

however,ericgibbs,I have changed the resistor to as low as 470kohms.

but it still trigger on and off frequently when the temperature reach the borderline..
 
well,I need to set the temperature as low as 5 degree celcius..

however,ericgibbs,I have changed the resistor to as low as 470kohms.

but it still trigger on and off frequently when the temperature reach the borderline..

hi,
As the required temperature is +5C Mikes circuit will be just fine.
What degree of hysteresis do you require on the +5C.?

If you would rather modify your circuit, let us know.
 
Hi there,


The two diodes D5 and D6 are there to provide a pseudo minus supply voltage for the LM358. Without a negative supply the output of the op amp can not reach down as low as 0.000 volts, but may only make it down to 0.050 volts or so. Since the output of the LM35 is about 10mv per degree C, at 5 deg C the output will be 50mv which is already as high as the op amp output could reach without a minus supply voltage and without any hysteresis. With the minus supply voltage provided by the two diodes, the op amp pin 1 output can reach down below zero volts which means it can be adjusted as low as needed even with the added hysteresis, which of course means pin 1 has to go even lower (about 33mv) in order to adjust for 5 deg C.
The secondary effect is that the op amp output at pin 7 can also go lower than zero volts which provides a little better hysteresis.
With the output at pin 1 adjusted for a trip point of 5 deg C, after the trip occurs the temperature would have to drop to about 3 degrees C in order to turn the relay off again. That's only 2 deg C of hysteresis which may or may not be enough for the app itself, as well as probably not enough to get past the effects of noise from the relay when it switches.
One fix for this may work that is not too hard to do, depending on how bad the environmental noise is. Right now the circuit has only DC hysteresis which works ok most of the time, but for these tight settings we may have to add some AC hysteresis too and that may help a lot. The simplest way to do this would be to connect a capacitor of 100uf in series with a 10k resistor, then connect that series combo right across the 4.7M resistor with (+) terminal of the cap at pin 7 of the op amp. The cap will charge up to around 8v, then when pin 7 goes low it will pull pin 5 down very very low which will keep pin 7 low regardless what the LM35 does after that (such as it's reaction to the relay noise). The cap will discharge after some 1 to 5 seconds which will allow
the op amp to be ready for the next time the LM35 output goes lower and trips the lower set point. Once that happens, the output will again go high which will force a rather high voltage at pin 5 which will keep the output at pin 7 high for that same time period of 1 to 5 seconds, after which it will again allow normal operation.
Note that this is something to try and cant be guaranteed that it will work because it depends on the other noise factors too.
A second additional fix may come from filtering the output of the LM35 with a 75 ohm resistor in series with a 1uf cap with the cap to ground and 75 ohm connected to the output of the LM35. That will help reduce noise transients from the output of the LM35 when the relay switches.

What else we need to know however is what the TWO trip points are, not just the one.
We need to know what temperature the relay is to turn on and what temperature it is to turn off.

Often a "window" comparator is best for these temperature applications because it allows us to adjust the upper trip point and the lower trip point independently of each other, and thus gives complete control over set point and hysteresis. That would require several circuit changes too however.
 
Last edited:
Mr Al:
Your signature:
"One test is worth a thousand expert opinions, but one expert specification is worth a thousand tests."

Is 1,000% true. Loved it!
 
Mr Al,

The LM358 output will swing within a few mV of its Vss pin (ground), which is not even a requirement for my circuit. It has an input common-mode range which includes ground (actually up to 0.5V below ground), so the circuit I posted will work from 0 degC on up... It will work with a tiny (~2mV) of hysteresis, which is only about (o.2degC). I specifically tried to make it as bulletproof with respect to the relay switching transients (note the source of the positive feedback) as possible by referencing everything in the circuit to Gnd (not Vdd like in the OP's circuit). I'm relying on the LM358's PSRR so that its supply voltage does not have to be regulated. I notice that I forgot to show a bypass cap across its Vdd/Vss pins.
 
Last edited:
with 470kohms,
the relay is no longer trigger so often...however, I am trying to avoid my relay get burst by any chance...
so, a degree of different would be more than enough for my circuit.

I will try one thing,
when I power on my circuit,I will try to make phone call to check if the environment noise is a big issue for my circuit or not.
 
Mr Al:
Your signature:
"One test is worth a thousand expert opinions, but one expert specification is worth a thousand tests."

Is 1,000% true. Loved it!


He he :) That first part is a commonly known technical saying, but i added the second part
myself because i didnt feel it was complete without it.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top