Zhejiang Xinsenzheng Automation Co., Ltd.

Industrial Sensor Manufacturer OEM & Application Support Factory-direct Supply

How to Wire an NPN Proximity Sensor Without Miswiring It

A typical three-wire NPN sensor uses brown for +V, blue for 0 V and black for output. Connect that output to a compatible sourcing PLC input: the sensor completes the current path to 0 V. Confirm the exact wiring diagram, input-group common and electrical limits before connecting power.

How do you connect a three-wire NPN proximity sensor?

For a conventional three-wire DC NPN sensor, connect its positive supply lead to +V, its negative supply lead to 0 V, and its output lead to a compatible PLC input. The PLC input must supply the load current that the NPN output sinks. In the common-positive arrangement below, that means the input-group common connects to +V.

Before touching the wiring: isolate hazardous energy and verify the equipment is de-energized under the machine’s approved procedure. A stopped PLC program is not energy isolation. Powered measurements belong to qualified personnel using appropriate equipment and safeguards. This guide covers ordinary process sensing, not personnel-safety circuits.

The common cable colors are brown (BN) for +V, blue (BU) for 0 V, and black (BK) for output. Treat them as a convention to verify against the full sensor part number and its wiring diagram—not permission to identify an unknown sensor by color.

Typical common-positive PLC connection

On a narrow screen, scroll the diagram sideways. Connections are also explained in the text below.

NPN sensor wiring with a sourcing PLC input Brown supplies sensor positive voltage. Blue returns to supply zero volts. Black connects to the PLC input terminal. The PLC input-group common is positive in this example. With the sensor output on, conventional current travels from positive common through the PLC input circuit, along black into the NPN output, and back along blue to zero volts. The sensor's internal circuit is not drawn. NPN sensor BN: +V supply BK: output BU: 0 V +V DC supply Sourcing PLC input Group COM: +V Input circuit Input terminal 0 V DC return ON current
Conceptual external wiring, not a connector pinout. The internal NPN switch is omitted. +V means the supply allowed by both devices; it is not automatically 24 V. Supply protection and other PLC power connections must follow the equipment drawings.

Follow the ON-state current: +V → PLC input-group common → PLC input circuit → black output wire → NPN output transistor → blue wire → 0 V. Brown separately powers the sensor electronics. The input circuit is the load; an ordinary compatible PLC input does not need an arbitrary extra pull-up resistor.

The output wire must not be connected directly to +V without a load in the path. When the output turns on, that would create a short-circuit path through the sensor. Blue 0 V is the DC reference in this example, not a substitute for protective earth.

How do you confirm the wires, pins and NO/NC function?

Identify the complete sensor model, then read its connection diagram and output timing chart. “Three wires” describes the cable, while “NPN” describes the output’s current direction. Neither tells you everything about the output function.

Use the label to find the right drawing

Record the full suffix, supply range and output designation. For a connector version, match the numbered terminals and the drawing’s viewing direction to the actual sensor and cordset. A plug-face view and a socket-face view can look mirrored.

Do not assume a fourth wire is unused or a second output. Its function might be complementary switching, configuration or communication. If the device is two-wire, push-pull, analog or IO-Link, use its own circuit instead of adapting this three-wire open-collector example by guesswork.

Blue rectangular proximity sensor with a prewired cable and a printed model label
Start with the complete label, then find the matching drawing. Housing shape alone cannot identify the output. Product photo from xsz sensor; not the OMRON example below.

A documented example: OMRON’s E2E small-diameter datasheet lists E2E-C04S12-WC-C1 2M as a prewired NPN NO version, with brown +V, black output and blue 0 V. The corresponding -C2 version is NC. The ordering table and I/O diagrams must agree; these suffix meanings belong to that family, not every manufacturer. See the OMRON E2E datasheet, pages 3 and 9.

NO/NC changes when the output conducts

For the conventional proximity-sensor functions below, “normal” means the powered, non-actuated sensing condition—not loss of power. NPN remains a sinking output in both versions.

Stable target states, after startup, with a suitable target and the specified settings.
FunctionTarget absentTarget detected
NPN NOOutput transistor OFF; no intended load current.Output transistor ON; sinks load current.
NPN NCOutput transistor ON; sinks load current.Output transistor OFF; no intended load current.

An NC designation does not mean the transistor is a mechanical normally closed contact or that it stays conductive without power. It also does not make an ordinary sensor a safety-rated device.

Which PLC input will work with the NPN output?

Use a sourcing input, or a sink/source input configured and wired to supply current to the NPN output. Check the input module’s circuit drawing: supplier terminology may describe either the module or the field device it accepts.

Check the common for that input group

In a common-positive circuit, +V supplies the input group. On some modules the common’s polarity determines whether the group accepts sinking or sourcing devices; on others the arrangement is fixed. A terminal called COM is not universally 0 V or universally +24 V.

AutomationDirect’s CLICK PLUS manual illustrates NPN-to-sourcing-input wiring and states that inputs sharing a common must use the same sinking/sourcing arrangement. Check all channels sharing that terminal before changing it. Never move a fixed sinking-input common to +V merely because a generic NPN diagram shows positive common.

Match electrical limits, not only the NPN label

  • Supply and signal range: both devices must accept the actual DC supply, including its variation. A nominally “24 V” installation does not establish every terminal’s rating.
  • ON-state current: compare the PLC input’s current demand with the sensor’s allowed output current under the stated temperature and load conditions. The sensor’s own supply consumption is a different specification.
  • ON-state voltage: residual voltage across the conducting output and wiring losses reduce the voltage available across the PLC input circuit. Check the input’s guaranteed ON conditions at the lowest intended supply.
  • OFF-state behavior: leakage through the sensor, cable or interface must remain compatible with the PLC’s guaranteed OFF limits. An output described as OFF is not necessarily a perfect open circuit.

If the PLC only has fixed sinking inputs, choose a compatible PNP sensor or a properly rated interface as part of the machine design. Swapping brown and blue, or inverting a PLC instruction, does not convert an NPN transistor into a PNP output.

What should a meter show when the sensor switches?

With the proper sourcing input connected, an NPN output normally moves toward 0 V when ON. When OFF, that input/load commonly pulls the output toward +V. State the measurement reference before interpreting either reading.

Low output voltage can mean PLC input ON

Illustrative voltage example—not measured product data. Assume a +24 V input-group common, a shared 0 V reference, negligible wire drop and 1 V from black output to blue when the transistor is ON.

Voltage across PLC input = 24 V − 1 V = 23 V

The meter reads 1 V from black to blue, but the PLC input has 23 V across its common-to-input path. That is why a low signal voltage can correspond to an energized input. Whether it meets the actual module’s ON requirements still depends on that module’s voltage/current limits.

Measure supply from brown to blue at the sensor connection, then interpret black-to-blue in both commanded output states with the specified load connected. The conducting output has a residual voltage; it need not read exactly zero. If different supply domains or an isolated interface are involved, use their documented references rather than bonding commons by assumption.

A floating output is not a valid load test

A high-impedance meter on a disconnected open-collector output may show an unstable or misleading voltage. It does not provide the same conditions as the intended input circuit. Do not diagnose a failed sensor solely from an unloaded OFF-state reading.

Use the manufacturer’s approved loaded test arrangement and a correctly rated meter in voltage mode. Do not place a current-range meter directly across supply or output terminals, and never perform resistance or continuity tests on an energized circuit. De-energized continuity checks can help trace an isolated cable; they do not establish the sensor’s switching performance.

Why does the sensor LED change but the PLC input stays off?

The LED may confirm the sensor’s local detection or output command, depending on the model. It does not prove that current reaches the correct PLC channel. Work along the chain: sensor supply and detection → loaded output → input terminal and common → hardware diagnostics → PLC program.

Illustrative case: a replacement sensor on the wrong input group

A machine previously used a PNP sensor. A replacement with a similar housing is NPN. Its local LED changes with the target, but the PLC input remains OFF. The input-group common is still connected to 0 V.

The first useful check is the two part numbers and the module drawing. Under this scenario, both the NPN output and the existing input arrangement provide a path toward 0 V; the required source of input current is missing. The symptom does not, by itself, prove the new sensor is defective.

Decision: if the shared group still serves PNP devices, do not reverse its common to make one NPN sensor work. Use the compatible replacement, or assess a separate suitable input group or rated interface. Then verify both output states under the approved test procedure. This is a reasoning example, not a reported customer repair.

Check the next link in the signal chain before replacing parts.
ObservationWhat to check nextWhat it helps separate
No local responseSupply at the sensor, polarity, cable condition, target material and sensing position.Power or detection trouble from PLC input trouble.
LED changes; loaded output does notLED meaning, exact output wire, NO/NC mode, load rating and protection status.A local indication from actual output switching.
Output changes; hardware input does notThe actual channel terminal, its common, continuity of the isolated wiring, and input thresholds.A valid sensor signal from an incomplete or incompatible input circuit.
Hardware input changes; program does notInput address, diagnostic state, inversion, forces, filters and capture/scan behavior.Electrical switching from configuration or program interpretation.

If a held target is detected but a moving target is missed, record the pulse at the input using suitable equipment. Check sensor response, input filtering and the controller’s capture method. Increasing sensitivity cannot correct a pulse that the PLC never samples; the actual signal must first be established.

Can the same output drive a relay or a microcontroller?

Sometimes, but each destination is a different load. A PLC connection that works does not establish that a relay coil or a low-voltage electronic input is suitable.

A relay needs a rated coil circuit and surge suppression

For an approved low-side NPN arrangement, a compatible DC coil sits between +V and the output. Verify coil demand, output rating, available coil voltage and the manufacturer’s suppression arrangement. A coil can generate a damaging voltage transient when switched off.

Use an appropriate built-in or externally specified suppressor and observe its polarity. A conventional flyback diode can lengthen relay release time, so verify the complete interface’s timing. Short-circuit protection is not permission to exceed the output rating or omit load protection.

A GPIO pin needs its own interface design

Do not connect an industrial sensor signal directly to a 3.3 V or 5 V GPIO merely because the sensor is NPN. The allowable pin voltage, pull-up supply, leakage, transients and power-up states all matter. Use a documented compatible input circuit or a suitably rated interface; an arbitrary resistor is not a universal solution.

What should you check before the first powered test?

Complete the wiring against the equipment drawings, then test the signal in a controlled state before allowing machine motion. A switching LED alone is not the acceptance test.

  1. Isolate and identify. Apply the machine’s energy-control procedure. Record the sensor part number, input module, channel and common group.
  2. Trace the complete loop. Confirm supply polarity, output terminal, load/current direction and every device sharing the common. Resolve any mismatch before wiring.
  3. Check ratings and terminations. Verify electrical limits, terminal assignments, cable connections, strain relief and protection. Do not test a suspected short by applying power.
  4. Set the intended switching function. Establish the expected NO/NC states from the sensor diagram and controller configuration. Keep wiring decisions separate from software inversion.
  5. Test both states under the approved procedure. With hazardous motion controlled, compare the target condition, sensor indication, loaded output, hardware input and program value. Isolate again before moving conductors.
  6. Verify the real operating cycle. Check timing, target passage and restart behavior under the machine’s commissioning plan. Record the final model, channel mapping and results.

The practical rule: prove the current path first, the electrical levels second and the PLC interpretation third. That sequence distinguishes a wiring mismatch from a sensing fault without relying on trial-and-error terminal changes.

Sources and method references

The circuit is an original conceptual illustration. The voltage calculation and replacement scenario are explicitly illustrative, not measured results or installation approval. The hero is an AI-generated generic sensor scene, not a photograph of a specified product.

Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
Click outside to hide the comparison bar
Compare