SenseTemp

An accurate and flexible four-channel temperature sensor for instrumenting electronics

May 10, 2019

Project update 7 of 7

Production Complete & SenseTemp Auto Calibration

I’m pleased to announce that all Crowd Supply campaign orders shipped out at the end of April.

SenseTemp Kit in Case

One small change to the shipments is that SenseTemp Kits, SenseTemp TEC Kits, and standalone RTD Harnesses shipped in translucent plastic boxes, pictured above. These cases work wonderfully to store and protect the RTD Harness, which can become tangled and is somewhat difficult to slide into a bag.

Since that shipment, we’ve been wrapping up testing of an additional batch of boards that will be stocked at Crowd Supply in the coming weeks.

Having access to this larger batch of hardware has allowed some exciting measurement and testing to occur across a larger sample size, and resulted in the development of an auto-calibration process for SenseTemp.

Production Testing Summary

As part of the production testing process, each SenseTemp board is plugged into an RTD Harness, which is thermally coupled to a large aluminum block via a compliant thermal pad and light pressure. In an ideal world, this would mean that the attached SenseTemp measures identical temperatures on all four channels.

Unfortunately, there are production tolerances throughout the measurement chain:

Testing of 40 units looks like this:

Production Testing of 40 SenseTemp Units

You might notice an overall positive trend in this graph. That is because the ambient temperature in the room changed slightly as production testing progressed. A linear trend line was fit to the data, but this isn’t an ideal ground truth as the ambient temperature rate of change decreases near the end of the test period and measurement outliers effect it too.

You can get a clearer picture when you separate each channel and include the 0.185 C error bars on each measurement (the sum of MAX31865 and reference resistor error)

Per channel measurements with error bars

Here, you see that the most significant positive and negative outliers between any single measurement and the global trend both occurred on Channel 4 of different SenseTemp units. These two units, named here A and B will be used later for auto-calibration testing — along with two units (C & D) that had very low measurement variance.

Although there are outliers seen here, it is encouraging to see that all SenseTemps were within their specified ±0.185C tolerance.

Histogram of Measurement to Trend Error

Interestingly, the error distribution is not symmetric about the trend line; there are more measurements below the trend than above. This could be due to the trend line itself not being correct, or a reflection of non-symmetry in the 0.05% reference resistors.

Auto Calibration

One possibility when you have multiple measurements of a single physical property is to use the difference between measurements (the error) to reduce the error. You have to be careful when you attempt this as correctly identify the "good" and "bad" readings; otherwise, you might pull or bias good data toward bad data.

The auto-calibration process developed for SenseTemp is best understood by looking at the code on GitHub, but the process flow diagram is reasonably clear too.

Auto-Calibration Process Flow

When executed within the CircuitPython REPL, the process looks like this:

Auto-Calibration Running on a SenseTemp

In this instance, the first running of auto-calibration identified Channel 4 as an outlier and adjusted its reference resistor value to 4.2974 kohms. This reduced measurement bounds on the four channels from 0.290 C to 0.118 C.

A second running of the calibration, using the new Channel 4 reference resistor value, found that Channels 1 and 4 were outliers. Changing their resistor values to 4.3006 and 4.2966 kohms respectively reduced temperature variance between the channels to 0.042 C.

As I mentioned, a danger in this kind of self-calibration is moving good data toward bad data instead of the other way around. This seemed to be avoided here by correctly identifying outliers and only adjusting those channels instead of all channels at once.

The other dangers of self-calibration are:

To visualize convergence, four SenseTemps were auto-calibrated four times, which each calibration starting from the results of the previous calibration. Two of these (A & B) were selected from the population due to large outliers they had and the other two (C & D) had low variance during initial testing.

Auto-Calibration Convergence Testing

From iteration to iteration you can see that variance between channels (measured here at max - mean and min - mean) either reduced or were constant when subsequent calibrations were run. Unit C did not converge as tightly as the other three but was still reduced by a factor of 3 from its initial uncalibrated state.

Auto-Calibration Reference Resistor Adjustment

When looking at the adjustment to reference resistor values, you can see the convergent behavior of the auto-calibration process. The most significant changes happen at iteration 1, and subsequent iterations show smaller adjustments. This iterative approach prevents the process from over-shooting the ideal resistor value.

Lastly, we must consider the unit to unit variance and error. It appears the calibration converges well to reduce variation, but do SenseTemp units converge toward a common understanding of temperature? To analyze that, we must look at actual temperature measurements, not relative error to other channels.

These four SenseTemp units were auto-calibrated on in quick succession (to minimize effects of ambient temperature change on the reference metal), and these are the results:

Auto-Calibration Results
SenseTempInitial MaxInitial MinInitial RangeFinal MaxFinal MinFinal Range
Unit A20.181 C19.886 C0.296 C19.949 C19.940 C0.009 C
Unit B20.021 C19.821 C0.199 C19.923 C19.916 C0.007 C
Unit C19.943 C19.884 C0.058 C19.930 C19.911 C0.019 C
Unit D19.931 C19.904 C0.027 C19.932 C19.927 C0.005 C
Overall20.181 C19.821 C0.360 C19.949 C19.911 C0.038 C

Auto-calibration reduced variance between these 16 temperature channels from 0.36 C (50% of SenseTemp’s specified error limits) to 0.038 C (6% of SenseTemp’s specified error limits).

Note that this is total system error — it includes the error in the RTD sensing elements, MAX31865 chips, and reference resistors. The process here cannot delineate between RTD error and reference resistor error, so if you change the RTD harness used with your SenseTemp you should either remove the auto-calibration reference resistors settings or redo the auto-calibration.


Sign up to receive future updates for SenseTemp.

Subscribe to the Crowd Supply newsletter, highlighting the latest creators and projects