MPU-6050 can't initialize

I am working with the MPU-6050 (GY-512) and downloaded the “jrowberg” library. I connected everything to the arduino UNO (vcc = 5v, gnd = ground, scl = A5, sda = A4).

I tried to run the “RAW” example and opened the serial monitor to find out that it just stops after “intializing I2C devices…”. I also tried the I2C scanner from the arduino playground, but it also stops after “scanning…”.

It doesn’t say something like “no devices” or “connection failed”

I also tried 3.3V, but without succes.

Has anybody the solution?
Thanks in advance.

Can you post a clear photo of the wiring?

How to post an image.

Post a link to the exact MPU6050 module you are using.

Thanks for replying by the way

Is the MPU the only device connected to the I2C bus?

Yes.

I also included a picture of my wiring

Is the red wire plugged into 3,3V or 5V? I believe that it should be 5V as there is a voltage regulator on the board.

Its hooked up to 5v (see my first post)

see my first post

OK, I just could not tell by the photo so thought to confirm.

I used the following small program (just temperature measurement) to make a functional check of my MPU6050 sensor. The device address of my sensor is 0x69 (keyed in the Library Files). You may try it.

Connection:
Vcc -----> 5V
GND ----> GND
SCL ----> A5 (SCL) of UNO
SDA ----> A4 (SDA) of UNO
xDA ----> no connection
xCL ----> no connection
ADD0 ----> 5V (to select device address at 0x69).
INT -----> no connection

Program Codes:

#include <Wire.h>
#include <MPU6050.h>

MPU6050 mpu;   //device address 0x69

void setup() 
{
  Serial.begin(9600); 
  Serial.println("Initialize MPU6050");

  while(!mpu.begin(MPU6050_SCALE_2000DPS, MPU6050_RANGE_2G))
  {
    Serial.println("Could not find a valid MPU6050 sensor, check wiring!");
    delay(5000);
  }
}

void loop()
{
  float temp = mpu.readTemperature();

  Serial.print(" Temp = ");
  Serial.print(temp, 2);
  Serial.println(" *C");
  
  delay(2000);
}

I tried your sketch but it says it hasn't an "begin" in it's class (the part: "mpu.begin")

To be honest, i didn't even know it has an temperature sensor....

Maybe it is my soldering...?

Try, this way:
1. Connect AD0 pin to GND. If it does not work,
2. Connect AD0 pin to 5V.

Check that your PC/IDE has included the MPU6050.h Library.

I've installed the library (from jrowberg on github) and even tried the library: "MPU6050_tockn". It didn't work.

I also tried connecting the ADO pin to ground and to 5v.

And like I said, the sketch above has an "mpu.begin ()", but the error says it hasn't a "begin" in it's class.

It just doesn't get further than: "initializing I2C device..."

EDIT:

I just found out that the name on the chip says: " MPU6050C". Maybe that has something to do with this...

but the error says it hasn't a "begin" in it's class

Then you are using the wrong code for the library you have.

Move your A4 wire to SCL and your A5 to SDA. The code you are using A4 and A5 are the pins for SCL and SDA on the Nano, but on the UNO it is separate or you can redirect to A4 and A5, but why? Just use the pins that were meant for it.

This is the library which I am using for my MPU6050 sensor. The address is keyed as 0x68 in the library file, and it can be checked/edited by opening the *.h file.

Execute this (attached with this post) address scanner program and see what address is detected for your MPU6050. This program checks for all I2C devices in the address range: 0x50 - 0x6F.

Address_Search50-6F.ino (520 Bytes)

Ive done everything you said but again it doesnt go further after something like "scanning...".

I dont know what to do next. Maybe i should just buy a new one...

Thanks for the replies (But if you have an idea, please post it).

Today at 05:04 pm
Ive done everything you said but again it doesnt go further after something like "scanning...".

What is this?

After running the address scanner program, the output should be one of the following:

FOUND message on the Serial Monitor with a list of addresses that have tested
not found message on the Serial Monitor with a list of addresses that have been tested
The system hangs which means that there is some some problem with your MPU6050.

If you see that the system hangs, remove MPU6050; re-run the address scanner program. The message on the Serial Monitor should be not found.

I dont get to see the list at all.

The mpu6050 sensor isn't sending data to the serial monitor. The angular values ​​are "0"