M8 and M12 Circular Connectors: Codings and Pinouts
Short answer
- The key on an M8 or M12 circular connector encodes its electrical purpose, and a mismatched plug will not turn into a locked position, which prevents accidental cross-connection.
- M12 codings cover general sensors and low-speed fieldbus with A-code and B-code, 100 Mbit Ethernet with D-code, 1 Gbit Ethernet with X-code, and power distribution with S, T, K and L codings.
- M8 connectors use the same coding scheme at a smaller scale, and the coupling nut torque, sealing gasket and IP rating together determine whether the connection stays sealed in harsh environments.
When a sensor cable is plugged into the wrong socket, the result is often a dead device, a short circuit, or a network failure. The physical key on an M8 or M12 circular connector is there to stop that from happening, and the key’s shape encodes the electrical purpose of the connector.
Why do M8 and M12 connectors have physical keying?
All industrial circular connectors use a rotating key that mates with a complementary slot in the mating part. The key geometry is defined by the coding. If the key on a plug does not match the socket, the parts will not rotate into a locked position, preventing accidental cross‑connection. This is not merely a convenience; it protects field wiring from:
- Voltage mismatches – power‑only codings (S, T, K, L) carry up to 24 V DC or 48 V DC at several amps, while sensor codings (A, B, D, X) are limited to 30 V DC and lower current.
- Signal‑level incompatibility – PROFIBUS (B‑code) uses differential 5 V signalling, whereas Ethernet codings (D, X) require 100 Ω termination and high‑speed transceivers.
- Ground‑loop creation – mismatched shielding can introduce noise into analog sensor loops.
Because the key is machined into the metal shell, a mismated plug will simply not turn, giving an immediate visual cue that the wrong connector is being used.
What does each M12 coding letter mean?
The M12 connector family is standardized by IEC 61076‑2‑101. The most common codings are:
- A‑code – General purpose sensors, binary I/O, and low‑speed fieldbus. Pin pitch 2.5 mm, 3‑ to 12‑pin variants. Typical voltage 30 V DC, current up to 2 A.
- B‑code – PROFIBUS DP and other 31.25 Mbit/s fieldbuses. Same 2.5 mm pitch, but the key is offset 45°. Designed for 24 V DC, 2 A max.
- D‑code – 100 Mbit Ethernet (Industrial Ethernet, Profinet, EtherNet/IP). The key is a 90° offset, and the connector includes a metal shield that doubles as a ground plane.
- X‑code – 1 Gbit Ethernet (Gigabit Ethernet, EtherCAT). The key is a 135° offset and the contacts are rated for higher frequencies (up to 250 MHz). Pin count is usually 8‑pin, supporting full‑duplex data and optional Power over Ethernet (PoE).
- S‑code, T‑code, K‑code, L‑code – Power codings. These have a 3‑pin (S/T) or 4‑pin (K/L) layout, larger contact area, and a key that prevents insertion into any data coding. They are used for 24 V DC, 48 V DC or 12 V DC power distribution to actuators, valves and motor drives.
When selecting a connector, match the coding to the device’s communication protocol. For example, a Profinet sensor will specify a D‑code M12, while a simple proximity switch will use an A‑code.
What are the typical pin counts and pinouts for M12 sensors?
Within each coding, the M12 family offers several pin counts. The most common for sensors are 3‑, 4‑, 5‑ and 8‑pin versions. The pinout convention is fairly consistent across manufacturers, which makes it easy to read a wiring diagram without looking up a specific part.
- 3‑pin (A‑code) – Power (V+), Ground (GND), Signal (e.g., NPN/PNP output). Used for binary proximity switches.
- 4‑pin (A‑code) – V+, GND, Signal, and a second signal line (often a second sensor output or a diagnostic line).
- 5‑pin (A‑code) – V+, GND, Signal, Shield, and a spare or auxiliary channel. The shield is tied to chassis ground at the device end, not at the cable end, to avoid ground loops.
- 8‑pin (D‑code or X‑code) – Four pairs for 100 Mbit or 1 Gbit Ethernet (Tx+, Tx‑, Rx+, Rx‑) plus optional PoE+ and PoE‑ pins, and a shield contact. When used for pure sensor data (e.g., a smart sensor with built‑in Ethernet), the extra pins may carry configuration or diagnostic data.
Note the male/female convention: the device (sensor or actuator) normally terminates with a female socket, while the field‑wireable cable ends with a male plug. This convention keeps the cable’s conductive pins protected when the cable is coiled or stored.
When should an M8 connector be used instead of M12?
M8 connectors use a 1.0 mm pitch and are intended for space‑constrained devices such as flow meters, temperature probes, and miniature proximity switches. The same coding scheme applies (A, B, D, X, power codings) but the key geometry is scaled down.
- 3‑pin A‑code M8 – V+, GND, Signal. Typical for temperature or pressure transducers.
- 4‑pin A‑code M8 – Adds a second signal or a diagnostic line.
- 5‑pin A‑code M8 – Includes a shield contact; the shield is usually connected to the device chassis.
- 8‑pin D‑code M8 – Rare, used for high‑speed Ethernet in very tight enclosures.
Because the M8 shell is smaller, the torque spec for the coupling nut is lower – typically 15 ± 2 Nm for a standard stainless‑steel thread. Over‑torquing can strip the threads and compromise the IP rating.
What mechanical and environmental ratings matter for connectors?
Industrial environments demand reliable sealing and secure coupling. The two most relevant IP ratings for circular connectors are:
- IP67 – Dust‑tight and protected against immersion up to 1 m for 30 minutes. Sufficient for most indoor and outdoor machines.
- IP69K – Provides protection against high‑pressure, high‑temperature washdown (up to 80 °C, 140 bar). Required in food‑processing, automotive paint lines, and other wash‑down applications.
Achieving the rating depends on two factors: the sealing gasket (usually an EPDM or silicone O‑ring) and the torque applied to the coupling nut. The manufacturer’s torque chart typically lists 20–30 Nm for M12 and 15 Nm for M8. Use a calibrated torque wrench; a loose nut will allow water ingress, while an over‑tightened nut can crush the O‑ring and reduce sealing effectiveness.
Two construction styles exist:
- Moulded (factory‑terminated) cable assemblies – The cable is pre‑terminated in a controlled environment, with the connector molded onto the cable jacket. These assemblies meet the IP rating out of the box and are ideal for high‑volume production.
- Field‑wireable (hand‑terminated) versions – The connector has a removable rear shell that accepts crimp pins or screw terminals. This allows on‑site customization of wire gauge, shielding, or the addition of a spare pin. Field‑wireable versions must be re‑tested for IP compliance after termination.
Shielding is another key decision. A shielded M12 or M8 connector has a metal shell that contacts the cable braid, providing a low‑impedance return path for high‑frequency noise. For analog sensors, an unshielded version is often sufficient, but for Ethernet (D‑ or X‑code) the shield is mandatory to meet IEC 61850‑3 electromagnetic compatibility requirements.
How do circular connectors work with Ethernet networks?
When a sensor or actuator uses Ethernet (D‑code for 100 Mbit, X‑code for 1 Gbit), the connector must be compatible with the plant’s network infrastructure. The connector’s pinout aligns with the standard RJ45‑style 8P8C layout, but the circular shell provides the ruggedness required for harsh environments.
Typical network design steps include:
- Verify that the switch supports the required speed and PoE class. Industrial Ethernet switches often provide 24‑port models with IP‑rated front panels that accept M12 plugs directly.
- Select the correct coding – D‑code for 100 Mbit, X‑code for gigabit. Using a D‑code plug on an X‑code socket will not mate because of the key offset.
- Confirm the cable assembly meets the category rating (Cat 5e for 100 Mbit, Cat 6A for 1 Gbit). Sensor and actuator cordsets are available with pre‑terminated M12 X‑code plugs that meet the required bandwidth.
- Maintain the recommended bend radius (typically 8× the outer diameter) to avoid signal attenuation.
For devices that combine power and data, the power codings (e.g., K‑code for 24 V DC) can be used alongside a separate data connector, or a hybrid M12 X‑code with PoE pins can supply both. The keying ensures that a power‑only plug cannot be inserted into a data socket, preventing accidental short circuits.
How should connector compatibility be confirmed across suppliers?
Many manufacturers follow the IEC coding standard, but subtle differences can appear in the mechanical tolerances of the key and the sealing gasket material. When specifying a part, reference the generic coding rather than a brand‑specific model. For example, state “M12 D‑code, 4‑pin, IP67, 20 Nm torque” instead of a part number.
Brands such as Turck offer a full range of M8 and M12 connectors that adhere to the IEC codings. Their catalog includes both moulded and field‑wireable options, as well as compatible cordsets listed under the circular connector category circular connectors. Cross‑reference the coding, pin count, and IP rating to the device datasheet to avoid mismatches.
Finally, remember that any installation involving live power or high‑speed Ethernet should be performed by qualified personnel. Verify torque with a calibrated wrench, check the seal after assembly, and test continuity before energising the system.
If you need help locating the right M8 or M12 connector family, cordset or Ethernet switch to match your application, feel free to reach out for sourcing assistance.
Need a quote on a specific part?
Request a QuoteFrequently asked questions
What does the coding on an M12 connector mean?
The coding is the shape of the key that mates with a complementary slot in the mating part, and it encodes the electrical purpose of the connector. A-code serves general purpose sensors and binary I/O, B-code serves PROFIBUS DP, D-code serves 100 Mbit Ethernet, X-code serves 1 Gbit Ethernet, and S, T, K and L are power codings. If the key does not match, the parts will not lock.
Can a D-code M12 plug be used on an X-code socket?
No. A D-code plug will not mate with an X-code socket because of the key offset. D-code is used for 100 Mbit Ethernet with a 90 degree key offset, while X-code is used for 1 Gbit Ethernet with a 135 degree key offset. Select D-code for 100 Mbit and X-code for gigabit so the coding matches the network speed.
What torque should be used on M8 and M12 coupling nuts?
The manufacturer's torque chart typically lists 20 to 30 Nm for M12 and 15 Nm for M8. A calibrated torque wrench should be used, because a loose nut allows water ingress while an over-tightened nut can crush the O-ring and reduce sealing effectiveness. Over-torquing can also strip the threads and compromise the IP rating.
What is the difference between IP67 and IP69K connectors?
IP67 means dust-tight and protected against immersion up to 1 m for 30 minutes, which suits most indoor and outdoor machines. IP69K protects against high-pressure, high-temperature washdown up to 80 °C and 140 bar, and is required in food-processing, automotive paint lines and other wash-down applications. Either rating depends on the sealing gasket and the coupling nut torque.
Industrial Automation & MRO Parts