Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

EDIT: This has been repeated several times, so putting it on top: Yes, it is well known that there is no "standard" for I2C inter-device connectors, but surely this community can formulate a list of "guidance" points for making such interconnects, based on signal behavior, noise minimization, and mitigation of risk due to wrong connections.


NXP defined the I2C standard without specifying a pin-out for I2C connectors, is my understanding. The only guidance from NXP seems to be a mention of placing a Ground and / or Vss between SDA and SCL if Vss / Gnd are carried across the interconnect.

Purchases of various I2C modules has left me with a variety of I2C pin-outs, and a bit of a task keeping track of the various little ribbon-cable-switching shims I've had to make for them.

e.g.

  • Mono OLED module: SCL, SDA, GND, 5V (obviously not ideal, since clock and data are next to each other.
  • Sensor Shield for Arduino: SDA, SCL, GND, 5V (again not ideal, plus switched SCL/SDA)
  • Color LCD module: SCL, GND, 5V, SDA (Yay!)
  • No-name I2C repeater: SCL, 5V, GND, SDA (ouch, they switched power pins! Nearly let the magic smoke out.)

So my question is this:
Is there a definitive / authoritative guideline for the I2C 4-pin connector pin-out sequence to use, where both Vss and GND are to be carried from host to device?

Failing this, is there any directory, however incomplete, of I2C modules / devices listing the pin-out each has adopted?

Clarification: Looking for guidelines such as "put Vss closer to SCL because..." rather than a defined standard which clearly does not exist.

share|improve this question
    
Every gadget I've seen has different I2C pinouts. –  Madmanguruman Nov 2 '12 at 10:49
1  
Hence the question. –  Anindo Ghosh Nov 2 '12 at 10:51
    
By your own question, it's clear to see there is no standard... and if there was, obviously people aren't following it. You're stuck making shims. :P –  Toby Lawrence Nov 2 '12 at 12:54
    
@TobyLawrence That comment brightened my day! :-) The shim making isn't as bothersome as the shim tracking. I now have a full 12 different shims, two of each, because I never could find the right one when I needed it. –  Anindo Ghosh Nov 2 '12 at 12:59
    
@AnindoGhosh heh. If it were me, I'd probably ditch the pre-bought modules and roll my own breakout boards with a standardized pinout using a polarized header. Probably something like 6 pins, with GND next to SDA, SCL and 5V... and then using a cable with three twisted pairs to keep ground near each signal to help lower noise and reject interference. –  Toby Lawrence Nov 2 '12 at 13:13
show 5 more comments

6 Answers

up vote 5 down vote accepted
+50

I've recently rolled my own as far as I2C connectors go. The connector itself is not very important, right now I'm just using 100mil pitch header (usually female on board so it's not so pokey when not connected), but any 4plus pin connector will do. Additionally, I'm using the P82B715 from TI as an I2C bus extender. This overcomes the capacitance issues associated with running long I2C drops off board, which as people have been saying, I2C was not intended for initially. I did try many different combinations, like in the examples you gave and I noticed absolutely no difference in performance. I believe this is because I2C is relatively slow, interference between SDA and SCL is not much of an issue. Basically the rise time for voltages (when interference will occur) on the bus are much much smaller than a bit length. So, that may not be what you want to hear, but it does afford more options. Personally I went with [VCC, SDA, GND, SCL] to be easily routed to/from this chip and also be immune to a VCC/GND mix up when plugged in backward.

share|improve this answer
1  
+1 +Accept. Thanks, probably the most actually practicable answer so far, "interdevice I2C exists, here's how I use it and why". The VCC/GND mix-up avoidance is useful. Good point on avoiding pokey pin headers on board, I've ripped a couple of pins off some sensor modules by accident. –  Anindo Ghosh Nov 6 '12 at 21:57
    
This is only answer which is really helpful and and if I have enough reputation I would give a bonus to @Samuel for it and I favorite this question because I have many many I2C modules and will build I2C modules some day following this guides. –  ExcitingProjects Nov 7 '12 at 9:42
add comment

When it was first established, the I2C (Inter-Integrated Circuit) bus was only intended to connect chips on a single PCB assembly. It was never intended to be used on cables to connect multiple boards together, and therefore, no connectors for that purpose were defined.

The only "standard" I2C-based external interfaces I'm aware of are the short-lived ACCESS.bus for connecting user interface devices to computers and the VESA Display Data Channel used to retrieve monitor information over VGA, DVI and HDMI connectors.

share|improve this answer
    
I understand the original purpose was different, but since I2C is being used for a lot of cable-connected modules now, I'd hope someone has begin a collaborative database for documenting pin-outs used by various products, specially the many products catering to the Arduino and other microcontroller board markets. –  Anindo Ghosh Nov 2 '12 at 12:07
add comment

No standard pin-out, no standard connector. The I2C standard isn't real amenable to this sort of thing. It's specified at the bus level, not the device level. For example, when you'd like to plug in an I2C device, do you know by the standard whether the pullups are on the host or on the device?? No. Plenty of other stuff you don't know, either, like where your cable capacitances are, what Vcc needs to be ....

In fact, there are even I2C devices that need extra lines for interrupts and other plain old digital I/O. How do you add those to the standard, if you can't get agreement on how many pins you need.

Bottom line, if your looking for portability and stability in your interconnects, I2C and SPI aren't where you need to look.

share|improve this answer
1  
What if one is looking for a guideline for making one's own device, that would work with (and like) all those other modules out there for the 'duino? There's a market there, don't see a point ignoring it. Incidentally, pull-ups are required at host and optional at device, as per the spec. –  Anindo Ghosh Nov 2 '12 at 12:56
3  
The "nice" thing about standards is that there are so many to choose from! You pick a standard with a well defined connector, like MIDI, USB, RS232 (aside from that stupid null modem things), and build a translator into your own device. The other option is forming a standards workgroup through a standards org, like IEEE. "Optional" pullups on the device impact the behavior of the whole bus, making my point exactly. MIDI optically isolates every device by standard, so compliant devices don't cause these issues –  Scott Seidman Nov 2 '12 at 13:27
    
+1 for the funny-but-so-true point about standards! :-) –  Anindo Ghosh Nov 2 '12 at 13:49
add comment

While there's no I²C pinout or connector standard, there are quite a few places I²C is used which are standardised. Some that come to mind are memory modules (DIMM, SO-DIMM), video connectors (DDC in DVI, VGA) and SM-Bus (yes, their webpage looks like something a kid made in the mid-90s). In particular, the SM-bus connector is keyed and contains only I²C and power, but SM-Bus places additional restrictions so technically not every I²C device should be connected to an actual SM-Bus. A few more proprietary plugs are around too, such as Lego NXT sensors.

share|improve this answer
    
It's a given that there is no standard... What I am hoping for is a canonical collection of guidelines, that device designers might then follow. SMBus, for instance, has the +5V line on the outside, while NXP recommends both +V and GND to be between the signal traces. Which way is better, and why? –  Anindo Ghosh Nov 6 '12 at 7:53
add comment

As usual for any post asking about why something is[nt] standardized:
Fortunately, the charging one has been solved now that we've all standardized on mini-USB. [Or is it micro-USB? Shit.
From XKCD

share|improve this answer
    
Perhaps if you had read the question more carefully, or the many comment threads, you might have noticed that it isn't a standard being sought but a collection of wisdom in the form of canonical guidelines. –  Anindo Ghosh Nov 6 '12 at 8:27
    
@AnindoGhosh - I don't see how that makes any difference. If you replace standard with guideline in the above comic, it's equally valid. Any situation where there are multiple ways to do something generally results in many people doing said thing many ways. Even if it's not a formal "standard". –  Connor Wolf Nov 6 '12 at 8:52
add comment

There is no standard.

There is no common practise.

As to issues for deciding yourself what to do:

  1. Keep the signals on one board like they were intended to be in the first place. The IIC lines have fairly high impedance, are single ended, and are therefore susceptible to noise and won't terminate transmission lines well. IIC simply isn't meant for going off board.

  2. If you're going to go off board anyway, keep the bus short. A few inches is probably OK. A meter or more is really asking for trouble.

  3. Keep off board lines away from noise sources. Don't wrap them around a motor, for example, or even try to go near one.

  4. Use a connector that can't be hooked up backwards. If someone can plug it in backwards, someone will.

  5. Ribbon cable is probably the easiest to use. You need three wires minimum, SCL, SDA, and ground. Adding power is probably a good idea. In any case, make sure the ground wire is between SCL and SDA to avoid crosstalk. The power wire should not be noisy, so stick it on one side, it doesn't matter which.

  6. After messing around with connectors and chasing potential problems, realize that point 1 was actually the only one you needed to know.

share|improve this answer
1  
+1 for the last point –  Wouter van Ooijen Nov 7 '12 at 8:27
    
So we must put head in sand for all hundreds of I2C things people made and selling for beginners of arduino and other microcontrollers? –  ExcitingProjects Nov 7 '12 at 9:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.