Microcontroller Makes Linear Temperature Measurement Simple

Oct. 30, 2000
Many microcontroller units include an internal analog-to-digital converter (ADC). For instance, most of Motorola's M68HC11 family members have an analog-to-digital subsystem, including an 8-bit ADC, an analog multiplexer, and an analog port (port E)...

Many microcontroller units include an internal analog-to-digital converter (ADC). For instance, most of Motorola's M68HC11 family members have an analog-to-digital subsystem, including an 8-bit ADC, an analog multiplexer, and an analog port (port E) with eight analog input channels. Any available analog-to-digital port pins can be used to implement a simple thermometer with a temperature span of about 40°C to 50°C, minimal incremental cost, and only 24 bytes of additional code in a 68HC11-based system.

In this circuit, a low-cost negative-temperature-coefficient (NTC) thermistor is used as the sensor element (Fig. 1). It's well known that NTC resistors have a highly nonlinear resistance versus temperature characteristic. This is usually modeled as:

RT = RO exp\[B(1/T − 1/TO)\]      (1)

where T is the absolute temperature (in degrees Kelvin), and TO is a reference temperature (usually 298K). RO is the resistance at TO, in ohms, while B represents the material constant of the NTC sensor, in degrees Kelvin. Both RO and B are sensor parameters provided by manufacturers.

This equation gives an error of about 0.3°C in a 50°C span1,2. Such NTC behavior can be easily linearized using a loading resistor, RLIN, placed across the analog input. For this arrangement, the resulting output voltage VO(T) is:

VO(T) = 5RLIN/(RT + RLIN)      (2)

The VO versus T dependence has an S-shaped appearance (VO rises when T increases). This S-shaped curve can be considered linear over a temperature range of about 40°C to 50°C. Due to the large NTC sensitivity, VO varies several volts at typical room temperatures (e.g., from about 1 to 4 V), eliminating the need for an amplifier.

If a linear behavior is expected in a temperature range centered around TC (K), then an optimal linearizing resistor (RLIN) can be added. The selection of the value of RLIN is a critical step. This value can be calculated using the following equation1,2:

RLIN = RC(B − 2TC)/(B + 2TC)      (3)

For illustration purposes, if an application requires temperature measurements over a range of 0°C to 40°C, then TC = 293K. Suppose an NTC is chosen with RO = 10k and B = 4400K2 (TO = 298K). Then, from equation 3, RLIN = 9841 Ω, and from equation 1, the NTC resistance values (RT) at 0°C and 40°C are derived. From equation 2, the circuit outputs (VO) at 0°C and 40°C are calculated.

With these values, we can find the approximate linear dependence:

VO(T) = 1.015 + 0.058T

where VO is in volts and T is in degrees Celsius. Then:

T = 17 VO

approximating to integer values.

For instance, if the ADC voltage references are 0 V and +5 V, then 1 bit is approximately 20 mV. When the 68HC11 internal ADC returns a binary result in variable hex (VO converted to a digital word), then the temperature this value represents is T = 17 × (0.020 × hex) − 18. This expression can be rewritten as T = (17 × hex/50) − 18. This can be easily programmed into a 68HC11 microcontroller by making use of the 68HC11's MUL (integer multiply) and IDIV (integer divide) instructions (see the listing).

The error achieved with this procedure is always less than 1.3°C in a 40°C range (including NTC tolerances). It can be further reduced, however, by implementing RLIN with a potentiometer for error compensation.

References:

  1. R. Pallas-Areny and J.G. Webster, Sensors and Signal Conditioning, John Wiley & Sons, 1991.
  2. Thermistors Catalogue, Therrnometrics Inc., Somerset, U.K., 1993.

Sponsored Recommendations

The Importance of PCB Design in Consumer Products

April 25, 2024
Explore the importance of PCB design and how Fusion 360 can help your team react to evolving consumer demands.

PCB Design Mastery for Assembly & Fabrication

April 25, 2024
This guide explores PCB circuit board design, focusing on both Design For Assembly (DFA) and Design For Fabrication (DFab) perspectives.

What is Design Rule Checking in PCBs?

April 25, 2024
Explore the importance of Design Rule Checking (DRC) in manufacturing and how Autodesk Fusion 360 enhances the process.

Unlocking the Power of IoT Integration for Elevated PCB Designs

April 25, 2024
What does it take to add IoT into your product? What advantages does IoT have in PCB related projects? Read to find answers to your IoT design questions.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!