20
\$\begingroup\$

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.

\$\endgroup\$
11
  • 3
    \$\begingroup\$ Hence the question. \$\endgroup\$ Nov 2, 2012 at 10:51
  • 1
    \$\begingroup\$ 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 \$\endgroup\$ Nov 2, 2012 at 12:54
  • 1
    \$\begingroup\$ @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. \$\endgroup\$ Nov 2, 2012 at 13:13
  • 3
    \$\begingroup\$ It seems some people are offended that I2C is a popular default connection option for lots of modules sold for Arduino users. Even if it was never designed for outside board connector it is here and it sells and asking for guidance on how better to make the connector for new devices is useful to us not experts and possible that experts dont like this. \$\endgroup\$ Nov 7, 2012 at 9:37
  • 1
    \$\begingroup\$ @ExcitingProjects No, they are right about what they say, I2C wasn't meant for this, and clearly faces several challenges in interdevice connection. It is just happenstance that module designers have chosen to go with I2C. I would be "offended" too if I had a choice. \$\endgroup\$ Nov 7, 2012 at 9:54

7 Answers 7

22
+50
\$\begingroup\$

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.

\$\endgroup\$
2
  • 2
    \$\begingroup\$ +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. \$\endgroup\$ Nov 6, 2012 at 21:57
  • \$\begingroup\$ 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. \$\endgroup\$ Nov 7, 2012 at 9:42
11
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ 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. \$\endgroup\$ Nov 2, 2012 at 12:07
5
\$\begingroup\$

Many people use some sort of connector to carry I²C signals and power between two PCBs. For example,

Some general tips for carrying I²C signals over longer distances:

p.s.: I see that Wikipedia: I²C Circuit interconnection has linked to this question.

\$\endgroup\$
4
\$\begingroup\$

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.

\$\endgroup\$
3
  • 3
    \$\begingroup\$ 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. \$\endgroup\$ Nov 2, 2012 at 12:56
  • 5
    \$\begingroup\$ 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 \$\endgroup\$ Nov 2, 2012 at 13:27
  • 1
    \$\begingroup\$ +1 for the funny-but-so-true point about standards! :-) \$\endgroup\$ Nov 2, 2012 at 13:49
3
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ 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? \$\endgroup\$ Nov 6, 2012 at 7:53
2
\$\begingroup\$

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

\$\endgroup\$
2
  • \$\begingroup\$ 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. \$\endgroup\$ Nov 6, 2012 at 8:27
  • 1
    \$\begingroup\$ @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". \$\endgroup\$ Nov 6, 2012 at 8:52
2
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ So we must put head in sand for all hundreds of I2C things people made and selling for beginners of arduino and other microcontrollers? \$\endgroup\$ Nov 7, 2012 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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