Use the PICs Watchdog Timer as a temperature sensor! Its frequency changes linearly over temperature, so it's possible to build a thermometer without external chip! See Microchip App Note AN720. They claim accuracy up to 1 degree Celsius.
Jinx's test of PIC WDT Temperature accuracy
Thermistors are easy to use because you can read it as a capacitor charge time.
Show Thermister Tempature on LCD
Characterizing a thermistor with the Steinhart-Hart equation
PIC Microcontroller based Dallas DS18S20 IO
Dallas DS1620 interface with floating point (full accuracy) conversion to plain text and USART RS232 xmit
PIC 16F876A based Temperature (DS1620) / Humidity (HS15p) Display (Hitachi LCD) by Jody Wisman
16F676 Thermometer using LM 35 by Edwin Tugano Jr.
LM335A Micro controller interfacing
Remote analog sensor electronics LM335A Temperature
James Michael Newton says:
A common question is "How do I display the digital output of an A2D converter [fed by a temperature sensor] as a temperature reading?"
You will need to scale the A2D output by multiplying or dividing by some constant number and possibly adding or subtracting a value. See:
the constdivmul code generator for the multiplication or division by a constant and the math library for the addition and/or subtraction.
Start by just displaying the output raw as a hexadecimal number using code from the base conversion part of the math library measure some different temperatures and make note of the numbers displayed and use multiplication and division to make sure that the change is correct. E.g. if you measure 70 degrees and 80 degrees and the display is (hex) 01h and 29h (decimal 1 and 41; a difference of 40) then you need to divide by 4 to get a change of 10. Next you need to add (or maybe subtract) a value. In the example, you need to add 45h (decimal 69) to get a display of 70 to 80 degrees. Then after you get the scaling right, add in a binary to decimal conversion routine from the same page.
For additional accuracy, you should in some way linearize the output of what ever temperature sensor you are using if it is not a pre-calibrated unit. Measure the sensors' output at multiple temperature points over the range of expected operation and then build a table of resulting values to lookup actual measurements in.
The Steinhart-Hart equation can reduce the number of points that must be measured when using thermisters by accuratly estimating (characterizeing) any number of points based on only three actual measurements which are often provided by the manufacturer.
If you use a seven segment LED, you need to translate the decimal values into segment patterns. See: Using lookup tables to convert numbers to seven segment LED display patterns
|file: /Techref/microchip/temp.htm, 5KB, , updated: 2012/8/7 13:19, local time: 2022/8/12 14:27,
|©2022 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.piclist.com/techref/microchip/temp.htm"> PIC temp</A>
|Did you find what you needed?|
PICList 2022 contributors:
o List host: MIT, Site host massmind.org, Top posters @20220812
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
Welcome to www.piclist.com!