Jump to content
I2Cdevlib Forums

MPU6050 connection failed

Recommended Posts

Thanks Jeff and Pam for suggestions.  No luck so far, though!

Here are more details I should have mentioned the first time around:


Arduino Uno R3 SMD

SparkFun MPU6050 breakout board




VDD - Arduino 3.3v
GND - Arduino GND
INT - Arduino digital pin 2
FSYNC - unconnected
SCL - Arduino SCL dedicated pin 
SDA - Arduino SDA dedicated pin
VIO - Arduino 3.3v
CLK - unconnected
ASCL - unconnected
ASDA - unconnected
MPU6050_raw sketch modified by putting ...



... after the line which has accelgyro.testConnection() in it.


Example serial output:


Initializing I2C devices...
Testing device connections...
MPU6050 connection failed
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
It looks like AD0 is grounded on the SparkFun board.  I have
not modified the board.
Tried SCL/SDA on A5/A4; got same result.


Don't know if the Arduino Uno R3 SMD has internal pull up 

resistors on SCL/SDA.  The SparkFun board has 10k pull up 

resistors on those lines.


I appreciate any more suggestions you may have.





Link to comment
Share on other sites

Fixed it.


The problem was that the MPU6050_raw sketch uses I2C address 0x68 as default, but the SparkFun board I'm using has AD0 tied to Vcc which sets the MPU6050 address to 0x69.


AD0 low is shown as a default on the SparkFun breakout board schematic but it looks like there is a solder bump on my board that sets AD0 high.  I don't know why it's there.  I didn't do it!


Changing ...


MPU6050 accelgyro;


... to ...


MPU6050 accelgyro(0x69);


makes the sketch work.


I figured this out by running I2cScanner which is found here: http://playground.arduino.cc/Main/I2cScanner


That sketch immediately told me that there was a device at 0x69.





Link to comment
Share on other sites

  • 2 months later...



i'm sorry to re-open this topic but after read many post and forum, I can not find a solution for my MPU 6050. When I try to use the MPU 6050 I2Cdev Lib, I am not able to connect my device to my arduino in the way off when I start the program, I have alway "MPU6050 connection faild", and after, only 0. ( with MPU6050_raw programs)

My device work well because I can receive raw data when I using arduino playground for MPU6050.

I currently use the GY-521 breakboard, and as it is said in the FAQ, I connect INT pins to pin 2 on arduino Uno R3.

The adress of My device is 0x68 ( foud by i2c_scanner).


I spend three all day to try to fix the problems but I can't find a solution, so, If someone can help me, It will be so nice,

Thank ,


P.s : I don't speak english very well, so sorry for the english mistakes.

Link to comment
Share on other sites

  • 2 weeks later...

Hi Winnie,


If you are using the MPU6050_raw.ino example, then the INT pin is not necessary, since the measurements are polled from the accel/gyro registers without doing any interrupt detection. Are you sure that you have a solid 3.3v supply on VCC, the AD0 pin is connected to GND, and all connections are securely soldered?

Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...

Im stuck in the same place.



SDA - A4

SCL - A5

VCC - 3.3V (I tried this with 5V as well)


I Also tried - Based on information I found around the internet

A0 - GND

A0 -> 4.7K - GND

A0 - Not Connected

INT - D2

INT - Not connected


None of there work.

Im stuck with the "Connection Failure" notification and only getting 0's for the Raw Data.

Link to comment
Share on other sites

I am using Arduino Uno,

Im using the i2cdev libraries found here: https://github.com/jrowberg/i2cdevlib/tree/master/Arduino

Im using the example program here: https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050/Examples/MPU6050_raw


The connections I made were:

MPU6050   -   Arduino

GND           -   GND

SDA            -   A4

SCL            -    A5

VCC            -   3.3V (I tried this with 5V as well)


I Also tried - Based on information I found around the internet

A0 - GND

A0 -> 4.7K - GND

A0 - Not Connected

INT - D2

INT - Not connected


Im getting the "Connection Failure" notification and only getting 0's for the Raw Data when i look at the output, when running the example code.

Link to comment
Share on other sites

It seems like you are doing everything fine...


The MPU6050 is supposed to be powered and communicated at 3.3V.  But this depends on the board you are using, because it could have a logical level translator.


Anyway, let's try this:


- Have you tried with both I2C adresses? 0x69 and 0x68


- Schematic of you MPU board?


- Can you try with another Arduino operating at 3.3V? Maybe an Arduino DUE, or some Arduino Pro Mini running at 3.3V...


- Do you have an oscilloscope? If so, could you measure the voltage in SDA and SCL while the sketch is running?


- Can you try with another MPU?


It could also be that your MPU is dead. I have used like 10 of them, and just one died after 2 months of using it.  

In Ebay you can get really cheap MPUs and generic Arduinos.

Link to comment
Share on other sites

The Arduino Uno and the MPU that I am using ware opened just 3 days ago. So its can't be that those are not working.

However I have another one, I will try it with that one.

I also do not have access to any other Board, except Beagle Bone Black, which I will work on at a later time. Since I am not currently in a country that has access to dev boards easily, it will take me sometime to get my hands on anything else. I have another Arduino Uno which I can try with, just to be sure.


I will try all the other suggestions as well.


Cheers for the reply.

Link to comment
Share on other sites

I went through my connections again, uploading the sketch to the Arduino Uno.

and the raw example code worked. It started outputting data.

It worked for both my MPU6050 units.


TBH im not sure what I did, but it is now working fine. Thanks luisrodenas


I am not trying to run the DMP6 example code.

Im stuck at the message on the serior monitor showing "DMP ready! Waiting for first interrupt..."

Does anyone know what are the next steps?
Link to comment
Share on other sites

I am in this situation too.


My Arduino is the UNO R1.

I have the MPU6050 on the GY-521 Breakout Board, tough mine is a little different from the default GY-521:






When I use the Arduino Playgroud Code, I receive all the RAW Data, with values that appear to be real, and change consistently with the sensor movement.


But when I use the RAW FreeIMU code, it give me NaN (not a number) for all values, and the DMP code give me "Connection Failed".


The pins are correctly connected, with INT disconnected and 5V supply.


The I2C scan give me 0x68, so I did not change anything in the code.

Link to comment
Share on other sites

For the ones still searching for a solution, I figured out, with the help from the Arduino Playgroud Page, that you should put Pull-Up resistors on the SCL and SDA pins for them to work. It seens that the values on the breakout board are not enough. 10K worked here.


Here is a picture of what you should do:




I am now using with all the supply on the 3.3V of the Arduino, and no more the 5V. Didn't tested with the 5V yet.

Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...