I2C - Community Recommended Pinout DRAFT 4th Feb 2015

This is a page for the community recommended i2c pinouts. Currently in draft status, thus is up for discussion still.


i2c Header Pins

The most common interface for an i2c pinout is via header pins. But the pin arrangements often change between modules. Hopefully this will help reduce it.

Layout

Full Header Pins Layout

[VCC][SDA][GND][SCL][ V_AUX ][INT1][INT2][INT_etc...]

VCC   : Regulated Input 
        [Warning: Acceptable voltage dependent on module]
SDA   : i2c serial data input/output
GND   : Ground 0V
SCL   : i2c serial clock
V_AUX : Unregulated Auxiliary Power 
        (This input will be regulated to VCC Voltage levels)
INT1,INT2,etc...  :  Interrupt lines

4 pins - Reduced Form with direct power input. No interrupts

 [VCC][SDA][GND][SCL]

4 pins - Reduced Form with Auxiliary Regulated power Input. No interrupts

 [SDA][GND][SCL][AUX]

5 pins - Reduced Form

 [VCC][SDA][GND][SCL][AUX]

6 pins - Reduced Form

 [VCC][SDA][GND][SCL][AUX][INT]

Layout Justification/Reasoning

This was because according to real life experience by Samuel from this stack overflow thread on "definitive i2c pinout guide , it makes no real difference to have a certain pattern. This is since i2c is a relatively slow protocol, such that interference between SDA and SCL makes no difference practically. And if you are going long distance, you might as well use a dedicated i2c bus extender.

Samuel suggest [VCC][SDA][GND][SCL] as the his recommendation, since it is resistant against incorrect wiring.


modular plug

6PxC connectors

Most easily sourced cables have 4 conductors:


    6P4C PORT (Telephone. Typically called RJ12):
    (6 Possible Contacts, 4 Pin Contacts Used)
            _____
          _|     |_
     ____|         |____
    |                   |
    |                   |
    |                   |
    |_  [] 4 3 2 1 []  _|

     Pin (i2c) :
      * 4 : SDA
      * 3 : GND
      * 2 : SCL
      * 1 : AUX Unregulated (Typically Max 12V)

    If Twisted Pairs:
        pair1: pin 3&2
        pair2: pin 4&1

    http://en.wikipedia.org/wiki/Registered_jack#Registered_jack_types

If you want to include a common regulated power rail, and a interrupt:


    6P6C PORT (Telephone. Typically called RJ12):
    (6 Possible Contacts, 4 Pin Contacts Used)
            _____
          _|     |_
     ____|         |____
    |                   |
    |                   |
    |                   |
    |_   6 5 4 3 2 1   _|

     Pin (i2c) :
      * 6 : VCC Shared Common ( disconnected by default. )
      * 4 : SDA
      * 3 : GND
      * 2 : SCL
      * 5 : AUX Unregulated (Typically Max 12V)
      * 1 : Interrupt from slaves to master 


    If Twisted Pairs:
        pair1: pin 3&4
        pair2: pin 2&5
        pair3: pin 1&6

    Note: VCC is user defined, and connected
          directly to a board's power rail.
          This is used, if a common regulated voltage is 
          shared by all devices on the rail. 
          Especially if the default onboard regulator is an LDO.
          This should be left disconnected by default.

    http://en.wikipedia.org/wiki/Registered_jack#Registered_jack_types

    Questions: Should pin 6 and 1 be user defined??

Justification/Reasoning

A property of I2C design, is that you must always do a voltage level conversion between different logic levels.

Observation of many cables, shows that many are bundled pretty flat. Does that mean it would help to use phillips i2c bus spec's recommendation for wiring patterns? ( "SDA VDD GND SCL" ). According to phillips "If the length of the bus lines on a PCB or ribbon cable exceeds 10cm and includes the VDD and VSS lines, the wiring pattern must be...". Since I suspect most would use this for long length sensors as well (and that it is possible to get the twisted version of telephone cabling. )

There is not enough extra pins to assign dedicated 5V and 3.3V, without sacrificing a pin for interrupt. Thus a VCC rail is user defined, and disconnected by default is assigned to pin 6, as a "user defined shared common power rail".

8PxC connectors


    8P8C (wired as twisted pair Cat5 ) I2C Plug PORT:
    (You can use standard straight through RJ45 Ethernet cable) 
                      _____
                    _|     |_
     ______________|         |_______________
    |                                        |
    |                                        |
    |                                        |
    |[3.3V][5V][SCL][SCL][GND][GND][AUX][INT]|
       ^    ^   ^    ^    ^    ^    ^     ^
       8    7   6    5    4    3    2     1

     Pin (i2c) :
      * 8 : 3.3V 
      * 7 : 5V
      * 6 : SDA
      * 5 : SCL
      * 4 : GND (Twisted with pin 5 in cat5 cable)
      * 3 : GND (Twisted with pin 6 in cat5 cable)
      * 2 : AUX Unregulated (Typically Max 12V)
      * 1 : Interrupt from slaves to master

Justification/Reasoning

This wiring pattern, is designed so that your standard Cat5 RJ45 Ethernet cable can still be used in an unmodified fashion. The cat5 ethernet cable connection pair pin 6&3 together, around the 5&4 pair.

Since there is multiple other pins available after the minimum needed for i2C communications. 3 are assigned for power transmission, with a unregulated power input, and 2 regulated common voltage power rails.

The last pin is used for a shared interrupt to master. E.g. fifo buffers on an i2c gyroscope.


i2c TRRS Pinout

Layout


i2c TRRS pinout

TIP    : SCL | i2c serial clock signal
RING1  : SDA | i2c serial data input/output
RING2  : VCC | Regulated power input [Warning: Voltage depends on module]
SLEEVE : GND | Ground power input 

Justification/Reasoning

A typical TRRS plug will not have twisted pairs, and is not wired flat, so kind of useless to try and pattern it in a specific manner from the plug.

Their wiring pattern is safe enough. Since the VCC pin will not activate until the GND sleeve is inserted. It does mean... don't plug this into a TRS socket.

Boards that uses this pinout