Help
  • FAQ
    browse most common questions
  • Live Chat
    talk with our online service
  • Email
    contact your dedicated sales:
0

Sensor Wiring for PLC Controllers

Author : AIVON | PCB Manufacturing & Supply Chain Specialists March 24, 2026

 

Overview

This article explains wiring methods between sensors and PLC controllers and includes multiple wiring diagrams.

PLC digital inputs are designed with input isolation to improve noise immunity. Input interfaces commonly use optocouplers to isolate the external signal from the internal processing circuitry. An external input signal drives the optocoupler LED; the phototransistor inside the optocoupler receives the light and transfers the input state reliably to the PLC internal circuitry.

optocoupler-input-diagram

Digital input ports are generally classified as single-ended common (common point) or two-ended inputs. Because of these differences, users must understand the appropriate wiring when selecting external sensors so that the sensors and PLC work correctly for subsequent programming and system stability.

 

Input Circuit Types

1. Classification of Input Types

Digital input terminals of a PLC can be DC or AC powered. According to input interface wiring they can be single-ended common or two-ended inputs. When the common point is connected to the power positive terminal, the input type is SINK (sink current). When the common point is connected to the power negative terminal, the input type is SRCE (source current).

 

2. Terminology

SINK means current flows out of the input terminal; connect the input to the negative terminal. This indicates the internal optocoupler common is tied to the power positive terminal, and NPN sensors are compatible.

SOURCE means current flows into the input terminal; connect the input to the positive terminal. This indicates the internal optocoupler common is tied to the power negative terminal, and PNP sensors are compatible.

Proximity switches and photoelectric switches with three- or four-wire outputs are available in NPN and PNP types. For NPN devices, with no detection signal the output is high (due to internal pull-up resistor); when a target is detected the internal NPN transistor conducts and the output goes low. For PNP devices, with no detection signal the output is low (due to internal pull-down resistor); when a target is detected the internal PNP transistor conducts and the output goes high.

3. By Power Configuration

(1) DC input circuit

In the DC input circuit, the external input element can be a passive dry contact or a DC active contactless switch. When the external element connects to the power positive, current flows through R1, the optocoupler LED, and the indicator VD1 to the COM terminal, forming a loop. The phototransistor receives the signal and transmits it to internal processing. The DC supply for inputs can come from the PLC internal power or an external DC source. R2 bypasses the optocoupler LED to prevent the LED from being triggered by the leakage current of two-wire proximity switches.

dc-input-circuit

(2) AC input circuit

The AC input circuit requires the external element to be a passive dry contact or an AC active contactless switch. Compared with the DC interface, an AC input adds a step-down network and a bridge rectifier before the optocoupler. When the external element closes to AC power, current is reduced by R1 and C2, rectified by the bridge and converted into DC; the following circuitry is then the same as the DC input case.

AC PLC inputs are suitable for harsher environments or where wiring changes are impractical; two-wire AC proximity switches can replace mechanical limit switches in these situations.

 

4. By Port Type

(1) Single-ended common (common point) digital input

To save terminals, single-ended common inputs connect one end of all input circuits (optocouplers) together inside the PLC to the COM terminal, while the other ends connect to individual input terminals X0, X1, X2, etc. Using one common terminal plus N single-ended inputs yields N digital inputs with N+1 terminals. External input elements should be wired similarly: tie one side of all external input components together as an external common line, and connect the other side to the PLC input terminals X0, X1, X2, etc.

For SINK input mode, NPN sensors are suitable; the X terminal is connected to the negative supply. For SRCE input mode, PNP sensors are suitable; the X terminal is connected to the positive supply. External input components can be pushbuttons, limit switches, reed switches, Hall switches, proximity switches, photoelectric switches, light curtains, relay contacts, contactor contacts, and other switching devices.

(2) SINK input wiring (single-ended common SINK). Internal common COM→24V+, external common→24V-.

(3) SRCE input wiring (single-ended common SRCE). Internal common COM→24V-, external common→24V+.

(4) Switchable SINK/SRCE input

S/S terminals differ from COM in that COM is fixed to the internal power polarity, while S/S is not fixed and can be tied to internal or external power positive or negative as required.

Example: S/S configured for SINK: internal S/S→24V+, external common→24V-.

Example: S/S configured for SRCE: internal S/S→24V-, external common→24V+.

(5) External power supply for many active inputs

If many active input devices (Hall switches, proximity switches, photoelectric switches, light curtains, etc.) are used and consume significant power, the PLC internal supply may be insufficient and an external 24 VDC switching power supply of appropriate power should be provided. The external power should not be paralleled with the internal power. For SINK input mode, connect the external power positive to the internal positive. For SRCE input mode, connect the external power negative to the internal negative.

(6) Simple method to determine SINK vs SRCE

Short Xn to negative; if the input indicator lights, the input is SINK (common positive optocoupler, compatible with NPN). Short Xn to positive; if the indicator lights, the input is SRCE (common negative optocoupler, compatible with PNP).

(7) Two-wire switch inputs

For passive dry contacts use the same wiring methods as above. For two-wire proximity switches, identify the sensor polarity before wiring to ensure correct connection.

(8) High-speed differential (two-ended) input circuit

Used for hardware high-speed counters. The interface voltage is typically 5 VDC and a differential line-drive is used for high speed and noise immunity. If frequency and noise are low, a 5 VDC single-ended SINK or SRCE input can be used, or a series resistor can convert such signals to 24 VDC single-ended SINK or SRCE wiring.

(9) Differential two-wire line-drive input.
line-drive-diagram

(10) 5 VDC single-ended SINK or SRCE wiring.
5v-single-end-wiring

(11) 24 VDC single-ended SINK or SRCE wiring.
24v-single-end-wiring

Note: For sensors powered by 24 VDC, include a series current-limiting resistor on the input. R1 example 10 Ω, R2 example 2 kΩ; without proper limiting the interface circuit can be damaged. A common recommended value is 2.7 kΩ for R2.

 

External Input Devices

1. Passive dry contacts

Passive dry contacts (pushbuttons, limit switches, reed switches, relay contacts, etc.) are simple to wire. They do not require polarity considerations or worry about voltage drop. See earlier figures for wiring examples.

2. Two-wire active sensors

Two-wire active proximity switches exist in DC and AC types. They have two conductors and require a holding voltage across the device when the output conducts, typically a voltage drop of 3.5–5 V and a standby leakage current below 1 mA. If leakage is too large, the PLC input optocoupler may be activated when the proximity switch is not detecting.

DC two-wire sensors may implement diode polarity protection or bridge rectifier protection; diode-protected types require polarity attention when wiring to PLC inputs, while bridge-rectified types do not. Active reed switches used on cylinders often include bidirectional diode protection. AC two-wire proximity switches do not require polarity attention.

 

Examples:

Single-ended common SINK wiring: internal COM→24V+, external common→24V-.

Single-ended common SRCE wiring: internal COM→24V-, external common→24V+.

3. Three-wire active sensors

Three-wire active sensors include inductive proximity, capacitive proximity, Hall sensors, and photoelectric switches. Their outputs use transistor stages, and sensors are available in NPN or PNP outputs. Some products use four-wire outputs such as dual NPN, dual PNP, or combinations of NPN and PNP.

For NPN output, when the sensor detects a target the transistor conducts and current flows toward the negative terminal; the output voltage is pulled near the negative level, i.e., a high-to-low transition. For PNP output, when the sensor detects a target current flows from the positive terminal to the output and the output voltage is pulled near the positive level, i.e., a low-to-high transition.

Emitter resistors are small sampling resistors (2–3 Ω) for short-circuit protection and do not significantly affect output current. Collector resistors provide pull-up or pull-down to establish the idle output level; some outputs are open-collector and do not include internal pull resistors.

When the sensor transistor conducts it is equivalent to closing a contact. See diagrams for wiring examples.

 

Examples:

Single-ended common SINK wiring: internal COM→24V+, external common→24V-.

Single-ended common SRCE wiring: internal COM→24V-, external common→24V+.

Because PLC input circuits and sensor output types vary widely, it is essential to understand both the PLC input circuit configuration and the sensor output format before wiring PLC input modules. Correct wiring ensures reliable operation, simplifies subsequent programming, and contributes to overall system stability.

AIVON | PCB Manufacturing & Supply Chain Specialists AIVON | PCB Manufacturing & Supply Chain Specialists

The AIVON Engineering and Operations Team consists of experienced engineers and specialists in PCB manufacturing and supply chain management. They review content related to PCB ordering processes, cost control, lead time planning, and production workflows. Based on real project experience, the team provides practical insights to help customers optimize manufacturing decisions and navigate the full PCB production lifecycle efficiently.

Related Tags


2026 AIVON.COM All Rights Reserved
Intellectual Property Rights | Terms of Service | Privacy Policy | Refund Policy