How to extend i2c/twi cable length?

Hi all!

Ok, so everything was working great with my project when I had the arduino boards next to each other (say, within 12 inches) and two regular old jumper wires connecting their digital 4's and 5's together. However, now that I have a 10' "serial" (DB9) cable connecting the two (one is a remote unit for the other and tells it what to do), my i2c is just not working.

I've checked connections and I get continuity between both sides just like a should, but none of my i2c communication works with the DB9 cable. I'd like to keep a 10' cable length, and it has to be >= 4' either way. I checked the impedance of my connections, they are 1.3Ohms from point to point. The i2c spec mentions maximum capacitance of the circuit, but I'm not sure how to measure that with regards to my cable.

Is there something I can do to make i2c work this way? I read in some i2c FAQs that a lower clock speed helps, but I'd hate to throw off the critical timing I have in my app.

Any advice would be greatly appreciated, thanks!

!c

P82B715 is designed for this.

Thanks! I found the part on digikey, and it's not terribly expensive. I had done some research last night, and found that LEDuino was using an IE5501 chip for the same purpose, but the only source is the manufacturer. I requested a sample pack, but we'll see how far that goes. I'm going to run to my local electronics shop that carries a bunch of NXP products in stock, and hopefully they'll have two of these so I can complete my project tonight. (This is all I have left to do besides make a few more cables... sigh)

!c

It turns out, all that was needed was a 4.7k pull-up on SDA/SCL on the slave. I saw mention of using them with another device on the sparkfun forums, and thought what the heck - let's try it. And, well, it worked.

Of course, the buffer IC will allow runs up to 100', which is nice (and I'll take advantage of later!), but it's probably worth mentioning that external pull-ups would be necessary for runs longer than a foot or so in the docs =)

!c

It turns out, all that was needed was a 4.7k pull-up on SDA/SCL on the slave. I saw mention of using them with another device on the sparkfun forums, and thought what the heck - let's try it. And, well, it worked.

A very recent thread on the forums here also mentioned this solution to i2c problems. Thanks for taking the time to report back with your findings--it's a useful contribution to the community.

--Phil.

A very recent thread on the forums here also mentioned this solution to i2c problems. Thanks for taking the time to report back with your findings--it's a useful contribution to the community.

--Phil.

Glad to be of service! One thing that might be useful in the documentation and examples as well, is indicating that there must be a delay between endTransmission() and requestFrom(), it doesn't really point that out, but the examples don't work (for me at least) from arduino->arduino. It took quite some while to figure that out, I thought I was going crazy in that the only way I could get it to work was to queue multiple bytes via send() and then do a requestFrom() inside the same transmission - resulting in the requestFrom() getting sent first.

After lots of experimenting, to try and get my send/requests in order, I added a delay and sure enough everything worked. I'm going to update my post in the bugs/suggestions area I posted a while back with this info.

!c

Thanks! I found the part on digikey, and it's not terribly expensive. I had done some research last night, and found that LEDuino was using an IE5501 chip for the same purpose, but the only source is the manufacturer. I requested a sample pack, but we'll see how far that goes. I'm going to run to my local electronics shop that carries a bunch of NXP products in stock, and hopefully they'll have two of these so I can complete my project tonight. (This is all I have left to do besides make a few more cables... sigh)

!c

Hi,

Yes, we do use the IES5501. I don't have many right now but if you want to try it, drop me a PM and I will organise something for you.

Henderson Semiconductor has a rather superb range of I2C/SMbus driver devices especially useful now that I2C has been adopted into so many other standards and has such a new lease on life.

We have also use the P82B715 and the P82B96 and they work quite well too. For not so grossly long cable runs just drop the pull-up resistor value. To get to 100 feet you will need to drop the speed and be very careful with cabling also. NXP has an app note (AN1070 I think it is) about extending I2C. The P82B715 is also made by TI, as is the P82B96 and several others.

The Geek.