Calculate the measured resistance value based on the read ADC LSB value.Store the 1☌ step LUT into your controller’s memory.See Figure 2 for examples.įigure 2. 1☌ and 5☌ table examples for the TMP61 thermistor family There are two types of LUTs: the 1☌ and 5☌. TI has a design tool that can provide you with a LUT or fourth-order polynomial and regression function, with examples of how to apply these math functions in C code for your controller to get the most accurate temperatures from a thermistor.Ī LUT typically ranges from -40☌ to 125☌, but will vary based on the thermal limits of the thermistor. These are simple math functions that can process faster than an LUT with interpolation. Most PTCs are based on polynomials.ĭon’t be concerned once you get the hang of polynomials, you will get better accuracy plus, you will not need a LUT in your controller. You must apply the polynomial fit yourself and then solve the regression function (the temperature based on the curve fit) to obtain the temperature. Another way to describe polynomials is that they provide a curve-fit equation for a slope. A polynomial is a mathematical expression of variables that involves only the operations of addition, subtraction, multiplication and non-negative integers. Polynomial equations are the most accurate way to get a temperature from a thermistor. PTCs can use a polynomial equation, given the linear output of the device. The Steinhart-Hart equation is more accurate than a LUT. It will require natural log math to complete, and you must have a floating-point controller or floating-point math libraries to perform the calculations. I will discuss this further in the Linear Interpolation section.Īnother method is to use a Steinhart-Hart equation, which is based on a 3rd order polynomial curve fit. A 5☌ LUT will require 33 elements, but no one wants to see 5☌ resolution, so further processing of the LUT will be necessary in order to get better than 5☌ or 1☌ of resolution. To reduce the number of elements, you could use a 5☌ LUT, but then you may have some linear error in the calculation. A 1☌ LUT table has 166 elements and must be stored in your controller, but this uses up controller memory. The most common method uses a look-up table (LUT), also known as a resistance table, normally provided by the thermistor manufacturer. Once you have converted the voltage to an ADC representation, there are a number of ways to get the actual temperature from the thermistor’s V Sense voltage. Where I bias is 200 ♚ (default standard current for a TMP61 family part) and V Sense is 1.63 V. Where the ADC resolution (12-bit ADC (2 12)) is 4,096 total bits, V REF is 3.3 V and the measured ADC LSB value is 2,024 (example ADC LSB value from a Texas Instruments (TI) TMP61 thermistor family test board).Įquation 2 calculates the resistance from the voltage divider’s V Sense:Įquation 3 calculates the resistance from the constant current, I bias: You can use Equation 1 to convert the measured 12-bit ADC LSB value to a voltage: Figure 1 shows both the voltage-divider and constant-current circuits.įigure 1. Voltage-divider and constant-current circuit implementations A common ADC resolution is 12 bits for many low-cost MCUs, so the formulas in this article will use 12-bit resolution. This article explains how to use an NTC or a PTC thermistor with an ADC, along with the various process techniques to convert ADC measured results into a usable temperature value.Ī typical thermistor circuit provides a voltage (V Sense) that is applied to an ADC input the ADC then converts this voltage to an LSB (least significant bit) digital value that is proportional to the input voltage. The most basic circuit is based on a resistor divider attached to a low-cost microcontroller (MCU) with an analog-to-digital converter (ADC). The simplest and most cost-effective circuits use a negative temperature coefficient (NTC) or positive temperature coefficient (PTC) thermistor to measure temperature. All of the products that I have designed in my career have had some form of temperature circuit in them.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |