SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
#193443
Hi, having a 9DoF Razor IMU M0 (SEN-14001), calling
imu.update(UPDATE_TEMP);
SerialPort.println("Temp:" + String(imu.temperature));
...shows a temperature of around 2900325. Now I am pretty sure that I haven't 2 million degrees Celsius in my office - so how do I interpret this value correctly?
Is it 29.00325 degrees C? Still hot, but might be correct considering the core temperature of the sensor being heated by the currents. But still I'm not sure.
The value seems proportional to the real temperature, because it reacts to the outside temperature.

SparkFunMPU9250-DMP.cpp #293 (::update) or #354 (::updateTemperature) or inv_mpu.c #870 (mpu_get_temperature) does not say anything about the returned value.
From inv_mpu.c #884 it looks like it converts the value from Q16 format to long, but doesn't reveal more about the actual resulting number or as to why it uses the values 35 and 65535.
RM-MPU-9250A-00-v1.6 Register Map.pdf section 4.23 at page 33 gives the following formula:
TEMP_degC = ( (TEMP_OUT - RoomTemp_Offset)/Temp_Sensitivity) + 21degC
which I can imagine would bring something like this: ((2900325 - RoomTemp_Offset)/ Temp_Sensitivity) + 21, But what should the RoomTemp_Offset and Temp_Sensitivity be?
Are they factory preset values inside the IMU? If so, I can't see how I can read them out with the SparkFunMPU9250-DMP library.
I am also wondering if the readout is an absolute temperature or just relative. It would be nice to have a full documentation about this.

Thanks