PIC16F877A-Based Temperature Monitoring System

Summary of PIC16F877A-Based Temperature Monitoring System


This project uses an LM35 temperature sensor and a PIC16F877A microcontroller to measure temperature and display it on a 16×2 HD44780-based LCD. The LM35 outputs 10 mV per °C; its analog voltage on RA0/AN0 is read by the PIC’s 10-bit ADC, converted to Celsius in software, and updated every second (configurable). Continuous monitoring, precise ADC conversion, and LCD display are the main features.

Parts used in the PIC16F877A-Based Temperature Monitoring System:

  • LM35 temperature sensor
  • PIC16F877A microcontroller
  • 16×2 LCD with HD44780 controller
  • Connection wiring (sensor to RA0/AN0)
  • Power supply for microcontroller and sensor

Temperature monitoring and control is important in industry environments. Sensors are widely used for measurement of temperature. Usually, a temperature sensor converts the temperature into an equivalent voltage output. IC LM35 is such a sensor. Here we describe a simple temperature measurement and display system based on LM35 sensor and PIC16F877A microcontroller. The temperature in degrees Celsius is displayed on a 16×2 LCD.PIC16F877A-Based Temperature Monitoring System

Fig.1 shows the functional block diagram of the PIC16F877A-based temperature monitoring system. The key features of this system are:

1. Continuous monitoring of temperature with 1-second update interval (which can be varied in the program).

2. Temperature measurement using LM35 precision integrated-circuit sensor.

3. Precise analogue-to-digital conversion using in-built 10-bit analogue- to-digital converter (ADC) of PIC16F877A microcontroller.

Hardware description

Fig.2.shows the circuit of the temperature monitoring system. The circuit mainly consists of the LM35 temperature sensor, PIC16F877A microcontroller and HD44780 controller based 16×2 LCD.

Schematic PIC16F877A-Based Temperature Monitoring System
Fig.2: Circuit of PIC16F877A-based temperature monitoring system

The output of the sensor is fed to the internal ADC of the microcontroller. Pin 2 of the microcontroller (RA0/AN0) is channel-1 of the internal ADC. The analogue voltage output of the sensor is converted into its equivalent digital value by the ADC and then its equivalent degree Celsius value is calculated by the software. The calculated temperature value is displayed on the LCD.

LM35 sensor. Fig.3 shows the pin configuration of LM35. It is a precision integrated-circuit centigrade temperature sensor whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear temperature sensors calibrated in degree Kelvin, as the user is not required to subtract a large constant voltage from its output to obtain convenient Centigrade scaling. For each degree Celsius change in temperature, the sensor output changes by 10 mV.

For more detail: PIC16F877A-Based Temperature Monitoring System

Quick Solutions to Questions related to PIC16F877A-Based Temperature Monitoring System:

  • How is temperature measured in this system?
    LM35 outputs an analog voltage proportional to Celsius which is read by the PIC16F877A ADC and converted to degrees Celsius in software.
  • What sensor output corresponds to one degree Celsius?
    The LM35 output changes by 10 mV for each degree Celsius.
  • Which microcontroller pin receives the sensor output?
    Pin 2 of the PIC16F877A (RA0/AN0) is used as ADC channel 1 to receive the sensor output.
  • How is the analog signal converted to a digital value?
    The PIC16F877A’s built-in 10-bit ADC converts the LM35 analog output to a digital value.
  • Where is the temperature displayed?
    The calculated temperature in degrees Celsius is displayed on a 16×2 LCD using the HD44780 controller.
  • How often is the temperature updated?
    Temperature is continuously monitored with a 1-second update interval, which can be varied in the program.
  • Why is LM35 advantageous over Kelvin-calibrated sensors?
    LM35 outputs voltage linearly proportional to Celsius so no large constant subtraction is required to obtain Centigrade scaling.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter