[SOLVED] how to design a thermostat without Microcontroller?

Status
Not open for further replies.
the calculation of hysteresis resistors is based on the link below: (with Vhysteresis=0.005v then R1=1K&R2=2.2M)
https://www.electronics-tutorials.ws/opamp/op-amp-comparator.html

(sigh)
With your design, you will get a hysteresis of about 1.5mV. It is suggested to try and have hysteresis of about 10mV - i.e. from 372 to 382 mV
This will achieve your target temperature goals as well as provide better immunity to 'noise' conditions.

The main reason a 2.2M/1K gives only 1.5mV is due to following -- the opamp output voltage swing will be approx 0.1v to 3.5v, and not 0v to 5v

In fact, simulations show that optimum feedback resistor pair with your circuit configuration should be 330K/ 1K, which gives 10mV @ 5v supply.
 

Unfortunately we didn't yet see a complete schematic that comprises the various changes and supplements mentioned in the posts, including power supply, voltage regulation, bypass capacitors. I'm not motivated to make guesses based on vague information.

Relay chatter shouldn't happen despite of exact hysteresis amount. There are possible improvements like a low pass filter for the temperature sensor output. Waiting for a valid schematic.
 

Agreed. Complete schematic as well as detailed pics of implementation. I suspect OP might be running wiring of lm35 too close to mains wiring for bulb, or some such issue. 50hz pickup fed to input of opamp will not help.
 

the relay is fed from input pin of 7805 regulator, exactly after diode bridge

@Dr_Mohammad, your above (deleted) post contained exactly the same schematic diagram with the same values posted more than a dozen posts back, despite all the calls to present the circuit diagram or the actual assembly. There was not included the suggested change in resistor values, nor addition of decoupling capacitors here and there. In addition, the last (deleted) circuit did not show the A/C rectifying circuitry of the input voltage fed to the relay, which certainly has considerable ripple on the bus due to insufficient rectification. AGAIN, do not disregard what people said, this thread is unnecessarily wide.
 


Yeah, you are right Mr. Andre.
I´m tied up and tomorrow will share the conclusion. Thanks for your patience, that is very nice of you.
After getting results, the unnecessary parts of the thread will be removed and the final scheme will soon be posted for public usages.
 

Agreed. Complete schematic as well as detailed pics of implementation. I suspect OP might be running wiring of lm35 too close to mains wiring for bulb, or some such issue. 50hz pickup fed to input of opamp will not help.

Today, 330k/1k resistors tested but the chattering still persists. Simulation shows 10mv hysteresis with no chattering but in practice not . It makes me nervous.
 

Today, 330k/1k resistors tested but the chattering still persists
So far you do not seem to have done any more detailed analysis of the physical plant, as was proposed on the first page of this thread where the possibility of a less abrupt control (eg PID) was mentioned; apparently you're just swapping component values to see what comes next. As said before, in practice, your system by itself with its intrinsic thermal capacity do offers you certain range of hysteresis, you could even add bulk metal plates between sensor and envoronment just to provide a way to tun the hysteresis.
Simulation shows 10mv hysteresis with no chattering but in practice not

By the way, you may be lacking familiarity with analog electronics, but at least as I see it, creating a 10mV range in a hysteresis is unfeasible unless you're willing to deal with Relay switching endlessly. In my own oppinion, you will not achieve what you want just with this trial and error approach, this is a waste of time. There are many things to consider as pointed before and you seem to be repeatedly overlooking them.
 


Your words about creating hysteresis are opposite of the experts´ comments in this thread. moreover, Nothing is trial and error approach, Nothing. My room is full of papers which have filled with too many calculations. Please search my name in IEEE to see my papers in all-optical computers which proving my efforts are not based on trial and error approach.
 

Today, 330k/1k resistors tested but the chattering still persists. Simulation shows 10mv hysteresis with no chattering but in practice not . It makes me nervous.

If this is so then source of problem is not visible to us. Hence please post multiple pics of your implementation, as well as accurate updated schematic including all elements.

Maybe we can spot some construction flaw.

Also, how have you done this simulation you speak of?
 

BY Proteus.
here is the new design.

 
Last edited:

The circuit is fine, except for cap at C3 (10u) which I believe should be removed.

From your pics I cannot see the lm35. The wires for lm35 looks suspect, and could be picking up powerline A/C noise. The 3 wires are going off in different directions, so cannot understand what has been done here.

As an experiment try mounting lm35 directly on board.
 

I STILL don’t see any decoupling caps. Probably a third of the posts here tell you to add caps on the opamp power rails, and you keep not doing it.

Another thing to look at is ground routing. You don’t want the return current for the relay mixing with the other ground paths. The emitter of the transistor should go directly to the PS ground.
 

c1 is connected to op-amp power rails.
today I will connect 0.33uf and 0.1uf to input andoutput pins of 7805 Regulator as decoupling Caps. please say their type & capacity too.

- - - Updated - - -




in this picture the LM35 is visible.
 
Last edited:

C1 or a second one in parallel with it should be DIRECTLY across the supply pins of U2 and preferably across the LM35 as well. When dealing with small signal changes you need to be absolutely sure the impedance across the supply pins is as low as possible and also not carrying current elsewhere. Even the few cm of track back to the capacitor is enough to cause problems and they will not show up in a simulation. For sensitive circuits like this you need to be very careful of layout and in particular the differences in voltage created by track resistance and inductance.

I think the underlying problem is the relay wiring though, the current path through the coil is via the transistor collector, transistor emitter and along the wiring back to the power supply. The current difference between relay on and relay off is going to cause a slight voltage drop along the track length and that in turn will cause a shift in the voltages perceived by the op-amp. Try disconnecting the transistor emitter and wiring it (alone) back to the incoming power.

If you want to keep C3, drop it's value to say 100nF and make sure it is wired as close as possible between pins 2 and 4. Then add an isolating resistor of about 4.7K in the voltage from the LM35 but at the U2 end of the wiring.

Brian.
 


excuse me, I did'nt realize where 4.7k resistor should be connected. your Grammar is too native and hard to me to understand. LOL
 
Last edited:

My suggestions are as follows:

1. Put a ceramic cap (0.1uF is sufficient) in parallel with C1.

2. Replace C3 with 0.1uF ceramic cap; also put a resistor in parallel 1K will be fine).

3. Put a 0.1uF ceramic cap in parallel with D1.

3. Put a 0.1uF ceramic cap between pin 4 and 8 very close to U2.

4. Put a 0.1uF ceramic cap between pin 1 and ground of U2.

5. Put one 1K resistor between pin 3 and ground of U2.

6. Configure pin 3 as a regular voltage adder.
 



I pretty much disagree with most of this.

1) C1 should just be replaced with a 0.1.

2) LM35 does not like to drive a capacitive load (I assume that's what U1 is); eliminate C3 altogether.

4) Adding capacitance to the output of an opamp will just make it more unstable. If you want to put it anywhere, put it on the base of Q1.

5) Adding a resistor from pin 3 to ground won't help anything.

6) Voltage adder? What voltages are you adding?
 

excuse me, I did'nt realize where 4.7k resistor should be connected. your Grammar is too native and hard to me to understand. LOL

He means between lm35 output pin and lm358 input pin, but close to lm358 side.

I urge you again to put lm35 directly on board temporarily just for testing purpose, and try then.
 

Mission Complete!

Fistly, I should express my fullest appreciation to @betwixt, @Klaus, @kripacharya,@c_mitra, @barry, @FvM, and @andre_teprom and those who valuable guidlines and patience helped me to get a better results. surely your efforts and patience will not be forgotten.

Dear Experts, after yesterday discussion I applied the following modifications to the circuit and furtunatlly the relay chattering removed and the thermostat works accurately:

1-the emmiter of Transistor connected to the Powe Supply ground.
2-the pararelled capacitor to LM35 removed.
3- an RC network connected as close as to pins 2 and 4 (R=4.7K & C=0.1UF).
4-decoupling capacitors imported to the circuit. 0.47uf & 0.1uf connected to input and output pins of 7805 Regulator, respectively.
5- 0.1uf also pararelled to the relay coil.
6-10uF cpacitore connected to Q1's base.





Excuse me for troublig you. good luck.
your lover, Mohammad Pirzadi from Iran.
 
Last edited:

furtunatlly the relay chattering removed and the thermostat works accurately:

You still need to work on the span control (the hysteresis range) and the temp setting.

In the present case, they are strongly interacting. You should be able to set the actual temp and the hysteresis control independently.

That will involve only a couple of resistors and one more potentiometer.

You are using film capacitors but for this application, ceramic capacitors will be somewhat better.

See the application note for LM35 for more ideas.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…