Multiple I2C [Solved]

Hello, I have spent about an hour searching through about a hundred forum questions and websites. I know this question has been asked... A LOT. But I have not seen one that will answer my question. What is the easiest way to connect 2 I2C devices to the Arduino Mega, I don't want to have to get a breakout board that is usually used for 5+ I2C devices when I only have two. I have a bunch of jumper wires that I used to connect just one at a time if that means anything. Thanks.

If they have different addresses then just connect them both to the mega. They'll share the SDA and SCL pins. Nothing else is needed.

Well since I2C is a bus, you can just join wires together by soldering or even twisting, and then putting one of them into a header hole.

But since you have 2x I2C (assuming you meant literally 2), you can use pins 20/21 and the last two pins at the other end of the same row as 2 pairs of SDA/SCL on the same bus. That makes physical connection simple.

I had no idea that the Mega had two sets of I2C pins!! That is awesome thank you so much!

Are your devices 5V compatible? The Mega has on-board pullup resistors to 5V.

I will just dig up this old thread since my question kind of relates:
Since the Mega has two sets of I2C pins, are they on different channels? So is it possible, to connect two parts with the same (fixed) address to one Mega without additional issues?

Thanks in advance

VincentVega:
I will just dig up this old thread since my question kind of relates:
Since the Mega has two sets of I2C pins, are they on different channels?

No; same bus.

So is it possible, to connect two parts with the same (fixed) address to one Mega without additional issues?

Depends on the sensor.

For that, do open your own thread with details on that sensor and so.

wvmarle:
No; same bus.

Thank you for the fast response.
Then I will just use two Micros communicating over serial with each other. Makes it a lot easier, since the I2C-adress is not changeable.

VincentVega:
Then I will just use two Micros communicating over serial with each other. Makes it a lot easier, since the I2C-adress is not changeable.

There are better/easier ways. Like switching the SCL line for the individual sensors (recently seen that trick mentioned in this forum, pretty neat).

Hi,
This may be what you are looking for to use two I2C devices with the same I2C address off the same I2C port.

Tom.. :slight_smile: