Digital thermometer is used for determining room temperature. It is basic project for beginners to understand functions of different pins of PIC16F877A.It is made by using analog-to-digital conversion(ADC) function in PIC16F877A & seven segment display(SSDs) using LM35 as temperature sensor.
Sensors are widely used for temperature measurement but LM35 series is precision Integrated Circuit Centigrade Temperature Sensor . It is low cost and doesn’t require any external calibration. It is produced by Texas Instruments.It can operate over a -55 °C to 150 °C temperature range. Its output voltage varies linearly with centigrade temperature.It draws very less current(60uA) from the supply so it has very less self heating.The voltage output (in volts) of the sensor is:
(ADC result × 5) / 1023
The temperature in degree Celsius is:
Sensor output × 1000 / 10 = Sensor output × 100
Pin layout of the sensor is as follows:
Pin 2-Output of the sensor
To understand more better, check out its datasheet from the following link:
We can also use a buzzer in digital thermometer so that when a temperature rises above a particular value it starts beeping. This can be used in fire alarms.
MPLAB PROGRAMMING USING HI-TECH PIC16 COMPILER
#define _XTAL_FREQ 4000000
if(t>=25)//this is for buzzer
This program includes multiplexing of common anode seven segment displays . So you need to give 0 at pins to glow respective leds.
Put lm35 away from voltage regulator so that its heating effect does not interfere with the reading.