Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com 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.

code for temperature sensing using pic16f872

Status
Not open for further replies.

sjjm

Junior Member level 1
Joined
Apr 17, 2006
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,410
how to use pic16f872

May someone pliz help me with a code for setting a certain temperature and comparing it with a temperature from a sensor connected to a pic 16f872
 

pic16f872 thermistor

i need code also for getting temperature from a thermostat and displaying it on LCD with Celsuis and Fahrenheit

thnx,
Salma
 

pic16f872 digital thermometer

It is quite easy doing so. pic16f872 has built in 10-bit A/D, so what you need is to follow up the steps:

1-Prepare for this chip and the programmer and Kit to program and test your code.
2-I suggest you use C lang, CCS from (www.ccsinfo.com) is very good one.
3-Buy the sensor, if you don't know which kind of sensors you will use, try LM35z, it looks like a transistor and has three legs, and translate the teperature to voltage up to 5V and with precetion = 1C/10mV.
Choosing this IC or sensor depends on your decided temperature range, you can find out this from the datasheet (**broken link removed**)
4-activate the sensor and attatch it to suitable PIC pin for A/D to read the data as voltage and make some operations on that data.
5-If you want to attach and LCD, there is pre-programmed library in CCS you can use it.
6- Good Luck
 

lm35z with pic

how about if i wanna start with a digital thermostat and wanna have temperature in C or F....what would i do...what will i need???
 

pic16f872

Maybe this link helps you: **broken link removed**
 

thermometer pic 16f872

Hi there,
Well I think hjamleh's advice is very good for one way of doing this. There are several possible ways, as well. Another would be to read a thermistor with an analog channel of the mcu. There is an example of this in the link posted above by impakt - it is about 2/3 down the page. They were using the CCS compiler, if I remember.
You could also get a digital thermometer. (google for projects with a DS1820, DS18s20, both one wire devices, or for DS1620 or DS1621. There are others, as well.) One of the better projects and source for using an ds18s20 I have seen is https://www.phanderson.com/PIC/PICC/index.html There are also sources for doing this in assembly, and you will find them when you google.
You didn't say which language you were doing this in, but I have seen examples for doing this in many languages, with a myriad of compilers.
Best of luck, have fun!
Regards,
Robert

Added after 8 minutes:

Oh, and
how about if i wanna start with a digital thermostat and wanna have temperature in C or F....what would i do...what will i need???
Well you would just do the math in your micro. Convert C to F, or vice versa. It's easy
Regards,
Robert
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top