Is there a guide or list of accel/gyro/compass sensors that have well-documented code that are known to work with the Pi2/3?

I've wasted several weeks trying to get various InvenSense chips to work (MPU-6050, MPU-9150, MPU-9250), and while I've found a ton of code for interfacing them with the Arduino or Pi, almost none of them actually work, and those that do only get raw noisy values with no way to calibrate. I was initially drawn to their on-board DMP, but it looks like InvenSense has discontinued these chips and has removed all documentation and source code for enabling the DMP functionality from their website.

  • What is it about those devices / code that you find does not work? I use the 6050 successfully (just finished up some code to interface to it yesterday), they are also widely used in drones etc.. Commented Jul 23, 2016 at 7:15
  • The 6050 isn't 9DOF. The others don't work with the Pi and report the wrong produce or device IDs, or just hang during DMP initialization. I just left a 9150 running in debug mode last night, and it's been outputting "Waiting for FIRO count >= 48..." for the last 12 hours...
    – Cerin
    Commented Jul 23, 2016 at 14:52
  • I use a 10 DOF GY-87 which combines a 6050, a HMC5883 and a BMP180 which seems to work well. Not using the onboard DMP though, as you say there is little info around on it - resorted to a simple Complimentary Filter instead - depends on your application though... Commented Jul 23, 2016 at 15:22

2 Answers 2


you can find the code for MPU sensor on GitHub over here MPU 6000. if you are looking for video tutorial you can find over here MPU 6000 video tutorial. MPU6000 is easy to use. lets say you want to read the acceleration the send these bytes I2C address+write, 0x3B and then read 6 bytes. first, 2 bytes will be the MSB,LSB for x Acceleration and so on.

If you want to read the Gyro data you can send this command I2C Address + write, 0x43 and read 6 bytes. first, 2 bytes will be the MSB,LSB for x gyro data and so on.


I would recommend the BNO055 from bosch which offers incredibly stable values in its fusion modi while exposing a simple I2C interface.

It is also widely used in Arduino projects and the like, making tons of documentation as well as libraries freely available.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.