LM35 Temperature Sensor with Fixed Voltage Reference

Works done? Proud of it? Show off here! Let's see what you've built can help inspire others.

LM35 Temperature Sensor with Fixed Voltage Reference

Postby Brian Griffin » Thu Apr 26, 2012 2:59 pm

Project Name: LM35 Temperature Sensor with Fixed Voltage Reference for the PIC16F1826

Author/Designer: Y H

Project Description: With the fixed voltage reference in the newer PIC16F microcontrollers, users may now not worry about drifting voltage references and wrong temperature readings. Plus, calculations are easier and no floating point calculations are involved.

Photo/Picture/Figure/Diagram/Flowchart:
2012-04-14-10-56-542.jpg
Picture of the hardware.


Compiler: MPLAB X 1.10 and Hi-tech C v.9.83 (Don't ask why I don't use the XC8 - it's messing up on me for that time I wrote it!)

MikroC and XC8 versions coming soon.

Source code: "pic16f1826-thermometer.X.zip"

Schematics:
screen13.jpg
Schematic of the project.


Important Note: If the UIC00B/PICKit 2 cannot recognize the PIC16F1826, you may need to upgrade the device file in PICKit 2 before you upload the program into the microcontroller. Grab the latest device file from this link: http://ww1.microchip.com/downloads/en/D ... -62-14.zip

When you have it, unzip it to “C:\Program Files\Microchip\PICkit 2 v2\” and overwrite the file. Then try uploading it again.

On MPLAB X, project files are not used anymore – it is referred to the folder instead. The MPLAB X, with that project does not support PICKit 2 for some strange reason but you still can automatically upload your program after you compile it. Here’s how to do it:

1.) In the PICKit 2 program, click on the “Auto Import Hex + Write Device”. You will be directed to a browse window.

2.) Afterwards, find the project folder you have just downloaded it. It is called “pic16f1826-thermometer.X”.

3.) Then click on the “dist”, and then “default” and “production”.

4.) You will find “pic16f1826-thermometer.X.production.hex” inside. Select it and click “open”.

Go back to the MPLAB X, (modify and) compile the project. The program will auto-upload every time you compile. The program will not be uploaded if you have a compilation error.
Attachments
pic16f1826-thermometer.X.zip
Source Code.
(162.5 KiB) Downloaded 294 times
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Re: LM35 Temperature Sensor with Fixed Voltage Reference

Postby ABSF » Sat Apr 28, 2012 6:36 am

Circuit is straight forward and software is very clear and in the standard and good format. Good for documenting and easy for beginners to follow the flow of the program. I supposed it was specially written for the cytron tutorial...... 8-)

I have bought some 16F1824 and 1828 when I bought the 16f1503 chip. I think the 16f1826 should be about the same as 16f1824 though they are not in the same datasheet. Maybe I'll copy this project after I finished my project on hand.

Keep the projects coming.... ;)

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: LM35 Temperature Sensor with Fixed Voltage Reference

Postby Brian Griffin » Sat Apr 28, 2012 10:21 am

ABSF WROTE:Circuit is straight forward and software is very clear and in the standard and good format. Good for documenting and easy for beginners to follow the flow of the program. I supposed it was specially written for the cytron tutorial...... 8-)

I have bought some 16F1824 and 1828 when I bought the 16f1503 chip. I think the 16f1826 should be about the same as 16f1824 though they are not in the same datasheet. Maybe I'll copy this project after I finished my project on hand.

Keep the projects coming.... ;)

Allen


Thanks for the compliment.

Both of the PIC16F1824 and 1826 are very similar. As long as the FVR is connected to the ADC, you can do this one easily.

Unfortunately, the PIC16F1503 does not have such facility despite the datasheet stating that they have FVRs. :?
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am


Return to Project Showcase

Who is online

Users browsing this forum: No registered users and 33 guests