# PICTemperatureSensing

### With Watch Dog Timer

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.

### With Thermistors

Thermistors are easy to use because you can read it as a capacitor charge time.

### With other sensors

16F676 Thermometer using LM 35 by Edwin Tugano Jr.

## Scaleing and Display

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

See:

Archive:

 file: /Techref/microchip/temp.htm, 5KB, , updated: 2012/8/7 13:19, local time: 2024/6/23 02:16, TOP NEW HELP FIND:  44.220.44.148:LOG IN

 ©2024 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?Please DO link to this page! Digg it! / MAKE! PIC temp

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
 Did you find what you needed? "No. I'm looking for: " "No. Take me to the search page." "No. Take me to the top so I can drill down by catagory" "No. I'm willing to pay for help, please refer me to a qualified consultant"

### Welcome to sxlist.com!

Site supported by
& kind contributors
just like you!

(here's why

Copies of the site on CD
are available at minimal cost.

.