Interfacing with IMU 6dof

Hello here,
I’m new here from France and currently using Arduino for building a hobby robot.

I bought an Arduino Uno and a IMU 6dof ( http://www.drotek.fr/shop/en/32-imu-6dof-itg3200-gyro-bma180-accelerometer-sensor.html ) to merge a BMA180 (3 axes Accelerometer) and a ITG3200 (3axes Gyro).
I’m using a Logic Level Converter BOB-08745 to adapt the 5V I2C from the Arduino Uno into the 3.3V I2C of the IMU.

My problem is: I’m successfully exchanging data with the ITG3200 but the BMA play dead.

In order to figure out I try a very simple code which print the ID of both sensors :

#include <Wire.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup(void) {
  uint8_t result1, result2;
  lcd.begin(16, 2);
  Wire.begin();  
  delay(1000);

  // GYRO
  Wire.beginTransmission(0x69); 
  Wire.write(0x00); 
  Wire.endTransmission();
  
  Wire.beginTransmission(0x69);
  Wire.requestFrom(0x69, 2);
  if (Wire.available()==2)
  {
    result1 = Wire.read();
    result2 = Wire.read();
  }
  else result1=0;
  Wire.endTransmission();

  lcd.print("ITG Id ");
  lcd.print(result1);
  lcd.print(" v.");
  lcd.print(result2);

  delay(1000);

  // ACCEL
  Wire.beginTransmission(0x40);
  Wire.write(0x00); 
  Wire.endTransmission(); 
  
  Wire.beginTransmission(0x40);
  Wire.requestFrom(0x40, 2);
  if (Wire.available()==2)
  {
    result1 = Wire.read();
    result2= Wire.read();
  }
  else 
  {
    result1=0;
    result2=255;
  }
  Wire.endTransmission();
  
  lcd.setCursor(0, 1);
  lcd.print("BMA Id ");
  lcd.print(result1);
  lcd.print(" v.");
  lcd.print(result2);
  
  
  delay(1000);
  // GYRO
  Wire.beginTransmission(0x69); 
  Wire.write(0x00); 
  Wire.endTransmission(); 
  
  Wire.beginTransmission(0x69); 
  Wire.requestFrom(0x69, 2);
  if (Wire.available()==2)
  {
    result1 = Wire.read();
    result2 = Wire.read();
  }
  else result1=0;
  Wire.endTransmission();
  
  lcd.setCursor(0, 0);
  lcd.print("ITG Id ");
  lcd.print(result1);
  lcd.print(" v.");
  lcd.print(result2);
  
}

void loop(void) {
}

On this code :

  • the ITG return an ID of 105 and a version of 78.
  • but the BMA has 0 returning by the function Wire.available()!

No matter which one I try to contact first.

Does someone has an idea on what could be turning bad?

Thanks a lot in advance

Best regards

There is an I2C scanner that you can use to find out whether your device is present (wired correctly). Perhaps the issue is that you are using the wrong address for it.

Thanks Paul for the advice. I did the try, and it only found a device on 0x69 (the Gyro adress)

Today my questions are : - do I need to set pull-up resistor, I did not understand clearly from this post http://arduino.cc/forum/index.php/topic,22309.msg167939.html#msg167939 - Is the setup could need to be different for the ITG3200 and the BMA180? - How could I know if the BMA180 is not disfunctionnal?

Regards

  • do I need to set pull-up resistor,

I don't know. If you don't have them, it might help to add them. If you do, it might help to remove them.

  • Is the setup could need to be different for the ITG3200 and the BMA180?

Yes, it is possible that the setup for the two devices needs to be different.

  • How could I know if the BMA180 is not disfunctionnal?

Try finding it, with and without pullup resistors, when it is the only thing connected.

I try to add pull-up, no change, only the gyro answer.

There is only the 6DOF connected, it includes both sensosr, with only one I2C input.
If I look carefully it seems that 2 pin are not weld on the BMA.
I start to thinks it’s an hardware issue on the IMU…

I tried your code only changed the BARO address to fit my GY_80 and it works...

Thanks MHefny. I'm now sure that is an hardware issue. Time to figure out if its my setup or the sensor itself.