No idea what I am doing...Noob here, help needed.. MPU-6050 [solved]

i am currently learning how to use MPU-6050 in order to use it for my project. i found a guide on the internet about how to use it, and try using "I2C Scanner code by Krodal" to find out the connected I2C devices to Arduino. I am currently using an Arduino Atmega 2560. On the guide i found out that if you have some lose wiring the serial monitor will give a message "No I2C devices found" or if there is some error it will give a message indicating that there's an error on a certain address. unfortunately my problem is not on this scope. you see when i compile and it and run it got stuck on scanning process... I tried waiting for a couple of hours to see if it would work if given time but it bore no good results. So now i ask of you noble people of the forum won't you give me a guide on how to solve this predicament i'm into right now.
Thanks....

// --------------------------------------
// i2c_scanner
//
// Version 1
//    This program (or code that looks like it)
//    can be found in many places.
//    For example on the Arduino.cc forum.
//    The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
//     Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26  2013
//    V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
//    by Arduino.cc user Krodal.
//    Changes by louarnold removed.
//    Scanning addresses changed from 0...127 to 1...119,
//    according to the i2c scanner by Nick Gammon
//    http://www.gammon.com.au/forum/?id=10896
// Version 5, March 28, 2013
//    As version 4, but address scans now to 127.
//    A sensor seems to use address 120.
// Version 6, November 27, 2015.
//    Added waiting for the Leonardo serial communication.
// 
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//

#include <Wire.h>


void setup()
{
  Wire.begin();

  Serial.begin(9600);
  while (!Serial);             // Leonardo: wait for serial monitor
  Serial.println("\nI2C Scanner");
}


void loop()
{
  byte error, address;
  int nDevices;

  Serial.println("Scanning...");

  nDevices = 0;
  for(address = 1; address < 127; address++ ) 
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address<16) 
        Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("  !");

      nDevices++;
    }
    else if (error==4) 
    {
      Serial.print("Unknown error at address 0x");
      if (address<16) 
        Serial.print("0");
      Serial.println(address,HEX);
    }    
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");

  delay(5000);           // wait 5 seconds for next scan
}

i just follow this wiring on my arduino.

MPU_2.JPG

Is the MPU-6050 module designed for use with a 5V Arduino? Post a link to the exact sensor you have.

http://www.e-gizmo.com/oc/index.php?route=product/product&product_id=537&search=gyroscope this is the MPU im using right now

So either you have not wired it up correctly or it is broken.
If a scan has not returned in about 10 seconds it is not going to.

Make sure all the wires are making a good connection, Solderless breadboard is normally crap,

Run_piggy:
http://www.e-gizmo.com/oc/index.php?route=product/product&product_id=537&search=gyroscope this is the MPU im using right now

The specification clearly says Power Input 2.3 ~ 3.4VDC. Maybe connecting it to the 5V pin on the Arduino wasn't a good idea ?

Steve

Do you use a bidirectional 3.3 V to 5 V, voltage level converter module?

Just asking, because I use this converter module to get the MPU-6050 module to communicate with the MEGA 2560.

So..... aside from the code, it's important to make sure that the hardware setup is correct.

It is fried, don't waste any more time with it.

I would recommend Pololu's sensor products, which are designed for operation at any voltage between 2.5 and 5.5V. They provide good example code, Arduino code libraries and unlike cheapo vendors, support their products.

This one is functionally equivalent to the MPU-6050 but performs better in all respects.

the site where i buy it gave this wire connection. so i thought that connecting it to 5v is probably fine. So following this is a not so good idea

Run_piggy:
the site where i buy it gave this wire connection. so i thought that connecting it to 5v is probably fine. So following this is a not so good idea

I'd go with JRem's advice for now.

As for the diagram you uploaded...... they didn't use pull-up resistors because the MEGA 2560 has inbuilt pull-up resistors for the SDA and SCL lines, which is good.

I reckon you really should power this mpu-6050 module with 3.3V, and use a voltage level converter module (3.3V to 5.5V).

But if you're unfamiliar with doing this kind of thing, then better off going for a module like the one JRem recommended.

And..... have a few spare mpu-6050 modules with you, for testing. Because.... we just never know.... some of them can be faulty to begin with..... straight out of the box.

Yes but he said

I am currently using an Arduino Atmega 2560.

So that will have a pull up resistor already fitted on the I2C lines.
Their appeared to be a voltage regulator on that board but the page the OP linked to did say

Power Input
2.3 ~ 3.4VDC

Which does not make sense for the board but does for the chip.

Southpark:
Do you use a bidirectional 3.3 V to 5 V, voltage level converter module?

Just asking, because I use this converter module to get the MPU-6050 module to communicate with the MEGA 2560.

So..... aside from the code, it's important to make sure that the hardware setup is correct.

i didn't use it.

got it. Thanks everyone for your help. i do think that i probably should have used 3.3v as the source for this MPU.