In the last blog, I went off-track a little to explore the practicality of implementing a multi-thermistor acquisition system using an ESP8266 and learned quite a bit about the practicality of hacking digital I/O pins as sources, the difficulties of having a sub-optimal divider resistor and limitations of ADCs that can’t necessarily be overcome through oversampling.
In this blog, I go back to what I originally wanted to do – to characterise the thermistors more comprehensively. After all, a two-point calibration as done in the previous blog is really only good for a Beta model. To have a more accurate system requires characterising the thermistor across a range of temperatures.
Table of Contents
Multi-Temperature Characterisation Challenges
Originally, I had proposed to characterise the thermistors at multiple temperatures, noting that the temperatures outside of boiling and freezing were likely to be less accurate.
My thought was to do what I had already done before in the Keysight Smart Bench Essentials RoadTest – to use my modified car fridge (which is a bit like a ghetto environmental chamber) to hold the environment stable at a given temperature and measure the thermistor resistances under such a condition.
However, this was not entirely as clean and successful as I had wished. The data from the previous experiment came out lumpy. I didn’t think much of it at the time, noting the general agreement between the different thermistors, but after further thought, it became apparent to me that the experiment was flawed.
The first issue is that it was reliant on a digital temperature sensor for chamber temperature regulation. In essence, it was treated as the ground truth value when its accuracy was not particularly great (and it had a limited temperature range as well)– the two BMP280 sensors used in this experiment showed this to be the case. Thinking ahead, I also put in a K-type thermocouple for a second-opinion which was a bit better.
The second issue really boils down to the experiment being done in air. While air is technically a fluid, it is one which has a low specific heat and acts more like an insulator than a good conductor of heat. As a result, it was likely that in spite of “dwell” time at each temperature to let the thermistors to equilibrate with the environment, there is a chance that the thermistors had not done so.
Furthermore, there is also the much bigger possibility that my crude PI (no D) control algorithm which turned on and off the heating would have maintained an “average” temperature which was reasonably close, the actual temperature oscillates around the setpoint. There is the possibility that individual thermistors may have been measured during the heating or non-heating portion. This is why having a lot of specific heat is good – like a capacitor, it smooths things out by resisting instantaneous changes in temperature as it requires more energy input to cause a temperature change.
Let’s Have a Coffee ...
After considering all of the challenges that multi-temperature characterisation posed, I decided that the experiment as originally proposed would not be all that fruitful. Instead, it was when I was showering that I had a thought come to my head. It was inspired by thinking about a problem that many hot-beverage drinkers have – how long does it take a hot beverage to cool down to the ideal drinking temperature?
It was by thinking about this that I realised that a potential solution had been staring me in the face all this time. Rather than try to “modulate” the temperature and then measure the response, why not just boil up a vat of water to 100°C and let it cool down to room temperature, while measuring the values of the thermistors as referenced to a reference temperature probe? If the vat of water cools slowly, the change in temperature over time would be slow enough that the measurement system would not be affected significantly by it. This is similar in a way to how curve-tracers work – the stimulus is an AC signal that doesn’t necessarily have to be highly accurate, as both current and voltage are continuously measured and plotted while the input signal varies.
Better yet, we can eliminate some errors by using dual-measurement techniques with the DMM to take paired measurements with only minimal time-offset between them. Using a proper multiplexer would allow for all thermistors to be observed sequentially as the pot cooled down, meaning one run is enough for all ten thermistors. Best of all, repeating this with ice water and letting it heat up would let us capture the other part of the curve from 0°C up to room temperature.
While this eases the experimental setup somewhat, there was still one issue that remained unsolved – the reference temperature measurement. In an ideal world, I would choose a highly accurate Class AA or Class A Pt100 resistance temperature device (RTD), but such probes are quite expensive in their finished form. The bare sensing elements aren’t cheap, but also are “fragile” as they could easily be damaged or contaminated. Preparing them in a robust way is perhaps a project for another time. Another option would be a metrology-grade thermistor, but given that this design challenge is all about experimenting with the provided thermistors, I decided not to investigate this further.
Instead, I had to settle for a relatively common, but not-so-accurate, K-type thermocouple probe. Such units are only expected to have a ±1.75°C accuracy, plus another ±1°C from the DMM’s own reference junction (as thermocouples measure relative temperatures, rather than absolute temperatures) leading to a final (quadrature) error of about ±2°C.
However, while this is not ideal, I still felt the experiment was worthwhile just for illustrating practical characterisation “on the cheap” and that any fixed offset in the reference temperature will just “shift” the resistance curves along the temperature axis, which should be relatively easy to spot.
Test Setup
The test used my trusty Keithley 2110 5.5-digit DMM as the acquisition device, bridged over to Ethernet using my Raspberry Pi-based USB-TMC Ethernet bridge. The resistance was measured in 2W mode. This was connected to a two-pole, 10-input relay multiplexer of my own design (an Arduino shield connected to an Ethernet shield on an Arduino Uno clone), built using brand new Nexem EC2-5NU signal relays to maintain high levels of isolation between inputs and low resistance when connected.
Being a mechanical relay-based device, it does have a limited lifetime, so I tried to ensure switching rates were not too frequent (approximately one switching operation for each relay every minute).
Dual measure was enabled with a Type-K thermocouple probe connected to a dedicated thermocouple input block. In this case, I used a Tenma 72-14556 probe from element14 that I got on sale – the specifications are somewhat lacking with regards to accuracy (0-800°C, ±2.5%) but it seems most suitable for use with liquid.
The experiment was coordinated over Ethernet using a pyvisa script running on an Asus TinkerBoard (similar to Raspberry Pi). The script read paired dual-measure values (i.e. thermistor resistance, thermocouple temperature) 16 times per channel at 10PLC (for maximum accuracy), recording the average paired value for each channel in sequence, repeating until the script was manually terminated after minimal change in temperature over time was recorded.
All thermistors were attached using Dupont-style wires to the multiplexer. The shorted input resistance was measured for compensation, while the open-resistance was also measured to ensure no stray short circuits existed in wiring.
To slow the change in water temperature, I decided to use a 1.5L volume (large thermal mass) inside a double-wall reflective vacuum glass carafe (like a thermos) to minimise heat loss/gain. The open top was covered with a piece of perspex, with a notch cut into it to allow for the temperature probe and thermistors to pass through. Any connections were made on the outside of this perspex, to avoid the potential for steam ingress affecting measurement results.
The thermistors were twist-tied to the shaft of the thermocouple probe, to ensure they maintained the same depth in the water of the carafe. Water of the appropriate temperature was prepared then poured to fill the carafe. The sensors were immersed and the perspex cover was fitted. Data acquisition was then started and left to run until the temperature of the water appeared to equilibrate. The measured data was curve-fitted based on the infinite-series fifth-order equation form given in previous blogs.
To try and understand the error of the thermocouple, a separate set of boiling and freezing water experiments were conducted with just the probe that was used for this experiment.
Results
This experiment took a long time to complete.
I had very much underestimated the effectiveness of the vacuum carafe, requiring about three days for the temperature change to slow down to the point I would abort the experiment and change over from boiling to freezing water. In this week-long process, I endured the endless clicking of relays at around ten-second intervals around the clock. It took a day for me to get used to sleeping with them running! Only after the 60-hour mark did the effect of ambient temperature modulating the heat flow out of the thermos become visually apparent.
Thermocouple Accuracy Conundrum
Understanding what type of errors the thermocouple would have could be of use in aiding interpretation of the results. Thermocouple errors generally can consist of simple offsets (due to thermal EMFs at connections or reference junction errors) which can be calibrated out by the user, or they can be more complex and involve gain errors due to material purity issues, or a combination of both.
While fully exploring this would open up a new chicken-and-egg scenario, I decided to try the two-point check with the thermocouple to see what the resulting errors would be.
Using a dedicated thermos of ice and water, thoroughly stirred and left to sit for a while, it seems the thermocouple is reading about 2.7°C when it should be reading about 0°C. The expected error is around ±2.7°C based on another K-type thermocouple’s accuracy specifications, so perhaps this thermocouple is not so accurate.
At boiling, on a day with a barometric pressure of 1017.45hPa, the expected boiling temperature is 100.12°C. Letting the water reach a rolling boil in the modified soymilk maker, the temperature did peak just around 100.05°C, with an average in the 99.95°C region, suggesting virtually zero error at boiling. This is unexpected as I was expecting a simple offset error from the reference junction to be the main source of error.
Nevertheless, we should conclude that the thermocouple reference temperature has an error in the range of 0-3°C.
Zero Resistance
All the inputs were shorted one at a time to check the zero-resistance measurement.
Channel |
Shorted Reading (ohms) |
1 |
1.054 |
2 |
1.527 |
3 |
1.154 |
4 |
1.184 |
5 |
1.271 |
6 |
1.786 |
7 |
1.451 |
8 |
1.342 |
9 |
1.205 |
10 |
1.192 |
The open-resistance measurement was in excess of 8MΩ. It was not off-scale perhaps due to residual flux on the PCB, however, this is considered a high-enough impedance for this experiment’s needs.
Given the relatively low resistance offset and similarities across all channels (mean = 1.32Ω, range = 0.732Ω), I deemed these differences negligible compared to other sources of error and did not compensate the readings using this data.
Thermistor Curves (with a Gap)
Taking all of the recorded data and sorting it, the curves of the thermistors can be drawn from the individual data points. It should be noted that there is a gap around room temperature – this is because the carafe of water never equilibrated fully to room temperature (as that would require infinite time, in theory). Nevertheless, there seems to be a nice curve going on, but with some “wiggles” possibly due to differences in temperature response time between the thermocouple and the thermistors.
Zooming into the 10kΩ range, the four different types are visible but their curves do not “cross-over” in a nice order as the theory would suggest. Practical real-life readings are noisier – but this may be “fixable” by curve-fitting.
First, we transform the data to 1/T (in K) vs ln(R) representation, where they start to look a bit more like straight lines.
Then, fifth-order fits are made to each of the lines. The coefficients are as follows:
Self-Characterisation 5th Order Fit Coefficients by Gough Lui |
|||||||
1/(T in K) = |
A * x^5 |
+ B * x^4 |
+ C * x^3 |
+ D * x^2 |
+ E * x |
+ F where x is ln(R) |
|
2152723307 |
3892K 3k 1% |
-4.23998519E-07 |
1.59136579E-05 |
-2.36787394E-04 |
1.74593756E-03 |
-6.12968790E-03 |
1.05748244E-02 |
2152723407 |
3892K 4k7 1% |
-2.07686411E-07 |
8.55607806E-06 |
-1.39111560E-04 |
1.11748611E-03 |
-4.19029501E-03 |
8.20595141E-03 |
2152723507 |
3892K 5k 1% |
-7.38849886E-08 |
3.06565153E-06 |
-5.02492664E-05 |
4.09411658E-04 |
-1.41563967E-03 |
3.91344604E-03 |
2152723607 |
3892K 10k 1% |
-8.23791126E-07 |
3.50356704E-05 |
-5.92731718E-04 |
4.98933839E-03 |
-2.06576068E-02 |
3.59330035E-02 |
2152723707 |
3892K 12k 1% |
-6.13344037E-07 |
2.68075724E-05 |
-4.65670523E-04 |
4.02264334E-03 |
-1.70507021E-02 |
3.06591754E-02 |
2152723807 |
3892K 30k 1% |
-6.38156369E-07 |
3.04733302E-05 |
-5.79215342E-04 |
5.48219361E-03 |
-2.56129566E-02 |
4.94603995E-02 |
2152723907 |
3892K 47k 1% |
-8.18350033E-07 |
4.09701510E-05 |
-8.17088992E-04 |
8.11818208E-03 |
-3.99518084E-02 |
8.00595843E-02 |
2138601637 |
3500K 10k 1% |
-1.85707713E-07 |
8.29049888E-06 |
-1.47862025E-04 |
1.32085524E-03 |
-5.63843980E-03 |
1.13905322E-02 |
2138602637 |
3500K 10k 2% |
-7.19519677E-07 |
3.09559531E-05 |
-5.31022959E-04 |
4.54444600E-03 |
-1.91551754E-02 |
3.40693238E-02 |
2138622637 |
3800K 10k 1% |
-1.42902867E-06 |
6.08357350E-05 |
-1.03201814E-03 |
8.72783781E-03 |
-3.65614495E-02 |
6.29479243E-02 |
Comparing the 5th Order Fit with Datasheet Values
The easiest way to understand the quality of the fits is to take the rounded datasheet resistances and compute the model predicted temperature for each of the thermistors. This way, we can see how closely my model based on my own characterisation efforts corresponds to the data from Molex.
The graph shows quite a bit of deviation outside of the 0-100°C characterisation range, reaching as far as 65°C of error. This suggests that the fifth-order model is poorly behaved outside of the characterisation window and that extrapolation is not recommended!
Focusing on the data within the characterisation window, two things immediately stand out – the 3892K 10kΩ thermistor deviation from specifications appears to be real as the curve in yellow deviates more than the others, and the 3500K 10kΩ 2% ring thermistor doesn’t behave like a 3500K unit – using the 3500K data causes it to have significant temperature deviations.
Zooming further in, it seems that the majority of the offset is concentrated in the 1.5°C to 3°C range, suggesting that the thermocouple probably had mainly an offset error with a slight positive gain towards boiling. The curve-fitted model data, especially around 20°C, seems to bunch together. This is an excellent result, suggesting that this new fit is consistent with the published Molex temperature-resistance data, but with an offset and gain-error likely from the thermocouple.
Conclusion
By using a bit of clever thinking, it seems that it was possible to do some characterisation of the curve of the thermistor “at home”. While individual readings may be noisy, the power of averaging and curve-fitting can extract the broader trend from the data. The fifth-order fits showed good consistency with the published resistance-temperature data from Molex for the thermistors previously identified as within-specification, but with an offset and slight gain error introduced by the error from the thermocouple used as the reference. Extrapolation outside of the characterised range of temperatures did result in wild errors appearing, however.
Ideally, characterisation should be done in a calibrated, tightly-regulated water-bath with the best of Pt100 RTD sensors or similar – but such devices are not inexpensive and are rarely found outside of well-funded scientific laboratories. As a result, this investigation did not resolve the “chicken-and-egg” problem in metrology – i.e. which one is more accurate. But it did, however, illustrate that characterisation can be performed and shows the use of my relay-based multiplex as another multi-thermistor running solution.
Raw sample data and most graphs from this thermistor curve characterisation experiment is also available for download as a zipped Excel workbook - curve-cal-data.zip
[[Characterising Thermistors Blog Index]]
- Blog #1: Characterising Thermistors - Introduction
- Blog #2: Characterising Thermistors - What's In The Box?
- Blog #3: Characterising Thermistors – A Quick Primer, Beta Value & Steinhart-Hart Coefficients
- Blog #4: Characterising Thermistors – An Inconvenient Truth, Taking Things to the Fifth Degree
- Blog #5: Characterising Thermistors – Measuring Resistance Is Not So Easy!
- Blog #6: Characterising Thermistors – Is Self-Heating a Problem or Not?
- Blog #7: Characterising Thermistors – Boiling, Freezing and Zapping the Truth Out of Them!
- Blog #8: Characterising Thermistors – Practically Running Multiple Thermistors
- Blog #9: Characterising Thermistors – Multi-T Results, Insulation R Redux, 5th Order Fits & Model Performance
- Blog #10: Characterising Thermistors – Multiple Thermistors on ESP8266
- Blog #11: Characterising Thermistors – Show Me Your Curves
- Blog #12: Characterising Thermistors – Sticking Rings on Tabs & Sinks, Absolutely Crushing It!
- Blog #13: Characterising Thermistors – Pulling Out, Overload, Response Time, Building a Flow Meter & Final Conclusion