I2C cable limitation using Arduino UNO R3?

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
bowserrh
 
Posts: 2
Joined: Sat Dec 21, 2013 3:10 pm

I2C cable limitation using Arduino UNO R3?

Post by bowserrh »

Is the I2C interface on the Arduino UNO R3 only good for very short cable lengths (e.g., 8" or so)?

I am using an UNO R3 (purchased from Adafruit) to drive a 16x2 LCD via I2C (SDA/SCL pins on UNO R3). Cabling is from shield to DB-9 connector pair to 16x2 display, with a total distance of about 8 inches. With that configuration, it works great. Display lights up, data gets displayed.

If I add a 6' DB-9 extension cable, nothing works. Display lights up for a few seconds, then goes dark. Reset UNO, reload software, same result. Checked the cable. It is straight one to one. No opens or shorts.

Using an O-Scope, I can see the SDA/SCL signals on the UNO R3 (cabling disconnected). If I simply connect the extension cable to the UNO R3 end (i.e., other end of the cable open), the interface dies. Same result using two different UNO R3's.

In just looking at the unloaded SDA/SCL lines, the pulses have a sharp negative going edge, but a very slow positive going edge. Perhaps it might need a pull up resister? I looked at the unloaded SDA/SCL lines on a MEGA2560, and the signal pulses looked very good.

I conducted a simple test using a bare board with my simple I2C software loaded. With nothing connected to the board but a scope probe, I can see the interface working. If I touch the SDA with my finger, the interface dies, although touching SCL doesn't seem to have any affect. Do the same test using a MEGA2560. Interface is unaffected.

In my last project, I used the same configuration, but the I2C interface was driven by a MEGA2560. It has worked flawlessly over a 6' DB-9 cable, so the problem seems to be specific to the UNO R3.

User avatar
Franklin97355
 
Posts: 23911
Joined: Mon Apr 21, 2008 2:33 pm

Re: I2C cable limitation using Arduino UNO R3?

Post by Franklin97355 »

This might be better answered in the Arduino forums. http://forum.arduino.cc/

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: I2C cable limitation using Arduino UNO R3?

Post by adafruit_support_rick »

Some additional 4.7K pullup resistors can't hurt.

waltr
 
Posts: 306
Joined: Wed Jun 12, 2013 5:01 pm

Re: I2C cable limitation using Arduino UNO R3?

Post by waltr »

I2C is a spec by NXP (formerly Philips). Here is an App Note on using I2C:
http://www.gooligum.com.au/tutorials.html

The full spec is:
http://www.nxp.com/documents/other/UM10204_v5.pdf

NXP does have I2C extender IC's.

The issue with longer bus lines is the capacitance and the Resistor pull-ups. These form a low pass filter that rounds the rising edge of the waveforms. Small value pull-ups lower the frequency of the filter and can help if the lines are not too long. See the App note ans spec docs for details.

Another way to use longer lines is to lower the clock frequency.

User avatar
bowserrh
 
Posts: 2
Joined: Sat Dec 21, 2013 3:10 pm

Re: I2C cable limitation using Arduino UNO R3?

Post by bowserrh »

I added 4.7K pull up resisters on the SCL and SDA lines. Now the I2C interface works fine over the 6' extension cable.

Thanks!

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”