LM35 Analog Thermometer with Arduino
10 mV per degree Celsius, straight out of a TO-92 — the simplest electronic thermometer you can build.
Difficulty: Breadboard. Estimated build time: about 20 minutes. Estimated parts cost: about US$3.80. 3-line bill of materials. Compare supplier offers when available. A thermometer that reads air temperature in Celsius using the LM35 — a three-pin sensor that outputs an analog voltage proportional to temperature with a 10 mV/°C scale factor and a 0 V offset.
Identify the pinout
TO-92 package, looking at the printed face: pin 1 (left) = +Vs, pin 2 (middle) = OUT, pin 3 (right) = GND. The LM35DZ is rated 4–30 V supply, so 5 V from the Arduino is fine.
Wire it up
Pin 1 → +5 V. Pin 3 → GND. Pin 2 → Arduino A0. Place a 100 nF cap from pin 1 to pin 3 right at the sensor — bypasses noise that would couple into the analog output.
Read the ADC
In Arduino: int raw = analogRead(A0); float v = raw * 5.0 / 1024.0; float tC = v / 0.01; Serial.println(tC); — that's the whole sketch. Print every 500 ms.
Calibrate against a reference
Pinch the sensor between thumb and forefinger and watch the temperature climb to 31–32 °C as your body warms it. Drop it into ice water (with the leads above the waterline) and watch it fall to 0–1 °C. If your reading is consistently 1–2 °C off, your Arduino's 5 V rail is probably actually 4.85 V — the ADC reference is supply-referenced. Measure 5 V with a multimeter and divide that into the math instead of 5.0.
Switch to the 1.1 V internal reference (optional)
For better accuracy below 100 °C, call analogReference(INTERNAL) in setup() — this swaps the ADC reference from 5 V to 1.1 V, multiplying your resolution by ~4.5×. Now the math is T = raw × 1100 / 1024 / 10, and noise drops from 0.5 °C to 0.1 °C. The trade-off: max temperature you can read is now 110 °C (above that the sensor output exceeds AREF and clips).