Issue
154 May 2003
Automatic
Temp Controller
Data
Logger for Slow Cooker
THERMOCOUPLE
PROPERTIES
First,
the output voltage of a type-K thermocouple is only
about 20 µV (i.e., 0.00002 V) per 1°F. This must be
amplified in order to use the microprocessor’s A/D converter,
but most amplifiers aren’t suitable. General-purpose
op-amps typically have input offset voltage errors of
1 to 5 mV, which corresponds to a temperature error
of hundreds of degrees! The precision op-amp used instead
has a maximum offset voltage error of only 5 µV, or
less than a quarter-degree error. The amplifier circuit
is configured for a gain of 111; therefore, by using
a 2.5-V reference with the A/D converter, you can measure
temperatures from 32° to roughly 1000°F with approximately
1° resolution.
Of
course, if you were to amplify the thermocouple signal,
you’d also amplify any noise signals in this not too
carefully constructed circuit. You can minimize the
effects of noise by taking multiple (32 to 256) A/D
readings and averaging them to produce a single temperature
measurement.
The
second thermocouple problem is that output is nonlinear.
You cannot perform a simple division to convert voltage
to temperature. This is easily dealt with by storing
the type-K voltage-to-temperature table in the controller
software. [1] The 0° to 1000°F temperature range can
be divided into approximately linear regions. You can
use linear interpolation to determine a temperature
within a given region.
The
final thermocouple problem is that output is relative,
not absolute. The voltage at the probe end of the thermocouple
where the two dissimilar wires connect is relative to
the voltage at the circuit end, where the thermocouple
wires connect to the voltage measurement circuit. If
the probe and circuit ends have the same temperature,
the measured voltage will be zero. If the probe end
is hotter, a positive voltage will be measured. If it’s
colder, a negative voltage will be measured.
Therefore,
in order to know the actual temperature at the probe
end, you need to know the temperature of the circuit
end. Historically, this was accomplished by keeping
the circuit end in an ice bath so its temperature remained
32°. Consequently, the connection between the thermocouple
and measuring circuit came to be known as the "cold
junction." The process of using the junction temperature
to calculate the actual probe temperature is referred
to as cold junction compensation.
Instead
of using ice, which is somewhat impractical for a barbecue
application, you can use an IC temperature sensor to
directly measure the actual temperature of the cold
junction. For this to work, the sensor and physical
connection point where the thermocouple wires meet the
copper circuit wires must be the same temperature (i.e.,
isothermal). A difference in temperature will directly
affect the accuracy of the temperature measurement.
One method, which seems to work acceptably well, is
shown in Photo 4.
|

(Click
here to enlarge)
|
Photo
4—An LM34 (inside the 0.25" copper tube) measures
the tube’s temperature, which is approximately isothermal
with the thermocouple connector. |
MULTIPLE
THERMOCOUPLES
After
you have the basic setup to measure one channel, it’s
easy to add an analog multiplexer to select from one
of several channels. However, in order to prevent false
alarms from the alarm circuit, you need to know if a
thermocouple is actually connected to a channel. The
circuit shown in Figure 1 allows the microprocessor
to determine this.
|

(Click
here to enlarge)
|
Figure
1a—With no thermocouple connected, a test voltage
applied to the op-amp produces a maximum output
voltage. b—The low impedance of a connected thermocouple
drastically reduces the test voltage, producing
a much lower output voltage. |
TEMP
MEASUREMENT
You
must complete several steps to make a single temperature
measurement. First, select the channel to be read by
setting the analog multiplexer to one of the four thermocouples.
Then, see if there is actually a thermocouple connected
by turning on the missing thermocouple test voltage
and taking an ADC measurement. Remember that a single
measurement is actually the average of 32 to 256 readings.
If
the result is the maximum A/D value, then there is no
thermocouple connected to that channel, so report a
temperature value of zero. Otherwise, turn off the missing
thermocouple test voltage, and measure the actual thermocouple
output.
Using
the A/D reading, the amplifier gain (111), and the A/D
voltage reference value (2.5 V), compute the actual
thermocouple voltage. A 10-bit A/D reading will be in
the 0- to 1023-V range, so the actual voltage is equal
to the following:
Next,
take and average multiple A/D readings of the cold junction
temperature sensor, and convert that voltage to the
cold junction temperature. Using the cold junction temperature
and the type-K voltage/temperature table, compute the
type-K voltage that’s equivalent to the cold junction
temperature. Add the thermocouple voltage to the cold
junction voltage. Using the type-K table, convert the
summed thermocouple and cold junction voltages to the
actual thermocouple temperature.