Experimenting with a thermistor using PIC16F1937

thermistor (1)

Recently i won a bid for a batch of 10K thermistors. The only thing that i knew when i got them in my hand, was that those things are 10K thermistors. As far as i know, the 10K nominal resistance is at room temperature (25C). But i had to find out if these are PTC or NTC, and also i had to draw their resistance to temperature characteristic line, otherwise they would be useless to me. So i ran some experiments with them…

thermistor (1)

A thermistor is actually a part that changes its resistance with the temperature change. There are namely 2 types of thermistors, the NTC and the PTC. The ‘T’ and ‘C’ stands for “Temperature” and “Coefficient”. The “P” stands for “Positive” and “N” for “Negative”. So, a NTC will decrease its resistance while the temperature rises, and a PTC will do the opposite.

Also, there are linear and non-linear thermistors. The old thermistors were uusually non-linear. This means that the resistance does not change linear to the temperature. That was a headache for taking measurements and the labs developed very linear sensors that are widely used nowadays. Every sensor should have a temperature to resistance characteristic diagram. But what i got was only a batch of sensors and nothing more.

What i had to find out was the type of the thermistors (PTC or NTC), and the resistance to temperature change characteristic.

The experiment

For this, i will use a PIC microcontroller. I chose the 16F1937 because… i had it already mounted on a breadboard. Actually, any other PIC with analog to digital conversion capability would do just fine. Then i connected a DS1621 temperature sensor. These sensors have an outstanding measuring accuracy.

Then i used a 10K resistor to create a voltage divider with the thermistor. According to the standard specifications of thermistors, when it is in room temperature (25C) it should have its nominal resistance, which in my case it is 10K. So, the output of the voltage divider should be 2.5 Volts. The PIC will measure this analog value. It then will get a binary 8-bit number from 0 to 255, representing this voltage.

The idea is to get as much measurements as possible for different temperatures. The more the measurements, the higher the accuracy. But this is not all. To have an overall image of the characteristic of the thermistor, i need to have a wide range of temperatures. The wider the temperature range, the better the accuracy of the characteristic. This is not easy though. I had to find a way to measure from very low temperatures (as low as 0C) to high temperatures up to 50 C. I do not really have device to do this, so i had to find different ways.

First of all the external ambient temperature. Today we had temperatures from 17.5C up to about 22C. This is a nice way to start. Then i used a thermal gun to increase gradually the temperature up to 50C. My thermal gun has an electronic adjustment. I hang it over the circuit at about half a meter away and let it run with different setting every time. With this way, i had a batch of nice stable measurement up to 50C.

The hardest part was the lower temperatures. the only thing available in my house that could work was the refrigerator. And this is exactly what i did. I put the circuit in the refrigerator while in operation. Every one hour i opened the door and quickly note the readings on the display. Then i slightly changed the setting of the refrigerator and repeated this process. It did work!

The measurements

Every time i got a measurement, i noted the decimal value of the voltage divider that the PIC had measured with the ADC, and the actual temperature that the PIC got from the DS1621. I came up with the following table:

 

Temperature [°C]      Voltage divider value
-9 41
3 63
10 82
12 85
17.5 110
18 111
19.5 115
20 117
21 119
23 123
25 128
26 130
30.5 140
33.5 153
36 155
38 160
41 170
45 161
45.5 182
21.5 120

 

I draw then a Cartesian system. The vertical axis had the temperature (in ° Celsius) and the horizontal had the decimal ADC values from the PIC. To get a first idea of the thermistor that i had, i put all the points corresponding to the above measurements on this system. This is what i got:

For more detail: Experimenting with a thermistor using PIC16F1937

Leave a Comment

Your email address will not be published. Required fields are marked *