Go Down

Topic: 2 MPU5060 on 1 arduino (Read 632 times) previous topic - next topic


I have connected an MPU-5060 up to my arduino and that works fine.
Now I am try to connect 2 on the same arduino. I have found some information on the internet on how to do this.
I have done the following connections:

MPU board 1, tie AD0 to GND (Should cause 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,

MPU board 2, tie AD0 to Vcc (SHould cause the address to be 0x69 decimal 105)
                    tie GND to Arduino GND, Vcc to Arduino +5V,
                    tie SCL to Arduino SCL
                    tie SDA to Arduino SDA

I am using the i2c scanner code from arduino to check for device addresses. When I connect either one AD0 on an MPU to 3.3V that becomes the address which is found. When there is is one, none or all AD0 connected to ground only address 0x68 is found! I have tried mix and matching the AD0 pins between 3.3 v and ground in different combinations and no success.

I cannot seem to get both of them connected and found. Anyone have a solution or idea as to why this is.
Thankyou in advance


The AD0 is a pin of the MPU-6050 sensor. That sensor is 3.3V, so you may never connect the AD0 to 5V.

Connect all SDA and SCL (both MPU-6050 modules) to Arduino SDA and SCL.
Connect all GND (modules and Arduino).
Do you have a module with a voltage regulator on it ? If so, connect both Vcc to the Arduino 5V pin else the 3.3V pin.

Connect one AD0 to GND and the other to 3.3V. Run the i2c_scanner and it should work.

If you really want to use XCL and XDA for some mysterious reason, that is possible, but you have to check the datasheet if that is default enabled. But please don't use that, just connect everything to the Arduino I2C bus. Do you use the Arduino Mega 2560 ? then you must use a level shifter.
Everything is binary, even life itself. It consists of only two things: the things that matter and the rest.


Well I am using an arduino mega, which only has one scl and one sda pin. Apparently linking the mpu's through xcl and xda allows for passing through values I think. But I don't know how to connect 3 mpu5060's to one arduino any other way. Any link or schematic would be good.
Thank you  in advance again


You may not connect the MPU-6050 module to the SDA and SCL of the Arduino 2560 Mega board.
That board is the only board that has 10k pullup resistors to 5V, thus creating a 5V I2C bus. That is too much for the MPU-6050 chip.

You have to buy a level shifter. The MPU-6050 might already be damaged.

The XCL and XDA allow passing-through the I2C bus, but don't use it. If those are enabled in the MPU-6050 chip, they will be the same as the I2C-bus from the Arduino. It will not be possible to use more than two MPU-6050 modules.

To use 3 MPU-6050 modules, you need some kind of mux for the I2C bus.
There seems to be a trick with ADO ( http://playground.arduino.cc/Main/MPU-6050#multiple ), but since the Arduino Mega 2560 is a 5V board, you have to lower the signals to 3.3V for the different AD0 pins.
Everything is binary, even life itself. It consists of only two things: the things that matter and the rest.


I tried putting one mpu AD0 pin to high and one to low but I get either one or the other working and it is always the one connected to high. Why is this, I am running out of time :(


I'm sorry, but I really don't know.
Can you make a photo of the MPU-6050 module of both sides ? Perhaps there is a jumper of solder blob area for AD0.
Everything is binary, even life itself. It consists of only two things: the things that matter and the rest.


Actually, reading that link you gave (http://playground.arduino.cc/Main/MPU-6050#multiple).
It says I can make all the mpu's high and then connect AD0 to arduino output through a multiplexer and then use AD0 to choose it; when it is connected through a multiplexer.
This may be a bad question but do you know the code to select the AD0 pin??


That is only possible if the i2c_scanner detects them also at 0x69.
If you want more than two MPU-6050 modules, you should lower the output pins of the Mega to 3.3V and connect those to the different modules.

I don't see how you can manage to get something working this way. Please get a level shifter and perhaps you should buy two new MPU-6050 modules.
Everything is binary, even life itself. It consists of only two things: the things that matter and the rest.


Aug 05, 2014, 12:25 pm Last Edit: Aug 05, 2014, 01:52 pm by Alexisa Reason: 1
Ok, so what I have gathered is that I make a pin High by an arduino output to make the mpu address 0x69 and then bring it to low and make the other high and read from that etc...

I have a multiplexer and shift register chip and 2 mpu's at my disposal.
Can I connect the AD0 pin on the mpu's to arduino digital pin say and then in the code set it to high or low accordingly?
Or would I need to use something like a digital switch to switch 3.3v between the AD0 pins to the mpu's?

Does anyone have a pin layout or schematic I could use for this link: http://playground.arduino.cc/Main/MPU-6050#multiple
I am really having trouble figuring out how to connect it all up.



I am having same issue as you. I need to connect 4 MPU6050 together.
The approach I used is different, but it still not working.
I just posted a new thread:


Perhaps you can have a look on my connection and code and feedback to me. I also cannot figure out what should I do now.

With that code and hardware connection, the result I got is zero. And I am pretty new to this, so maybe we can discuss about this and make it work together??

Thank you.

Go Up