Go Down

Topic: mpu6050 problem (Read 13 times) previous topic - next topic


Ok thank you. But how can I change the i2c address in 0x69?


That's why I added my own measurements to that page : http://playground.arduino.cc/Main/MPU-6050#measurements

Your values seem okay. If you want to know what they mean, you have to read the datasheet about bits and range.
For serious use, you can now move on to use the library by Jeff Rowberg. But you have to connect the INT to Arduino digital pin 2.

Another option you have is to use the FreeIMU library, which supports generic MPU6050 breakout boards.  Be sure to modify freeIMU.h, and comment out the line the by default sets to the libary to use FreeIMU hardware, and un-comment out the line that say GenericMPU6050.

I have used both Rowbergs code and the FreeIMU library.  They are both very good.  Here are few things to know about each to get them up and running.

Rowbergs code is designed to use I2CDev library and his code accesses the DMP (digital motion processor) on the MPU6050.  This offloads a lot of the motion calculations to the MPU6050 instead of your Arduino doing the calculations.  Getting your MPU6050 working with Rowberg's code is pretty easy, and the resulting data output from the DMP looks good.  It will output Yaw/Pitch/Roll, Euler Angles, and Accelerations from the accelerometer.

FreeIMU takes a little more work to get up and running, but not by much.  FreeIMU does not use the DMP, and comes with a library that uses a MARG orientation algorithm to calculate the Yaw/Pitch/Roll of your sensor.  FreeIMU comes with an older I2CDev library that does NOT work with Rowbergs DMP code.  So make sure you keep the I2CDev libararies separate somehow.  I name one directory I2CDev_Master and one I2CDev_FreeIMU.  Whichever code I am using (I often switch between the two for comparison) I rename to just I2CDev.  I am working on modifying the I2CDev libaries to work with both, but I am slow at it.  FreeIMU does not output just acclerations, it only uses the accelerometer to aid in determinging yaw/pitch/roll and Euler angles.  I may be wrong about that, as I need to spend more time looking at the examples and code, but from what I saw initially, I did not find anything in the code that would suggest it outputs accelerations on their own.  I am working on a sketch that integrates the FreeIMU code to get the yaw/pitch/roll and Rowberg's DMP code to get the acclerations. The problem has been the I2CDev versions that are incompatible.  The freeIMU libary's yaw/pitch/roll data seems to be stable and faster than using the DMP, which is why I want to use freeIMU's code for it.

Another thing to keep in mind is support.  I've emailed Jeff before with questions about quaternions and gymbal lock with respect to his code and he responded very quickly and was very helpful, so that is a bonus.  FreeIMU's founder Fabio Varesano sadly passed away last month so support for FreeIMU will only be from other users until/unless somebody else takes over FreeIMU and continues to develop it. 


Thank you so much for this reply. Also I have emailed to jeff, but he did't replie me yet. ok. let's try XD


Ok. I've modified the source and now Arduino can find my board, but it does the same value that the first sketch did... How is this possible?
Code: [Select]
Initializing I2C devices...
Testing device connections...
MPU6050 connection successful
a/g: -4488 244 17336 236 -134 -76
a/g: -4476 252 17184 259 -146 -78
a/g: -4436 368 17380 254 -162 -84
a/g: -4496 336 17364 250 -173 -62
a/g: -4544 200 17308 261 -189 -68


Looks like you are using the raw data example.  There is another example directory included called "DMP6 Example" or something like that.  That is the one that uses the DMP to process the data, and will allow you to output in degrees and accelerations instead of raw sensor values.

Go Up