Thermometer with PIC Microcontroller

In the last tutorial we learn about the multiplexing technique used with seven segment displays. We learnt how it saves i/o line by using persistence of vision. Only one digit is lit at a time, but to a human eye it is too fast to catch, so we see all four digit lit the same time. In this tutorial we will make a practical use of multiplexed seven segment displays. We will use them to show current room temperature using a LM35 temperature sensor.

Before reading further make sure you know the following concepts

Schematic for PIC Thermometer

Please note that this schematic is slightly different from our previous schematic on multiplexed seven segment display. The display select i/o pins were RA0,RA1,RA2,RA3 on that schematic. But in this schematic the display lines are RA1,RA2,RA3,RA4 this is because RA0 is used as analog input channel for LM35′s output.

PIC Thermometer using LM35

Multiplexed Seven Segment wiring

We use our PIC Development Board for making the above demo project. The PIC Development Board has all the core circuitry to sustain the MCU while the project specific part is developed on the expansion board.

Multiplexed Seven Segment Display SetupThermometer with PIC Microcontroller schematich

HI-TECH C Code for Thermometer Project



Simple Program to connect with LM temperature sensor using the
internal ADC of PIC MCU.

The program displays the current environment temperature on
LED Module.

MCU: PIC18FXXXX Series from Microchip.
Compiler: HI-TECH C Compiler for PIC18 MCUs (

Copyrights 2008-2011 Avinash Gupta
eXtreme Electronics, India

For More Info visit

Mail: [email protected]

#include <htc.h>

#include <math.h>

#include "types.h"

#define _XTAL_FREQ 20000000ul

//Chip Settings


For more detail: Thermometer with PIC Microcontroller

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: