Watchdog Timer as Temperature Sensor




The timing of the Watchdog timer in a PIC or any micro varies with temperature. This variation can be used by software to determine the temperature of the chip.

The LED Counter/Timer was used to measure the time difference between WDT IRQs at various temperatures to 1/10000th of a second. The results are shown below, and indicate that a PIC16F84A can be used as a pretty accurate temperature sensor. I've heard the same about a 12C508 but am not aware of anyone who has quantitised it. Four F84s from different batches were tried, and these are representative results from just one of them. They all performed very much the same. Only one stopped producing WDT IRQs at high temperature (> 85 deg C), but it resumed IRQ output when the chip had cooled. All four were commercial grade devices.

The " % of predicted " is a relative figure for an individual PIC. Before full testing, the WDT was measured at three reference temperatures ; -15, 0 and 82. Measurements at other temperatures are compared to a straight line plot of these three references. To use a micro as a temperature sensor you should calibrate it at least at one temperature in the middle of the range you wish to measure, preferably at the bottom and top ends of the range, or best of all at the bottom, middle and top. As this test showed that Temp v Time is quite linear, any intermediate temperatures can be computed or looked up in a table. The micro has a relatively large plastic body compared to a thermistor or a TO92-type sensor, and time should be allowed for the temperature of the IC body to stabilise. This could be done more quickly by putting it on a heatsink or attaching a fin to provide a bigger reactive surface area

Temp Time % of predicted...................



82 2.9716 100.00 80 2.9573 99.99 78 2.9332 99.96 76 2.9050 100.08 74 2.8769 100.19 72 2.8489 100.31 70 2.8201 100.45 68 2.8081 99.99 66 2.7818 100.05 64 2.7624 99.86 62 2.7382 99.84 60 2.7210 99.56 58 2.6830 100.04 56 2.6635 99.84 54 2.6436 99.65 52 2.6232 99.48 50 2.5922 99.71 48 2.5618 99.93 46 2.5346 99.98 44 2.5103 100.12 42 2.4942 99.65 40 2.4675 99.72 38 2.4395 99.85 36 2.4136 99.89 34 2.3882 99.70 32 2.3522 100.39 30 2.3324 100.18 28 2.3029 100.38 26 2.2767 100.45 24 2.2562 100.26 22 2.2356 100.08 20 2.2125 100.00 18 2.1902 99.89 16 2.1592 100.17 14 2.1432 100.24 12 2.1133 100.00 10 2.0846 99.82 5 2.0311 100.77 0 1.9601 99.86 -3 1.9284 100.04 -7 1.8809 100.12 -10 1.8581 100.34 -13 1.8067 100.13 -15 1.7782 100.00

Back to Stuff To Make Page