How to Compensate for Temperature Sensor Accuracy at Hot and Cold ExtremesSeptember 13, 2016 by Ezana Haile
This article discusses the method of compensating non-linear accuracy characteristics of temperature sensors for higher-accuracy embedded systems.
Analogue and serial output IC temperature sensors may be accurate at room temperature, but at hot or cold extremes the accuracy can decrease nonlinearly. Normally, that nonlinearity has a parabolic shape, which means an equation can be derived to describe the typical nonlinear characteristics of the sensor. This, in turn, can be used to determine compensation for the sensor's accuracy error over a specified range of operating temperatures.
Silicon characterisation data can be used to determine the nonlinear sensor characteristics. From these data, an equation can be derived that describes the typical performance of a sensor. When the corresponding coefficients for the equation are determined, the coefficients can be used to compute the compensation for the typical sensor’s nonlinearity.
In this case, a total of 100 devices were used as representative for the Microchip MCP9700 and MCP9701 analogue-output temperature sensors and 160 devices were used for the MCP9800 serial-output temperature sensor.
Figure 1 shows the typical sensor accuracy before and after compensation. It illustrates that the compensation provides an accurate and linear temperature reading over the sensor operating temperature range. A PIC microcontroller was used to compute the equation and compensate the sensor output to provide a linear temperature reading.
Figure 1: Typical sensor accuracy before and after compensation
Accuracy and Theory
The typical sensor accuracy over the operating temperature range has an accuracy error curve. At hot and cold temperatures, the magnitude of the error increases exponentially, resulting in a parabolic-shaped error curve.
Due to the sensor nonlinearity at temperature extremes, the accuracy specification limits are widened. The reduced accuracy at temperature extremes can be compensated to improve sensor accuracy over the range of operating temperatures.
The temperature sensors use a fully turned-on PNP transistor to sense the ambient temperature. The voltage drop across the base-emitter junction has the characteristics of a diode. The junction drop is temperature dependent, which was used to measure the ambient temperature.
A constant forward current was used to bias the diode, which makes the ambient temperature the only changing variable in the equation. However, the saturation current varies significantly over process and temperature. The variation makes it impossible to measure reliably the ambient temperature using a single transistor.
To reduce dependency on the saturation current, two diodes were used. If both diodes are biased with constant forward currents of IF1 and IF2, and the currents have a ratio of N (IF2/IF1 = N), the difference between the forward voltages (∆VF) has no dependency on the saturation currents of the two diodes; ∆VF is also called voltage proportional to absolute temperature (VPTAT).
VPTAT provides a linear voltage change. The voltage is either amplified for analogue output sensors or is interfaced to an analogue-to-digital converter for digital sensors.
The accuracy of VPTAT over the specified temperature range depends on the matching of both forward current and saturation current of the two sensors. Any mismatch in these variables creates inaccuracy in the temperature measurement. The mismatch contributes to the temperature error or nonlinearity. The nonlinearity can be described using a second-order polynomial equation.
The accuracy characterisation data were used to derive a second-order equation that described the sensor error. This equation can be used to improve the typical sensor accuracy by compensating for the sensor error.
The accuracy error magnitudes are not the same at hot and cold temperatures. There is a first-order error slope, or temperature error coefficient, from -55 to +125˚C. The error coefficient can be calculated using an end-point-fit method.
Once the error slope is calculated, the corresponding offset can be determined at cold by adjusting the error at cold temperature.
To capture the parabolic-shaped accuracy error between the temperature extremes, a second-order term and the corresponding coefficient must be computed.
The second-order temperature error coefficient was solved by specifying an ambient temperature where the calculated second-order error was equal to the known error at ambient temperature. When the ambient temperature was equal to the hot or cold extreme, the second-order term was forced to zero with no error added to the first-order error term. This is because the error at the hot and cold temperature extremes is included in the first-order error.
The average sensor accuracy with the second-order error compensation for all tested devices indicated that, on average, the sensor accuracy over the operating temperature could be improved to ±0.2˚C for the MCP9800, and ±0.05˚C for the MCP9700 and MCP9701.
Among the compensations, the second-order temperature coefficient variable was evaluated at +25˚C. For most applications, the compensation characteristics at this temperature are adequate. However, changing the temperature at which the variable is evaluated provides relatively higher accuracy at narrower temperature ranges. For example, Fig. 2 shows the MCP9700 evaluated at 0, +25 and +90˚C.
Figure 2: MCP9700 average accuracy with varying second-order temperature coefficient variable
When comparing this at 0 and +25˚C, accuracy is higher at cold rather than hot temperatures. However, for temperatures higher than +25˚C, accuracy is higher at hot rather than cold temperatures. However, the magnitude of accuracy error difference among the various values is not significant. Therefore, evaluating at +25˚C provides practical results.
Calibration of individual IC sensors at a single temperature provides superior accuracy for high-performance, embedded-system applications. If the MCP9700 is calibrated at +25˚C and the second-order error compensation is implemented, the typical sensor accuracy becomes ±0.5˚C over the operating temperature range.
A PIC MCU can implement the second-order accuracy error compensation for embedded temperature-monitoring systems. The equation is relatively easy to implement in a 16bit core MCU since built-in maths functions are readily available. However, 12 and 14bit cores require firmware implementation of some maths functions, such as 16bit add, subtract, multiply and divide. Figure 3 shows the firmware flowchart.
Figure 3: Firmware flowchart
MCP9800 and MCP9700 demo boards (MCP9800DM-PCTL and MCP9700DM-PCTL, respectively) were used to evaluate the compensation firmware. A constant temperature airstream was applied directly to the temperature sensors. A thermocouple was used to measure the air stream temperature and compare the sensor outputs.
The test results show the accuracy improvement achieved using compensation firmware routines. At hot and cold temperatures, accuracy is improved by approximately 1 to 2˚C, respectively.
The nonlinear accuracy characteristics of a temperature sensor were compensated for higher-accuracy embedded systems. The nonlinear accuracy curve has a parabolic shape that was described using a second-order polynomial equation. Once the equation was determined, it was used to compensate the sensor output. On average, the accuracy improvement using compensation is ±2˚C for all tested devices over the operating temperature range.
The compensation also improves the wide temperature accuracy specification limits at hot and cold temperature extremes. A PIC MCU can compute the equation and compensate the sensor output using firmware.
About the Author
Ezana Haile works as the Principal Applications Engineer and New Product Architect at Microchip Technology. He is responsible for supporting thermal management products such as temperature sensors, resistance temperature detector or RTD solutions, thermocouple solutions including firmware, hardware or software development. He is particularly skilled in the field of integrated circuits, embedded systems and mixed signals. He is a graduate from St. Mary's University located in San Antonio, Texas, USA.
This article originally appeared in the Bodo’s Power Systems magazine.