11
\$\begingroup\$

As a hobbyist who don't have access to lab equipment, it really seems impossible to me to be able to calibrate the thermistor that i have.

Of course there are calibrated temperature sensors like DS18B20, but thermistors specially on slow MCUs like Aruino UNO (compared to new MCUs) are snappier.

What options do we have for calibrating a thermistor without using lab equipment?

\$\endgroup\$
11
  • 1
    \$\begingroup\$ Use a calibrated sensor as the DS18B20 to take a characteristic of the thermistor. \$\endgroup\$
    – Janka
    Aug 27, 2019 at 22:06
  • \$\begingroup\$ What do you mean by "snappier"? That doesn't sound like a good justification if you need to do software correction on the thermistor but you don't with a DS18B20. \$\endgroup\$ Aug 27, 2019 at 22:07
  • \$\begingroup\$ If the one second delay of the DS18B20 on full resolution is your concern, use one of the battery monitor onewire sensors, e.g. the DS2438. It has a fast temperature sensor on chip. \$\endgroup\$
    – Janka
    Aug 27, 2019 at 22:08
  • 3
    \$\begingroup\$ @newbie Calibration of temperature, for accuracy, is generally difficult. Some ranges are more difficult than others. Freeze-points of commonly available materials can help a lot, more so if your range includes more of those. But accurate references will be traceable to NIST or DIN (or similar group) standards kept in a lab somewhere and managed by a physicist or two. It would help your question if you specified the temperature range and the accuracy and precision you seek over that range. \$\endgroup\$
    – jonk
    Aug 28, 2019 at 0:51
  • 2
    \$\begingroup\$ @newbie But at home? Look for purity and then create ice/liquid combinations or else pure condensing boilers. For example, ice mixed with water is very commonly used -- but whether or not it helps enough may depend on your accuracy figures and the work you are willing to go to. You can also use boiling water or sulfuric acid allowed to condense upon the bottom of a florence flask. (I've used both.) But the results also depend upon impurities and atmospheric pressure variations and other factors. Your requirements have a lot to bear on what can be suggested for homebrew attempts. \$\endgroup\$
    – jonk
    Aug 28, 2019 at 0:56

4 Answers 4

11
\$\begingroup\$

Reading Thermistor is a little tricky. The above method of calibration, wield no yield to an error detection, It would create two points of a logarithmic curve (the thermistor response curve.

This means, for every 0.1°C of changue of temperature, the correspondent changue on resistance will vary, depending on the range of the temperature. enter image description here

At first, you might look an error about 2 to 5°C off the real temperature, yet no error, only a bad reading.

You dont post any details on how are you reading this thermistor, Arduino May be? I must say, some libraries dont work at all, so you must create a especial function to do so.

Post on detailed explanation on how to characterize and read an thermistor. The post is in spanish, but in the code tags, all explanation in in plain English.

Once you have obtain you ABC coeficients, your error will be about 0.1°C from another measurement, even in a 6m long run of LAN wire.

A test on 4 thermistors This test read at the same time the 4 thermistors, You can see a small difference in temperature from 2 of them I was holding briefly in my fingers.

\$\endgroup\$
11
  • 1
    \$\begingroup\$ Links die, and the ability of this answer to create a solution in the future is highly dependent on the link staying active. Can you add the steps to your answer? \$\endgroup\$ Aug 28, 2019 at 13:55
  • 1
    \$\begingroup\$ I copy and paste the code section of the answer; //This is an example code on how to read a thermistor, the "Thermimistor.h" Lib out there only acepts Beta //coeficient and in my case yield to incorrects results, this a way more accuerrate way to read the //thermistor, in case you have odd or wrong meassurements please follow this steps: // //For get the acurrate results for this code you will need; //a multymeter, a NTC thermistor, another accurrate themperature //probe meter. //Step 1.- Set multimiter on resistance meassurement mode \$\endgroup\$ Aug 28, 2019 at 14:52
  • 1
    \$\begingroup\$ //Step 2.- Read and anotate the actual resistance of the thermistor //and the actual temperature (allow 1min to get stable meassurement). //Some Hot water and a cup. //Step 3.- place both sensors (Thermistor and temperature probe in a //recipient containing water at ambient temperature). //In another cup heat up some water. //Add hot water until you heat more than 10°C the temp probe, wait for //stable meassurement and anotate the temperature and the resistance. //Add more water to heat up the element 20° from the first meassurement. //Take note of the temperature and resist \$\endgroup\$ Aug 28, 2019 at 14:53
  • 1
    \$\begingroup\$ //Step 4.- //Go to the website: //thinksrs.com/downloads/programs/Therm%20Calc/NTCCalibrator/… //and set your data on it. //The calculator will deliver three values we need on the code: A, B and C. //Step 5.- //Replace the values you get in the calculator on this code. \$\endgroup\$ Aug 28, 2019 at 14:54
  • 1
    \$\begingroup\$ //Step 5.- //Replace the values you get in the calculator on this code.//Step 6.- Upload and test it. //Place both sensors on ambien water, warm water and hot water, use the temperature //probe to chek for accurracy. \$\endgroup\$ Aug 28, 2019 at 14:54
9
\$\begingroup\$

Fill a cup with ice cubes and pour in water to fill up to the brim. Give it the occasional stir. When the ice is starting to melt you'll be at 0°C. Stick the sensor into the water and take a reading.

If your sensor can tolerate it, drop it into a kettle of boiling water. At sea-level that will give you a 100°C reference reading.

If you need to heatshrink your sensor for waterproofing you will have to allow some time for the reading to stabilise.

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Simple linear calibration curve.

  • y1 is the resistance, voltage or ADC reading at 0°C.
  • y2 is the resistance, voltage or ADC reading at 100°C.

$$ T = 100 \frac{y - y1}{y2-y1} $$ where y = reading at temperature T.

As pointed out in the comments, if you are using a thermistor you will need to check the datasheet for linearity. If this simple approach isn't good enough you will have to use a polynomial calculation or a look-up table in a micro-controller.

\$\endgroup\$
9
  • 3
    \$\begingroup\$ This will give you two points, which you can use to calculate beta for those two temps. The response in that range will be nowhere near linear (assuming the OP means it when s/he calls it a "thermistor"), \$\endgroup\$ Aug 27, 2019 at 22:13
  • 2
    \$\begingroup\$ @newbie: See the update. \$\endgroup\$
    – Transistor
    Aug 27, 2019 at 22:15
  • 5
    \$\begingroup\$ @newbie As Transistor writes at the end, this approach may not be good enough. I can't imagine it would ever be good enough, frankly. The only thing this approach will get you is repeatability (supposed 40°C will always be the same supposed 40°C, but it may really be 20°C or 60°C). \$\endgroup\$
    – piojo
    Aug 28, 2019 at 4:34
  • 2
    \$\begingroup\$ Pure water boils at 100 °C if the pressure is 1.01325 bar or 1013.25 millibar or hectopascal. The pressure at sea level depends on weather. \$\endgroup\$
    – Uwe
    Aug 28, 2019 at 14:55
  • 2
    \$\begingroup\$ @newbie. That looks useful. If you get it to work then post some sample code into your question or as an answer. I'm sure others would find it more useful than my answer. \$\endgroup\$
    – Transistor
    Aug 29, 2019 at 11:50
6
\$\begingroup\$

Calibrating a thermistor (or mostly any sensor for that matter) is a two step process:

  1. measure the calibration data
  2. devise a calibration law that fits that data

The first step is the hardest, and unfortunately the one I have the least experience with. I will then only describe it in very general terms. The second step is mostly math.

Measuring the calibration data

You have to fill a table with (T, R) pairs, i.e. with resistance values measured at know temperatures. Your calibration data should cover the whole range of temperatures that you will need in actual use. Data points way out of this range are not very useful. Otherwise, the more data points you have, the better.

In order to measure the resistance of the thermistor, I advise you against using an ohmmeter. Use instead the same setup you will be using for the actual post-calibration measurements. This way, any systematic errors in the resistance measurement (like ADC offset and gain errors) will be calibrated out.

For knowing the temperature, you have two options: either use fixed temperature points (like, e.g., boiling water or melting ice) or use an already calibrated thermometer. Fixed points are the gold standard of temperature calibration, but it's hard to get them right, and you will likely not find many of them within the range of temperatures you care about.

Using a known-good thermometer will likely be easier, but there are still a few caveats:

  • you should make sure the thermistor and the reference thermometer are at the same temperature
  • you should keep that temperature stable long enough for both to reach thermal equilibrium.

Putting both close together, within an enclosure with high thermal inertia (a fridge or oven) may help here.

Obviously, the accuracy of the reference thermometer is a very important factor here. It should be significantly more accurate that the requirements you have on your final measurement accuracy.

Fitting a calibration law

Now you need to find a mathematical function that fits your data. This is called an “empirical fit”. In principle, any law can do as long as it lies close enough to the data points. Polynomials are a favorite here, as the fit always converges (because the function is linear relative to its coefficients) and they are cheap to evaluate, even on a lowly microcontroller. As a special case, a linear regression may be the simplest law you can try.

However, unless you are interested in a very narrow range of temperatures, the response of a NTC thermistor is highly non-linear and not very amenable to low-degree polynomial fits. However, a strategic change of variables can make your law almost linear and very easy to fit. For this, we will take a diversion through some basic physics...

The electric conduction in an NTC thermistor is a thermally-activated process. The conductance can then be modelled by an Arrhenius equation:

G = G exp(−Ea/(kBT))

where G is called the “pre-exponential factor”, Ea is the activation energy, kB is the Boltzmann constant, and T is the absolute temperature.

This can be rearranged as a linear law:

1/T = A + B log(R)

where B = kB/Ea ; A = B log(G) ; and log() is the natural logarithm.

If you take your calibration data and plot 1/T as a function of log(R) (which is basically an Arrhenius plot with the axes swapped), you will notice it is almost, but not quite, a straight line. The departure from linearity comes mainly from the fact that the pre-exponential factor is slightly temperature dependent. The curve is nevertheless smooth enough to be very easily fitted by a low-degree polynomial:

1/T = c0 + c1 log(R) + c2 log(R)2 + c3 log(R)3 + ...

If the range of temperatures you are interested in is short enough, a linear approximation may be good enough for you. You would then be using the so-called “β model”, where the β coefficient is 1/B. If you use a third degree polynomial, you may notice that the c2 coefficient can be neglected. If you do neglect it, you then have the famous Steinhart–Hart equation.

In general, the higher the degree of the polynomial, the better it should fit the data. But if the degree is too high you will end up overfitting. In any case, the number of free parameters in the fit should never exceed the number of data points. If these numbers are equal, then the law will fit the data exactly, but you have no way to assess the goodness of fit. Note that this thermistor calculator (linked to in a comment) uses only three data points to provide three coefficients. This is god for a preliminary approximate calibration, but I would not rely on it if I needed accuracy.

I will not discuss here how to actually perform the fit. Software packages for making arbitrary data fits abound.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks for well detailed and explained answer. side question; i used a DS18B20 sensor as my temperature reading source and noticed the thermistor reading is about 2.2 degrees off. i then added that 2.2 degrees in thermistor temperature calculation. now both readings from ds18b20 and thermistor are almost the same. i tested the temperature change within the range of 25 to 35 degrees and even though thermistor was more responsive to temperature changes but at the end result was almost the same. what's the down side of this method that i used? \$\endgroup\$ Aug 29, 2019 at 13:21
  • 2
    \$\begingroup\$ @newbie: I don't understand “the thermistor reading is about 2.2 degrees off”. A thermistor doesn't give a reading in degrees. Do you mean that you tried some calibration law (coming from where?) that gave readings 2.2 °C off? If this is the case, and this offset is strictly constant, you approach has the minor drawback of having a more complex conversion law with an extra arithmetic step. If the offset is not strictly constant, redoing the fit should give you better results. \$\endgroup\$ Aug 29, 2019 at 13:52
2
\$\begingroup\$

Linearized thermometers have a gain & offset error.

  • Bipolar supplies will likely have offset nulled at 0V.
  • single supply bridges will have some Vref or R ratio of Vref or Vcc where offset is nulled at that deign temperature. Usually this is symmetrical, so that would correspond to the midpoint of your design range.
  • thermistors are calibrated at 25’C with a specific sensitivity curve with 2 variables.

  • to calibrate it you only need 2 measurements

    • Null adjust where error voltage =null = 0 , Vt=Vref
    • gain adjust at T max
      • for a typical 4 R bridge, that is usually midpoint temp.
  • use any better thermometer for calibration or
    • use ice water and boiling water for 0, 100’C
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.