Professional Documents
Culture Documents
Thermistor Signal Conditioning - Dos and Don'ts, Tips and Tricks - Jason Sachs
Thermistor Signal Conditioning - Dos and Don'ts, Tips and Tricks - Jason Sachs
Thermistor Signal Conditioning - Dos and Don'ts, Tips and Tricks - Jason Sachs
Home
Blogs
Popular Tweets
Forums
TV
Tutorials
Books
Free PDFs
Vendors
Login / Register
Home Blogs Popular Tweets Forums TV Tutorials Books Free PDFs Vendors
Sign in
Username Password
Remember me
In an earlier blog entry, I mentioned this circuit for thermistor signal
Popular Posts by Jason
conditioning:
Understanding and Preve
Over ow (I Had Too Muc
Add Last Night)
How to Read a Power MO
Datasheet
Chebyshev Approximatio
How It Can Help You Sav
Money, Win Friends, and
In uence People
How to Estimate Encoder
Velocity Without Making
It is worth a little more explanation on thermistor signal conditioning; it's Mistakes: Part I
Ten Little Algorithms, Pa
something that's often done poorly, whereas it's among the easiest The Single-Pole Low-Pas
applications for signal conditioning. Filter
The basic premise here is that there are two resistors in a voltage divider: Blogs - Hall of Fame
Rth is the thermistor, and Rref is a reference resistor. Here Rref is either R3
alone, or R3 || R4, depending on the gain setting. 10 CIRCUIT
COMPONENTS
SHOULD KNOW
This is only one possible circuit. There are many others, but please use the Jason Sachs
following guidelines.
THERMISTOR
Just to be clear, we're going to talk about using an NTC (negative-
SIGNAL
temperature coe cient) thermistor in an embedded system with an CONTIONING:
analog-to-digital converter (ADC) and a processor. AND DON'TS,
AND TRICKS
Jason Sachs
DON'T:
TUTORIAL: BY
Don't linearize your analog circuitry AND SWITH
Jason Sachs
These all add up. My rule of thumb is that unless you keep things very
simple, use good components, and design carefully, it is di cult to have
net voltage errors below 1% of the ADC fullscale -- excluding the sensor
itself, and this goes for any sensor, not just thermistors. If errors concern
you, then you really need to anticipate what kind of errors to expect in your
system, and nd ways to deal with them.
For a basic resistor divider, you can use 0.1% resistors: these have really
come down in price over the last 10 years -- a single 10K 0.1% 0603
resistor can be purchased from Digikey for 0.25, withpricesof about
0.10 in 1K quantities. As far as op-amps go, so many manufacturers make
CMOS op-amps with picoamp input currents that it's easy to forget about
input current errors. Typical offset voltages are now in the 2-5mV range.
For a buffering application in a 3.3V system this is about 0.1-0.2% of
fullscale; applications with gains higher than 1 are worse and you may
have to use more costly precision op-amps.
DO:
Do understand your requirements
This is probably the most important and understated part of the design
process, for any circuit, not just thermistors.
Let's look at the "Z" curve for Quality Thermistors, in a voltage divider:
You'll notice that for each reference resistor, there's a range of about 60-80
degrees C over which α drops from 0.9 to 0.1. Outside those ranges, the
sensed voltage changes very little with temperature. So if your range of
interest is, for example, 25 C - 100 C, you might want to use Rref of 0.2R25
and live with the low resolution in sensed temperature above and below
that range. If you need to sense temperature over a wide range, you need
to make a system that either can accurately read voltage to deal with the
low sensitivity at cold and hot temperatures, or you need to switch Rref
between ranges, like we talked about in my previous article (with the
choice of either R3 alone, or R3 || R4).
Another way of looking at this circuit is to analyze the sensitivity itself (for
those of you familiar with calculus, it's the rst derivative with respect to
temperature dα/dT):
If you are using an 8-bit ADC, this graph shows the sensitivity (in counts
per degree) of temperature sensing at various temperatures. Sensitivity
and resolution are related: the more sensitive a circuit is, the higher
resolution it provides. Quantitatively, the two are related inversely: 3 counts
per degree means 0.33 degree resolution, whereas 10 counts per degree
means 0.1 degree resolution. If you only need 1 degree C resolution, you're
probably ne with an 8-bit ADC. If you need 0.1 degree C resolution, you'll
want a 10-bit ADC, or you'll want a way to amplify ranges of the thermistor
voltage.
Nearly all ADCs and DACs are ratiometric as well: the sampled digital
output of an ADC is the ratio of its analog input voltage to its reference
voltage, and the analog output of a DAC is the fraction of its reference
voltage selected by its digital input.
Watch out with your ADCs and DACs, though: some of them take in half-
scale reference voltages, so there is an indirect gain of 2 somewhere in the
circuit, caused by resistor or capacitor or transistor area matching, and the
ICs that do this sometimes don't specify very well the tolerance of this
gain. Some examples of this are the ADCs in TI's 28xxx DSP family, and the
MAX5322 DAC.
Most sensors are ratiometric but not strongly ratiometric: for a xed
sensing quantity (temperature, strain, humidity, etc.) their output is
ratiometric to a supply voltage or reference voltage, but the sensor gain is
not unitless, and has part-to-part variation. For strain gages, as an
example, there is a gain from strain to resistance that depends on the
manufacturing tolerances and material properties of the strain gage. So
the gain of a strain gage will not be affected by changes in supply voltage,
but it will vary from part to part. Often the gain will need to be calibrated
out.
In any case, the #1 thing you should remember when you have a sensor
that is ratiometric, used with an ADC that is ratiometric, is to use the same
reference voltage! (Or reference voltages with very tightly coupled ratios.)
Otherwise you are throwing away free accuracy. As an example, if you have
a precision 3V reference driving a voltage divider, but you use an
inaccurate 3.3V analog power supply on an ADC, as the power supply
varies you will see different readings from the ADC.
Input capacitance is a much more subtle issue. Many ADCs use an internal
sample-and-hold capacitor: the ADC hooks this capacitor up to your input
voltage using internal switches, then disconnects the capacitor from the
input and uses a state machine and comparators and what-not to convert
that capacitor voltage to a digital reading. (If you're curious, look up
successive-approximation converters in Wikipedia.)
So the input stage of an ADC looks like a capacitor that appears and
disappears, and in a multiple-channel ADC this capacitor transfers charge
between inputs. This happens every time you sample the input voltage
before a conversion, and your external circuit needs to transfer charge
to/from the sampling capacitor until the voltage stabilizes.
The best solution is to put a unity-gain buffer (which solves the input
leakage and part of the input capacitance issue) followed by a small RC
low-pass lter, in front of the ADC input. This lter provides a stiff source
of charge (via the external capacitor) to the ADC sample-and-hold
capacitor, and the resistor isolates the op-amp from a capacitive load.
Usually this RC is in the 100-1000ohm and 100-1000pf range, so its time
constant is under 1us.
There are two things you can do to reduce self-heating: One is to use a
higher-valued thermistor, e.g. 100K rather than 10K nominal -- I'm not sure
why 10K is the standard value, but it's a poor choice in many applications.
The other is to use a smaller reference voltage. This makes the voltage
sensitivity of your circuit smaller, but it may lower the total error if the self-
heating can be greatly reduced.
This is one reason why thermistor leads and copper traces may need to be
very thin, so that they minimize parasitic thermal conduction through the
thermistor leads.
TIPS AND TRICKS
There's two other tips and tricks I'll share with you. One is on the analog
side, and the other is on the digital side.
ADCs have gain and offset error. You're stuck with it, and it's usually
speci ed in LSBs (multiples of 1 ADC count). For example, Microchip's
MCP3201 (a 12-bit ADC) is spec'd at +/- 3LSB (=0.07% of fullscale) offset
and +/-5LSB (=0.12% of fullscale) gain error.
Let's use a 4:1 analog multiplexer to measure 4 different things into the
ADC channel:
This lets us measure two voltage divider ratios, and two reference ratios.
The reference ratios are so close to 0 and 1 that they are very insensitive
to resistor tolerance. A 1:100:1 voltage divider that uses 1% tolerance
resistors has ratios of approx 0.0098 and 0.9902, with worst-case ranges
of 0.0096-0.0100 and 0.9900-0.9904. That's +/- 0.02% of fullscale
accuracy out of 1% resistors! These inaccuracies are smaller than the
errors caused by the gain and offset error of the MCP3201, so we can
measure its inputs at 1% of fullscale (nominally 41 counts) and 99% of
fullscale (nominally 4055 counts) and use the readings to compensate for
gain and offset error. (We're still stuck with differential and integral
nonlinearity) A high-ratio voltage divider also allows for a very low output
impedance with low power dissipation (100 ohm output impedance but
10.2K fullscale resistance in the above circuit)
Once you've measured the ADC reading of a thermistor voltage divider, and
compensated for ADC gain and offset, there are a number of ways you can
convert that ADC reading to a temperature. (Remember, the relationship
between voltage divider output and NTC thermistor temperature is a
nonlinear operation.) Two ways not to do this are:
lookup tables
ADC reading -> resistance -> temperature
Lookup tables are simple. They're arrays of numbers that convert an index
to an output. But they're also space hogs for the amount of accuracy you
get out of them. With a 12-bit ADC, you're either going to need a 4096-
element lookup table, or you're going to have to interpolate between
elements of a smaller lookup table, in which case you need to do some
multiplication. By the time you commit to using multiplication, you're
generally better off just using a polynomial. So unless you have a lot of
extra RAM or ROM (or an 8-bit ADC which only needs a 256-element
lookup table) and are using a processor where hardware multiplication
isn't available (no "multiply" assembly instruction), a lookup table is a poor
choice for converting ADC voltage to temperature.
The other important thing to note is that while you can convert between
ADC reading and thermistor resistance, and then from thermistor
resistance to temperature, in almost all cases this two-step process is
unnecessary and a poor choice. You don't really care what the thermistor's
resistance is! You care what temperature it is. And on top of that, if you try
to compute the thermistor's resistance, it varies over several orders of
magnitude: it's a nearly exponential relationship with temperature, and
exponentials are bad things to have to calculate with xed-point math.
(thought experiment: a Quality Z 10K thermistor at 25C will be 32.6K at 0
C, and 679 ohms at 100C. If you want 1% numerical accuracy, that means
a dynamic range of 32.6K / (1% of 679 ohms) = 4800:1, which is possible
in 16-bit math but doesn't leave much room in case you suddenly nd out
you need to sense temperature from -10 C or -20 C)
What does this mean? That's another story for a future article, but brie y:
Whew!
At this point, you may be wondering, how did such a simple problem get so
complicated?
The 2021
Embedded Online
Conference
Comments
Reply Reply
Thanks, Bob
Reply Reply
http://www.ti.com/lit/an/snoa633/snoa633.pdf
Reply Reply
Thanks for the detailed feedback and for the pointers to the
base2 log appnote.
Reply Reply
0
Reply Reply
[-] Comment by Anish19 ● January 18, 2014
Hi, nice article
the hyperlink you've given to the first line, is linked to the
address which doesn't contain the article. http://electronics-
0 related.com/showarticle/81.php
Instead, it must be linked to
http://www.embeddedrelated.com/showarticle/81.php
Reply Reply
0
Reply Reply
Reply Reply
Reply Reply
Reply Reply
0
Reply Reply
Reply Reply
I'm not sure I have them anymore; this was an early article
and I didn't keep everything carefully in version control the
way I do now.
0
Anyway, they aren't explicit formulas; the way I derived them
was to fit a curve to the Quality Thermistor Z data, then
consider the voltage divider function α = R /(R + R )
ref ref th
Reply Reply
Jason -
QUESTIONS (see below for current circuit and details that may
help with answers):
help with answers):
DETAILS:
THANK YOU for any help. I'm a hobbyist so any detail you can
provide with your suggestion would be helpful so I don't screw
up your good advice! Any help received will certainly be passed
on as anyone might ask me for help.
- Scott
Reply Reply
1
Reply Reply