LESSONSensors · Part 2EP.67 · 24 s

LM35: the chip that speaks °C

// WHAT YOU WILL LEARN

OUT = 10 mV per °C (25 °C = 250 mV); on A0: tempC = raw × 500 ÷ 1024.

// LESSON NOTES

Can your Arduino feel the temperature? Meet the LM35 🌡️

1️⃣ 10 mV PER °C: three legs — +5V, OUT, GND (flat face toward you). The OUT leg gives 10 millivolts for every degree Celsius.

2️⃣ REAL NUMBERS: 25 °C → 250 mV. Hot tea at 60 °C → 600 mV. 100 °C → 1 V. You can check it with a multimeter.

3️⃣ ARDUINO CODE: connect OUT to A0, then:
int raw = analogRead(A0);
float tempC = raw * 500.0 / 1024;
Serial.println(tempC);
(5 V ÷ 1024 steps = 4.88 mV per step, and 10 mV = 1 °C → × 500 ÷ 1024.)

📌 10 mV per °C — that's the LM35.

CODE FROM THIS LESSON
int raw = analogRead(A0);
float tempC = raw * 500.0 / 1024;
Serial.println(tempC);
Read the voiceover (transcript)
  1. Can your Arduino feel the temperature?
  2. Meet the LM35. Three legs, and ten millivolts out for every degree.
  3. Twenty-five degrees? Two hundred fifty millivolts. Hot tea at sixty? Six hundred!
  4. Read A zero, times five hundred, divided by ten twenty-four: degrees Celsius!
  5. Ten millivolts per degree!
  6. Next: the LDR! Follow for part three!

Related lessons