needs help for MPU-6050!!!!!!!

Hi,

I'm new to this forum, new to Arduino due and new to electronics....

I want to measure acceleration and gyroscope by the use of MPU-6050.

The code which I use is from "EXAMPLE SKETCH" on http://playground.arduino.cc//Main/MPU-6050#sketch

I connect as follows. Arduino Due – SDA20 –> MPU6050 Pin SDA Arduino Due – SCL21 –> MPU6050 Pin SCL Arduino Due – Pin3.3V –> MPU6050 Pin VCC Arduino Due – PinGND –> MPU6050 Pin GND

This code is verified, however ,correct value is not displayed on Serial Monitor. Any help is much appreciated. Thank you.

does your device have 2 power input pins ?

The ones I have, will take 5V at VIN and put through a regulator device that the chip uses OR they will take 3.3 V at another pin, and use that directly, without using the regulator.

If you put 3.3V to the vin pin, it probably wont work.

Your device may be different.

which board are you using, some boards supports both IIC and SPI, and you might need to ground some pin to use IIC. also u can try out some other samples, i am working with the 9250, the onboard mpu6500 is pertty much the same as 6050. you can try to read without any setup first. just try to request 14 bytes from reg 0x3B

michinyon: does your device have 2 power input pins ?

The ones I have, will take 5V at VIN and put through a regulator device that the chip uses OR they will take 3.3 V at another pin, and use that directly, without using the regulator.

If you put 3.3V to the vin pin, it probably wont work.

Your device may be different.

My device (MPU-6050) has VCC, GND, SCL, SDA, XDA, XCL, ADO, and INT. Arduino due has Vin, 3.3v, and 5v. I connect VCC(MPU-6050) to 3.3V(Aruduino due) without using the pull-up or pull-down register.

Does this answer your question?? I am inexperienced in English, so do not have confidence.

jesseCZ: which board are you using, some boards supports both IIC and SPI, and you might need to ground some pin to use IIC. also u can try out some other samples, i am working with the 9250, the onboard mpu6500 is pertty much the same as 6050. you can try to read without any setup first. just try to request 14 bytes from reg 0x3B

My device(MPU-6050) and Arduino due supported only IIC. I try to ground XDA, XCL,ADO,and INT in vain.... I try out some othersamples, for example, sample code from http://forum.arduino.cc/index.php/topic,228878.0.html ,only to fail. Let me know more detailed about "just try to request 14 bytes from reg 0x3B ".

you have to look at the spec of your board, i think it might say something if it requires you to ground any pins.

actually first thing you should try is to read the who am i register do sth like: wire.beginTransmission(address); wire.write(who_am_i_reg) wire.endTransmission();

wire.requestFrom(address,1); Serial.pring(wire.read());

there should be a default value for the register just check that up first

Which is your natal language? If Spanish, I can help you!

Second, try this code and see if your device is responding to the I2C request:

#include <Wire.h>


void setup()
{
  Wire.begin();

  Serial.begin(9600);
  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("Unknow 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
}

It’s an I2C Scanner.