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

Hi Mike,


Oh really? Well i havent been able to get one to go perfectly to ground yet and the spice
model doesnt either. Another trick that sometimes worked was to put a diode in series
with the output to drop some voltage, when it is possible of course in the app.
Also, for some values of feedback (hysteresis) resistor the output of that op amp will have
to swing negative, not just to 0.000v, so it's not a bad idea i think to use the two diodes.
I've used one diode for this same purpose too in the past because even 0.6v gets you
there, allowing close to -0.65v output without the bother of having to add another power
supply rail that is negative.
 
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.

Hi again,

Ok, but did you check to see that you got your set points working ok too?
I still didnt see you mention the TWO set points i asked about, did you post them already?
We really need to know this information for best results.
You should tell us your required turn on point and your turn off point (degrees C).
 
Ok...
I set the turn off point when the degree drop less than 5 degree celcius.
and the relay will trigger off,so the temperature shall rise again.. when the temperature is over 5 degree again,the relay will trigger on to cool the temperature down
 
Hello again,


Ok, but you can not have it turn 'on' at exactly 5 deg C and 'off' at exactly 5 deg C, so what you have to do is define TWO points instead of that one point in order to design (or mod) a circuit to control temperature.

What you have to do is decide what you need for this application, say turn off at 5 deg and back on at 10 degrees, or something like that. If you choose a range too low like 5 and 6 deg it might be hard to get it to work right, so go as high as you can with the second point.

If you let us know what two points you would like to use, we can recommend more ideas or mods.
 
Last edited:
off at 5
on at 8

I know it takes some time to go up to 6...because I am cooling the water..and the problem which I facing is when the border line...
for example
5.0001 on
4.9999 off...

thats why the relay keep trigger on and off rapidly...

other than that,it is fine as I dont need a very precise temperature controller.
 
off at 5
on at 8

I know it takes some time to go up to 6...because I am cooling the water..and the problem which I facing is when the border line...
for example
5.0001 on
4.9999 off...

thats why the relay keep trigger on and off rapidly...

other than that,it is fine as I dont need a very precise temperature controller.

hi,
Have you decided which circuit you plan to use, ie: Mike's or yours extensively modified.?:)
To get the 5/8C Off/On is easy to achieve.
 
Hello again,


Here are the two equations that describe your current circuit values:

R4=((Vs1-Vs2+Vb-Va)*R5)/(Va-Vb)
Vo=((-Vs1+Va)*R5+Va*R4)/R4

where

Va is the voltage that will appear out of the LM35 with your first set point (upper, 8 degrees),
Vb is the voltage that will appear out of the LM35 with your second set point (lower, 5 degrees),
Vs1 is the upper source voltage,
Vs2 is the lower source voltage,
Vo is the output setting of the top op amp,
R5 is of course R5 in your schematic,
R4 is R4 in your schematic.

Since your upper set point is at 8 deg and the LM35 response is 8*0.010, the upper set point voltage Va is equal to 0.080 volts.
Similarly, the lower set point is 5*0.010 so the lower set point voltage Vb is 0.050 volts.
Vs1 is the source supply voltage after the drops from the transistor and diode and LED, so we'll start with an estimate of 8 volts.
Vs2 is the negative supply voltage which due to two diodes in series is about 1.4v, but it's negative so Vs2 is equal to -1.4 volts.
R5 is of course 10k but we'll work in units of k ohms so R5 is equal to 10.

Plugging all these into the two equations we get:
R4=((Vs1-Vs2+Vb-Va)*R5)/(Va-Vb)
R4=((8 - (-1.4)+0.050-0.080)*10)/(0.080-0.050)
and doing the math we get:
R4=3123.33333333333
which is in k ohms, so R4 is approx equal to 3123k.

The op amp output set point is:
Vo=((-Vs1+Va)*R5+Va*R4)/R4
Vo=((-8+0.080)*10+0.080*3123.3333)/3123.3333
so doing the math we get:
Vo=0.05464 approximately.

This means R4 will have to be 3123k ohms and the output of the op amp will have to be adjusted to approx 55mv.

This was using the approximations of 8v and -1.4v for the two source voltages, so if they are not that (you can measure them first and do the calculations over again if you like) you will have to redo the calculations and find the new value of R4.

Also, if noise is still a problem (and it most likely will be) you will have to try the other suggestions of adding the caps and resistors (previous post).

If it doesnt work after that it could simply mean that something is not connected properly.
 
Last edited:
@ MrAl,ericgibbs and MikeMl

I believe that I have sort out the problem.

thank you for the great supports...

cheers.
 
Hi again,


That's good to hear...perhaps you can tell us what you had to do to fix it.
If not that's ok too, just thought you might want to share your experience.
I assume you tested the two set points too.
 
Last edited:
Hi again,


That's good to hear...perhaps you can tell us what you had to do to fix it.
If not that's ok too, just thought you might want to share your experience.
I assume you tested the two set points too.

hi AL,
For reference, this image shows the effect upon the LM35 output when the two diodes are connected to the 0V pin of the LM35.
The 2mV/C change in forward voltage of each diode has to be catered for.

This also works on real devices on projects I have built, the LM35 outputs must be taken from the LM35 out pin and at the top of diodes, the 18K is also required.

LM35_diodes1..gif
 
Last edited:
Hi there Eric,


Yes, i am aware of the method used to get the LM35 to output voltages that indicate temperatures below zero as well as above zero by using two bias diodes AND an 18k resistor connected between the output and the minus supply. The thing is though, the circuit is not connected with an 18k resistor in this manner and i dont believe it is needed for his application either so i assumed the schematic was correct. If the original schematic is not correct then i guess that's another matter :)

Also what i thought was cool was the app note that mentioned turning the output into a current, which would allow a long run line between sensor and circuit without adding inaccuracies by the long wire length...Nice.
 
Last edited:
I added a 100nF capacitor across the pin 2 and 3 of the LM35.
It filtered out the noise perfectly.

However,sorry,I dont have time to do test onto the two set points yet(laboratory has closed)
 
Hi there jjsoong,


That's ok, when you get some lab time and you care to report back here that would be nice.
So i guess the noise was prevalent in this system, which is typical with a relay and LM35 as noted earlier. At least we know for sure now :)


Hey Eric, did you by any chance take a look at why they use an 18k resistor in the first place?
Why that value? They seem to be assuming that the two diode drop together is only 0.9v instead
of the more likely 1.3 to 1.4v as two diodes like that normally drop. Any ideas there?
 
Last edited:
Well,I would say the noise is come from LM35 as it picks up environment noise.

However,I will try post it whenever I got the time for it :)

and its 1.4volt for both diodes...lol
 
Hi again,


Ok, then i get 4107k for R4 and adjust Vo=0.0535v.
If conditions are ideal that will mean the set points will be 5 deg and 8 deg.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top