Help thermostat opamp with lm35

Thread Starter

joerack

Joined Jun 2, 2016
30
Hello, I thought about opening a new thread as this is slightly different

I'm still trying to build a thermostat with an opamp and a lm35

It works perfectly as a thermostat wih 123dcircuits, but I cannot for the life of me, build the physical circuit, I'm getting simply the same voltage with and without the LM35, the opamp is simply not doing it's job.

Somebody is saying that a lm741 is not advisable, and that I need a single voltage opamp, could you please shed some light on this
 

Attachments

wayneh

Joined Sep 9, 2010
17,498
If you read the data sheet for the 741, you'll find that it cannot sense voltages that fall within a couple volts of either power rail. Your simulator may be using an ideal op-amp rather than a real model of the 741. The signal from your LM35 is too close to ground, so the 741 cannot use it. An LM358 (and many other op-amps) can sense to very near the negative rail and would work in this circuit.

Better yet, learn about the LM393 comparator. You're using an op-amp configured as a comparator. A purpose-built comparator does a better job, although an op-amp is fine for this application.
 

dl324

Joined Mar 30, 2015
16,943
I have a lm324, would that solve my problem?
If you check the datasheet you'll see that the input common mode voltage range includes 0V.

Do everyone a favor and post a schematic so it'll be easier to follow your circuit. I see an opamp being used as an amplifier, not a comparator.
 
Last edited:

shteii01

Joined Feb 19, 2010
4,644
If you read the data sheet for the 741, you'll find that it cannot sense voltages that fall within a couple volts of either power rail. Your simulator may be using an ideal op-amp rather than a real model of the 741. The signal from your LM35 is too close to ground, so the 741 cannot use it. An LM358 (and many other op-amps) can sense to very near the negative rail and would work in this circuit.

Better yet, learn about the LM393 comparator. You're using an op-amp configured as a comparator. A purpose-built comparator does a better job, although an op-amp is fine for this application.
Like you say, if they are using 741, they could provide -9 volts to power the other rail of 741. That way they can get withing the 0 volts provided by LM35.
 

wayneh

Joined Sep 9, 2010
17,498
Like you say, if they are using 741, they could provide -9 volts to power the other rail of 741. That way they can get withing the 0 volts provided by LM35.
Yes, and a common trick for doing that is to just use another 9V cell.
But the LM324 should work as-is.
 

shteii01

Joined Feb 19, 2010
4,644
Yes, and a common trick for doing that is to just use another 9V cell.
But the LM324 should work as-is.
I completely agree.
It is simply a question of what OP has near by and their knowledge/experience. I have 4 pack of 9 volts batteries near by so I would probably grab another battery. I got some op amps, but they are further away and will need more work to setup.
 

Thread Starter

joerack

Joined Jun 2, 2016
30
Is this good enough?

I've just started studying comparators, so I really don't know how to add a schmitt's trigger to this circuit
 

Attachments

wayneh

Joined Sep 9, 2010
17,498
I think it would be best to step back and define what you want your circuit to do. I read "thermostat" as an on/off switch, but the circuits shown are not really configured that way. And I don't see any load being switched.

If you want to amplify the LM35 output before feeding that to a thermostat, that's fine, but it requires a different circuit.

I posted a completed project that, while overkill, might help you see how to use the LM35 in a thermostat.
 

Thread Starter

joerack

Joined Jun 2, 2016
30
I would need a temperature alarm circuit that starts with a lm35, amplifies with an opamp and increases the voltage enough to make a 9/12v fan spin when the temperature of the place to be controlled exceeds a set level.

I can do it with arduino instead of the opamp, easy enough, but I would like to implement it without coding.

I'm thinking that even if the opamp were to do it's job, i would need at least 90/100% of the power to make the fan spin
Probably it would be best to keep a lower threshold and use a relay
 

shteii01

Joined Feb 19, 2010
4,644
I would need a temperature alarm circuit that starts with a lm35, amplifies with an opamp and increases the voltage enough to make a 9/12v fan spin when the temperature of the place to be controlled exceeds a set level.

I can do it with arduino instead of the opamp, easy enough, but I would like to implement it without coding.

I'm thinking that even if the opamp were to do it's job, i would need at least 90/100% of the power to make the fan spin
Probably it would be best to keep a lower threshold and use a relay
Question 1.
The fan spins only when one temperature is detected? Meaning that when temperature is X, fan is on. When temperature is below X, the fan is off.

Question 2.
When the fan is on, the fan runs at a single speed. You are not doing that whole variable speed thing. Right?
 

wayneh

Joined Sep 9, 2010
17,498
And even if you want variable speed, the better way to do it is with PWM. Just like turning it on and off once like a thermostat, doing PWM switches power to the fan via a MOSFET switch.
You don't need to amplify the LM35 signal if you're doing a thermostat, and need a range of a couple degrees. An op amp or comparator will do fine by itself. If you want tighter control, down to 0.1 degrees or so, then you'll need to amplify the signal first with an op amp.
 

Thread Starter

joerack

Joined Jun 2, 2016
30
this project looks like a very good attempt. I tried in building it with the lm324 as suggested, but the same issue appeared.
probably the lm324 cannot detect the very low lm35 voltage
what if I were to change the lm324 with a lm311

And one more thing: is there a way to simplify the circuit? like removing the transistor on the second opmamp's histeresis feedback?
 

Attachments

shteii01

Joined Feb 19, 2010
4,644
this project looks like a very good attempt. I tried in building it with the lm324 as suggested, but the same issue appeared.
probably the lm324 cannot detect the very low lm35 voltage
what if I were to change the lm324 with a lm311

And one more thing: is there a way to simplify the circuit? like removing the transistor on the second opmamp's histeresis feedback?
Assuming room temperature (25°C), the output of LM35 will be 250 mV or 0.25 volts.
It seems to me that you either have something fried or you are doing something wrong.
 
Top