Consumer and commercial thermal applications all rely on temperature sensors. Simpler applications, such as electronic thermometers monitoring outdoor temperatures or temperature monitors inside vehicles, only report ambient temperatures. More complex applications may use temperature data in a control loop, taking actions based on the data. For example, HVAC systems control heating and air-conditioning units to achieve desired indoor temperatures; battery systems control battery charge currents to prevent overcharging of batteries; optical transceivers control laser outputs; and computer memory modules employ thermal management techniques. These are just some of the many applications in which temperature sensor accuracy is vital for performance. Let’s examine the accuracy and interfaces of currently available integrated, discrete and active temperature sensors that address an operating range of –25 to +100 °C.
Integrated Temperature Sensors
By addressing board space and bill of materials (BOM) cost constraints, a microcontroller (MCU) with an integrated temperature sensor can provide a cost-effective, single-chip solution for obtaining temperature data. Temperature sensors integrated into MCUs will likely share similarities with the architecture shown in Figure 1, where a temperature sensor connects internally to one of the multiple inputs of an MCU's analog-to-digital converter (ADC). The voltage across the temperature sensor varies with temperature according to Equation 1. Firmware interfaces to the temperature sensor by reading the ADC output register and applies Equations 1 and 2 to calculate the temperature.
The accuracy of these systems in units of degrees Celsius is usually not readily apparent because it is not explicitly listed in the MCU data sheet. Instead, the data sheet specifies the temperature sensor characteristics in terms of slope, slope error, offset and offset error. Additionally, these error sources are exacerbated by errors in the ADC voltage reference. For example, let us assume an MCU has a 10-bit ADC and the following characteristics:
- Temperature sensor slope = 2.8 ± 0.03 mV/°C
- Temperature sensor offset = 770 ± 9 mV
- ADC voltage reference = 2.4 ± 0.05 V
If the temperature sensor, ADC and voltage reference are considered ideal and without error, the ADC output will be 329 at 0 °C and 448 at 100 °C, using Equations 1 and 2. Accounting for error, an ADC output of 329 can correspond to approximately 0 ± 9 °C, and an ADC output of 448 can correspond to approximately 100 ± 12 °C.
In applications where error on the order of ±12 °C is not acceptable, three calibration techniques can be used to minimize the error. First, address the ADC voltage reference error by measuring the ADC voltage reference with an external voltmeter. Save this measurement so that software can use it in future computations of Equation 2.
Second, address the temperature sensor offset error by performing a one-point calibration. Place the MCU at a known, fixed temperature and take an ADC measurement. After applying Equations 2 and 1, the calculated temperature may differ from the known temperature. Save this difference so that firmware can adjust the offset accordingly in future calculations of Equation 1.
Third, firmware can address the temperature sensor slope error by performing a two-point calibration. First, perform the one-point calibration. Then, repeat the one-point calibration at a different temperature. These two data points will provide the slope according to Equation 3. Save this slope so firmware can use it in future computations of Equation 1.
All three calibration techniques should be used once on each MCU since errors will vary from device to device. The MCU temperature sensor is much more accurate, but the product production test increases in time and complexity.