I2C Communications with Arduino


My Engineering Design and Development (EDD) class is working on a high altitude balloon (HAB) and my friend an I are in charge of data collection. It looks like we are going to use an Arduino (Uno or Due based on needed ports) and sensor breakout boards for logging data. As I was browsing our possibilities, and I wasn't quite sure if running multiple I2C devices on the Arduino was realistic.

For example, in viewing the tutorials for an accelerometer (3-axis) and a gyroscope (3-axis), I found that both require the use of the SDA and SCL ports on the Arduino. If I have read correctly, each device has a different I2C address, and you can use them in the same port, but I wasn't sure. If that is possible, how do you know what the address is or how to assign the address? Is there a maximum limit of I2C devices that an Arduino can handle? I have reviewed How to connect multiple i2c-interface devices into a single pin A4 (SDA) and A5 (SCL) on Arduino? but I'm not quite sure this answers my questions fully.

Best Answer

The accelerometer address is 0x1D by default and can be changed to 0x1C with a bit of soldering(Found in the Address Select Jumper section of the guide you linked). The gyroscope address is 0x69 by default and can be changed to 0x68(Found in section 6.1.1 of the datasheet, and the I2C Address Jumper section of the guide you linked). The Arduino can theoretically support as many I2C devices as can be acquired without having two that share an address.

Note also that accelerometers and gyroscopes are often packaged together on a single chip, which may be easier to work with. I've used the MPU-9150 with good results.