I2c connections

Which pins should you use for i2c communication between 2 or more arduino uno’s (r3)?

The 2 pins left of the aref pin or the analog pins A4 and A5?

Or both?

Hope to find out soon!



They are connected to eachother. SDA/SCL pins are probably a better choice if you're making a custom board or connector, because on other Arduino boards (like the Mega2560 for example) where SDA and SCL are not on A4 and A5, the appropriate pins are connected to SDA and SCL instead - so you could use the same shield/board/whatever on those boards.

Don't forget Gnds too.

Thanks for the help!
Do the plus also have to be connected?

florisfassin: Do the plus also have to be connected?

Good question.

Yes and no. If any device is unpowered, it will pull the lines down to ground, preventing any other device using the I2C bus. This might block a program if it is "hanging" on an I2C transfer. If the total pull-up resistance is no less than 3.3 k for a 3.3 V system or 4.7k for a 5 V system, the limit of the protective diodes on the unpowered device will not be exceeded.

A level translator (using FETs) can be used to isolate an unpowered section.