herunterladen

Maxim > Design Support > Technical Documents > Application Notes > Temperature Sensors and Thermal Management > APP 685
Keywords: temperature sensors, temperature switches, thermal comparators, remote diode temperature
sensors
APPLICATION NOTE 685
How to Simplify the Interface between
Microcontroller and Temperature Sensor
Aug 04, 2000
Abstract: Temperature is an analog quantity, but digital systems often use temperature to implement
measurement, control, and protection functions. If you apply the right techniques and components, the
necessary conversion of analog temperature to digital information won't be difficult. This application note
discusses thermal comparators, PWM-output temperature sensors, and remote diode (or thermal diode)
temperature sensors.
Temperature is an analog quantity, but digital systems often use temperature to implement measurement,
control, and protection functions. If you apply the right techniques and components, the necessary conversion
of analog temperature to digital information won't be difficult.
Reading temperature with a microcontroller (µC) is simple in concept. The µC reads the output code of an
analog-to-digital converter (ADC) driven by a thermistor-resistor voltage divider, analog-output temperature
sensor, or other analog temperature sensor (Figure 1). The ADC built into some controllers can simplify this
design. ADCs require a reference voltage, which can be generated by an external device. For example, the
reference voltage for a thermistor sensor is usually the same as that applied to the top of the resistor-
thermistor voltage divider. However, the following complications can arise in these systems:
The sensor's output-voltage range is significantly smaller than the ADC's input-voltage range. A
typical ADC for this purpose might have 8-bit resolution and a 2.5V reference voltage, which is normally
equivalent to the input-voltage range. If the sensor's maximum output for the temperature range of
interest is only 1.25V, the effective resolution drops to 7 bits. To achieve 8-bit resolution, either add gain
via an external op amp or lower the ADC's reference voltage (which may reduce the accuracy of some
ADCs).
The error budget is tight. Combining the error from the thermistor-resistor combination or analog-
sensor device with those contributed by the ADC, the amplifier offset voltage, the tolerance of gain-
setting resistors, and the voltage reference error may be more error than your system can tolerate.
You want a linear temperature-to-code transfer function and you're using a thermistor. The
transfer function for thermistors is very nonlinear, but it may be sufficiently linear over the narrow
temperature range required in many applications. You can compensate for the nonlinearity with a look-
up table, but this approach requires resources that may not be available.
ADC inputs are limited. If the number of temperatures you want to measure exceeds the number of
ADC inputs available, you may need to add a multiplexer, which will increase the cost and development
time.
The number of µC I/O pins is limited. This won't be an issue for an internal ADC, but an external
Page 1 of 6