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

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?

Thanks.

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

https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050/Examples

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. :)

Kucky

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
LGK

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: http://www.ebay.com/sch/i.html?_sop=15&_osacat=0&_from=R40&LH_PrefLoc=2&_nkw=iic+i2c+level+module&_sacat=0

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.

http://www.ebay.de/itm/IIC-UART-level-Conversion-Module-Two-Way-Power-Meter-Protector-For-Arduino-5V-3V-/130963951751?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item1e7e0f5087

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.

It works. Thank you. :) :)

Hello Erdin, The MPU9150 works fine with libraries from Februar 2013.

I get the following error message when I use the current libraries.

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

Your post dated "March 13, 2013, 07:08:29 pm".

I changed only the "MPU6050 6 Axis MotionApps 20.h" in "MPU6050 9Axis MotionApps4.h1" from the MPU6050 example. Isn´t that right?

Thank you for your patience. Willi

No that is not right. It might work if you carefully change the #include in every *.cpp file. But the library is complex enough, don't try to make things more difficult.

The compiler complains that it can't find some functions. It needs the *.h file for that.

Hey,

I don´t understand.
I use MPU 9150 breakout with level shifter. No file is changed.
I copied all libraries(_stup - TCA6424A) with changelog “2012-06-21” into the Arduino libraries folder.
I changed this part in the example “MPU6050_DMP6.ino”.

#include “I2Cdev.h”
#include <MPU6050_9Axis_MotionApps41.h> <----------
#include <helper_3dmath.h>
#include “Wire.h”
//#include “MPU6050_6Axis_MotionApps20.h”
//#include “MPU6050.h”

Compiling OK.

Now I copied the newest Lib-Versions (changelog 2013-05-08) into the Arduino libraries folder.

#include “I2Cdev.h”
#include <MPU6050_9Axis_MotionApps41.h> <----------
#include <helper_3dmath.h>
//#include “MPU6050_6Axis_MotionApps20.h”
//#include “MPU6050.h”

???
// Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation
// is used in I2Cdev.h
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
#include “Wire.h”
#endif
???

Compiling ‘MPU6050_DMP6’ for ‘Arduino Nano w/ ATmega328’
MPU6050_DMP6.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

Please excuse me, but I do not understand.

Willi

I don't know what is wrong. Perhaps you have only half the new library, or the library itself is wrong. That include file is updated a few days ago and I read : "changelog : ongoing debug release". Perhaps you have to wait a few days and update everything.

Cood idea. Thanks. Willi

i have a big problem with mpu 9150 i tried more then one example about mpu 9150 and still having the same problem witch is >>>> calculating yaw , pitch , roll from the values ax , ay, az , gx , gy , gz , mx , my , mz .