I have a few chinese breakout boards with MPU6050 and 6500 chips on them.
It seems that Ivensense use two different scaling formulae to get form the sensor data to a temperature in celcius. Neither of which give credible temperature out values.
They are typically 5-10 deg C either side of ambient room temp. I'm aware this is chip temp but I doubt the current case I have on the bench showing 7 deg C LESS than ambient is the chip temp. They are somewhat near RT, and the rest of the data is good, so I rule out comms failure or incorrect programming of the interface.
This seems to be persistent problem and I have found two formulae on line. Neither of which seem to be physically credible.
Has anyone managed to get this to work correctly or should I regard this as a largely worthless feature?
I should also note that I do not know the origin of the actual chips. One is marked IVENSENSE MPU-6050, so I'm guessing it's legit, the other seems like markings may have been osbcured. In any case it's not too legible, so it could be a knock off chip, not Ivensense devices. It register structure and whoami reg suggest 6500.
If it is of any help, this is what I see from the datasheet:
Temperature = ((TEMP_OUT ā RoomTemp_Offset)/Temp_Sensitivity) + 21degC
where RoomTemp_Offset = 0 and Temp_Sensitivity = 333.87
I have rev 2.1 of the 6500 data sheet which gives that formula but I do not see where gives RoomTemp_Offset = 0. If that is the case what is the point of that parameter? That was part of my confusion.
What do you actually want to use the temperature reading for?
The MPU's temperature sensor isn't intended to be an accurate ambient temperature sensor. It's primarily useful for tracking the die temperature and temperature-dependent behaviour of the IMU. So even if you get the conversion formula right, it may not give you the ambient temperature accuracy you're looking for.
If you need actual ambient temperature, use a proper temperature sensor such as a DS18B20 instead.
Thanks Rob, for 6050 I was using this which is the same:
(float)temp / 340.0 + 36.53
[EDIT] well not quite the same the offset is neg., so I add it to correct for the offset.
Re. 6500: Now, I understand the room temp offset. It is not an offset, it is the temperature with zero offset, so it is indeed not needed in the calculation.
That won't get my 6050 any nearer and I dumped the 6500 which was junk anyway.
Thanks for the help. At least I know I have the right figures now.
0 is "just a number" and it is finite (or rather infinitely small) but it does not matter whether you add or subtract it. In fact as I pointed out it does not even need to be in the calculation.