SBOU246 January   2022 TMP61 , TMP61-Q1 , TMP63 , TMP63-Q1 , TMP64 , TMP64-Q1

 

  1.   Trademarks
  2. 1Introduction
    1. 1.1 NTC Thermistor Versus TMP6 Linear Thermistor Family
    2. 1.2 NTC/Linear Thermistor TCR
    3. 1.3 NTC Versus Silicon-Based Linear Thermistor Trade-Offs
    4. 1.4 TMP6 Accuracy
  3. 2Typical NTC Thermistor Design Considerations
    1. 2.1 Voltage-Biased NTC Thermistor Network
    2. 2.2 Pinouts/Polarity
    3. 2.3 Converting NTC Thermistor Hardware Design to TMP6 Linear Thermistor Design
    4. 2.4 Simple Look-Up Table
  4. 3Software Changes
    1. 3.1 Firmware Design Considerations
    2. 3.2 Oversampling
    3. 3.3 Low-Pass Filtering in HW Versus SW
    4. 3.4 Calibration
  5. 4Design considerations for Full-Scale Range Voltage Output
    1. 4.1 Simple Current-Biased
    2. 4.2 Active Voltage-Biased
  6. 5Conclusion
  7. 6Additional Resources/Considerations
    1. 6.1 Constant-Current Source Design
    2. 6.2 TMP6 Thermistor Standard Component Footprints
    3. 6.3 Dual-Sourcing Approach for TMP6 and NTC Thermistors

Low-Pass Filtering in HW Versus SW

Noise can cause erroneous temperature measurements, which is why many designers choose to add an RC filter in hardware to filter out noise coming from the system. But instead of filtering in hardware, you can use this method to eliminate the need for the extra resistor and capacitor, enabling greater board and cost savings. Implementing your filter in software gives you more control over the filter's response by changing the alpha value in real time. Additionally, having the ability to set the filtered temperature minimizes your start-up time.

There are three variables needed for the firmware based low-pass filter:

  1. Alpha

  2. Measure Temp

  3. Filtered Temp

Alpha: This variable controls how much noise is filtered out.

Measured Temp: This variable stores your calculated, pre-filtered temperature reading.

Filtered Temp: This variable stores the resulting temperature after having passed the temperature value through the filter.

The firmware low-pass filtering is executed by the following equation:

Low pass filter equation:

Equation 4. Y(n)=(1-α)×Y(n-1)+(α×X(n))

where

  • Y = Filtered Temp
  • α = Alpha
  • X = Measured Temp

Simplifying...

Equation 5. Y(n)=Y(n-1)-(α×(Y(n-1)-X(n)))

Simplifying further...

Equation 6. Y(n)=Y-(α×(Y-X)) meaning Filtered_Temp = Previous_Filtered_Temp - (Alpha * (Previous_Filtered_Temp - Meas_Temp))

On the Low-Pass Filter tab of the Thermistor Design Tool, you can adjust the alpha and samples per second values to change the filter. In Figure 3-8, you can see that the alpha was set to 0.8. The result seen in Figure 3-9 is that the resulting temperature data after implementing the low pass filter does not change much from the raw data.

GUID-7C29879C-B6E9-4F7B-ADF0-8FD5FE929DF9-low.pngFigure 3-8 Low-Pass Filter Setting With 0.8 Alpha Value.

GUID-75005D1E-FFE2-4480-8751-65CE69A4488A-low.pngFigure 3-9 Low-Pass Filter Response With 0.8 Alpha Value.

After adjusting the alpha value, a filtered response for an alpha value of 0.2 is shown below:

GUID-C91F9DDC-4689-4E63-9DB8-5727119A3A33-low.pngFigure 3-10 Low-Pass Filter Response With 0.2 Alpha Value.
Here you can see that the filtered temperature data comes out to be much smoother than the raw data.

An example of the C code for the low pass filter from the Thermistor Design Tool can be seen in Figure 3-11.

GUID-1366D67B-CCCF-4455-AD42-15E07C6EDF3B-low.pngFigure 3-11 Low-Pass Filter Example C Code.
After oversampling and implementing the low-pass filter algorithm the TMP6 thermistor can show improved performance. A comparison between the corrected TMP6 thermistor and a typical NTC thermistor can be shown below:

GUID-D16C9A9F-A48B-42CE-AA68-FE99F7E05E9D-low.pngFigure 3-12 Corrected Thermistor Accuracy Comparison.
See the Low-Pass Filter tab of the Thermistor Design Tool for more information.