Skip to content

Proximity switch wiring diagrams explained: a practical beginner’s guide

Identify the wire count and output type before connecting a proximity sensor. This guide explains common 2-wire, 3-wire and 4-wire arrangements, plus the difference between PNP and NPN outputs.

Mason Alexander
Published February 23, 2024
Reviewed September 14, 2026
7 min read

Key takeaways

  • Use the model label or manufacturer datasheet as the source of truth; wire colors alone are not enough.
  • A common 3-wire DC convention is brown for positive supply, blue for 0 V and black for the switching output.
  • Match a PNP or NPN sensor to the PLC input circuit and its common connection before applying power.
  • Two-wire devices are connected in series with the load and must be checked for leakage current and voltage drop.

Proximity switches detect an object without mechanical contact and are widely used for position confirmation, counting and machine interlocks. The wiring method depends on the exact sensor model, supply voltage, output circuit and connector pinout. Isolate the circuit before installation and verify every terminal against the manufacturer documentation.

Start by identifying the sensor

Read the complete part number and wiring diagram on the sensor body or datasheet. Confirm whether the device is AC or DC, how many conductors it uses, whether the output is PNP or NPN, and whether the switching function is normally open (NO), normally closed (NC), or complementary.

Common conductor arrangements

Sensor typeTypical conductorsWhat to verify
2-wire AC or DCSupply and switched current share two conductorsVoltage rating, polarity where applicable, leakage current and load range
3-wire DCBrown: L+ · Blue: M/0 V · Black: outputPNP or NPN output and PLC input common
4-wire DCSupply pair plus two output conductorsExact pinout; the second output may be NC, complementary or model-specific

PNP and NPN: what changes at the PLC input

A PNP output sources current to the input when active. An NPN output sinks current toward 0 V when active. The PLC input module must be wired with the compatible common reference; otherwise the input may stay off, behave unpredictably or create a fault.

Typical 3-wire DC input arrangements

PNP output3-wire DC
SENSORPNPPLC INPUTcommon 0 VBrown · +24 VBlue · 0 VBlack · output+24 V

Active output sources current into the PLC input.

NPN output3-wire DC
SENSORNPNPLC INPUTcommon +24 VBrown · +24 VBlue · 0 VBlack · output0 V

Active output sinks current from the PLC input.

Conceptual comparison only. Terminal numbers, protective devices and common wiring vary by sensor and PLC input module.

How a 2-wire sensor is connected

A 2-wire proximity sensor is normally placed in series with the load, so the same two conductors provide operating power and carry the switched current. Even in the off state, a small leakage current may remain; in the on state, the sensor also introduces a voltage drop. Both values must suit the connected PLC input, relay or load.

What a fourth wire usually means

Many four-wire sensors provide two switching outputs, often NO and NC or complementary outputs. Some models use the additional conductor for a different function. Treat the datasheet connection diagram—not a generic color chart—as authoritative.

A safe connection checklist

  1. 01

    Record the full model number

    Include suffixes, connector type and cable version; visually similar sensors can have different outputs.

  2. 02

    Confirm electrical ratings

    Check AC/DC supply, operating voltage, maximum load current, voltage drop and leakage current.

  3. 03

    Match the input circuit

    Verify PNP/NPN compatibility and the PLC input common before landing the output conductor.

  4. 04

    Wire with power isolated

    Use the documented terminal or pin assignment, then inspect polarity, grounding and protective devices.

  5. 05

    Test the switching state

    Restore power under the site procedure and confirm the sensor indicator and PLC input change together.

Frequently asked questions

Concise answers to common questions about the subject covered in this guide.

What do brown, blue and black wires usually mean on a proximity sensor?

On many 3-wire DC industrial sensors, brown is positive supply, blue is 0 V and black is the switching output. Always confirm the exact model’s diagram because color and pin assignments can differ.

Can a PNP sensor replace an NPN sensor?

Not as a direct substitution in every circuit. The PLC input type and common wiring must be compatible with the sensor output, and the supply and switching specifications must also match.

Why can a 2-wire proximity sensor keep a PLC input faintly active?

Two-wire sensors draw operating current through the load, so some off-state leakage current can remain. Compare the sensor leakage current with the PLC input’s off-state threshold and the manufacturer’s recommended connection.

Is the white wire always the normally closed output?

No. That is a common arrangement on some four-wire sensors, but the function is model-specific. Check the connection diagram and pin assignment for the complete part number.

Need help identifying a proximity sensor?

Send the complete part number, nameplate photo and application details. We can review the requirement and confirm available sourcing options.

Request a quote