Cannot find LSM303D on Gy-89 IMU board from Arduino Uno

I am trying to use a GY-89 IMU board that has a LSM303D accelerometer, L3GD20 gyro and BMP180 temperature sensor.

I can connect and read from the gyro without any problems using the Adafruit libraries - so it is wired up properly.

I do know that the I2C addresses do change depending on if SDO/SAO is set high or low, but I have tried every combination I can think of of setting this pin and passing the I2C address into begin(), but have had no luck.

Frustratingly there is a thread about this exact problem on the forums - they say they solved it, but don't leave a solution for anyone else:

Does anyone know how I can read the accelerometer from an Arduino Uno?

I have read all of these sensors using Python from a Raspberry Pi before so I know that they do work.

thanks

Simon

Which may have fried the chip. If you connected that pin to 5V you were clearly above the allowed maximum of the datasheet.

But the Raspberry Pi runs on 3.3V, the UNO runs on 5V. The module you're using is made for 3.3V boards, so you have to be very careful when connecting to the UNO.

What does an I2C scanner say?

I haven't fried the chip - I was only ever using 3.3V

I have tried out the Pololu drivers and get good data out, so I must assume the Adafruit libraries have a bug. Unfortunately the Pololu data is raw, so less convenient, but they do mention how to convert it and that appeared to work.

It would be nice to know how to fix this bug.

The i2C scanner shows these addresses:

When SDO/SA0 is high:

I2C device found at address 0x1D !
I2C device found at address 0x6B !
I2C device found at address 0x77 !

When SDO/SA0 is low:

I2C device found at address 0x1E !
I2C device found at address 0x6A !
I2C device found at address 0x77 !

This is the same as the linked thread. The LSM303D has to be the 0x1D / 0x1E address.

Fine.

I doubt that. The UNO runs 5V on all pins, including the I2C pins (although the internal pull-ups are quite weak).

I don't think that the library has a bug, most probably you're using it incorrectly. As you're hiding your wiring and code from us we cannot help to fix that.

I am not hiding anything. I was just trying to get the Adafruit example to work:

When it comes to wiring I have these connections:

Sensor 3V3 connected to Arduino 3.3V
Sensor GND connected to Arduino GND (the one next to pin 13)
Sensor SCL connected to Arduino A5
Sensor SDA connected to Arduino A4

I have also tried adding this connection (because I have run out of GND pins) to switch I2C addresses:

Sensor SDA/SAO connected to Arduino pin 12

And set it low so with this code in setup():

pinMode(12, OUTPUT);
digitalWrite(12, LOW);

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.