Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Trying to create a Digital Thermometer

Not open for further replies.


Junior Member level 1
Dec 2, 2010
Reaction score
Trophy points
Activity points
I am trying to build a Digital Thermometer using a LM34 temperature sensor, PIC16F917, couple resistors, seven segment display and a couple transistors that act as switches for the seven segment display. I am using the program MPLAB IDE so i need a C code to make my thermometer work. I am just wondering if anyone has a C code to make a digital thermometer in my case where it will display the degrees on my seven segment display.

If the application of uC is not a constraint, you can use the 7106 or 7107 IC.
These A/D provides direct driving control do display with no need to program any code.
The only work required to you is connect the sensor to input ( oviously regarding proper voltage range scaling ).


I wish i could, but i have to use C Code for this project.

Is there a difference in the code for using PIC16F instead of a PIC18F as they use in these examples?

The top example use a PIC16F688. However, the difference between C code for 16F and 18F is mainly SFR and Config settings.

Use the top example as a template and build upon it with the other two.

ok, you don't by any chance have actual C Code for my problem do you?

You need to write code for the the following functions :
Read the analogue LM34 voltage (A2D)
Convert the reading to temperature
Convert the temperature value to BCD ( 2 digits)
Convert the BCD to 7 segment code
Refresh the 7 segment displays
Re do the loop
Your school require you to write the code to demonstrate that you have the necessary skills to past your course

Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to