Reprints     Printer-Friendly    Email this Article    RSS        Font Size     What's This?

[Ideas For Design]

Microcontroller Makes Linear Temperature Measurement Simple



Contributing Author  |   ED Online ID #4868  |   October 30, 2000

Article Rating: Not Rated

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 <− 18

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.




Reprints     Printer-Friendly    Email this Article    RSS        Font Size     What's This?


  • Parasitic Extraction Tool Targets Next-Generation Custom ICs
  • Synopsys Jumps Into ESL-Synthesis Pool
  • Verify Control Systems Before Committing To Hardware
  • You're Using How Many FPGAs?
  • Tool Up For The FPGA Blitz
  • Support Will Have Android Showing Up In Embedded Apps
  • High-Level Design In EDA—Quo Vadis? (Or, Where Are You Going?)
  • New Power-Management Policies Emerge At DAC
    1) Build A Smart Battery Charger Using A Single-Transistor Circuit
    (171 views today)
    2) Hot Hands For Some Cool Rock: Motion Sensing Meets Audio Engineering
    (163 views today)
    3) White LEDs Promise Green Illumination Domination
    (66 views today)
    4) Bidirectional H-Bridge DC-Motor Motion Controller
    (65 views today)
    5) What's All This Transimpedance Amplifier Stuff, Anyhow? (Part 1)
    (46 views today)
    ALL TOP 20







    POST YOUR COMMENTS HERE

    Name:

    Email:
    Rate this article:

     less useful more useful 
    1
    2
    3
    4
    5
    Your Comments:

    Enter the text from the image below




    Please refresh the page if you have trouble reading this text.
    (Acceptable Use Policy)
     
     

    PartFinder

    Find real-time pricing, stock status, same-day/next-day shipping options and more. Brought to you by Digi-Key. Go to PartFinder.    
    GlobalSpec

    PART SEARCH :
    Powered by: GlobalSpec - The Engineering Search Engine
    Sponsored Links

    Electronic Design Europe Electronic Design China EEPN Power Electronics Auto Electronics Microwaves & RF
    Mobile Dev & Design Schematics Find Power Products Military Electronics EE Events Related Resources