Connect 2 or more MPU6050 on board arduino Uno R3

Hi EVERYONE,
i have an question ,hoped that all of you can solve for me.
I want to connect 2 or more MPU6050 on board arduino Uno R3
could you tell me detail how to connect them?
Thanks!

Can you give a link to your sensor breakout board ?
There should be a 'AD0' to be able to select between two i2c addresses.
If you want to use more, you need some kind of i2c multiplexer.

That module has a solder jumper for AD0, solder one module one way and the other module the other way.


Rob

Caltoa:
Can you give a link to your sensor breakout board ?
There should be a 'AD0' to be able to select between two i2c addresses.
If you want to use more, you need some kind of i2c multiplexer.

i connect as below:
MPU1 ARDUINO
VCC 3.3V
GND GND
SDA A4
SCL A5
BUT i don't know the method to connect MPU2
could you tell me the way to connect it?
thanks!

Graynomad:
That module has a solder jumper for AD0, solder one module one way and the other module the other way.


Rob

could you tell me more detail about your ideal?
thanks!

I really need to know what kind of breakout board you have.
Where did you buy it ? Is there a brand or type printed on it ? Can you make a photo of it ? A photo of both sides ?

Caltoa:
I really need to know what kind of breakout board you have.
Where did you buy it ? Is there a brand or type printed on it ? Can you make a photo of it ? A photo of both sides ?

what do you mean?

mpu-6050.jpg

Ok, I thought you were using the Sparkfun board

that has a solder bridge you can use to set AD0.

Do you have a schematic or a photo of the back of this module, or any documentation?

I suspect however that you tie the AD0 connection you can see there to either VCC or GND. VCC on one board and GND on the other board.


Rob

I think AD0 is connected to ground via a resistor of 4k7.
You can have one module like that, and another module withe the AD0 to 3.3V. Be very careful not to connect the AD0 to 5V, it will blow the chip.

But you need to apply the Arduino 5V to the VCC of the sensor breakout board. Since there is a voltage regulator for the MPU-6050, using 3.3V would result in a voltage that is too low for the I2C bus.

Beside the AD0, the rest is simple:
Arduino 5V -> all Vcc of all MPU-6050 breakout boards.
Arduino GND -> all GND
Arduino A4 -> all SDA
Arduino A5 -> all SCL

Run the i2c scanner to see if it detects both boards.
http://playground.arduino.cc/Main/I2cScanner

Caltoa:
I think AD0 is connected to ground via a resistor of 4k7.
You can have one module like that, and another module withe the AD0 to 3.3V. Be very careful not to connect the AD0 to 5V, it will blow the chip.

But you need to apply the Arduino 5V to the VCC of the sensor breakout board. Since there is a voltage regulator for the MPU-6050, using 3.3V would result in a voltage that is too low for the I2C bus.

Beside the AD0, the rest is simple:
Arduino 5V -> all Vcc of all MPU-6050 breakout boards.
Arduino GND -> all GND
Arduino A4 -> all SDA
Arduino A5 -> all SCL

Run the i2c scanner to see if it detects both boards.
http://playground.arduino.cc/Main/I2cScanner

you mean as picture below:

Graynomad:
Ok, I thought you were using the Sparkfun board

https://www.sparkfun.com/products/11028

that has a solder bridge you can use to set AD0.

Do you have a schematic or a photo of the back of this module, or any documentation?

I suspect however that you tie the AD0 connection you can see there to either VCC or GND. VCC on one board and GND on the other board.


Rob

if i used my module, you can tell me detail how to connect them ( each pin of MPU and arduino)
thanks!

MPU board 1, tie AD0 to GND (causes board 1 to have an I2C address of 0x68, decimal 104),
tie GND to GND of board 1, tie Vcc to Vcc of board 2,
tie SCL to XCL of board 2, tie SDA to XDA of board 2,
Leave XCL & XDA open, INT depends on whether or not you intend to use it in app.

MPU board 2, tie AD0 to Vcc through a 1k to 10k (your choice) resistor (caused board2 to have an I2C address of 0x69, decimal 105),
tie GND to Arduino GND, Vcc to Arduino +5V,
tie SCL to Arduino SCL (A4 or A5, don't rember of hand) and through a 4k7 resisror to Arduino +3.3V,
tie SDA to Arduino SDA (A5 or A4, don't rember of hand) and through a 4k7 resisror to Arduino +3.3V,
INT depends on whether or not you intend to useit in your app.

The stock WIRE lib used A4 & A5 for I2C SCL & SDA. If you want to hook up more than two MPU's, you will need to setup another I2C channel. one way is to initiate another instance of WIRE, using another Analog pin of the Arduino as the SDA for that channel ( and hook up MPU's as above). Another way suggested is to multiplex the SDA lines with hardware.
This is from memory, but with a little reading, you canget the corrected details. check out the MPU6050 data sheet and the ARDUINO playground.

123Splat, Sorry, but you make things confusing.

kate213, never tie AD0 to 5V, not even with a resistor. Only to 3.3V. Don't use XCL or XDA. You don't have to add 4k7 resistors to 3.3V, since there are already pull-up resistors on the sensor breakout boards.

just out of curiosity (i WISH i had even ONE MPU 6050) - may i ask what you want to do with TWO MPU 6050s - on ONE Arduino ?

i'm finding just one MMA7361 accelerometer is a lot to deal with - although probably insufficient as i'm understanding a gyroscope is also necessary for a self-balancing robot.

so i'm wondering if you're going to be controlling TWO self-balancing robots with one microcontroller ?

Do you need just two of these to work together or do you need more than two? Just two is not hard to do, 123Splat pointed out, just don't follow his "connect AD0 to 5V via resistor". Using say 3-4 requires some additional wiring. You picked the right board for multiple boards to work together though. Sparkfun disappoints again by not bring out AD0 to a pin.

123Splat:
MPU board 1, tie AD0 to GND (causes board 1 to have an I2C address of 0x68, decimal 104),
tie GND to GND of board 1, tie Vcc to Vcc of board 2,
tie SCL to XCL of board 2, tie SDA to XDA of board 2,
Leave XCL & XDA open, INT depends on whether or not you intend to use it in app.

MPU board 2, tie AD0 to Vcc through a 1k to 10k (your choice) resistor (caused board2 to have an I2C address of 0x69, decimal 105),
tie GND to Arduino GND, Vcc to Arduino +5V,
tie SCL to Arduino SCL (A4 or A5, don't rember of hand) and through a 4k7 resisror to Arduino +3.3V,
tie SDA to Arduino SDA (A5 or A4, don't rember of hand) and through a 4k7 resisror to Arduino +3.3V,
INT depends on whether or not you intend to useit in your app.

The stock WIRE lib used A4 & A5 for I2C SCL & SDA. If you want to hook up more than two MPU's, you will need to setup another I2C channel. one way is to initiate another instance of WIRE, using another Analog pin of the Arduino as the SDA for that channel ( and hook up MPU's as above). Another way suggested is to multiplex the SDA lines with hardware.
This is from memory, but with a little reading, you canget the corrected details. check out the MPU6050 data sheet and the ARDUINO playground.

sr , i don't understand what you say.
can you give me an image that show how to connect them?
thanks!

Caltoa:
123Splat, Sorry, but you make things confusing.

kate213, never tie AD0 to 5V, not even with a resistor. Only to 3.3V. Don't use XCL or XDA. You don't have to add 4k7 resistors to 3.3V, since there are already pull-up resistors on the sensor breakout boards.

i showed an image above that follow you.
could you check again for me?
thanks!

retronet_RIMBA1ZO:
just out of curiosity (i WISH i had even ONE MPU 6050) - may i ask what you want to do with TWO MPU 6050s - on ONE Arduino ?

i'm finding just one MMA7361 accelerometer is a lot to deal with - although probably insufficient as i'm understanding a gyroscope is also necessary for a self-balancing robot.

so i'm wondering if you're going to be controlling TWO self-balancing robots with one microcontroller ?

i want to controll 2 mpu by one microcontroller but i don't use for self-balancing robots .

kate213:
i showed an image above that follow you.
could you check again for me?
thanks!

Sorry, I have missed that image. I have checked it and it is correct. Perhaps the 4k7 to GND is not needed, since there is already a 4k7 to GND on the MPU-6050 breakout board. But it is okay to use that 4k7 to be sure.

Connect it like that and run the i2c_scanner. You should see 0x68 and 0x69.

Oops, sorry. My Bad. 6050 is a 3.46V MAX device, so A0 would definitely NOT tie to +5V, but +3.3V.
However, the AUX_DA and AUX_CL are pass-throughs for putting other devices on the same I2C channel (either to talk to the 6050, or the host). And yeah, the pull-ups aren't needed. Sorry again, was looking at the 6050 datasheet, not the breakout board.