Calibrating Thermistors for the Arduino

This is my first post about my current geek project: building a wireless thermometer/alarm/data logger for my Weber smoker. Until now, I’ve been using a Maverick/RediCheck wireless unit which is merely OK. The wireless signal tends to be really flaky and it has only one temp probe. There are multi-probe units available, they’re still missing other features I’d be interested in such as logging the data for generating graphs, measuring ambient temperature outside and setting multiple alarms (for both the food and smoker temperature too high/low).

For my food and smoker temp measuring needs, I picked up 3 food safe probes from Thermoworks for $8/ea. Unfortunately, the probes come with no technical documentation and my email to the company requesting information was ignored. Contrary to my initial thoughts, these probes are not the same as those sold by Maverick or Amwei. I was however able to determine they are NTC thermistors and some searches turned up a way to convert the resistor readings into actual temperatures.

I did a lot of research on the web, and ended up having to piece together a lot of information to get something that actually works. Once you know what to do, it’s more tedious then anything, but getting that knowledge seems to be challenging.

To do calibrate an unknown thermistor, you first take a series of measurements of the resistance at different temperatures. There’s no need to provide power to the thermistor or hook anything up to it. The more measurements the better, and you want to read 10% above and below your necessary usable range for best accuracy. For measuring meat and smoker temps that means about 60-325F + 10%. Using a refrigerator, electric water pot for boiling water and a convection oven I was able to take a series of temperature readings using commercially calibrated thermometers and read the resulting resistance values using a multimeter. The real trick is to use temperature sources which are as stable as possible so your readings are stable and accurate. The whole process took me a few hours and ended up setting off the smoke alarms, but in the end I had a fair bit of data for processing.

If you do this, you’ll quickly realize that thermistors are not at all linear, so you can’t easily interpolate missing values. But there is an equation you can use called the Steinhart-Hart Equation to calculate the unique curve of a thermistor. To use the Stenhart-Hart equation (“S/H” for now on) you take your temp/resistance readings and do some math to generate four coefficients which are then used in a different equation to convert resistance values into to temp values.

There’s a fair bit of math involved, but there is the thermistor project on SourceForge which has C/Java code to do all the work for you. Look at the included simu.txt file for an example table showing temp values (in Centigrade) in the first column and resistance in the second column- space delimited. Run the coeff tool to generate the four coefficients needed for later. Here’s the simu.txt file I used:

3.6     640000
4       620000
14.3    383333
17      350000
80.3    24767
83.6    21433
90      17940
92      16133
100     13033
107.2   9627
115.6   7783
126.7   5857
137.8   4440
142.8   3923
149.4   3247
168.3   1988
190.6   1176
199.4   997
210     774
232.2   645

And the resulting coefficients:

a[0] = 1.211111230054231e-04
a[1] = 3.762691542377820e-04
a[2] = -1.735716635603824e-05
a[3] = 6.538964941154940e-07

Once you have these coefficients, it’s relatively straight forward to use the S/H equation to convert any resistance value (at least within the range you measured) into a temperature. For the Arduino, I ended up using the
Thermistor4 library which seems to give me good results.

Wiring up a thermistor is pretty simple. Connect it to +5V and run it through a resistor acting as a voltage divider and then to an analog pin on your Arduino board. For best results you will want to measure the actual voltage since voltage regulators are very rarely exactly 5.0V and measure the resistor since those are usually +/-5% and plug that into the Thermistor4 library.

6 thoughts on “Calibrating Thermistors for the Arduino

  1. Well NTC probes aren’t super accurate to begin with, but most of the problems I’ve seen with them are related to probe damage either due to overheating outside of it’s operating range or damage to the probe’s wire.

    Honestly, my biggest problems are:

    1. My circuit is getting large enough that the free version of Eagle is a problem as is finding protoboards big enough. Looking at gEDA, but the learning curve is pretty steep.

    2. Realizing that a lot of the components I’d like to use only come in SMD so trying to manage that effectively. I suppose I could start using a hot plate to solder SMD, but I just want to keep things simple.

  2. stupid question… how did you connect the probes to your board? Did strip off the connector? (the link to Thermoworks appears to redirect now to the Chef Alarm page, so I’m not exactly sure which 3 you reference).

  3. Ugh, looks like they totally changed their site. I can’t even find the probes I bought there anymore. But they’re just standard cheap probes like Maverick with what looks like a small headphone jack. I bought the appropriate jack from Digikey and it was easy to wire up.

  4. Pingback: Calibrating Thermistors with a 3.3v Arduino | Arduino based underwater sensors

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.