MPU6050 on I2C with Arduino Due

Hi all,

i have a problem connecting my MPU6050 (board is a GY-521) to an Arduino Due. I connect them via I2C using pins 20 and 21 one the Due. When I run the I2C scanner it finds the MPU6050 at address 0x68, but when I try to read values it returns 'nan'.
The same code works great on Arduino Uno, so I guess it's not a problem of the code itself. Am I missing something? Can someone help me to figure out the problem?

Thank you in advance :slight_smile:

https://forum.arduino.cc/index.php?topic=545257.0

Hi, thank to have pointed out that thread... unfortunately it didn't solve my problem.
My IMU has onboard pull-up resistors so I followed what they said connecting it to SDA1 and SCL1 and changing every 'Wire' with 'Wire1'... doing so the Arduino Due couldn't even find the device at his own address... any other suggestion?

Post the code (don't forget the code tags!) you're using for the tests as well as links to the used libraries. As the scanner finds your sensor, I assume the wiring is correct. Not every Arduino library can be used on all platforms available in the IDE. Many work only with the AVR platform, so that might explain why it works on the UNO.