dmp on MPU6050

Hi at all!

I have a platform drotek 10dof, arduino 2009 328p, ide1.01, win 7 64 bit.

The sketch of the site arduino.cc krodal in the playground, he runs well, with raw sensor data.

By jeff rowberg on github site, the file mpu6050_raw is ok but MPU6050_DMP6 gives me this screen

and then, error: FIFO OVERFLOW.

does anyone know how I can fix it?

The FIFO is used with the INT (interrupt) to signal that something is waiting in the fifo.

If you check the example code, you see that an interrupt routine is used. So you have to connect the INT output of the sensor to some input of the Arduino.

Check this line in the code: attachInterrupt(0, dmpDataReady, RISING);
That where the interrupt routine is set with interrupt 0 (pin 2).
http://arduino.cc/it/Reference/AttachInterrupt

I added the line suggested:
attachInterrupt (0, dmpDataReady, RISING); in the interrupt detection routine, before the initial setup.

The problem of fifo overflow is re-proposes after several seconds of time.

To use the potential of the sketch MPU6050_DMP, perhaps I have to change this line?

fifoBuffer uint8_t [64]; / ??/ FIFO storage buffer

Enlarging the FIFO buffer ? I don't know if the code can handle that.
You could try to double the size, just to test what it will do.

Sorry if my post was not clear.
You don't have to add that line, it is already in the code. So please remove what you added. Use the original code.
Look in the code for that line (search for "attachInterrupt"), you see that INT0 (pin 2) of the Arduino is used.

Question : Do you have the interrupt output of the sensor board connected to the interrupt input of the Arduino?

it is I who must apologize!

I found the line of code, I try to set the right number of the switch outside.

Your question to me is a problem ...
The connections between Arduino and 10dof drotek these should be ...

I do not understand what I do ...

interrupt by setting to 1, the serial ..

Initializing I2C devices...
Testing device connections...
MPU6050 connection successful

Send any character to begin DMP programming and demo:
Initializing DMP...
Enabling DMP...
Enabling interrupt detection (Arduino external interrupt 0)...
DMP ready! Waiting for first interrupt...
$=vQÿ¹
FIFO overflow!
$:ÞWMa¾
FIFO overflow!
FIFO overflow!

There should be an extra line: the interrupt.
The sensor signals an interrupt, telling the Arduino that new data is in the FIFO. The Arduino reads the sensor FIFO data over the I2C-bus, but only if the Arduino gets the interrupt signal.

But your sensor board doesn't have an interrupt output !

If your Drotek sensor board is this one, there is no interrupt output.
http://www.drotek.fr/shop/en/62-imu-10dof-mpu6050-hmc5883-ms5611.html

But this Drotek sensor board does have a interrupt output.
http://www.drotek.fr/shop/en/42-mpu6050-gyro-accelerometer.html

The Sparkfun sensor board has a 'INT' output: http://www.sparkfun.com/products/11028
My Ebay sensor board has a 'INT' output: http://arduino.cc/playground/Main/MPU-6050
This has a 'INT' output: http://flyduino.net/MPU6050-Break-Out-onboard-33V-reg_1
Even this one has a 'INT' output: varesano.net -

You bought the only board without 'INT' output, so you probably can't use the Jeff Rowberg library.
Perhaps you could ask Jeff Rowberg if this board can be used without interrupt.
Or you could ask Drotek.fr how to solve this.

thanks a lot, now I understand better the situation ..

I try to contact jeff (or drotek..),

but do you think can change the sketch of such free_imu or others to obtain a result similar to that of MPU6050_DMP?

julio79:
...but do you think can change the sketch of such free_imu or others to obtain a result similar to that of MPU6050_DMP?

In the playground section: Arduino Playground - InterfacingWithHardware
there is a link to the forum : http://arduino.cc/forum/index.php/topic,58048.0.html
which is about Kalman filtering and so. But I haven't used that yet, so I don't know much about it.

Sorry, for using your thread. I happened to have your same problem. Like Krodal said, i connected INT of my MPU-6050 to digital pin 2 of the arduino, still the serial monitor displays junk values. Any idea what i should do?

Never mind, guys. Got it working. I hadn't noticed the define statements were commented, i had to uncomment them to get the readings. But I haven't got the teapot application working though :frowning: It just doesn't move. If anyone does get it, Please help me out.

I have the same problem. INT is connected to pin2, still FIFO overflow =(
Any sugestion?

Maybe your code is too slow or ineffective? I had a FIFO overflow too when I set the baudrate to 4800 and when I had a small delay in the code :wink: But I have a problem with my arduino pro mini 8mHz 3.3V. I use the same code for my Uno and Mini, but the mini won't even execute the first part of the code whereas it runs fine on the UNO.. The mini doesn't seem to get past the mpu.initialize(); part..

void setup() {
// join I2C bus (I2Cdev library doesn't do this automatically)
Wire.begin();

// initialize serial communication
// (115200 chosen because it is required for Teapot Demo output, but it's
// really up to you depending on your project)
Serial.begin(19200);

// initialize device
Serial.println(F("Initializing I2C devices..."));
mpu.initialize();

any ideas??

i would be happy if the sketch comes to the FIFO Overflow, my problem and i dont know why:

Initializing MPU device...
Testing device connections...
MPU60X0 connection successful

Send any character to begin DMP programming and demo:
Initializing DMP...

Resetting MPU60X0...
Disabling sleep mode...
Selecting user bank 16...
Selecting memory byte 6...
Checking hardware revision...
Revision @ user[16][6] = 4D
Resetting memory bank selection to 0...
Reading OTP bank valid flag...
OTP bank is valid!
Reading gyro offset values...
X gyro offset = 63
Y gyro offset = 0
Z gyro offset = 1
Setting slave 0 address to 0x7F...
Disabling I2C Master mode...
Setting slave 0 address to 0x68 (self)...
Resetting I2C Master control...
Writing DMP code to MPU memory banks (1929 bytes)
Success! DMP code written and verified.
Writing DMP configuration to MPU memory banks (192 bytes in config def)

Can anybody please help me out with this?

that looks successful. what are you actually complaining about ?

I also have been having issues with the FIFO overflow on my GY521. Below is a screen capture of what I am getting now. I am happy with the gyroscope readings, but I also need the accelerometer's aswell for my project. Anyone please tell me what I should do to correct this problem?

The readings were taken when everything was sitting still on a table at close to 10 degrees angle.

grimreaper:
Sorry, for using your thread. I happened to have your same problem. Like Krodal said, i connected INT of my MPU-6050 to digital pin 2 of the arduino, still the serial monitor displays junk values. Any idea what i should do?

Are u using MPU6050_DMP6 of Jeff? and the baudrate of your serial is 115200? The junk values are the results of the conversion to ASC. If u uncomment #define OUTPUT_READABLE_EULER u will see the Euler angles(in degree).

It looks like you are not reading the device often enough. The MPU6050 is doing calculations faster than you are reading the results, and it's buffer overflows.

This doesn't necessarily matter, if you don't need such a rapid update rate anyway. You can just delete that warning message in your arduino sketch, and you won't see the message any more.

I slowed the transmission frequency in the MPU6050_6Axis_MotionApps20 library from 100 Hz to 20 and the device is able to be picked up by a terminal on the phone, but my app still is unable to read all the information. Like you said the information is transmitting so fast that the phone can't read it.

An idea that I had was to transmit the information in one string in both subroutines. This would prevent the device from sending out parts of the information in separate lines. Problem that I am running into is that the format of program won't allow me to do this. What would you suggest for me to limit the transmissions to allow my app to catch up?

Hello, I'm new here, looking for some answers to our beloved MPU 6050. I had the same problem before but a friend gave me a hand and explain something about that it wasn't aligned. At the processing code, not at the arduino code. What he did was to realign if is not aligned. I don't know how it really works but it works.

while (port.available() > 0) {
        int ch = port.read();
        print((char)ch);
        if (aligned < 4) {
            // make sure we are properly aligned on a 14-byte packet
            if (serialCount == 0) {
                if (ch == '

Maybe this can be helpful, or maybe not. But just in case, it didn't work and now it works (with some other issues)) aligned++; else
                {
                  aligned = 0;
                  serialCount=0;
                }
            } else if (serialCount == 1) {
                if (ch == 2) aligned++; else
                {
                  aligned = 0;
                  serialCount=0;
                }
            } else if (serialCount == 12) {
                if (ch == '\r') aligned++; else
                {
                  aligned = 0;
                  serialCount=0;
                }
            } else if (serialCount == 13) {
                if (ch == '\n') aligned++;else
              {
                  aligned = 0;
                  serialCount=0;
                }
            }
            //println(ch + " " + aligned + " " + serialCount);
            serialCount++;
            if (serialCount == 14) serialCount = 0;
        } else {
            if (serialCount > 0 || ch == '


Maybe this can be helpful, or maybe not. But just in case, it didn't work and now it works (with some other issues)) {
                teapotPacket[serialCount++] = (char)ch;
                if (serialCount == 14) {
                    serialCount = 0; // restart packet byte position
                    
                    // get quaternion from data packet
                    q[0] = ((teapotPacket[2] << 8) | teapotPacket[3]) / 16384.0f;
                    q[1] = ((teapotPacket[4] << 8) | teapotPacket[5]) / 16384.0f;
                    q[2] = ((teapotPacket[6] << 8) | teapotPacket[7]) / 16384.0f;
                    q[3] = ((teapotPacket[8] << 8) | teapotPacket[9]) / 16384.0f;
                    for (int i = 0; i < 4; i++) if (q[i] >= 2) q[i] = -4 + q[i];
                    
                    // set our toxilibs quaternion to new data
                    quat.set(q[0], q[1], q[2], q[3]);

Maybe this can be helpful, or maybe not. But just in case, it didn't work and now it works (with some other issues)