M12 A-Coded Connector Pinout: 3-Pin, 4-Pin, and 5-Pin Wiring Explained

M12 A-Coded Connector Pinout: 3-Pin, 4-Pin, and 5-Pin Wiring Explained

Author Penny
Published
Read Time 7 min read

You know you need an A-coded M12 connector. But which pinout should you use? A 3-pin sensor, a 4-pin switching sensor, and a 5-pin IO-Link device may all use the same M12 A-coded interface, but their wiring is not the same.

If the pin assignment is wrong, the sensor may not power on, the signal may not reach the PLC, or the device may be damaged. This guide explains the standard M12 A-coded 3-pin, 4-pin, and 5-pin pinout and wire color conventions used in industrial automation.

Quick answer: M12 A-coded pinout and wire colors

For most M12 A-coded sensor cables, pin 1 is brown for +24V DC, pin 3 is blue for 0V, and pin 4 is black for the main switching output or IO-Link C/Q line.

Pin 3-Pin A-Coded 4-Pin A-Coded 5-Pin A-Coded Typical Wire Color
1 +24V DC +24V DC +24V DC Brown
2 Second output / input Second output / analog signal White
3 0V 0V 0V Blue
4 Switching output Primary switching output Output / IO-Link C/Q Black
5 FE / third output / analog ground Grey

This table gives the common reference, but the final wiring should always follow the device datasheet. Some sensors, IO-Link devices, and proprietary equipment may use pin 2 or pin 5 differently.

M12 A-coded pinout and wire color table
M12 A-coded pinout and wire color table.

Before you start: check the IEC standard and the device datasheet

M12 A-coded connectors are widely used for industrial sensors and actuators. Their mechanical interface and coding are related to the IEC 61076-2-101 connector standard, but the actual signal assignment still depends on the device manufacturer.

Most industrial sensor manufacturers follow common pinout conventions, but not every product is wired the same way. For example, pin 2 may be a second output, an external input, an analog signal, or not connected at all. When in doubt, the device datasheet overrides any general pinout guide.

Before ordering or wiring an M12 A-coded connector, confirm these details:

  • Pin count: 3-pin, 4-pin, or 5-pin
  • Gender: male pins or female sockets
  • Connector direction: straight or angled
  • Mounting type: cable assembly, field wireable, panel mount, or PCB mount
  • Wire color and signal assignment
  • Voltage, current, cable material, and shielding requirements

M12 3-pin A-coded pinout and color code

A 3-pin M12 A-coded connector is commonly used for simple switching sensors that only need power, ground, and one output signal.

M12 3 pin A-coded connector pinout
M12 3-pin A-coded connector pinout.
Pin Signal Typical Wire Color
1 +24V DC supply voltage Brown
3 0V ground Blue
4 Switching output, NO or NC Black

Notice that pin 2 is skipped. This is intentional. A 3-pin M12 A-coded connector normally uses pins 1, 3, and 4 so that it remains physically compatible with common M12 A-coded mating interfaces.

This configuration is often used for basic inductive proximity sensors, magnetic reed switches, and simple photoelectric sensors. The current draw is usually low, so the cable does not normally require a heavy conductor size. However, the final cable specification should still match the sensor current and installation environment.

M12 4-pin A-coded pinout and color code

A 4-pin M12 A-coded connector is one of the most common configurations in industrial automation. It adds pin 2 for a second output, input, or special function while keeping the same basic power and signal structure.

M12 4 pin A-coded connector pinout and color code
M12 4-pin A-coded connector pinout and color code.
Pin Signal Typical Wire Color
1 +24V DC supply voltage Brown
2 Second output / input / not connected White
3 0V ground Blue
4 Primary switching output, NO or NC Black

In a standard 4-pin PNP normally open sensor, pin 4 is the main switching output. When the sensor detects a target, pin 4 switches high, usually to +24V DC.

Pin 2 depends on the device. On some sensors it is a second output, such as light-on or dark-on output for a photoelectric sensor. On other devices it may be an input, such as a teach-in signal, or it may not be connected.

If you are selecting an M12 4-pin connector for a machine, control cabinet, or sensor cable, do not confirm the part only by pin count. You should also confirm whether you need a male or female connector, straight or angled body, molded cable, field wireable type, panel mount socket, or PCB mount connector.

M12 5-pin A-coded pinout and color code

A 5-pin M12 A-coded connector is commonly used for IO-Link devices and sensors that need more than one signal function through the same connector.

M12 5 pin A-coded connector pinout and wire colors
M12 5-pin A-coded connector pinout and wire colors.
Pin Signal Typical Wire Color
1 +24V DC supply voltage Brown
2 Second output / analog output / auxiliary signal White
3 0V ground Blue
4 Primary output / IO-Link communication C/Q Black
5 Functional earth / analog ground / third output Grey

In IO-Link applications, pin 4 is normally used as the C/Q communication line between the sensor and the IO-Link master. Pin 2 may be unused, or it may be used as an additional digital or analog signal depending on the device design.

Pin 5 is also application-dependent. It may be functional earth, analog ground, or another signal line. Always check the IO-Link device documentation before wiring a 5-pin M12 connector.

If you replace a 4-pin sensor cable with a 5-pin cable, the connector may still physically fit because both are M12 A-coded. However, the available functions depend on the device, cable, and IO-Link master. A physically compatible connector does not always mean the wiring is electrically correct.

M12 male vs female pinout: front view is mirrored

Male and female M12 connectors are easy to confuse because the pin positions appear mirrored when viewed from the mating face.

M12 male vs female pinout front view
M12 male and female pinout front view is mirrored.

A male M12 connector has visible pins. A female M12 connector has sockets. When you look at the front face, the pin numbering position is not the same as the mating connector. This is one of the most common reasons for wiring mistakes during field assembly.

When assembling a field wireable M12 connector, do not guess the pin position from the opposite mating side. Check the printed numbering on the insert, the wiring diagram supplied with the connector, or the device manufacturer’s datasheet.

Common M12 A-coded wiring mistakes

Most wiring problems happen because the connector is selected by appearance only. The same M12 size can have different pin counts, coding types, gender directions, and internal wiring.

  • Mixing up male and female pin positions: the front view is mirrored, so pin positions must be checked carefully.
  • Assuming all 4-pin sensors use pin 2 the same way: pin 2 may be an output, input, or not connected.
  • Using a 4-pin cable for a 5-pin IO-Link device: basic switching may work, but IO-Link communication or auxiliary functions may be lost.
  • Choosing only by pin count: A-coded, B-coded, D-coded, and other M12 connectors are not interchangeable.
  • Ignoring cable material: PVC and PUR cable jackets behave differently in drag chain, oil, abrasion, and outdoor environments.

How to confirm an M12 pinout when the datasheet is unclear

If the device datasheet is missing or unclear, confirm the pinout step by step before connecting the sensor to a PLC or IO-Link master.

  1. Identify pin 1 and pin 3 first. These are usually +24V DC and 0V on standard A-coded sensor wiring.
  2. Use a known-good M12 cable to trace wire colors if the device side is not clearly marked.
  3. Apply 24V to pin 1 and 0V to pin 3 only if the device rating confirms this voltage.
  4. Trigger the sensor and measure the output between pin 4 and pin 3.
  5. Check pin 2 and pin 5 separately if the device has additional outputs, inputs, analog signals, or IO-Link functions.

If you are not sure, send the connector photo, device model, datasheet, or wiring diagram to your supplier. A clear front-view photo of the connector face can help confirm the pin count, coding, and gender direction.

Need M12 A-coded connectors or cable assemblies?

NITAI Electronics manufactures M12 A-coded connector products for industrial automation, sensor wiring, control cabinets, and OEM equipment projects.

We can support different M12 A-coded configurations, including:

  • M12 4-pin connectors for sensors, actuators, and control cabinet wiring
  • M12 5-pin connectors for IO-Link devices and multi-function sensors
  • Male and female connectors, straight and angled types
  • Panel mount sockets, PCB mount connectors, field wireable connectors, and molded cable assemblies
  • PVC, PUR, and customized cable jacket options
  • Standard or customized pin assignments based on your wiring diagram

If you already have a drawing, datasheet, sample, or target application, send it to us for checking. We can help confirm the connector type, pinout, cable structure, and suitable production option before quotation.

Ask NITAI about your M12 A-coded wiring requirement →

Leave a Reply

Your email address will not be published. Required fields are marked *

NITAI Electronics · Dongguan, China

Ready to Source Industrial Connectivity Products?

NITAI manufactures terminal blocks, M8/M12 waterproof connectors and industrial distribution modules for global OEMs, distributors and automation customers.