Connecting Four MPU 6050 to Arduino Mega

Yes, if you have a 3.3V Arduino board.

Using AD0 (with a 3.3V Arduino board):

Keep all sensors at 0x69 and never use that in software. Have all the AD0 pins connected to digital pins.
Bring one sensor to 0x68 by making its AD0 pin low. Then use that sensor. When finished make that AD0 high.
You can not do this with a Arduino Mega, because then you would push 5V into the AD0 pin. That will damage the sensor.

Using a software I2C library:

By using a software I2C library, it is possible to create multiple I2C buses. It is allowed the share the SCL pin for all the buses.
You only need one extra I2C bus, because you can already can set them at 0x68 and 0x69.
The libraries for the sensor might have to be changed (a little or a lot), to use the software I2C bus.

Warning:

The Arduino Mega 2560 board is the only board with 10k pullup resistors to 5V for the I2C bus. You should not connect those SDA and SCL directly to a 3.3V sensor chip. You need a I2C level shifter.
If you create an extra I2C bus with software, then I suggest to use a level shifter for that bus as well.

1 Like