Temperature Measurement: Temperature Measurements Using Data Acquisition Processors
Temperature Measurement: Temperature Measurements Using Data Acquisition Processors
, Bellevue, WA 98004
Sales and Customer Support: (425) 453-2345
Finance and Administration: (425) 453-9489
Fax: (425) 453-3199
WWW: http://www.mstarlabs.com/
Temperature Measurement
Temperature Measurements using Data
Acquisition Processors
Off-the-shelf temperature measurement and display products are
excellent for what they do. They offer accuracy within a couple of
percent, sometimes better. And they are ready to go with all
necessary functions included. If they do what you want, you
should use them. But if they don't have exactly what you need,
they offer you few options. See how Data Acquisition Processors
can help.
Choosing Sensors
Several temperature sensor types are available, each with its own strengths and
weaknesses. To help you make an appropriate selection, here are brief
descriptions of some of the most important temperature sensor types. DAPs are
intended to work with any sort of sensor that delivers a measurable electrical
signal.
www.mstarlabs.com/sensors/temperature.html Page 1
Calibration
Published standard curves are a good start, and sensor manufacturers try to
match them as close as they can, but actual devices deviate from the ideal.
Check your tolerance requirements. If you don't need best accuracy, keep things
simple, and stay with "typical" curves. But for better accuracy, calibrate. Check
the calibration and linearization page for more information.
Some DAPL processing commands can help you apply sensor calibration for
improved measurement accuracy.
Measurement
Example
need:
www.mstarlabs.com/sensors/temperature.html Page 2
• A SCALE or DAPL expression command to correct for gains and
offsets.
• A linearization command like THERMO or INTERP to compensate
for nonlinearity and calculate the corresponding temperature.
junction compensation.
electrical signal.
www.mstarlabs.com/sensors/temperature.html Page 3
Better Temperature Measurements
for Systems
Temperature Measurements: More, Better, Faster
Here are some of the difficult temperature measurement problems
Data Acquisition Processor (DAP) boards can help with.
www.mstarlabs.com/sensors/temperature.html Page 4
Problem: Fully integrated devices work with limited device
types, sometimes only with packages from one
manufacturer.
www.mstarlabs.com/sensors/temperature.html Page 5
Temperature Sensors Survey
Common Temperature Measurement Sensors
This page surveys the most common temperature measurement
sensor types.
Thermocouple
www.mstarlabs.com/sensors/temperature.html Page 6
RTD
RTDs, short for "resistive thermal devices," are built basically the
same way as wire-wound or thin-film resistors, but using materials
with relatively high levels of resistivity variation as a function of
temperature. They are generally between thermocouples and
RTD Example
thermistors in terms of speed, ruggedness, signal level and
temperature range.
Though most common metals exhibit RTD effects, platinum alloys have the best
range and performance, and are by far the most popular.
Thermistor
Example
nonlinear, so you must apply corrections that differ for every Calibration
device type. For full accuracy you must calibrate. They have a
limited range compared to other thermal sensors.
For the temperatures where liquid water can exist, thermistors usually
perform very well.
Infrared
www.mstarlabs.com/sensors/temperature.html Page 7
These sensors are very useful for measuring extreme temperatures through
a viewing port, under conditions that would rapidly destroy other sensor types.
The accuracy, stability, and repeatability are not very good, so they need a lot of
attention.
Solid state
The drawbacks are that the operating range of the electronics limits the sensing
range, and any calibration other than offset adjustment is impractical.
Bimetallic
www.mstarlabs.com/sensors/temperature.html Page 8
Thermocouple Application
Fast, Accurate Thermocouple Measurement
This application example is based on a commercial HTST (High
Temperature, Short Time) pasteurization processing for milk. We
will cover only the temperature measurement aspects. The basic
HTST process must do the following:
3. The milk exits the process at the far end of the tubing,
after the required time interval (for example 22 seconds).
4. If the milk is still at the required temperature at the exit
point, it is allowed to continue on for further processing.
Temperature
Sensors
Thermocouple
Calibration
Cold Junction
Compensation
www.mstarlabs.com/sensors/temperature.html Page 9
2. No physical damage from out-of-range temperatures.
3. Total measurement accuracy +- 0.5 degrees C.
4. Long term drift +- 0.2 degrees C.
5. Maximum settling time 4 seconds.
Selecting a sensor
A high quality type T thermocouple probe is selected. Thermistors have good
response characteristics but are vulnerable to moisture and damage. RTDs have
better stability and linearity, but slow response times — perhaps this is because
the entire RTD has to settle to thermal equilibrium before a reading is accurate,
whereas only a thermocouple probe tip needs to settle to temperature.
The main challenge with a thermocouple sensor is the very low signal level,
difficult to isolate from background noise.
www.mstarlabs.com/sensors/temperature.html Page 10
The issue of how to obtain an accurate cold junction measurement is covered in
a separate note. We will merely presume here that there is a separate
temperature measurement involved, and that the cold junction absolute
temperature is known within +- 0.1 degrees C.
Applications with less stringent accuracy and speed requirements can route
thermocouples directly to a termination board, with an onboard CJC circuit, and
breadboarding space for termination networks.
The excitation and signal lines required for the thermocouple and supplementary
cold junction sensors are provided through the 37-in panel connector of the
MSXB 065. A balanced termination network on the board provides a ground
reference voltage so that the thermocouple junction does not "float" to a high
common mode voltage.
www.mstarlabs.com/sensors/temperature.html Page 11
For supporting more channels and more complex calibration curves, you would
probably choose a DAP 5200a.
The 100 millivolt signal level is still too small to digitize with good precision.
Configure the input sampling of the Data Acquisition Processor to apply an
additional gain of 40. This will raise the signal range to about 4 volts, within the
usual +/- 5 volt input range used by most Data Acquisition Processor
configurations. In the input configuration, your input channel definition will look
something like the following:
SET IP1 D1 40
After filtering, all noise beyond 75% of the Nyquist frequency (75 samples per
second x 0.75) are gone. In particular, all 60 Hz interference from power sources
is gone.
The 150 samples per second can still exhibit residual random noise in the 10 to
50 Hz range. We can apply digital filtering to remove most of that, with care. The
lower the cutoff frequency, the more time delay in producing results. The 10 Hz
cutoff is selected to keep this filtering delay relatively small. We can apply a 4th
order inverse Chebyshev filter with 46 dB stopband rejection to remove the
higher frequencies sharply while preserving the low-frequency temperature
variations accurately. 10 Hz is 0.1333 of the Nyquist frequency of 75 Hz, so we
specify the following digital filter.
www.mstarlabs.com/sensors/temperature.html Page 12
CHEBYINV(PREDUCED, 4, 0.1333, 0.005, PFILT)
LINTEMP = \
((POT85-PFILT)*55.0 + (PFILT-POT55)*85.0)) \
/ (POT85-POT55)
(PFILT-POT55)/(POT85-POT55) * \
(POT85-PFILT)/(POT85-POT55) )
You can verify that the second-order correction is zero at the ends of the ranges,
and equal to the maximum -0.20 at the center of the range. The residual error in
the corrected temperature reading is just a few hundredths of a degree. Thus,
conversion errors are almost insignificant. Total system error depends almost
exclusively on the quality of the signal and calibration.
The final temperature measurements are available 150 times per second, with a
delay of a few milliseconds after receiving each temperature update. Total
www.mstarlabs.com/sensors/temperature.html Page 13
response delay depends almost exclusively on the temperature probe time
constant.
DAP
Analog Cable
Half IE with backplane
MSXB065 signal conditioning board
www.mstarlabs.com/sensors/temperature.html Page 14
RTD Application
RTD Measurements for Roaster Control
Producing a rich, aromatic cup of java requires a blend of art,
science, and good coffee beans. A critical step is the roasting of
the beans. There are hundreds of complex organic chemicals that
produce the flavors and aromas. Roasting brings out some of
these, and produces others, in a manner highly dependent on
timing and temperatures. Good roasting techniques can produce
quite acceptable results from relatively low-grade beans; bad
roasting can produce quite dreadful results from the best
high-grade beans. Temperature
Measurement
Profile roasting
Green coffee beans are placed into a drum or chamber, where
they are agitated or tumbled as they are roasted by hot air. There Temperature
Sensors
Temperature sensing
The critical variable is the temperature of the beans. Other variables can help to
improve the control of the critical variable. The heated air is easier to measure,
but it can differ from the bean temperature by as much as 200 degrees F, so it is
not a sufficient indicator by itself.
A thermal probe measuring the temperature within the coffee beans provides the
most important feedback. The probe must withstand the pounding as beans are
tumbled. Because of its rugged sheath, this kind of probe will not respond
www.mstarlabs.com/sensors/temperature.html Page 15
quickly, but the temperature profile will not change very fast either, and a
reasonable balance is maintained.
Either a thermocouple or RTD probe could work for this application. We will
select an RTD probe because it is reliable, accurate, stable, easy to use, and
well suited for an operating temperature range of 100 to 500 degrees F.
The voltage across the RTD changes roughly in proportion to the resistance
change of the RTD, which changes roughly in proportion to changes in
temperature. The nonlinearities are simple and can be computed exactly, to yield
accurate measurements.
www.mstarlabs.com/sensors/temperature.html Page 16
Accuracy of the measurement will be affected by tolerances in the resistance
values:
A DAP board's voltage reference can supply the 1/2 milliampere of current
required to power the resistive network, while holding the reference level of +5.0
volts closely. If properly calibrated, the DAP will have negligible offset and gain
errors.
The input declaration sets the amplifier gain to 10 for measuring the RTD voltage
(and some other temperature measurements). The measurement rate is
established by setting the time interval in microseconds between sampling
events. The rate of data arrival can be used as a timing base for driving all
automatic processing.
IDEFINE measurement
CHANNELS 4
...
TIME ...
www.mstarlabs.com/sensors/temperature.html Page 17
The processing includes commands that convert the captured voltage
measurements into the corresponding temperature measurements. Two of these
are DAPL expression tasks, and two are specialized downloadable commands
available on this site.
PDEFINE processing
TEMPRdegf = (9*TEMPRdegc/5)+32
END
www.mstarlabs.com/sensors/temperature.html Page 18
Thermistor Application
Precise Measurement Using a Thermistor
This page describes an application using an individually-calibrated
thermistor to obtain highly accurate measurements of ambient
temperature. This is an important side-problem for the HTST
pasteurization application on this site: specifically, the temperature
measurement of the thermocouple sensor used by that system
does not completely determine the process temperature. The cold
junction temperature must be measured accurately as well. Many
of the application configuration issues are predetermined to satisfy
the requirements of that system. Better than 0.1 degree C Temperature
Calibration
Hardware details
The pasteurization application uses an MSXB 065 signal conditioning and
filtering board. The application reserves one of the channels on this board for
cold junction measurements.
www.mstarlabs.com/sensors/temperature.html Page 19
custom termination board provides a thermally stable environment, where the
temperature can be measured accurately at the thermocouple cold junction
terminals.
A cable must be built to connect the MSXB 065 to the thermocouple termination
board.
Beyond the point where the thermocouple wires terminate, use well-balanced
conductors to connect to the terminal strip. On the other side of the terminal strip,
connect to the excitation source and the differential measurement pins from the
signal conditioning connector. The following diagram summarizes the electrical
connections.
www.mstarlabs.com/sensors/temperature.html Page 20
Figure 3 - thermistor connections on termination board
www.mstarlabs.com/sensors/temperature.html Page 21
TemperatureObserved voltageResistance
(degrees C) (gain 25X) (Ohms)
10 4.274 1989
18 2.974 1369
25 2.190 1002
32 1.625 740
40 1.175 533
Steinhart-Hart Equation Three-Point Fit
Verifying at midpoints:
The model is able to fit the data to better than 0.1 degree, which makes it
possible to keep the total measurement error within 0.5 degrees.
The MSXB 065 does not have a reference voltage source in the ordinary sense.
It does, however, have an alternative that is almost as good. When jumpers are
installed at position J8 (this is the default configuration) the outputs of the DAC
(digital-to-analog converter) devices on the DAP are routed through the
MSXB 065 to pins on its 37-pin "input connector." (This makes the term "input
connector" a little awkward when these signals are outputs!) We only need one of
these signals to use for the excitation. There are a few minor hazards.
1. When you use a DAC device as a voltage source in this way, without any
means to latch and hold the signal level at the receiving end, the DAC
output must remain undisturbed. For example, if you use a DACOUT
processing command that reads its value from a variable, the value of
that variable must never be changed.
2. There is limited drive current. With loading of over 50K ohms driven by a
voltage of +5 volts or less, there is about 0.1 mA, well below this limit.
3. Special configuration is required to set up the DAC to operate this way.
www.mstarlabs.com/sensors/temperature.html Page 22
4.0 volt excitation, below the maximum range, to drive the loaded thermistor.
Then the following calculates the desired digitized excitation level.
In the DAPL configuration, declare a source pipe to deliver this value to the DAC.
Insert the data into that pipe.
In the processing section, define a task that moves this value to the selected
output DAC.
DACOUT( EXCITATION, 0 )
When this task begins to execute, it will move the specified output level to DAC0.
After this, the DACOUT task will be starved for new data and unable to change the
output DAC further. The DACOUT task goes to sleep permanently, and does not
get in the way of other processing.
While the converter electronics are very precise, you cannot be sure that small
offsets or losses aren't affecting the voltage actually appearing across the
thermistor and loading resistance network. You can improve accuracy by
measuring the actual voltage with an accurate high-impedance voltmeter. If
necessary, adjust the value loaded into the EXCITATION pipe, upward or
downward (each level change of 16 adjusts the 12-bit converter output by one
"quantum" on the DAP5200a). Adjust until the measured value is as close to a
perfect 4.000 volts as possible.
www.mstarlabs.com/sensors/temperature.html Page 23
Figure 3 - Filtering channels on a MSXB065 board
This application only uses one thermocouple channel, but it could be expanded
to measure additional channels. As long as all cold junctions are maintained at
the same temperature, you only need one cold junction measurement.
TIME 333.3
www.mstarlabs.com/sensors/temperature.html Page 24
The DAP 5000a processing capacity is useful
for independently processing the CJC
temperature readings in parallel with the You can export the
thermocouple readings. Changes in the cold configurations you develop
junction temperature will be very slow, so with DAPstudio software,
simple averaging that reduces each set of 10 and run them on your DAP
thermistor measurements to one averaged independent of DAPstudio
measurement will do the trick. Multi-tasking is or other GUI packages.
automatic in the DAPL system.
Now, use the following voltage divider formula to combine the measured voltage
VTHERM, the known 4.0 volt excitation level, and the known loading resistance
56.18K, yielding the value of the thermistor resistance in ohms, to high accuracy.
www.mstarlabs.com/sensors/temperature.html Page 25
Later, in the processing section, specify this
device model as you convert the
measurements into temperatures. Another useful way to apply
device-specific calibrations
is the DAPL system's
SCALE command.
To complete the processing, combine the cold junction temperature result with
the temperature difference result from the thermocouple.
Now you can route the stream of TEMPERATURE measurements to any location
you wish, test the range and signal alarms in real time, collect statistics for data
logging, etc.
www.mstarlabs.com/sensors/temperature.html Page 26
Calibrate Temperature Sensors
There are four adjustments that a good calibration can provide. Temperature
Measurement
• OFFSET
All voltages are measured with respect to a reference. All
devices operate at some operating voltage. Any
displacements in these voltages, or any consistent errors
Temperature
• GAIN
The voltage that you measure is not really the voltage Thermocouple
• LINEARIZATION
The relationship between measured voltage and sensed Thermistor
www.mstarlabs.com/sensors/temperature.html Page 27
After applying the offset, gain, and linearization corrections, the results might not
be in the most useful form. A good follow-up step is the following:
• UNIT SCALING
Convert the results to a common and useful representation. For example,
present all temperature measurements in degrees C.
Calibration is a process of aligning what your formulas say with what real devices
actually do. This involves taking some accurate measurements.
You can't control what a sensor does directly. It responds based on its physical
properties. But you can to some extent control what your sensor measures. You
can establish a set of temperature levels that span the operating range, and
measure those levels with a laboratory-grade temperature standard. For each of
those measured temperature points, observe the response level of the sensor. If
you construct a curve that passes through these points, you will have a very
good calibration specialized for the individual sensor.
Given the temperature vs. voltage data set, treat the sensor readings as noisy
input values, and the temperature measurements as the corresponding output
values to be produced. Taking multiple measurements and averaging them helps
to obtain the best possible data quality for calibration.
From here, there are two ways that you can go.
For more information about the linearization curves most commonly used for
temperature sensor calibration, check the following.
• Calibrate thermocouples
• Calibrate RTDs
• Calibrate thermistors
www.mstarlabs.com/sensors/temperature.html Page 28
Calibrating Thermocouple Sensors
Calibrate Thermocouples
The potential produced by a thermocouple as a function of
temperature difference between its two ends is very nearly linear,
over a very wide range. The following curve is the "standard
response curve" for a type-K thermocouple.
Temperature
Measurement
Calibration
Overview
Thermocouple
Example
Cold Junction
Compensation
www.mstarlabs.com/sensors/temperature.html Page 29
The differences are significant enough that most applications need a correction
to obtain acceptable measurement accuracy. For moderate accuracy, you can
assume that standard device curves match your actual thermocouple exactly,
and use the standard response curves. This can yield a measurement accuracy
within a few degrees. If you calibrate, you obtain maximum measurement
accuracy for your individual thermocouple device, and also correct for any offset
and gain errors present in your measurement system.
Individual thermocouples are very stable and repeatable, even if they do not
match the standard curves exactly. Over a limited temperature range, it is
possible to reduce the measurement error to about 1 degrees C using a
well-calibrated lower-order polynomial curve.
www.mstarlabs.com/sensors/temperature.html Page 30
with error less than 0.1 degrees C through the range -45 degrees C to +150
degrees C.
You can modify the coefficients slightly to make the conversion curve match an
individual device's response for best accuracy. The calibration data must be
captured very carefully, but the process is straightforward.
1. Establish stable temperatures throughout the full operating range that you
intend to cover.
2. Measure each temperature carefully using an accurate measurement
standard.
3. Take many measurements of the noisy thermocouple potential at each
temperature point, averaging these measurements to reduce noise.
4. Collect the temperature-potential data pairs, and apply a least-squares
curve fitting analysis to obtain a polynomial that best predicts the
temperature given the junction potential.
Knowing that the response will be nearly linear for each of the pieces, you don't
need to measure everywhere as you do with a polynomial fit. For an N-piece
model, measure at the two ends of the temperature range, and also at N-1
roughly evenly-spaced intermediate points. Use the same precautions as with a
polynomial fit, allowing temperatures to stabilize, and taking multiple
measurements at each selected point for noise reduction. You can then code the
monotonically-increasing voltage terms as a vector of input x-values, and the
corresponding temperature levels as a vector of y-values. Provide these two
vectors to the INTERP command to evaluate your piecewise curve at any point.
www.mstarlabs.com/sensors/temperature.html Page 31
Calibrating cold junction effects
You can read more about the principles and application of cold junction
compensation in another page on this site.
There are some practical limitations on the accuracy you can achieve when using
the LT1025A temperature measurement devices available on MSTB009
termination boards, and optionally available on MSXB037 analog expansion
boards.
The bottom line: any errors in reading the cold junction temperature will
contribute directly to errors in the final temperature measurement. Expect at least
1 degree error from cold junction measurements when using the on-board
temperature memeasurement circuits.
For better accuracy, you will need better control and calibration of your cold
junction measurements. An application using a separate calibrated temperature
sensor for best cold junction measurement accuracy is described in an
application note on this site.
www.mstarlabs.com/sensors/temperature.html Page 32
Cold junction compensation
Thermocouple Cold Junctions
The terms hot junction and cold junction, as applied to
thermocouple devices, are mostly historical. You don't need to
have any junctions to get thermocouple effects. If you heat one
end of a metal conductor and hold the other end at a constant
reference temperature, two important things occur.
Example
www.mstarlabs.com/sensors/temperature.html Page 33
Figure 1 - dissimilar metals form loop, two junctions
Welding the thermocouple wires at the cold junction also equalizes the potentials
there. To make the potential difference observable again, it is necessary to break
the loop. Pick a location in one of the thermocouple wires where the temperature
matches the temperature of the measurement leads. Break the loop there, and
attach matching leads to the two sides of the gap to measure the potential.
Maintaining an ice water slurry and actual cold junction is rarely feasible.
Typically, the cold junction is omitted, and the potential is measured directly
across the two terminal ends of the thermocouple wires at ambient temperature.
For historical reasons, we speak of the terminal ends of the thermocouple wires
as the cold junction, despite the fact that there is no longer an intentional
junction. (For the same historical reasons, we refer to the measurement junction
of the thermocouple as the hot junction even if it is used to measure below-zero
temperatures.) The measured potential indicates the temperature difference
between the hot junction point and the unknown cold junction terminals. To
complete the temperature measurement, you must determine the terminal
temperature in some manner.
www.mstarlabs.com/sensors/temperature.html Page 34
Figure 3 - omitting the physical cold junction
1. Simulate the potential effects that would result for a thermocouple wire
pair between the terminals, at their measured temperature, and another
junction at a reference temperature of 0 degrees. Measure the potential
across the thermocouple wire pair in series with the simulated potential.
Apply the linearizing curve to the sum, thus obtaining an estimated
absolute temperature directly. This is known as cold junction
compensation. Usually, the simulation is done electronically with
specialized integrated circuit devices.
This approach makes two approximation errors, one for estimating the
cold junction temperature, and one for approximating the effects on
junction potential. Beyond what is already built into the electronic
simulation, calibration is tricky and probably limited to offset adjustment.
www.mstarlabs.com/sensors/temperature.html Page 35
Figure 5 - independent cold junction measurement
This approach uses one less estimate, but it still depends on accurate
measurements of the cold junction temperature.
www.mstarlabs.com/sensors/temperature.html Page 36
Calibrating RTD Sensors
Calibrate RTDs
RTD devices depend on the fact that metals increase resistivity
approximately in proportion to temperature. Their thermal
characteristics are conventionally described by a base resistance
value and a conversion characteristic that equals 1.0 exactly at 0
degrees C.
R = R0 ( 1.0 + ka * T + kb * T2 + ... )
resistance value R0. Immersing the RTD sensor in an ice water Measurement
Overview
www.mstarlabs.com/sensors/temperature.html Page 37
Figure 1 - RTD characteristic and alpha approximation
For accurately modelling RTD response through its full temperature range of a
few hundred degrees, a higher order polynomial is used. For platinum materials,
a polynomial of order two is usually sufficient for full measurement accuracy. For
less expensive but less linear RTD devices, you might need a polynomial order
as high as six.
www.mstarlabs.com/sensors/temperature.html Page 38
Usually it is most efficient to compute RTD characteristic curves directly. As with
any sensor, it is possible to select corner points at intervals along the
characteristic curve and represent the inverse curve with a piece-wise linear
approximation, and evaluate it using the INTERP command. Intervals of about 50
degrees C should work well.
Operating over a wide temperature range, you will probably do well to measure
the RTD resistance using a simple voltage divider network and unity amplifier
gain.
Operating over a limited temperature range, you might want to consider a bridge
configuration. If the bridge is reasonably well balanced, you can measure the
differential voltage across the bridge with a gain amplifier to improve
measurement resolution. A linear mapping from differential voltage to
temperature will then yield an accurate conversion.
www.mstarlabs.com/sensors/temperature.html Page 39
Figure 3 - RTD in bridge network
You can use the DIVIDER command or the BRIDGE command for deriving
RTD resistance from voltage measurements. Both commands are available
on this site. You can use the RTD command, also available on this site, for
the inverse calculation of RTD temperature from normalized resistance. The
RTD command also provides extensions, not discussed here, for
multiple-part curves covering sub-zero temperatures.
www.mstarlabs.com/sensors/temperature.html Page 40
Calibrating Thermistor Sensors
Calibrate Thermistors
Thermistors have the advantage of a very high sensitivity to
temperature changes, but the disadvantage of an aggressively
nonlinear characteristic. Here is a characteristic curve showing the
resistance of a typical negative temperature coefficient thermistor
device over a temperature range from 0 to 100 degrees C.
Temperature
Measurement
Calibration
Overview
Thermistor
Example
As you can see, the value changes from over 15k ohms to under
100 ohms. The change is most rapid at low temperatures, giving
great resolution for determining the corresponding temperature
values there. At the other end of the range, resistance levels
change relatively less with temperature and measurement
resolution is relatively poor.
Curve forms are available that describe the nonlinear shape of the thermistor
characteristic quite well. The most commonly used form is the Steinhart-Hart
Equation. The resistance measurement of the thermistor is not normalized, so
just use the measured value of Rt in ohms. Manufacturers can provide typical
values of the ka, kb, and kc coefficients, or you can calibrate these values for
better accuracy.
Steinhart-Hart Equation
www.mstarlabs.com/sensors/temperature.html Page 41
Thermistor Linearization Curves
It is relatively easy to calibrate your own response curves, if you have an
accurate temperature measurement standard. Convert the temperature values to
Kelvins, and invert. Take the corresponding measured resistance values and
compute the natural logarithm. Now, fit the coefficients of a third order polynomial
in the log-resistance values to best match the inverse-temperature values.
For the following example, three points are selected, two close to the ends of the
operating range and one near the center. We know that measurements will not
be completely accurate, so artificial errors have been inserted into the data to
result in temperature errors of magnitude 0.1 degrees C with alternating sign at
the three measured points.
ResistanceTemperature
10500 9.13
3200 35.56
700 77.02
3-point Actual
Term
Fit Curve
ka 1.236*10 1.283*10-3
-3
kb 2.453*10-42.362*10-4
kc 4.389*10-89.285*10-8
www.mstarlabs.com/sensors/temperature.html Page 42
Both of these formulas produce curves that are virtually indistinguishable from
Figure 1. The following shows the differences — the calibration errors — that
resulted from the data errors deliberately included for the the 3-point fit.
Deviations of 0.1 degrees appear, as we know they should, where they were
injected at the locations of the measured points used for the fit. At intermediate
locations, the fit error is well behaved. We can conclude that the fit is about as
good as the measurement errors that went into making it — but don't extrapolate
much beyond the range that you measure. To reduce sensitivity to noise during
calibration try the following steps.
1. Calibrate over a range just a little wider than the range you intend to use.
2. Select some points very close to the limits of the range you intend to use.
3. Take multiple measurements at each point and average to reduce
random noise.
4. Consider using more than three points, and determining best-fit
If the range is not too large, you can balance the resolution significantly by
measuring in a voltage divider configuration. Power the thermistor from a
regulated voltage supply, connect the other end to ground through an accurately
measured load resistance, and observe the output voltage where the thermistor
and load resistor join.
www.mstarlabs.com/sensors/temperature.html Page 43
Figure 3 - Voltage divider network
The slope doesn't change much through the operating range. This is very
different from the drastic nonlinear behavior you see in Figure 1. How does this
work? The voltage divider has a saturating characteristic that responds less as
thermistor resistance grows. The growth and saturation effects approximately
balance.
www.mstarlabs.com/sensors/temperature.html Page 44
1. Calculate the current flow from the measured voltage and accurately
2. Determine the thermistor resistance from the voltage across it and the
known current.
3. Apply the Steinhart-Hart equation, either with nominal values provided by
the manufacturer, or with adjusted values determined from calibration, to
obtain the temperature reading.
4. Optionally: convert temperature units from Kelvins to degrees C or
degrees F.
You can use the DIVIDER command, available on this site, for computing
the resistance value given the measured voltage level in a voltage divider
configuration. You can use the THERMISTOR command, also available on
this site, for computing the Steinhart-Hart curves using typical or calibrated
coefficients.
www.mstarlabs.com/sensors/temperature.html Page 45
Module SENSORM :: BRIDGE
DAPL Operating System | Processing Commands
Syntax
Parameters
VIN
Input data pipe with bridge imbalance voltage measurements
FLOAT PIPE
VS
Nominal or measured excitation voltage driving bridge network
BALANCE
Nominal or measured balancing network gain
FLOAT CONSTANT
RLOAD
Nominal or calibrated load resistance, ohms at 0 degrees C
FLOAT CONSTANT
RCOEFF
Temperature coefficient of resistance of load resistor, ohms per degree C
FLOAT CONSTANT
LTMP
Input pipe with load temperature measurements, degrees C
www.mstarlabs.com/sensors/temperature.html Page 46
FLOAT PIPE
GAIN
The gain used to measure the VIN signal
FLOAT CONSTANT
ROUT
Output resistance measurements, in ohms
FLOAT PIPE
Description
The BRIDGE command converts the differential voltage readings from VIN to
measure an unknown resistance in a bridge network configuration. Current from
a known voltage supply drives a load resistance, and then passes through the
unknown device to the drain voltage. On the other side of the bridge network, two
known resistors form a voltage divider to establish a reference voltage. The
differential measurements of voltage between the measurement and reference
sides of the bridge are used to calculate the values of the unknown resistance,
with results placed into the ROUT pipe, one output value for each input value.
Ideally, the voltage dividers on the reference and measurement sides of the
bridge produce exactly the same voltage at a suitable reference operating point
within the normal operating range. Obtaining a perfect balance is hard to achieve
www.mstarlabs.com/sensors/temperature.html Page 47
and not really necessary. Measure the resistances in the balancing network
accurately, then set the BALANCE parameter equal to the ratio
When load temperature is not so well controlled and there is significant thermal
variation in the loading resistor, use the optional RCOEFF and LTMP parameters.
Set the RCOEFF parameter to the temperature coefficient of load resistance in
ohms per degree Centigrade. Adjust the RLOAD parameter if necessary so that it
equals the correct loading resistance at 0 degrees Centigrade. Independently
measure the load temperature in units of degrees Centigrade, and send these
readings to the BRIDGE command through the LTMP pipe. The BRIDGE
command will adjust the value of the loading resistor prior to each conversion.
For each input voltage measurement, the reference voltage on the balancing side
of the bridge is equal to the BALANCE ratio times the excitation voltage. The
voltage on the active side of the bridge equals this reference voltage plus the
measured differential voltage. The voltage between the positive source and the
measurement point appears across the known loading resistance, so the
measurement-side current can be computed. Using the value of this current, and
the known voltage on the measurement side of the bridge, the unknown value of
resistance can be calculated.
Examples
www.mstarlabs.com/sensors/temperature.html Page 48
Voltage measurements are taken for a bridge configuration in which nominal
values of components are used. The voltage at the active divider junction,
relative to the balancing network junction, is obtained from the differential input
sample channel pipe IPipe 2. The excitation voltage is a nominal 5.0 volts.
The nominal balancing ratio with equal-value balancing resistors is 0.5. The
loading resistor is 1K, equal to the nominal operating value of the measured
resistance. Default measurement gain of 1.0 is assumed. The computed
resistance values are reported in pipe R2.
The same as the previous configuration, except that all components are
calibrated and the loading resistor value is compensated for temperature
variations to obtain maximum measurement accuracy. The supply voltage is
measured at 4.959 volts. The balancing resistors are not perfectly matched and
their gain ratio is 0.5025. The nominal 1K loading resistance is measured at 0
degrees Centigrade where it has the value 1001.8 ohms. The loading resistor
value is observed to increase by 8.7 ohms over a 100 degree temperature swing,
so the temperature coefficient is 0.087 ohms per degrees C. Independent
measurements of the operating temperature of the load resistance are provided
by pipe TLOAD. The measurements use an amplifier gain of 10.0. The results of
the resistance calculations are returned in pipe R2.
See also:
DIVIDER
www.mstarlabs.com/sensors/temperature.html Page 49
Module SENSORM :: DIVIDER
DAPL Operating System | Processing Commands
Syntax
Parameters
VIN
Input measurements of divider voltage
FLOAT PIPE
VS
Nominal or measured excitation voltage driving divider network
RLOAD
Nominal or calibrated load resistance, ohms at 0 degrees C
FLOAT CONSTANT
RCOEFF
Temperature coefficient of resistance for load resistor
FLOAT CONSTANT
LTMP
Input pipe with load temperature measurements, degrees C
FLOAT PIPE
GAIN
Gain used to measure input signal VIN
FLOAT CONSTANT
www.mstarlabs.com/sensors/temperature.html Page 50
ROUT
Output resistance measurements, in ohms
FLOAT PIPE
Description
The input divider voltage measurements are received through the VIN pipe.
These measurements have units of volts. By default, this command assumes that
the voltage measurement are obtained using an amplifier gain of 1.0, but if you
use a higher gain, specify it as the GAIN parameter.
If the supply voltage is very well regulated, you can measure it once and specify
the value as a constant VS parameter. If you use the regulated voltage from the
data acquisition processor for this excitation, you could specify 5.0 volts and omit
the calibration measurement. If the excitation is subject to small but potentially
relevant variations, make simultaneous voltage measurements of the supply
voltage, in units of volts, and provide this second input stream to the DIVIDER
command through the VS pipe, one supply voltage measurement per divider
voltage reading.
www.mstarlabs.com/sensors/temperature.html Page 51
Specify the loading resistor value RLOAD parameter in units of ohms. Sometimes
a nominal resistor value is close enough, but for better results enter an
accurately- measured value.
Most of the time, variations in operating temperature are insignificant, and the
load resistance can be presumed constant. For these cases, omit the RCOEFF
and LTMP parameters. However, if significant temperature variations are
anticipated, the DIVIDER command can adjust the effective load resistance to
compensate for temperature-dependent changes. Set the RCOEFF parameter to
the temperature coefficient of load resistance in ohms per degree Centigrade.
Adjust the RLOAD parameter if necessary so that it reports the correct loading
resistance at 0 degrees Centigrade. Measure the load resistance temperature in
units of degrees Centigrade and send these measurements to the DIVIDER
command through the LTMP pipe, one temperature reading per divider
measurement.
For processing each input value, the difference between the known excitation
voltage source and the measured divider junction appears across the known
loading resistor, hence the divider current can be computed. This known divider
current passes through the unknown element to produce the measured voltage,
so its resistance can be computed, producing the results placed into the ROUT
pipe.
Examples
Read the voltage at the junction between a load resistance of exactly 10K ohms
and an unknown resistive sensor when a 5.000 volt excitation voltage is applied
across the divider network. The voltages across the resistive sensor element are
measured with gain 1 and received from input sample channel pipe IPipe 2.
The computed resistance values are reported in pipe ROUT.
This example is the same as the previous configuration, except calibrated for
maximum measurement accuracy. The pre-measured supply voltage level is
4.958 ohms is specified as a constant. The measured load resistor value is
10008 ohms. The nominal load resistance is observed to increase by 42 ohms
over a 100 degree temperature swing, so a temperature coefficient 0.42 ohms
per degrees C is specified. The measurements of divider voltage are captured
using an amplifier gain of 4.0. The operating temperature is separately measured
and provided in the PAmb pipe. The computations use a temperature-adjusted
value of load resistance for each conversion.
www.mstarlabs.com/sensors/temperature.html Page 52
See also:
BRIDGE
www.mstarlabs.com/sensors/temperature.html Page 53
Module SENSORM :: GENPOLY
DAPL Operating System | Processing Commands
Syntax
Parameters
VIN
Input data values
FLOAT PIPE
NORDER
Order of the polynomial function
WORD CONSTANT
VCOEFFS
Coefficients of the polynomial
FLOAT VECTOR
VOUT
Output data values
FLOAT PIPE
Description
www.mstarlabs.com/sensors/temperature.html Page 54
The polynomial mapping is determined by the VCOEFFS vector. The coefficients
specified in this vector start with the zero-order term, followed by the first-order
term, followed by the second-order term, etc. up to the order specified by the
NORDER parameter. If you omit the NORDER parameter, the command will count
terms and assume the corresponding maximum order.
Examples
Take values X from the PIN pipe one at a time, and for each one apply the
second-order polynomial mapping
to obtain the values Y that are placed into the output data stream POUT.
See also:
www.mstarlabs.com/sensors/temperature.html Page 55
Module SENSORM :: RTD
DAPL Operating System | Processing Commands
Syntax
Parameters
RIN
Input resistance values in ohms
FLOAT PIPE
VMODEL
Coefficients for polynomial conversion model
FLOAT VECTOR
TEMPOUT
Output data pipe, temperatures in degrees Centigrade
FLOAT PIPE
Description
The RTD command converts resistance values received from the RIN pipe,
using the device model specified by the VMODEL vector, and delivering the
corresponding output temperatures in degrees C to the TEMPOUT pipe.
www.mstarlabs.com/sensors/temperature.html Page 56
you can fit a polynomial curve to measured resistance and the corresponding
temperatures, thus calibrating your own response curves.
The following conversion characteristic for an RTD device is suitable for wide
temperature ranges and a variety of RTD device types.
R = R0 ( 1.0 + c1 T + c2 T2 + c3 T3 ...)
Some curve forms provided by manufacturers and standards bodies will not
correspond to the general polynomial form. For these, you will need to adjust the
coefficients. An important example is the platinum PT device series. It uses a
conversion polynomial of the Callendar - Van Dusen form
R = R0 ( 1.0 + a1 T + a2 T2 + a3(T-100) T3 )
c1 = a1
c2 = a2
c3 = -100.0 a3
c4 = a3
The following table provides coefficients that you can use for typical device types.
www.mstarlabs.com/sensors/temperature.html Page 57
Device type c1 c2 c3 c4 c5 c6
Platinum
(PT family, IEC751)
above 0 degrees
3.9083e-3 -5.7750e-7 0.0 0.0 0.0 0.0
C
below 0 degrees
3.9083e-3 -5.7750e-7 4.183e-10 -4.183e-12 0.0 0.0
C
Platinum
(JPT family, RC-4, 3.9787e-3 -5.8686e-7 4.167e-10 -4.167e-12 0.0 0.0
SAMA)
Nickel
5.485e-3 6.6650e-6 0.0 2.805e-11 0.0 0.0
(limited range)
Copper
4.270e-3 0.0 0.0 0.0 0.0 0.0
(limited range)
To summarize the layout of the device characteristic vector, the terms are
specified in the following sequence.
When the operating temperature range is within interval T=0 to T=100 degrees
Centigrade, and maximum accuracy is not required, the simplified "alpha
coefficient" model is often used. The alpha coefficient is the slope of a straight
line that matches the nonlinear conversion curve at the points T=0 and T=100. If
you substitute the alpha coefficient for the c1 coefficient in the conversion data,
and set all of the other coefficients to zero, the conversion is linear and fast, with
maximum conversion error a fraction of a degree near the center of the range.
This often is good enough.
For wider temperature ranges, the conversion curves are not in the most useful
form. An RTD curve yields resistance given the temperature, so calculating
temperature requires evaluation of the inverse characteristic. The evaluation is
almost perfect for low-order characteristics and moderate temperature ranges.
For devices with significant nonlinearities at temperature extremes, the
conversion error is typically better than 0.1 degrees C.
Examples
www.mstarlabs.com/sensors/temperature.html Page 58
VECTOR vPT100POS FLOAT = ( 100.0,
3.9083e-3, -5.7750e-7, 0.0, 0.0,
0.0, 0.0 )
...
RTD(PRESIST,vPT100POS,TEMPR)
A type PT100 RTD is used, but temperatures never go below 0 degrees C. The
characteristic terms for the sub-zero piece of the standard conversion curve are
omitted. Otherwise, the conversion curve in vector vPT100POS matches the
IEC751 standard for this device type. The nominal 100 ohms base resistance at
0 degrees C is used. When the RTD command executes, measurements of
resistance in ohms are obtained from pipe PRESIST. Each resistance value is
converted to the corresponding operating temperature of the RTD device by
solving the inverse of the device characteristic. The resulting temperatures in
degrees C are placed into pipe TEMPR.
The same example, except that temperatures can range both below and above 0
degrees C. The resistance of the RTD device is calibrated by measuring
accurately at 0 degrees C, and the observed value 99.86 ohms is specified as
the base resistance. The first set of polynomial terms conform to the the IEC751
standard for temperatures below 0.000 degrees. For temperatures above 0.000
degrees, the conversion processing switches over to the second set of terms.
See also:
DIVIDER, BRIDGE
www.mstarlabs.com/sensors/temperature.html Page 59
Module SENSORM :: THERMISTOR
DAPL Operating System | Processing Commands
Syntax
Parameters
RIN
Input resistance values in ohms
FLOAT PIPE
VMODEL
Coefficients for Steinhart and Hart thermistor model
FLOAT VECTOR
TEMPOUT
Output data pipe, temperatures in degrees Centigrade
FLOAT PIPE
Description
The THERMISTOR command converts resistance values received from the RIN
pipe, using the device model specified by the VMODEL vector, and delivering the
corresponding output temperatures in degrees C to the TEMPOUT pipe.
www.mstarlabs.com/sensors/temperature.html Page 60
The form of the Steinhart and Hart equation is
where the final 273.16 term converts the temperature units from Kelvins to
degrees Centigrade. For maximum conversion accuracy, you can calibrate the
curve for the individual device you are using. Measure the actual resistance at
three well-selected temperature points representative of your operating range,
insert these values into the Steinhart-Hart equation form, and solve for the
coefficient values.
Example
www.mstarlabs.com/sensors/temperature.html Page 61
See also:
DIVIDER, BRIDGE
www.mstarlabs.com/sensors/temperature.html Page 62
Module SENSORM :: THERMOPOLY
DAPL Operating System | Processing Commands
Syntax
Parameters
VIN
Input thermocouple potential measurements
CJT
Input cold junction temperature measurements
FLOAT PIPE
NORDER
Order of the conversion polynomial function
WORD CONSTANT
VCOEFFS
Coefficients of the conversion polynomial
FLOAT VECTOR
TEMPC
Output results, temperature Centigrade
FLOAT PIPE
Description
www.mstarlabs.com/sensors/temperature.html Page 63
This command is an alternative to the THERMO command provided by the DAPL
system for systems that need calibrated temperature measurements for
maximum accuracy. Input values are received from pipe VIN. The polynomial
characteristic defined by vector VCOEFFS is applied to each input value,
producing the corresponding thermocouple temperature difference.
Thermocouples do not return an absolute temperature, so independent
measurements of the "cold junction temperature" must be provided in pipe CJT,
one cold junction temperature for each thermocouple measurement. The
measurements are combined and the resulting absolute temperatures in degrees
C are placed into the TEMPC pipe.
For determining the temperature, the usual way to interpret the potential across a
thermocouple to apply published conversion curves as determined by standards
organizations. Manufacturers do their best to produce devices match these
standard curves, but the match is never perfect. Individual devices are very
repeatable, however. If operated consistently over a bounded range, without
severe thermal stresses, it is possible to apply adjusted curves and get a total
measurement accuracy within about 1 degrees C. The THERMOPOLY command
supports adjustable conversion curves; in contrast, the THERMO supports only
predetermined standard curves.
Examples
www.mstarlabs.com/sensors/temperature.html Page 64
VECTOR VCF FLOAT = ( -0.01897, 25.41881, -0.42456, 0.04365 )
...
THERMOPOLY( PKIN, PCJC, VCF, PTOUT )
See also:
www.mstarlabs.com/sensors/temperature.html Page 65
Copyright (c) 2008, Microstar Laboratories, Inc.
All rights reserved.
Microstar Laboratories, Data Acquisition Processor, DAP, DAP 840, DAP 4000a, DAP 5000a, DAP 5016a, DAP 5200a, DAP 5216a, DAP
5380a, DAP 5400a, iDSC 1816, DAPcell, DAPserver, Accel, Accel32, DAPL, DAPL 2000, DAP Measurement Studio, DAPstudio, DAPcal,
DAPlog, DAPview, and Channel List Clocking are trademarks of Microstar Laboratories, Inc.
This document presents proprietary information regarding Microstar Laboratories products. The information is provided "AS IS" and may be
subject to change without notice. You are granted no intellectual property rights in the information nor in the products. Microstar
Laboratories ASSUMES NO LIABILITY WHATSOEVER, AND DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO
INFORMATION PRESENTED, WITH OR WITHOUT USE OF MICROSTAR LABORATORIES PRODUCTS. Microstar Laboratories
MAKES NO CLAIMS OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR
INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
Any performance specifications were determined in a controlled environment, dependent on component parts that are themselves subject
to unannounced specification changes by their respective manufacturers. Actual results may vary. Performance information is provided "AS
IS" with no warranties or guarantees expressed or implied by Microstar Laboratories regarding suitability of the information for determining
actual performance for any specific application.
Microstar Laboratories products are not intended for use in medical, life saving, life sustaining, critical control or safety systems, or in
nuclear facility applications.
Other names and brands may have claims as property of others. Microstar Laboratories is not responsible for the performance or support of
third-party products mentioned in this document, and does not make any representations or warranties whatsoever regarding these devices
or products.
www.mstarlabs.com/sensors/temperature.html Page 66