Simple Temp Sensor Circuit using LM35 IC working principle - Page 1
Forum section: electronics / beginners

author: Lucky-Luka
author_rank: Unknown
timestamp: December 23, 2021, 11:21:30 am
content: Hi allcan anyone tell me how does this circuit work? How is it possible that the green light in ON below a certain temp and the red one is ON above that temp?can it work with just the lower 470 ohm res and the red LED?https://circuits-diy.com/simple-temperature-sensor-circuit-using-lm35-ic/Thanks

author: magic
author_rank: Super Contributor
timestamp: December 23, 2021, 11:34:01 am
content: I don't think it worksLM35 output is ~200mV at room temperature which is too low for µA741 to work. Definitely use LM358 instead.The opamp simply amplifies the signal by some fixed factor.The LEDs circuit is very simple: when opamp output is low, the upper LED turns on. When it's high, the lower. When it's in the middle, both are on at about25%33% of single LED current. Using less supply voltage would reduce that center overlap.editCorrection above and one more thought:It is actually possible to use a µA741 type amplifier as a thermometer in itself. You do it by wiring IN+ to ground (negative supply).If you give it feedback (short IN- to OUT) you get a voltage output which decreases with temperature. It will be near 1.8V and -7mV/°C.If you disconnect feedback and apply a particular voltage to IN-, the opamp will work as thermostat. At low temperature the output will be high, and as the preset temperature is crossed, it will go low.I have tested the trick on 741-style amplifiers in the AD588 IC, but I believe normal µA741 chips should also work. You will need some regulated voltage to apply to IN-, but 78L05 is cheaper than LM35https://www.eevblog.com/forum/metrology/ad588-self-heated-reference-may-be-possible/

author: Lucky-Luka
author_rank: Unknown
timestamp: December 23, 2021, 12:52:21 pm
content: thanks for the reply.You told me what the circuit does. That was clear to me. Why does that behaviour occour?I mean: when the temp is low the output pin of the op amp is connected to gnd at pin 4?What happens if I disconnect the green led? will the red light work at high temp?Thanks

author: magic
author_rank: Super Contributor
timestamp: December 23, 2021, 12:56:19 pm
content: The circuit you linked is a normal noninverting amplifier with gain adjustable by a trimpot.Its output is simply a temperature-varying voltage source. If you disconnect any LED, all else works as usual.At least so long as the current doesn't exceed the opamp's limit (tens of mA).editWait, no. It's connected as comparator.Still, it doesn't matter. The output will be hard low or hard high depending on temperature. Still low impedance. Still doesn't care about the LEDs as long as their current is low enough to drive.You also have a different problem now: the threshold temperature depends on battery voltage. If the battery discharges from 9V to 6V, the threshold decreases from 30°C to 20°C and so onAgain, 78L05 to the rescue. Or better, LM317L wired for 1.2V output. That will last longer.BTW, if this is meant to run on batteries, low power alternatives to standard parts may be preferable.

author: Lucky-Luka
author_rank: Unknown
timestamp: December 23, 2021, 01:14:56 pm
content: yes, this is meant to run on batteries. I thought 1 9V NiMh Battery or 4x1.2V AA NiMh batteries.It will not run 24/7: just some hours every day.I have to check a 50 C temp.

author: magic
author_rank: Super Contributor
timestamp: December 23, 2021, 02:23:31 pm
content: Then grab some CMOS comparator and low power voltage reference.Out of jellybean parts that I have: TS3702/TLC3702, LM385-1.2.No need for 9V and AA/AAA cells will last longer.It may be nice to have some low battery warning - the other half of the comparator could do that.Quote from: magic on December 23, 2021, 11:34:01 amI take this back. That circuit works, using exactly the µA741-thermometer trick I described earlier. IN+ doesn't really need to be at ground, it only needs to be significantly less than 1.8V and LM35 is just a somewhat expensive way of ensuring that IN+ is less than 1.8VThen you set IN- near 1.8V and you have a thermometer

author: Lucky-Luka
author_rank: Unknown
timestamp: December 23, 2021, 02:31:25 pm
content: I have already a LM385 IC and TMP36 sensor.do you think 4.6V (4xAA NiMh) input is ok?How can I arrange a voltage level check using the same IC?

author: magic
author_rank: Super Contributor
timestamp: December 23, 2021, 03:31:28 pm
content: Divide battery voltage with resistors to get 1.25V from 4V battery and compare against the reference.High resistance will minimize power drain in the divider.edit4 freshly charged cells may be too much voltage for that sensor.3 seems perfectly right.

author: Lucky-Luka
author_rank: Unknown
timestamp: December 23, 2021, 06:07:14 pm
content: Don't I need a zener diode too?

author: magic
author_rank: Super Contributor
timestamp: December 24, 2021, 08:18:50 am
content: I don't know. Where and what for?

author: Lucky-Luka
author_rank: Unknown
timestamp: December 24, 2021, 10:05:29 am
content: voltage reference.https://www.electroschematics.com/low-battery-indicator/

author: magic
author_rank: Super Contributor
timestamp: December 24, 2021, 12:03:38 pm
content: I suggested using the same voltage reference as for temperature measurementsQuote from: Lucky-Luka on December 24, 2021, 10:05:29 amFor the record, their suggested opamp doesn't work with its inputs close to the positive rail and PMOS is "P-channel MOSFET" rather than "protected MOSFET"

author: Lucky-Luka
author_rank: Unknown
timestamp: December 24, 2021, 02:36:16 pm
content: Since voltage range of the op amp is 3V to 32V I think it's better to use 4 batteries to use the circuit. TMP36 works between 2.7V and 5.5V (abs max 7V) so there will be no problems.Isn't the reference voltage varying without a zener diode?Can you provide a schematic for your idea?

author: fourfathom
author_rank: Super Contributor
timestamp: December 24, 2021, 04:11:41 pm
content: That opamp is being used as a comparator, not an amplifier. That potentiometer is used to set the temperature threshold, not the amp gain. The opamp output can source and sync current, so it can drive either of the LEDs. But as noted, the '741 opamp doesn't have the input voltage range needed for this circuit to work.

author: wizard69
author_rank: Super Contributor
timestamp: December 24, 2021, 11:13:25 pm
content: More info might help here. It might be easier, well more flexible, to get a cheap microcontroller, with an analog in and program it to do whatever checking you need done. A micro controller might be a better long term play too if your checking requirements expand.One problem with simple analog circuits like this is how would you deal with the comparator flipping back and forth as whatever you are monitoring crosses the 50deg C mark. Adding some programmed hysteresis and a dead band might make such monitoring more livable. Often an indication of inside band and warnings outside, are more useful.Quote from: Lucky-Luka on December 23, 2021, 01:14:56 pm