Struggling to wire a proximity switch correctly? Whether you're dealing with a 2-wire, 3-wire, or 4-wire sensor, understanding the wiring diagram is key to getting your automation system up and running. This beginner-friendly guide breaks it all down—clear, simple, and with visuals.
For teams sourcing replacement sensors or related automation parts, ParttoGo can help identify suitable components by MPN, brand, or application.
What is a Proximity Switch?
Common Wiring Types
2-Wire (AC or DC)
-
Wiring: One wire is connected to the positive voltage supply, and the other wire connects to the load. The sensor acts as a switch that closes when an object is detected, allowing current to flow to the load.
3-Wire (DC, PNP/NPN)
- Brown – Power (+V)
Blue – Ground (0V)
Black – Output signal (connects to PLC or controller)
4 -Wire (Dual output)
Components of a 4-Wire Proximity Switch
-
Brown Wire: Positive voltage supply.
-
Blue Wire: Ground or negative terminal.
-
Black Wire: Normally open (NO) output.
-
White Wire: Normally closed (NC) output.

Wiring Considerations
Understanding the wiring of proximity switches is crucial for their proper operation. Depending on the application, you may encounter 2-wire, 3-wire, or 4-wire proximity switches.
Sample Wiring Diagrams
PNP Sensor Wiring:
-
Brown wire → +24V (Power supply)
-
Blue wire → 0V (Ground)
Think of it as "sourcing" current to the output when triggered.
NPN Sensor Wiring:
-
Brown wire → +24V
-
Blue wire → 0V (Ground)
-
Black wire → Connects to PLC input or relay (delivers a negative signal when triggered)
NPN is "sinking" current — it pulls the load to ground when active.

-
Check the label or datasheet.
-
Look at the wire colors (standard for DC sensors).
-
Use a multimeter if unsure.
Tips to Avoid Common Mistakes
-
Don’t mix PNP and NPN sensors without matching your input logic.
-
Use surge protection when wiring to inductive loads like relays.
-
Never assume wiring color — always double-check.
-
Ground your power supply properly to prevent false triggers.
Conclusion