Sensors enable software to detect what is happening in the real world. This article surveys various temperature sensors and describes how they interface to a processor.
Temperature is one of the most common real-world characteristics that systems need to measure. Many industrial processes, from steel manufacturing to semiconductor fabrication, depend on temperature. Some electronics products need to measure their own temperature, such as a computer that monitors its CPU or a motor controller that must know the temperature of the power driver IC.
Various types of sensors are used to measure temperature. One of these is the thermistor, or temperature-sensitive resistor. Most thermistors have a negative temperature coefficient (NTC), meaning the resistance goes up as temperature goes down. Of all passive temperature measurement sensors, thermistors have the highest sensitivity (resistance change per degree of temperature change). Thermistors do not have a linear temperature/resistance curve.
|Table 1: Typical NTC thermistor data|
|Temp ºC||R/R25||Temp ºC||R/R25|
Data for a typical NTC thermistor family is shown in Table 1. This data is for a Vishay-Dale thermistor, but it is typical of NTC thermistors in general. The resistance is given as a ratio (R/R25 ). Often, many thermistors in a family will have similar characteristics and identical temperature/resistance curves. A thermistor from this family with a resistance at 25∞C (R25 ) of 10K would have a resistance of 28.1K at 0∞C and a resistance of 4.086K at 60∞C. Similarly, a thermistor with R25 of 5K would have a resistance of 14.050K at 0∞C.
Figure 1: Thermistor resistance/temperature curve
Figure 1 shows this thermistor curve graphically. You can see that the resistance/temperature curve is not linear. While the data for this thermistor is given in 10-degree increments, some thermistor tables have five-degree or even one-degree increments. In some cases, you need to know the temperature between two points on the table. You can estimate this by using the curve, or you can calculate the resistance directly. The formula for resistance looks like this:
where T is the temperature in degrees Kelvin and A, B, C, and D are constants that depend on the characteristics of the thermistor. These parameters must be supplied by the thermistor manufacturer.
Thermistors have a tolerance that limits their repeatability from one sample to the next. This tolerance typically ranges from 1% to 10%, depending on the specific part used. Some thermistors are designed to be interchangeable in applications where it is impractical to have an adjustment. Such an application might include an instrument where the user or a field engineer has to replace the thermistor and has no independent means to calibrate it. These thermistors are much more accurate than ordinary parts, but considerably more expensive.
Figure 2: Thermistor circuit
Figure 2 shows a typical circuit that could be used to allow a microprocessor to measure temperature using a thermistor. A resistor (R1 ) pulls the thermistor up to a reference voltage. This is typically the same as the ADC reference, so Vref would be 5V if the ADC reference were 5V. The thermistor/resistor combination makes a voltage divider, and the varying thermistor resistance results in a varying voltage at the junction. The accuracy of this circuit depends on the thermistor tolerance, resistor tolerance, and reference accuracy.
Since a thermistor is a resistor, passing current through it will generate some heat. The circuit designer must ensure that the pullup resistor is large enough to prevent excessive self-heating, or the system will end up measuring the thermistor dissipation instead of the ambient temperature.
The amount of power that the thermistor has to dissipate to affect the temperature is called the dissipation constant, and is the number of milliwatts needed to raise the thermistor temperature 1∞C above ambient. The dissipation constant varies with the package in which the thermistor is provided, the lead gauge (if a leaded device), type of encapsulating material (if the thermistor is encapsulated), and other factors.
The amount of self-heating allowed, and, therefore, the size of the limiting resistor, depends on the measurement accuracy needed. A system that require an accuracy of ±5∞C can tolerate more thermistor self-heating than a system that must be accurate to ±0.1∞C.
Note that the pullup resistor must be calculated to limit self-heating dissipation over the entire measurement temperature range. For a given resistor, the thermistor dissipation will change at different temperatures because the thermistor resistance changes.
Figure 3: Thermistor scaling
Click here for larger view
Sometimes you need to scale a thermistor input to get the proper resolution. Figure 3 shows a typical circuit that expands the 10-40∞C range to span the 0-5V input of the ADC. The formula for the output of the op amp is as follows:
Once you have a thermistor scaled (if needed), you can make a chart showing the actual resistance vs. temperature values. You need the chart because the thermistor isn't linear, so the software needs to know what ADC value to expect for each given temperature. The accuracy of the table-one-degree increments or five-degree increments-depends on the accuracy your application requires.
In any thermistor application, you have to select the sensor and any other components in the input circuit to match your required accuracy. Some applications may only need 1% resistors, but others may require .1% resistors. In any event, you should make a spreadsheet showing the effects of tolerance stackup in all the components, including the resistors and references, and the thermistor itself.
If you need more accuracy than you can get with affordable components, you may have to calibrate the system after it is built. In some applications, this is not an option since the circuit boards and/or thermistor must be field-replaceable. However, in cases where the equipment is not field-replaceable, or where the field technicians have an independent means to monitor the temperature, it is possible to let the software build a table of temperature vs. ADC values. There must be some means to input the actual temperature (measured with the independent tool) so the software can construct the table. In some systems, where the thermistor must be field-replaceable, you may be able to calibrate the replaceable component (sensor or entire analog front end) at the factory and provide the calibration data on disk or other storage media. Of course, the software must provide a means to apply the calibration data when the components are changed.
In general, thermistors provide a cost-effective means to measure temperature, while still remaining easy to use. Next we will look at RTD and thermocouple temperature sensors.
Resistance temperature detector
A resistance temperature detector (RTD) is a wire that changes resistance with temperature. Typical RTD materials include copper, platinum, nickel, and nickel/iron alloy. An RTD element can be a wire or a film, plated or sprayed onto a substrate such as ceramic.
Figure 4: Temperature/resistance curve: RTD vs. thermistor
RTD resistance is specified at 0∞C. A typical platinum RTD with 100W resistance at 0∞C would have a resistance of 100.39W at 1∞C and a resistance of 119.4W at 50∞C. Figure 4 shows a comparison of a typical RTD temperature/resistance curve to that of a thermistor. The tolerance of RTDs is better than thermistors, typically ranging from .01% for platinum to .5% for nickel. Aside from better tolerance and overall lower resistance, the interface to an RTD is similar to that for a thermistor.
A thermocouple is a junction of two dissimilar metals, which produces a tiny voltage when heated. The amount of voltage is dependent on which two metals are joined. Three common thermocouple combinations are Iron-Constantan (type J), Copper-Constantan (type T), and Chromel-Alumel (type K).
The voltage produced by a thermocouple junction is very small, typically only a few millivolts. A type K thermocouple changes only about 40V per 1∞C change in temperature; to measure temperature with .1∞C accuracy, the measurement system must be able to measure a 4V change.
Figure 5: Thermocouple
Since any two dissimilar metals will produce a thermocouple junction when joined, the connection point of the thermocouple to the measurement system will also act as a thermocouple. This effect is usually minimized by placing the connections on a isothermal block, so that the two connection points are at the same temperature, minimizing the error. In some cases, the temperature of the block is measured, allowing compensation for the temperature effects. Figure 5 shows an isothermal block with an added diode used for temperature measurement.
The gain required to measure a thermocouple is typically in the range of 100 to 300, and any noise picked up by the thermocouple will be amplified by the same amount. An instrumentation amplifier is often used because it rejects the common mode noise in the thermocouple wiring. Off-the-shelf thermocouple signal conditions, such as the Analog Devices AD594/595, simplify the hardware interface.
The simplest semiconductor temperature sensor is a PN junction, such as a signal diode or the base-emitter junction of a transistor. If the current through the forward-biased silicon PN junction is held constant, the forward drop decreases about 1.8mV per ∞C. A number of ICs take advantage of this semiconductor characteristic to measure temperature. These parts include the Maxim MAX1617, the National Semiconductor LM335, and the LM74. Semiconductor sensors have different interfaces, ranging from a voltage output to a serial SPI/
The range of available temperature sensors is wide. With the right combination of software and hardware, you should be able to find one that suits your application.
Stuart Ball is an electrical engineer with over 20 years of experience designing embedded systems. He is the author of three books, Embedded Microprocessor Systems: Real World Design, Debugging Embedded Microprocessor Systems, and Analog Interfacing to Embedded Systems, all published by Butterworth-Heinemann. His e-mail address is .