Noob here - need help with wiring the MPU-9150 (gyro/accel) to the Uno

Hi, I need some help please with wiring the MPU-9150 breakout board to the Arduino Uno. I have the sketch that will be running on the Arduino from here:

From what I know so far, I only need to connect the following breakouts: GND, VCC, SDA, SCL.

I've searched the web but was not able to find a diagram for the MPU-9150.

Could anyone please either help with a diagram or walk me through the process? Thank you!

The MPU-9150 is a new sensor, so you won't find many examples of it right now.

Do you have the Sparkfun breakout board ?

That board is for 3.3V only. Connect it like this: Arduino Uno <-> Sparkfun MPU-9150 breakout board GND <-> GND 3.3V <-> VCC A4 <-> SDA A5 <-> SCL 2 <-> INT Don't connect the other pins of the Sparkfun breakout board.

Run the i2c scanner,

After that, use the code to interface the MPU-9150. The link by Sparkfun is a copy of the code by Jeff Rowberg. You better use his (newest) code from his website, His code uses the interrupt, that is why pin 2 (=interrupt.0) of the Arduino Uno is used.

Erdin, thank you for your speedy help. I do have the Sparkfun breakout board that you've referenced. I have all I need now!

Thanks again! Here is the working link of the demo running:
Is there a point for me to create a graphical wire diagram for other noobs like myself?

Very nice. You have a result very fast! Maybe you can thank Jeff Rowberg with a link to your video,

Great idea! Just did.

Hello dmelamed,

Looks great, Im having difficulty getting the g values from my 9150 (they all return 0) any chance of a peek at your code… or any hints as to how you got yours working, there’s very little on the web to help…


Read the posts above, about how to connect it and using the i2c scanner.

Hey, I used the Arduino code from the examples that are provided by the chip manufacturer. Do you have that URL or would you like me to post it?

Hi there,

I'm trying to do exactly what you've done in the video, but having trouble with getting it to display as a visualization. I've followed the instructions in the post above, so far this is what was done:

  • Connected everything correctly.
  • Run I2C successfully
  • Calculated roll pitch and yaw from the raw data (did you manually calculate or use another program)? All these values seem to be right.
  • Downloaded processing and FREEIMU, and placed the processing folder from FREEIMU into the processing libraries. Now what?

hi dmelamed! Can you guide me to the link for the processing code?


Hi, I also see that jrowberg has removed the mpu9150 example code from github. Any chance of someone knowing where I can find it?

I search the examplecode for the MPU9150. The original example von Jeff Rowbwerg used "MPU6050_6Axis_MotionApps20.h". I did not found an example with "...9Axis...". Am i blind?

MPU-9150 = MPU-6050 + compass.

You can use the MPU-6050 code, it is one of two chips inside. Jeff Rowberg started with code for the MPU-9150, but he removed it. I don't know why.

Ok thanks for the quick answer. :)


Which option must be enabled to view the Teapotsketch? LG Kucky

Now i get this Errors.
Compiling ‘Quad102’ for ‘Arduino Mega 2560 or Mega ADK’
Quad102.ino : In file included from
MPU6050_9Axis_MotionApps41.h : : In member function ‘uint8_t MPU6050::dmpInitialize()’:
MPU6050_9Axis_MotionApps41.h : ‘setXGyroOffsetUser’ was not declared in this scope
MPU6050_9Axis_MotionApps41.h : ‘setYGyroOffsetUser’ was not declared in this scope
MPU6050_9Axis_MotionApps41.h : ‘setZGyroOffsetUser’ was not declared in this scope
Error compiling

The Mega 2560 board has onboard 10k pullup resistors to the 5V for the I2C. It is one of the very few boards with onboard pullup for the I2C. As a result, the I2C bus is a 5V bus.

If you connect the 3.3V MPU-9150 to it, the sensor might already be damaged (the sensor seems to allow up to 6V, but it is designed for 3.3V). You need a level shifter. I use these for my Mega board:

I think the Teapotsketch uses processing, but I have not tested that myself yet. Is the normal simple sketch running (the one without dmp) ?

I have that Levelshifter.

Is that OK? Must I 3V or 5V connector use? Best Regards Willi

That is the level shifter I use on my Mega board. The 3V is an output, the board has a voltage regulator. It is actually 3.3V, which it should be.

From the Mega to one side of the level shifter: 5V, GND, SDA, SCL. The other side is output side of the level shifter for the 3.3V I2C bus to the sensor: 3V (3.3V), GND, and the 3.3V signals SDA and SCL.