The temperature sensor is a device that converts temperature into an output signal based on the characteristics of materials that change with temperature. It is one of the most commonly used sensors. This article introduces the LM35 analog temperature sensor.
1. Introduction to LM35
LM35 is a widely used temperature sensor component that is very easy to connect—requiring only one analog interface, and its output voltage is in degrees Celsius. It uses internal compensation, allowing output to start from 0°C. The operating voltage ranges from 4 to 30V, and the chip itself has almost no heat dissipation issues that affect measurement.
The sensor’s output voltage has a linear relationship with Celsius degrees; at 0°C, the output is 0V, and for every 1°C increase, the output voltage increases by 10mV. We use this relationship to convert the voltage input into the corresponding temperature value.

The LM35 package is as follows, with the model printed face up. From left to right, the pins are: VCC, VOUT, GND.

2. Experimental Materials
-
Uno R3 Development Board
-
USB Data Cable
-
Breadboard and Connecting Wires
-
LM35
3. Experimental Steps
1. Build the circuit according to the schematic.
The connections are very simple; connect the LM35’s VCC, VOUT, and GND to the development board’s 5V, A0, and GND, respectively.
The experimental schematic is shown below:

The physical connection diagram is shown below:

2. Create a sketch, copy the code below to replace the auto-generated code, and save it.
/* * LM35 * Testing the LM35 Analog Temperature Sensor */int potPin = A0;float temperature = 0;long value = 0;
void setup() { Serial.begin(9600); // Set the serial baud rate to 9600}
void loop() { value = analogRead(potPin); // Read the analog input
// Voltage to Celsius conversion: //0.00488125=5/1024, 0~5V corresponds to analog readings 1~1024, every 10mV corresponds to 1°C temperature = (value * 0.0048828125 * 100);
Serial.print("Temper = "); Serial.print(temperature); Serial.println("°C"); delay(500);
}
3. Connect the development board, set the corresponding port number and board type, and download the program.

4. Experimental Phenomenon
Open the serial monitor, set the baud rate to 9600, and the serial will continuously print the temperature values read.

