SNAA344 October 2020 HDC2080
Figure 2-2 shows the sensor output vs ambient temperature data for the same data as in Figure 2-1. The goal of regression is to obtain the simplest acceptable relationship between the desired variable (ambient temperature), and the known variable (sensor output). Most data analysis software provides curve fitting/trend line tools that can be used to quickly obtain a linear or polynomial relationship.
The R2 value can be used here to evaluate the quality of the regression. A higher R2 value will result in less system temperature error contributed by the curve fit. Using a linear fit will result in a faster computation time, but in a typically lower R2 value when compared to a polynomial regression. In this example, a linear regression line of Tamb = -4.641 +1.03Tc gives an R2 value of greater than 0.999. This quality of fit is sufficient for most system requirements. In this case, the regression shows that the error can be corrected with just a simple offset and gain correction. The I2C host should be used to apply this equation to compensate the sensor temperature readings.