Summary of Digital Thermometer using PIC Microcontroller and LM35 Temperature Sensor
This article details the construction of a digital thermometer using a PIC Microcontroller and an LM35 temperature sensor. The LM35 provides a linear voltage output proportional to Celsius temperature, eliminating the need for external calibration. The system reads the analog signal via the PIC's ADC, converts it to a digital value, and displays the result on an LCD. The design utilizes a 5V reference voltage for simplicity, though higher precision can be achieved with a dedicated voltage reference IC like the MCP1525.
Parts used in the Digital Thermometer:
- PIC Microcontroller
- LM35 Temperature Sensor
- LCD Display
- MCP1525 IC (Optional for high precision)
Thermometer can be easily constructed using a PIC Microcontroller and LM35 Temperature Sensor. LM35 series is a low cost and precision Integrated Circuit Temperature Sensor whose output voltage is proportional to Centigrade temperature scale. Thus LM35 has an advantage over other temperature sensors calibrated in Kelvin as the users don’t require subtraction of large constant voltage to obtain the required Centigrade temperature. It doesn’t requires any external calibration. It is produced by National Semiconductor and can operate over a -55 °C to 150 °C temperature range. Its output is linearly proportional to Centigrade Temperature Scale and it output changes by 10 mV per °C.
The LM35 Temperature Sensor has Zero offset voltage, which means that the Output = 0V, at 0 °C. Thus for the maximum temperature value (150 °C), the maximum output voltage of the sensor would be 150 * 10 mV = 1.5V. If we use the supply voltage (5V) as the Vref+ for Analog to Digital Conversion (ADC) the resolution will be poor as the input voltage will goes only up to 1.5V and the power supply voltage variations may affects ADC output. So it is better to use a stable low voltage above 1.5 as Vref+. We should supply Negative voltage instead of GND to LM35 for measuring negative Temperatures.
This article only covers the basic working of Digital Thermometer using PIC Microcontroller and LM35, and uses 5V as Vref+. If you want more accurate results it is better to select Vref+ above 2.2V. I suggest you to use MCP1525 IC manufactured by Microchip, which will provide precise output voltage 2.5.
Suggested Readings:
Circuit Diagram

Note: VDD and VSS of the pic microcontroller is not shown in the circuit diagram. VDD should be connected to +5V and VSS to GND.
You can download the complete MikroC Source Code and Proteus files at the bottom of this post. The Analog output voltage of LM35 temperature sensor is given to the Analog Input pin AN0 of the PIC Microcontroller. The result of the 10-bit Analog to Digital (A/D) Conversion is read using the function ADC_Read(0). This 10-bit digital value is then converted to the corresponding voltage by multiplying with 0.4887 (For More Details read: Analog to Digital Converter in PIC Microcontroller). Then the Voltage is converted to corresponding character to Display it in LCD.
For more detail: Digital Thermometer using PIC Microcontroller and LM35 Temperature Sensor
- What is the primary advantage of the LM35 over Kelvin-calibrated sensors?
The LM35 is calibrated in Centigrade, so users do not need to subtract a large constant voltage to get the required temperature reading. - How does the output voltage change relative to temperature?
The output changes by 10 mV per degree Celsius and is linearly proportional to the Centigrade scale. - Can the LM35 measure negative temperatures?
Yes, but you must supply a negative voltage instead of GND to the LM35 to measure negative temperatures. - Why is a stable low voltage above 1.5V recommended as Vref+?
Using the 5V supply results in poor resolution because the input only goes up to 1.5V; a stable lower voltage improves accuracy. - Which component is suggested for more accurate results than a 5V reference?
The MCP1525 IC from Microchip is suggested to provide a precise 2.5V output. - How is the analog output converted to a readable value?
The Analog to Digital Conversion function ADC_Read(0) reads the 10-bit digital value, which is then multiplied by 0.4887 to determine voltage. - Does the LM35 require external calibration?
No, the LM35 does not require any external calibration.
