Is it possible to change I2C address of MPU-6050 ?

I am trying to connect a bunch of MPU-6050 to my Arduino.

Almost all of them are running on the same address. Few are running on different address.

Can anyone tell me how to change I2C address of MPU-6050 if it is possible ?

  • check the datasheet – jsotola Jul 30 '19 at 7:15
  • 1
    The MPU-6050 has a pin that allows control the LSB of the I2C address. This pin can be used to allow multiple devices. For 1-2 devices use the pin directly. For >2 devices use a GPIO pin per device. Web-search "multiple MPU-6050". – Mikael Patel Jul 30 '19 at 8:38

The MPU-6050 has an address pin, marked as A0, which can be used to set the LSB (least significant bit) of the address. So if you connect A0 to ground, the address will be 0b1101000, if you connect it to Vcc it will be 0b1101001. You can find this information in the table under capter 6.4 in the MPU-6050 datasheet (page 15). Normally this pin is getting hardwired, but you can also connect A0 to a digital output pin of your Arduino and dynamically change the address of the MPU.

So with this pin you can have 2 different MPU-6050's on the bus. If you need more, you can keep all MPU's on one address, while pulling the MPU, that you want communicate with, to the other address. I described this principle at the end of my answer to this question. It is about a different chip, but the principle is the same.

It is important, that you cannot have multiple devices with the same address on one I2C bus, unless you never communicate with that address. When you try to use an address, where multiple devices will answer, the I2C bus most likely will get stuck, or the data will get corrupted. As long as such an address is never called, everything is fine.

Your Answer

