two different MinIMU-9 v2 ?

Dear all,

I am doing a project that needs to interface two MinIMU-9 v2 to a microporcessor (not yet determine).

However according to the link above:
"the gyro, accelerometer, and magnetometer each have separate slave addresses on the I²C bus. The board pulls the gyro’s SA0 pin high, setting its slave address to 1101011b. The accelerometer’s slave address is fixed to 0011001b and the magnetometer’s slave address is fixed to 0011110b."

Since the address for accelerometer is fixed, can I still interface two different minimu-9-v2? (I just want to read the result of accelerometers and gyros)

Best Regards,

No, not possible.
It seems that the LSM303DLHC is using a fixed address indeed.
There are I2C devices that are master over a few new I2C busses. I don't know what they are called. I2C bus multiplexers or something?
And there is SoftI2C, http://rweather.github.com/arduinolibs/classSoftI2C.html
But I don't know if that library is good.
I also found this one, https://sites.google.com/site/marthalprojects/home/arduino/i2c-via-digital-pins

Well that is a piece of bad news for me :frowning:

I am just a beginner in embedded system, please give me more advices: The main task here is two interface two IMU sensors (3-axis gyro and 3-axis accelero) to the same microcontroller. The range of motion is moderate, since it is for a bioengineering project.

Would you please giving me some suggestions about the choice of sensors and microcontroller? I am quite familiar with the arduino , lpcxpresso, and i2c communication.

Best regards!

You can go analog.
The Leonardo has 12 analog inputs, http://arduino.cc/en/Main/arduinoBoardLeonardo

If you don't need the extra analog inputs of the Leonardo ( and also not the keyboard and mouse emulation) I would suggest a common Arduino Uno. That is the easiest board to use.

Most sensors are capable to change the I2C address, and I assume that most sensor breakout-boards are also capable to change the I2C address.

You could use two ITG-3200 boards, and two MMA8452Q boards. I think you can make 4 different addresses with those.

But if you need less accuracy, it should be possible to buy cheaper sensors.

On the other hand, the MPU-6050 module is only 6 dollars.
The MPU-6050 is accelerometer + gyro in one I2C chip, and can select between two addresses. They cost 6 dollars per module on Ebay or 40 dollars at Sparkfun. The AD0 pin selects between the two addresses.

Thank you Erdin for so many information.

I have tried the MPU-6050 before, and really like it! However, here is what i got: I have one arduino uno, one arduino mega, one lpcxpresso board, two mpu-6050, and maybe two minimu v2. I cant find the library for MPU-6050 for LPCxpresso. :frowning:

And the minimu v2 as you have pointed out above, cant interface two of them to the same microprocessor to read both gyro and accelero.

Can you briefly show me how to interface mutiple I2C to one arduino uno? Is there any timing issue that need to worry about?

Thank you so much

Many people have written code for the Arduino, so it doesn't surprise me that there is no code to use the MPU-6050 with the LPCxpresso.

If you have two MPU-6050 boards, set one AD0 to ground, and on the other board the AD0 to 3.3V.
Now you have 3-axis gyro and accel at 0x68 and 3-axis gyro and accel at 0x69.

The I2C is for multiple slaves, so connect both MPU-6050 boards SDA and SCL to the SDA and SCL of the Arduino Uno board (SDA=A4 pin, SCL=A5 pin).
If both boards have 4k7 or 10k pull-up resistors, that is okay. But if both boards have 2k2 pull-up resistors, I would remove them of one of the MPU-6050 boards.

To test the sensors, you could use this, Arduino Playground - MPU-6050
But for real use, use the code by Jeff Rowberg (the link is on that page). I don't know if the code by Jeff Rowberg can easily be adapted for two sensors. It uses an interrupt, so you would need two interrupt inputs.

I think that timing is not a problem. The I2C is fast enough to read many sensors. Also kalman filtering and PID control can be done in the Arduino.

Thanks Erdin!

I have just skimmed through the MPU6050 code again, but quite cluecless of how to set up another interrupt. Would you please giving me some suggestions?

Regards,

Most sensors are capable to change the I2C address, and I assume that most sensor breakout-boards are also capable to change the I2C address.

That's actually a rather poor assumption. I would not blithely just assume that.

It's true that most I2C sensor chips have a pin which you can set high or low to create two possible I2C bus addresses that
it responds to.

However, these pins are usually not brought out to a user-accesible pin on breakout boards or multi-sensor boards such as
your typical "imu" type boards. And by "usually", I mean , on none of the more than a dozen such board that I have.

So unless you can identify the right pin or trace on the board and start doing board micro-surgery to alter it, you can't assume
that it is easy to change the I2C address at all. If I doubt, check the board schematic, if there is one, or check the datasheet
of the particular sensor, locate the address select pin, and see what it is connected to.