14.1.5 Thermistor [T-Series Datasheet]
Overview
AIN#_EF_INDEX values:
50: calculate temperature using the Steinhart-Hart equation
51: calculate temperature using the beta equation
This Thermistor Extended Feature automatically performs the necessary calculations for thermistors using the Steinhart-Hart equation or the beta equation.
Steinhart-Hart vs. beta: The beta function works well over a limited range of about 50 ºC. Typical error is ~±0.5 ºC. The Steinhart-Hart is usually more accurate (±0.01 ºC) across a larger range. Note that this is just the accuracy of the math converting resistance to temperature, and there are likely other sources of error in your measurement that are similar or greater (e.g. accuracy of the thermistor itself and accuracy of the resistance to voltage conversion circuit).
Configuration
To configure, write to the following registers.
AIN#_EF_CONFIG_A - Thermistor Options: Selects temperature units:
- 0 = K
- 1 = °C
- 2 = °F
AIN#_EF_CONFIG_B - Excitation Circuit Index: The index of the voltage divider excitation circuit to be used.
See 14.1.0.1 Excitation Circuits for circuit indices.
AIN#_EF_CONFIG_C - 2nd AIN: Channel Number to Measure Vresistor: For excitation circuits 3 and 5 this is the extra AIN used to measure the voltage across the fixed resistor. Ignored for other excitation circuits.
AIN#_EF_CONFIG_D - Excitation Volts or Amps: For excitation circuit 2 this is the fixed amps of the current source. For excitation circuit 4 this is the fixed volts of the voltage source. Ignored for other excitation circuits.
AIN#_EF_CONFIG_E - Fixed Resistor Ohms: For excitation circuits 3, 4 and 5, this is the ohms of the fixed resistor.
AIN#_EF_CONFIG_F - R25 Ohms: The nominal resistance in ohms of the thermistor at 25 °C.
Steinhart-Hart | Beta | |
AIN#_EF_CONFIG_G | A coefficient | ß |
AIN#_EF_CONFIG_H | B coefficient | ºC at which ß was calculated |
AIN#_EF_CONFIG_I | C coefficient | No meaning |
AIN#_EF_CONFIG_J | D coefficient | No meaning |
The G, H, I, and J config registers have different meaning for Steinhart-Hart and beta. Steinhart-Hart coefficients are normally provided in the thermistor's datasheet or obtained from the manufacturer.
There are 2 forms of the Steinhart-Hart equation:
1/T= A + B*ln(R/R25) + C*ln(R/R25)^2 + D*ln(R/R25)^3
1/T= A + B*ln(R) + C*ln(R)^2 + D*ln(R)^3
We use the former with "R/R25". If you have coefficients that were generated based on the "R" equation, just set
R25 = 1 (AIN#_EF_CONFIG_F = 1).
Further, sometimes the ^2 term is dropped and the equation is written A + B*ln(R) + C*ln(R)^3
. If you have coefficients that were generated based on this form set C = 0 (AIN#_EF_CONFIG_I = 0) and pass the given C value for D (AIN#_EF_CONFIG_J).
The online calculator from daycounter.com uses the "R/R25" form, and thus is useful for testing. LabJack provides a Thermistor Calculator spreadsheet that is also useful for testing and troubleshooting (make a copy if you want an editable version). The online calculator from thinksrs.com can be used to test "R" based coefficients or the beta equation, and can also be used to generate "R" based Steinhart-Hart coefficients from 3 resistance-temperature pairs.
Remarks
The normal analog input registers are used to control negative channel, resolution index, settling, and range.
T7: If the voltage will stay below 1.0V, use the 1.0V range for improved resolution and accuracy.
T8: For improved resolution and accuracy, use the lowest voltage range that is appropriate for your signal's voltage min/max. For example, if the signal's min/max is -0.0064V/0.0549V, use the T8 voltage range of ±0.075V.
Results
For results, read the following registers.
AIN#_EF_READ_A: Calculated thermistor temperature
AIN#_EF_READ_B: Thermistor resistance
AIN#_EF_READ_C: Thermistor voltage
Only reading AIN#_EF_READ_A triggers a new measurement, so you must always read A before reading B or C.
Troubleshooting
Temperature to Voltage
Determine the expected resistance and voltage and compare to what you are seeing. Assume we have a Vishay NTCLE100E3103 10k Thermistor and LJTick-Resistance-10k and are at 22 °C. From the datasheet the expected resistance is 12488 at 20 °C and 10000 ohms at 25 °C, so we interpolate to come up with an expected resistance at 22 °C:
R22 = 12488 - ( ((22-20)/(25-20)) * (12488-10000) ) = 11493 ohms
Now we use the equation from the LJTick-Resistance Datasheet to calculate the expected voltage:
Vout = Vref*Rfixed/(Runknown+Rfixed) = 2.5*10000/(11493+10000) = 1.163 volts
Compare the expected resistance and voltage to AIN#_EF_READ_B and AIN#_EF_READ_C.
Resistance to Temperature
Use one of the various online calculators from daycounter.com to check the resistance to temperature conversion. In this case we have the Steinhart-Hart coefficients and the first calculator on that page is applicable. We put in A=0.003354016, B=0.000256985, C=0.000002620, D=0.00000006383, Rt=10000, and R=11493, and we get a result of 21.85 °C. Close enough to 22.0 to tell us things are working right. The main source of error here is the fact that we did a linear interpolation to get expected resistance, but resistance is very non-linear. We know this is the main source of error because if we put the actual table value of 12488 ohms for 20 °C, the calculator gives us 19.998 °C.
Example
This example configures a LabJack to read from a Vishay NTCLE100E3103 10k Thermistor using a LabJack LJTick-Resistance to complete the excitation circuit. The LJTick-Resistance is connected to the AIN0/1 terminal block. The thermistor is connected between the Vref and INA terminals on the LJTick-Resistance.
AIN0_EF_INDEX = 50 -- Steinhart-Hart
AIN0_EF_CONFIG_A = 1 -- Output degrees Celsius.
AIN0_EF_CONFIG_B = 4 -- Excitation circuit #4.
AIN0_EF_CONFIG_C = 0 -- Second AIN, not used for excitation circuit #4.
AIN0_EF_CONFIG_D = 2.5 -- 2.5 V provided by the LJTick-Resistance
AIN0_EF_CONFIG_E = 10000 -- 10 kΩ shunt resistor provided by the LJTick-Resistance-10k.
AIN0_EF_CONFIG_F = 10000 -- R25 The nominal resistance of the thermistor at 25 ºC.
AIN0_EF_CONFIG_G = 0.003354016 -- Constants from the thermistor's datasheet.
AIN0_EF_CONFIG_H = 0.000256985
AIN0_EF_CONFIG_I = 0.000002620
AIN0_EF_CONFIG_J = 0.00000006383
Results:
AIN0_EF_READ_A = 23.19 -- Temperature of the thermistor. (°C)
AIN0_EF_READ_B = 10829.4 -- Calculated resistance. (Ω)
AIN0_EF_READ_C = 1.299774 -- Voltage across the thermistor. (V)