Long range I2C communication between 2uC

I2C is designed for short distances but it can be made to work over longer distances. I have it working reliably over about 25 to 30m.

Use twisted pair cable, use 2 pairs. On 1 pair put 0V and SCL and on the other pair 0V and SDA. If you need to supply power in the same cable swap one of the 0V connections for +5V.

Use 1k pull up resistors. Better still distribute the resistance to either end of the I2C bus, so put 2k resistors at each end so they are in parallel giving 1k on each of SDA and SCL. Doing this minimises reflections.

I've not tried running at 100kHz, but you are right to try a lower frequency if needed. You might get it working at 100kHz, don't know, experiment.

You only set the clock speed in the master, the slaves clock from SCL, that's the whole point of having a clock signal.

2 Likes