tockn / MPU6050_tockn

Arduino library for easy communication with MPU6050
226 stars 89 forks source link

Temperature error - please check #37

Open hydrastarmaster opened 5 years ago

hydrastarmaster commented 5 years ago

Hi, MPU6050 temperature does not match the specific BMP280 temperature measurement.

The current calculation for the temperature is: temp = (rawTemp + 12412.0) / 340.0; But the datasheet (MPU-6000-Register-Map1.pdf) specifies:

Temperature in degrees C = (TEMP_OUT Register Value as a signed quantity)/340 + 36.53

36.53 * 340 = 12420020, so the error should be in the formula.

Using this calculation will give the right value: temp = rawTemp / 340.0 + 36.53; In this case, the small difference vs. BMP280 can be justified as the internal heat of the gyro.

Thank you.