Skip to content
AESTECHNO
Pinout

M12 pinout: A, D and X-coding

The M12 is the sealed circular connector of industrial automation, with a 12 mm thread. Its coding, a mechanical key, prevents plugging a cable into the wrong use: A-coding for sensors, actuators and IO-Link, D-coding for 100 Mbit/s Ethernet, X-coding for Ethernet up to 10 Gbit/s.

By Hugues Orgitello · Updated ·

A-coded, 4 and 5 pins (sensors, actuators, IO-Link)

Assignment and wire colors per IEC 60947-5-2 for 3 and 4-wire proximity sensors, and per the IO-Link specification for the IO-Link column. Pin 5 only exists on the 5-pin version.

A-coded, 4 and 5 pins (sensors, actuators, IO-Link). Male plug (pins) seen from the front. 1 L+ 2 Out 2 3 L- 4 Out 1 5 FE
Male plug (pins) seen from the front
Pin Signal WireIO-Link Description
1 L+ Brown (BN)L+ +24 V supply (Power)
2 Out 2 White (WH)I/Q (class A), P24 (class B) Second output, complementary output or unconnected depending on the sensor (Signal)
3 L- Blue (BU)L- 0 V (Ground)
4 Out 1 Black (BK)C/Q Main switching output (Signal)
5 FE / NC Gray (GY)NC (class A), N24 (class B) Functional earth or unconnected (Shield / earth)

D-coded, 4 pins (10/100 Mbit/s Ethernet)

Assignment per IEC 61076-2-101, used by PROFINET and EtherNet/IP. Wire colors per PROFINET cabling. The last column gives the matching RJ45 pin. D-coding adds a second, smaller key, not drawn here.

D-coded, 4 pins (10/100 Mbit/s Ethernet). Male plug (pins) seen from the front. 1 TD+ 2 RD+ 3 TD- 4 RD-
Male plug (pins) seen from the front
Pin Signal WireRJ45 Description
1 TD+ Yellow1 Transmit, positive (Differential pair)
2 RD+ White3 Receive, positive (Differential pair)
3 TD- Orange2 Transmit, negative (Differential pair)
4 RD- Blue6 Receive, negative (Differential pair)

X-coded, 8 pins (1 and 10 Gbit/s Ethernet)

Assignment per IEC 61076-2-109. The four pairs are separated by a cross-shaped shield; the key sits in the pin 1-2 quadrant. The last column gives the matching RJ45 pin (T568B wiring).

X-coded, 8 pins (1 and 10 Gbit/s Ethernet). Male plug (pins) seen from the front. 1 BI_DA+ 2 BI_DA- 3 BI_DB+ 4 BI_DB- 5 BI_DD+ 6 BI_DD- 7 BI_DC- 8 BI_DC+
Male plug (pins) seen from the front
Pin Signal RJ45 Description
1 BI_DA+ 1 Pair A, positive (Differential pair)
2 BI_DA- 2 Pair A, negative (Differential pair)
3 BI_DB+ 3 Pair B, positive (Differential pair)
4 BI_DB- 6 Pair B, negative (Differential pair)
5 BI_DD+ 7 Pair D, positive (Differential pair)
6 BI_DD- 8 Pair D, negative (Differential pair)
7 BI_DC- 5 Pair C, negative (Differential pair)
8 BI_DC+ 4 Pair C, positive (Differential pair)
An interface to design?

An industrial sensor to design around an M12 connector, an IO-Link port to integrate, a move to industrial Ethernet? We design the board and pick the connectors with you.

M12 codings and what they are for

The coding is a key molded into the insulator: a D-coded cable does not fit an A-coded receptacle. The common ones are A (sensors, actuators, IO-Link, 24 V DC fieldbus), B (PROFIBUS and some fieldbuses), D (100 Mbit/s Ethernet), X (1 to 10 Gbit/s Ethernet), and for power L (up to 16 A DC, PROFINET power), T (DC), S and K (AC).

Seen from the front, a female receptacle is the mirror image of the male plug drawn here: pin 1 moves to the other side of the key. That is the most common source of error when drawing a panel connector from a cable drawing.

Frequently asked questions

FAQ

What are the wire colors of an M12 sensor cable?
Per IEC 60947-5-2: pin 1 brown (+24 V), pin 2 white, pin 3 blue (0 V), pin 4 black (output), pin 5 gray. A 3-wire PNP sensor only uses brown, blue and black.
What is the difference between M12 D-coding and X-coding?
D-coding has 4 pins, so two pairs: it carries 10/100 Mbit/s Ethernet. X-coding has 8 pins, so four pairs separated by a cross-shaped shield: it carries Gigabit and 10 Gbit/s. The two do not mate with each other.
How do you wire an M12 D-coded to an RJ45?
M12 pin 1 to RJ45 pin 1 (TD+), M12 2 to RJ45 3 (RD+), M12 3 to RJ45 2 (TD−), M12 4 to RJ45 6 (RD−). RJ45 pins 4, 5, 7 and 8 stay free. Keep the pairs together: M12 pins 1 and 3 form the transmit pair.
What does IP67 mean for an M12 connector?
Dust-tight and protected against temporary immersion, per IEC 60529, but only once the plug is screwed onto the receptacle with its seal. A receptacle with no cap and no cable does not have that rating.
Sources
  • IEC 61076-2-101, Circular connectors M12 with screw-locking (codings A, B, D...) (paid or members-only document)
  • IEC 61076-2-109, Circular connectors M12 for data transmission up to 500 MHz (X-coding) (paid or members-only document)
  • IEC 60947-5-2, Proximity switches (connector pinout and wire colors) (paid or members-only document)
  • IEC 61076-2-111, Circular connectors M12 for power (codings L, S, T, K) (paid or members-only document)
  • IO-Link Interface and System Specification V1.1.x (IEC 61131-9), Tables 12-13, Figure 26

Tables built from these documents and cross-checked against manufacturer datasheets. Always check the datasheet of the connector you actually use: some manufacturers number differently.

Further reading

Other pinouts