# Revised version of LM35 based digital temperature meter

This is a revised version of my LM35 based digital thermometer project that I posted last year. Although it is one of the simplest projects, it is very popular among newbies who are just starting to learn microcontrollers. There was a little flaw in the original project as pointed by some readers. I was using a 1.2 V reference for A/D conversion with PIC16F688 microcontroller. However, the PIC16F688 datasheet says Vref should be equal to or higher than 2.2 V to ensure 1 LSB accuracy of A/D conversion. Here, I am rewriting the same project but this time I am using a MCP1525 IC to generate a precise 2.5 V reference for A/D conversion. This will improve the accuracy of temperature measurements.

Interfacing LM35 temperature sensor with a PIC microcontroller

Theory

The LM35 series of analog temperature sensors are produced by National Semiconductor Corporation and are rated to operate over a -55 °C to 150 °C temperature range. These sensors do not require any external calibration. The output voltage is proportional to the temperature, and the temperature-to-voltage conversion factor is 10 mV per °C. The sensor does not have any DC offset output voltage (which means the output is 0V at 0 °C temperature) and therefore, a negative voltage source is required in order to measure temperatures below 0 °C. For simplicity, the setup shown here is made to measure temperatures above 0 °C only. The PIC16F688 microcontroller reads the analog output voltage from the sensor through one of its ADC channel and derives the temperature information out of it.

For the maximum temperature value of 150 °C, the output voltage of the sensor would be 150 x 10 mV = 1. 5 V. If we use Vref = 5.0 V (power supply voltage) for A/D conversion, the resolution would be poor as the input signal goes only up to 1.5 V. Besides, if the supply voltage is not stable, it won’t be a good idea to use it as  Vref for A/D conversion. Using a lower and more stable Vref voltage can improve both the resolution and the accuracy of A/D measurements. However, the datasheet of PIC16F688 microcontroller recommends to use reference voltage above 2.2 V to ensure 1 LSB accuracy of A/D conversion. The MCP1525 IC from Microchip provides a precise output voltage of 2.5 V, which could serve this purpose. This device is also available in TO-92 package, and therefore, it can be wired on a breadboard too.

READ  DIY Internet connected smart humidifier

Circuit diagram

The revised circuit diagram of the project is shown below. All the connections remain the same, except the two diodes and a resistor in the original circuit are replaced by a MCP1525 device.

Revised circuit diagram (click the image to enlarge)

The whole setup of this project is shown below. For illustrative purpose, I am using the LCD display from my I/O board project here. Don’t get confused with all the LEDs and tact switches on the board, they should be disregarded. I am only using the LCD part of it.

For more detail: Revised version of LM35 based digital temperature meter

#### Current Project / Post can also be found using:

• rgb led binary clock using pic16f628a