Step 1: Introduction about the Analog Temperature Sensor
The LM35 series are precision integrated-circuit temperature devices with an output voltage linearly proportional to the Centigrade temperature. LM35 is a three-terminal linear temperature sensor from National Semiconductor. It can measure temperature from -55 degree Celsius to +150 degree Celsius. The voltage output of the LM35 increases 10mV per degree Celsius rise in temperature. LM35 can be operated from a 5V supply and the stand by current is less than 60uA. The pin out of LM35 is shown in the figure below.
Features:
- Calibrated directly in Celsius (Centigrade)
- Linear + 10-mV/°C scale factor
- 0.5°C ensured accuracy (at 25°C)
- Rated for full −55°C to 150°C range
- Suitable for remote applications
- Low-cost due to wafer-level trimming
- Operates from 4 V to 30 V
- Less than 60-μA current drain
- Low self-heating, 0.08°C in still air
- Non-linearity only ±¼°C typical
- Low-impedance output, 0.1 Ω for 1-mA load
You can download the datasheet from the below file.
Step 2: Hardware Required and Circuit Diagram
- Arduino board (any)
- LM35 sensor
- Breadboard
Step 3: Connection to be done
🛠️ เจาะลึกเบื้องหลังการทำงาน (Deep Dive / Technical Analysis)
A digital DHT11 sensor hides all the electrical physics inside a microchip. The Monitoring Temperature Using a Temperature Sensor project using a physical TMP36 Analog Temp Sensor (or a generic 10k Thermistor) forces the programmer to learn the absolute mathematical fundamentals of Analog-to-Digital Conversion (ADC) and Voltage Mapping to measure raw environmental heat!
The Analogue ADC Voltage Trap (Math Mapping)
The TMP36 sensor is a tiny black transistor-looking chip with 3 legs (5V, Data, GND).
- As the room gets hotter, the physical silicon inside it allows mathematically more voltage to flow across the Data leg!
- The Arduino Uno’s
analogRead(A0)function reads this voltage. - The ADC Raw Integers: It does NOT output
32 Degrees. It outputs a massive integer block exactly mapped from0 Volts = 0up to5 Volts = 1023. - The C++ code must aggressively calculate the TRUE Voltage first!
int sensorVal = analogRead(A0);
float voltage = (sensorVal / 1024.0) * 5.0; // Converts 0-1023 instantly back to exactly 2.5V!
Calculating Celsius from Resistance
Because every analog sensor is built differently, the programmer must read the physical hardware datasheet!
- The TMP36 datasheet explicitly states: Every 10 Millivolts (0.01V) is exactly 1 degree Celsius. The offset starts critically at 0.5 Volts.
- The Execution Formula:
float tempC = (voltage - 0.5) * 100; // Subtract the 0.5V offset, multiply by 100!
float tempF = (tempC * 9.0 / 5.0) + 32.0; // The standard Fahrenheit physics conversion!
- The code then simply prints the exact, floating-point decimal calculation into the Arduino IDE
Serial Monitor! This is the absolute foundation for every HVAC system on Earth!
Basic Thermal Data Needs
- Arduino Uno/Nano (Standard execution speeds are perfectly sufficient).
- TMP36 Analog Temperature Sensor (Ensure you plug the 5V and GND legs in correctly. If backward, the tiny plastic chip will physically melt instantly!).
- Generic Breadboard & 3 Jumper Wires (The simplest, purest circuit required).