The k value from Equation 5 is unchanged if substituting T2with T1 and ADCT2 with ADCT1. Compensation can now be done by removing the offset and gain errors from the ADC values. This is accomplished by applying the following formula on the output values:

Equation 6: Compensation equation.

T= (TADC - Toffset ) . K

TADC is the output from the ADC converted to °C by subtracting 273 from the ADC value.

Figure 1. ADC Output with Offset and Gain Errors Removed