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:

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?


  • Synopsys Takes The Analog/Mixed-Signal Plunge
  • October 2, 2008
  • Electronic Design Update: October 1, 2008
  • For Checking Software Without Hardware, FPGAs Are The Answer
  • ESL Platform Looks To Solidify Baseband PHY Design Flow
  • September 25, 2008
  • Electronic Design Update: September 24, 2008
  • Tools Take On IC-Package And SiP Design Challenges
    1) Build A Smart Battery Charger Using A Single-Transistor Circuit
    (191 views today)
    2) Easily Convert Decimal Numbers To Their Binary And BCD Formats
    (107 views today)
    3) Precision DC motor speed controller
    (88 views today)
    4) Efficient DC-To-AC Inverters Charge Equipment Racks
    (78 views today)
    5) DC-AC inverter targets electroluminescent applications
    (68 views today)
    ALL TOP 20







    Reader Comments

    Sir, I need a circuit to convert 4-20ma to 0-5vdc, for interface to a pic analog input, could you please send me a circuit to do so with accuracy and leniarity.

    Anonymous -June 10, 2008

    Sir, could you send me the source code and circuit diagram for temperature sensing using PIC.. INPUT: THERMISTOR..OUTPUT:LCD..range:0-50 deg celsius

    HARIHARAN -March 14, 2008

    Rating Only

    Rating Only -March 14, 2008   (Article Rating: )
    Read more comments...

    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.
     
     

    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