In industrial automation, the integration of proximity sensors with Programmable Logic Controllers (PLCs) forms a critical foundation for reliable machine control and process monitoring. Proximity sensors, being non-contact detection devices, are indispensable for sensing the presence or absence of metallic or non-metallic objects. Their correct wiring to a PLC's input module is paramount for system integrity. This guide details the fundamental principles and best practices for this essential connection.
Proximity sensors are broadly categorized by their sensing technology and output type. Inductive sensors detect metallic objects, while capacitive sensors can detect both metallic and non-metallic materials. Photoelectric sensors use light beams for detection. Regarding output, the two primary types are NPN (sinking) and PNP (sourcing) for DC sensors, and 2-wire or 3-wire AC/DC types. The wiring methodology is fundamentally dictated by this output configuration and the design of the PLC's digital input card.
For a standard 3-wire DC proximity sensor (the most common type), the wires are typically color-coded: brown for positive supply (+V), blue for common (0V), and black for the output signal. The core principle is to complete a circuit that allows the sensor's output signal to be correctly interpreted by the PLC input as a logic HIGH (24V) or LOW (0V).

Wiring a PNP (Sourcing) Sensor to a PLC:
A PNP sensor switches the positive voltage to its output wire. Here, the brown wire connects to the +24V DC supply. The blue wire connects to the 0V (common) of the same supply. The black output wire connects directly to the designated terminal of the PLC's input channel (e.g., I0.0). The other side of that PLC input channel is internally connected to the PLC's common (0V). Thus, when the sensor detects an object, it sources +24V from the black wire into the PLC input, registering a logic '1'. The current flows from the sensor, into the PLC input, and to the PLC's internal common.
Wiring an NPN (Sinking) Sensor to a PLC:
An NPN sensor switches the negative or 0V line to its output. The brown wire still connects to +24V, and the blue wire to 0V. However, the black output wire must connect to the PLC input terminal. Crucially, for an NPN sensor to work with a typical sinking PLC input, the PLC input's common must be connected to +24V. This creates a path where, upon detection, the sensor sinks current: current flows from the +24V PLC common, through the PLC input's internal circuit, out to the black wire of the sensor, and down to 0V via the sensor's internal switch, registering the logic state.
A critical rule is matching the sensor type with the PLC input circuit. Most modern PLC input modules are configurable as either sinking or sourcing, but the common terminal connection must be set accordingly. Mismatching a PNP sensor with a sinking-configured input (or vice-versa) will result in no signal detection. Always consult the datasheets for both the sensor and the PLC module.
For 2-wire AC or DC sensors, wiring is simpler as they are connected in series with the load (the PLC input). One wire connects to the power supply (L1 or +), and the other wire connects to the PLC input. The PLC input completes the circuit to the other side of the supply. A key consideration here is the residual leakage current of the sensor when "off," which must be lower than the PLC input's minimum OFF-state current to prevent a false trigger. Often, a bypass resistor is needed.
Shielded cables are highly recommended for long cable runs or in electrically noisy environments. The drain wire of the shield should be connected to a functional earth ground at one end only (typically at the PLC cabinet) to prevent ground loops. Always ensure proper grounding of the sensor housing if metallic.
Practical Steps & Safety:
1. De-energize: Always lock out and tag out (LOTO) all power sources before beginning wiring.
2. Identify: Confirm the sensor type (PNP/NPN, voltage rating) and the PLC input module specifications.
3. Power Supply: Use a clean, regulated DC power supply (typically 24V) shared between the sensors and the PLC input common for consistency.
4. Wiring: Follow the color codes and diagrams meticulously. Use ferrules on stranded wires for secure termination in PLC terminals.
5. Testing: After power-up, use the PLC's diagnostic software or hardware indicators to verify the input status changes reliably when an object is