I2C over rather long wires, how to?

Status
Not open for further replies.

alexandros

Well-known member
I need to have I2C communication between some Teensies over rather long wires (don't know the exact length yet, it should be between half and one meter). I've been reading that I2C should happen at a rather short distance, and I remember reading some post in this forum saying that additional hardware is needed if I2C is to be run in long wires, but I can't find that post again.

Since I'm designing some PCBs for this, I thought it's best to ask first before I go on and try my luck. So, how can I get I2C communication over, say, a wire that's one meter long?
Thanks
 
What I understand from reading all the above is that one meter shouldn't be an issue. My setup though might be a little bit more problematic as I will probably use more than one slave, and I don't know if their wires add up to the total capacitance that can cause issues.
Here's a schematic describing the setup:
I2C_length_issue.png
If the greatest length of this setup is one meter, the shortest is 15 cm, and the middle length is half a meter, does it mean that the total cable length should be considered to be 100cm + 50cm + 15cm = 165cm? In this case the wires labelled "SLAVE1_SDA" etc. will also add to the whole length?

It's quite unlikely that I will use 9 slaves, but the setup should provide various places where the slaves can be wired, that's why I inserted all these in the schematic. If I am to use, say three slaves in the above setup, will using a lower pull-up resistor fix any possible issues? What's the lowest resistor value that can be used with I2C on a Teensy?
 
Meter is no issue. Put pull-ups on both ends. 30 feet is the "theoretical " limit.

Or buy a couple of buffer chips if you're worried. I'm looking for the part numbers
 
Meter is no issue. Put pull-ups on both ends. 30 feet is the "theoretical " limit.

Or buy a couple of buffer chips if you're worried. I'm looking for the part numbers
30 feet is approximately 10 meters, right? I'm not even getting close to that length. I'm using pull-up resistors on the master and all slaves, so I guess there shouldn't be a problem there either. Thanks both for the answers, hope I'm on the right track!
 
Yes, 10 meters is approximately 30 ft. As you already know, capacitance is your enemy. Pullups on both ends works reliably
 
I’ve had success running i2c over a cable that was definitely at least 30ft possibly upwards of 50ft with no issues running at 100khz. They were connected to a Teensy LC and a level shifter because the receiving device was 5v and there was only pull-up resistors on the Teensy side.

In my case I was replacing an old system that used 8051 microcontrollers that communicated over i2c from an ISA card to peripheral devices. On the ISA cards they used a 3ma constant current sources instead of pull-up resistors and they had resistors running inline with the SDA and SCL lines before each 8051.

So I used a Teensy LC to replace the ISA cards and the old computer that was used to run them so I could interface with the peripheral devices over USB with a modern computer.
 
Status
Not open for further replies.
Back
Top