Wrong accelerometer output - MPU9250 and RTIMULib

Hi all,

I'm trying to use an MPU9250 breakout board, powered by RTIMULib library, to obtain Euler angles. Having seen several posts discussing the same sensor and library, I think I've got a problem that hasn't been met. Here's what I've done:

After downloading the RTIMULib from

I switched my sensor type from default MPU9150 to MPU9250 (lines 32 and 34, in file RTIMULibDefs.h). The ArduinoMagCal.ino was then launched. The demo program ArduinoIMU.ino was started, with calibration data saved in EEPROM.

However, the output pose seemed strange. When placing the breakout board flat on the table (positive z-axis pointed upwards, and there was no hard/soft iron or magnets nearby), the roll read -66 and pitch read 51.6, which made no sense.

Then, I used the same program to print the accelerometer data - boom, the x-, y-, and z-axis read -1.96g, -1.42g, and +0.62g, respectively, while the positive z-axis was pointing upwards!

believing that the accelerometer also needs calibration, I then found RTIMULib2 at

This version of RT library contains a whole set of accelerometer & magnetometer calibration tools. I completed the calibration, but I couldn't use the demo program which was not developed for Arduino, but for Raspberry Pi instead.

Have you ever got wrong accelerometer outputs which RTIMULib cannot correct? I guess the problem stems from hardware issue. Before ordering a new MPU9250, I plan to transplant RTIMULib2's accelerometer calibration algorithm back into RTIMULib and try again. Is that feasible?

Stay safe and healthy!