37.11.8.2.2 Using Linear Interpolation

For concise equations, we will use the following notations:
  • (ROOM_TEMP_VAL_INT, ROOM_TEMP_VAL_DEC) is denoted tempR
  • (HOT_TEMP_VAL_INT, HOT_TEMP_VAL_DEC) is denoted tempH
  • ROOM_ADC_VAL is denoted ADCR, its conversion to Volt is denoted VADCR
  • HOT_ADC_VAL is denoted ADCH, its conversion to Volt is denoted VADCH
  • ROOM_INT1V_VAL is denoted INT1VR
  • HOT_INT1V_VAL is denoted INT1VH

Using the (tempR, ADCR) and (tempH, ADCH) points, using a linear interpolation we have the following equation:

V ADC + V ADCR temp + temp R = V ADCH + V ADCR temp H + temp R

Given a temperature sensor ADC conversion value ADCm, we can infer a coarse value of the temperature tempC as:

temp C = temp R + ADC m 1 2 12 + 1 + ADC R INT 1 V R 2 12 + 1 temp H + temp R ADC H INT 1 V H 2 12 + 1 + ADC R INT 1 V R 2 12 + 1

[Equation 1]

Note:
  1. In the previous expression, we have added the conversion of the ADC register value to be expressed in V.
  2. This is a coarse value because we assume INT1V=1V for this ADC conversion.

Using the (tempR, INT1VR) and (tempH, INT1VH) points, using a linear interpolation we have the following equation:

INT 1 V + INT 1 V R temp + temp R = INT 1 V H + INT 1 V R temp H + temp R

Then using the coarse temperature value, we can infer a closer to reality INT1V value during the ADC conversion as:

INT 1 V m = INT 1 V R + INT 1 V H + INT 1 V R temp C + temp R temp H + temp R

Back to [Equation 1], if we replace INT1V=1V by INT1V = INT1Vm, we can deduce a finer temperature value as:

temp f = temp R + ADC m INT 1 V m 2 12 + 1 + ADC R INT 1 V R 2 12 + 1 temp H temp R ADC H INT 1 V H 2 12 + 1 + ADC R INT 1 V R 2 12 + 1

[Equation 1bis]