Circuits / Sensors
Temperature alarm with an LM35 and a comparator
The LM35 gives 10 mV per °C; the comparator releases its output when that voltage passes the reference from the divider (about 42 °C, give or take 4 °C with 5 % resistors) and the LED lights

Tap a part to see its voltages and currents. It is a model, not a measurement.
What do you need?
- Resistor 10 kΩAliExpress Amazon
- Resistor 910 ΩAliExpress Amazon
- Temperature sensor LM35DZAliExpress Amazon
- Integrated circuit LM393AliExpress Amazon
- Resistor 1 kΩAliExpress Amazon
- Red LEDAliExpress Amazon
- Jumper wires × 12AliExpress Amazon
- BreadboardAliExpress Amazon
The AliExpress links are affiliate links: if you buy through them ohmio.dev gets a commission, at no extra cost to you. Affiliate links
This page is a guide: the numbers come from a simulation, and real parts vary. Check your parts before you power the circuit. Safety and responsibility
How does an LM35 trigger a temperature alarm?
The LM35 gives 10 mV for each degree Celsius, so 250 mV at 25 °C. A divider of R1 (10 kΩ) and R2 (910 Ω) makes a fixed reference of 0.418 V, about 42 °C, and an LM393 compares the two. While the sensor is below the reference, the comparator's output pulls down to 0.28 V, the LED stays off and 4.7 mA flows through R3 (1 kΩ) into the output. At 42 °C the sensor reaches 0.420 V, the output is released and the LED takes 3.4 mA. In the model the switch happens between 41 and 42 °C. Resistors with 5 % tolerance move the reference, so a real alarm can sit about 4 °C above or below 42 °C. Measure the reference with a multimeter: every 10 mV is one degree, and R2 moves it.
Values from the Protoboard ISO simulation: a model, not a bench measurement.
Hear about the next circuit
One email when a new circuit is out, about twice a month. Nothing else.