Precision Temp Readings with a Thermistor

tracecom

Senior Member
I want to use a 10k thermistor as the sensor for a precision PICAXE thermometer and thermostat. The range of temperatures that I need to read is from 95.0 degrees F to 106.0 degrees F. I would like for the resolution of the thermometer to be .1 degrees with no interpolation required. The way that I think this might be accomplished is by storing a data point for each of the 111 .1 degree readings in the range to be covered; these data points would be derived from the corresponding resistances of the 10k thermistor that I plan to use. (I have those resistance values for the 111 temperature data points; each of the values is a four digit decimal value.)

Unfortunately, I don't really know if this is possible and I certainly don't know how to do it. I think I would put these resistance values in a data table along with the corresponding temperature to be displayed, but it may be that I need to use the resistance values in conjunction with a voltage divider circuit and store the corresponding voltage values. I also don't know if the PICAXE-18X has sufficient memory space for this data.

I have spent most of the day today thinking about this, looking at potentially applicable code, and reading the manual; I intend to continue to try to work this out on my own, but if you have some helpful information or insight, I would be glad to get it. My coding skills are very limited.

Thanks in advance for your constructive input. :)
 
Last edited:

manuka

Senior Member
Best you first clarify that you know of the esteemed, & PICAXE friendly, DS18B20. ( DS= Dallas Semiconductors- now run by Maxim). They're slightly more costly that thermistors, but have long been THE thermal sensor of choice for most projects. The PICAXE manuals have great insights-even the baby PICAXE-08M can read them.

They offer 0.0625 or 1/16 °C resolution,with output in degrees Celsius,but PICAXE Fahrenheit conversion is easy enough.

About the only appeal of thermistors in this modest (biological?) range may be that they're (usually) physically smaller.
 
Last edited:

tracecom

Senior Member
Thanks for the reply. I am aware of the DS18B20 and actually have one in my collection of parts although I have never experimented with it. Maybe I will while I think the thermistor project through. As you correctly surmised, the fact that it is a Celsius device has put me off.

I also have experimented (with some success) with the LM34DZ and its Celsius twin, but once again, I didn't find the accuracy through the PICAXE to be as close as I would like. Probably my own coding ignorance, although I have worked to refine the ADC conversion as best I knew how.

I have built and used circuits that use thermistors as temperature indicators. In fact, I have a thermostat that I cobbled together that is now controlling the heater to my chicken egg incubator (and regulating the temperature to within .2 degrees F of the set point.) In addition, I have had a thermistor connected to a PICAXE-18X that used P. H. Anderson's code to read out the temperature (also in C,) but I could never get the accuracy any closer than a couple of degrees.

It occurred to me today that my rather narrow performance range for the thermometer might negate the need for interpolation and minimize the non-linearity of the thermistor. Oh, and I am rather frugal and thermistors are cheap. So, do you think what I propose is possible?

Thanks.
 
Last edited:

manuka

Senior Member
As you correctly surmised, the fact that it is a Celsius device has put me off.
At least give the DS18B20 a whirl- you'll love them. Conversion via the old F= 9/5 C +32 formula is near trivial. Several forum regulars (especially Manie in Sth Africa) have "egg"tensive experiences in this field as it happens. Which PICAXE are you using ? What sort of readout? 16x2 LCD maybe?
 

marks

Senior Member
I dont think you can get much better than the DS18B20
resolution 0.1125 per degrees Fahrenheit
and accuracy of 0.9 degrees F between (14 to 185 degrees F)
it converts just as easy as Celsius its just refferred as a Celsius sensor because the zero point is 0 degrees Celsius ( 32 derees Fahrenheit )

Hope you try this code in the terminal -67.0F to +257.0F @ 0.1 resolution.
Code:
Fahrenheit:
                           
Readtemp12 b.6,w1                         ' read in result ds18b20

     Convert:                                    '  info     + 257 degrees / 0.1125 =  2000
        let b9 =43                                   ' Display + (43) space (32)
     W1 =  W1 +880 * 9 / 8 -670                  '  info     + ie w1=2570 Display + 257.0 C
     IF W1 >  64865 THEN                         '  info     -  67 degrees = 64866
     W1 = -W1                                    '  info  if - ie w1=670  Display -  67.0 C
        let b9 =45                                   ' Display - (45)
        ENDIF
      
BINTOASCII w1,b8,b7,b6,b5,b4
 IF b7 = "0" THEN : B7 = " "     ' zero blanking b7
 IF b6 = "0" THEN : B6 = " "     ' zero blanking b6
  ENDIF:  ENDIF

SERTXD (CR, LF, "Temperature  ",b9,b7,b6,b5,".",b4,"  Degrees F", CR, LF)'resolution to 0.1

PAUSE 1000
GOTO fahrenheit
 

John West

Senior Member
One clear advantage of the thermistor is its response time. Fractions of a second for very tiny ones.

However, the current being fed through them (especially with the lower resistance ones and the tiny ones) will introduce self-heating errors that will vary with the type of environment they reside in, i.e. how effectively heat is transferred away from them.
 

MFB

Senior Member
John West, self-heating can of course be reduced by only powering (from a PICAXE output) the thermistor whilst it's resistance is being measured by an ADC.
 

hippy

Ex-Staff (retired)
I would like for the resolution of the thermometer to be .1 degrees with no interpolation required. The way that I think this might be accomplished is by storing a data point for each of the 111 .1 degree readings in the range to be covered; these data points would be derived from the corresponding resistances of the 10k thermistor that I plan to use. (I have those resistance values for the 111 temperature data points; each of the values is a four digit decimal value.)
That seems possible, and the 18X should have enough memory to do as you suggest; it's basically a 111 entry lookup table and presenting what's looked-up as the temperature you want to show. You may also be able to use a mathematical equation instead of lookup table.

The real question is can you determine which of the 111 resistances you have, uniquely and accurately, using the PICAXE ? You may have to use an op-amp to scale or adjust the resistance of the thermistor to something suitable for the PICAXE.
 

tracecom

Senior Member
I dont think you can get much better than the DS18B20
resolution 0.1125 per degrees Fahrenheit
and accuracy of 0.9 degrees F between (14 to 185 degrees F)
it converts just as easy as Celsius its just refferred as a Celsius sensor because the zero point is 0 degrees Celsius ( 32 derees Fahrenheit )

Hope you try this code in the terminal -67.0F to +257.0F @ 0.1 resolution.
I'll try the code. Thanks.

Here's a little bit about thermistors including their formula. Over a very narrow range high accuracy and resolution are easier to obtain.

http://www.capgo.com/Resources/Temperature/Thermistor/Thermistor.html

What thermometer and temp controlled bath or the like, will be able to verify the results?
Thanks for the link. I'll check it out.

I have two thermometers that have been verified. One is a Brinsea Spot Check and the other is one that I made using a DMM and a multimeter that has been calibrated. Both readout to .1 degrees F.

One clear advantage of the thermistor is its response time. Fractions of a second for very tiny ones.

However, the current being fed through them (especially with the lower resistance ones and the tiny ones) will introduce self-heating errors that will vary with the type of environment they reside in, i.e. how effectively heat is transferred away from them.
That has been my experience as well. I am using a thermistor to control a heating element. The thermistor is bundled with an LM34DZ that feeds a DMM calibrated to be accurate. I can watch the temp via the LM34DZ and hear the heat/fan come on and a second or so later, see the temperature decline on the DMM that caused the heat to come on. It was a little freaky until I figured out that the thermistor was just faster to react than the LM34DZ.

John West, self-heating can of course be reduced by only powering (from a PICAXE output) the thermistor whilst it's resistance is being measured by an ADC.
I wonder what allowances (if any) the thermistor manufacturer (Vishay, in my case) made for this when the resistance formula was created. It certainly would be easy enough to only power the thermistor for a second or so for each reading.

That seems possible, and the 18X should have enough memory to do as you suggest; it's basically a 111 entry lookup table and presenting what's looked-up as the temperature you want to show. You may also be able to use a mathematical equation instead of lookup table.

The real question is can you determine which of the 111 resistances you have, uniquely and accurately, using the PICAXE ? You may have to use an op-amp to scale or adjust the resistance of the thermistor to something suitable for the PICAXE.
In the temperature range at which I am interested, the resistance of the thermistor changes by 13 ohms per .1 degree F at the cool end, and by 11 ohms per .1 degree F at the warm end. That seems to be enough to make a linear relationship unadvisable; of course if I were mathematician and programmer enough, I am sure it could be done.

Instead of storing resistances in the table, it may be better to set up a voltage divider and route the output from it to the PICAXE which compares the voltage to a set of calculated voltages based on the resistances. (I know that's a convoluted sentence, but you know what I mean.)


Thanks to all of you for your input.
 
Last edited:

premelec

Senior Member
self-heating

There is likely a comment on self heating in Vishay's material - usually deg/mw sort of thing - self heating is a a useful characteristic in some applications - e.g. detection of mass flow. For temperature measurement you just go for the least power dissipated in the thermistor - reduce voltage or use higher R thermistor. Look at the spec sheet and see if there isn't some mention of self heating...
 

Jaguarjoe

Senior Member
I have two thermometers that have been verified. One is a Brinsea Spot Check and the other is one that I made using a DMM and a multimeter that has been calibrated. Both readout to .1 degrees F.


I wonder what allowances (if any) the thermistor manufacturer (Vishay, in my case) made for this when the resistance formula was created. It certainly would be easy enough to only power the thermistor for a second or so for each reading..
For your device to be accurate to 0.1 degrees means that your calibration equipment must be much better than 0.1 degrees.

I would be inclined to believe that any thermistor formula such as the Steinhart-Hart would be for an ideal thermistor. Self heating is a consequence of the method used to measure the part.

I would sample the thermistor much much faster than one second, more like one millisecond. Being a DC device there's no settling time to incure. The longer current is going through the thermistor the more it will self heat.
 

premelec

Senior Member
As well as what JJ says you'll need the resistors associated with the thermistor to have very good temperature and drift stability - since the READADC is ratiometric and thermistors of good quality are very stable [repeatable / driftwise] - this could work out for you. There are high temperature glass coated [like a silicon diode] thermistors that drift very little and have small mass.
 

fernando_g

Senior Member
Pilko's is an excellent find is as good as it gets with a thermistor.
But do a little math on the requirements.

For instance for the first thermistor in the table the slope (gain) is 5.756 mV per deg C. This translates to 319 microvolts per each 1/10 deg F.
A 10 bit DAC, as used on the PICAXE, won't have enough resolution.
You will require an external 14 bit DAC to be able to resolve such a minute voltage change.
If you would want to use PICAXE's internal DAC, then you have to amplify this tiny signal change with a PRECISION op-amp, one that has offset voltages in the order of tens of microvolts. Chopper stabilized preferably.
 

Jaguarjoe

Senior Member
In the middle of this page there is a simple formula to use for a 3 point thermistor linearization that centers at the temperature you are measuring:

http://www.ecircuitcenter.com/circuits/therm_ckt1/therm_ckt1.htm

How do $6.00 digital fever thermometers do 0.1 degree resolution?

Maybe looking at strain gauge amplifiers will show how to amplify very small signals. The performance of this amplifier will determine what ADC is needed.

http://focus.ti.com/lit/an/sloa034/sloa034.pdf

Who sells those LTN thermistors and how much do they cost?
 
Last edited:

premelec

Senior Member
LTN

YSI used to sell the LTN units - I forget who took over that company - they are expensive and you need a stable reference voltage - for small ranges it makes a lot more sense to have an interpolation table... I have an analog circuit that linearized a particular thermistor curve well - it was produced by Texmate - no longer fashionable with all the computing power available...

I just looked in google - type in YSI Thermilinear and you'll find these still for sale about $20 a piece..
 
Last edited:

tracecom

Senior Member
I dont think you can get much better than the DS18B20
resolution 0.1125 per degrees Fahrenheit
and accuracy of 0.9 degrees F between (14 to 185 degrees F)
it converts just as easy as Celsius its just refferred as a Celsius sensor because the zero point is 0 degrees Celsius ( 32 derees Fahrenheit )

Hope you try this code in the terminal -67.0F to +257.0F @ 0.1 resolution.
Code:
Fahrenheit:
                           
Readtemp12 b.6,w1                         ' read in result ds18b20

     Convert:                                    '  info     + 257 degrees / 0.1125 =  2000
        let b9 =43                                   ' Display + (43) space (32)
     W1 =  W1 +880 * 9 / 8 -670                  '  info     + ie w1=2570 Display + 257.0 C
     IF W1 >  64865 THEN                         '  info     -  67 degrees = 64866
     W1 = -W1                                    '  info  if - ie w1=670  Display -  67.0 C
        let b9 =45                                   ' Display - (45)
        ENDIF
      
BINTOASCII w1,b8,b7,b6,b5,b4
 IF b7 = "0" THEN : B7 = " "     ' zero blanking b7
 IF b6 = "0" THEN : B6 = " "     ' zero blanking b6
  ENDIF:  ENDIF

SERTXD (CR, LF, "Temperature  ",b9,b7,b6,b5,".",b4,"  Degrees F", CR, LF)'resolution to 0.1

PAUSE 1000
GOTO fahrenheit
I began trying out your code today. It worked right off the bat on my PICAXE-18X despite the port.pin input reference you used (I guess for -M or -X2 parts.) It is interesting that your code was set up to input on B.6 and my hardware was set up to use input 6. Somehow the B.6 input reference on your code still directed the input to leg 15 of my PICAXE-18X. I assume that means that my -18X just ignored the port part of the port.pin reference. Anyway, I changed the input to "Readtemp12 6,w1" for my setup. Next, I want to redirect the output to my LCD. Thanks for the code.
 
Last edited:
Top