Go Down

Topic: dmp on MPU6050 (Read 20217 times) previous topic - next topic


Mar 16, 2013, 12:13 am Last Edit: Mar 16, 2013, 12:17 am by Swoop132 Reason: 1
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.


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.

Code: [Select]
while (port.available() > 0) {
        int ch = port.read();
        if (aligned < 4) {
            // make sure we are properly aligned on a 14-byte packet
            if (serialCount == 0) {
                if (ch == '$') aligned++; else
                  aligned = 0;
            } else if (serialCount == 1) {
                if (ch == 2) aligned++; else
                  aligned = 0;
            } else if (serialCount == 12) {
                if (ch == '\r') aligned++; else
                  aligned = 0;
            } else if (serialCount == 13) {
                if (ch == '\n') aligned++;else
                  aligned = 0;
            //println(ch + " " + aligned + " " + serialCount);
            if (serialCount == 14) serialCount = 0;
        } else {
            if (serialCount > 0 || ch == '$') {
                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)

Go Up