Sensor LED Is On but the PLC Input Is Off: PNP vs NPN Wiring

The sensor LED lights, the PLC input does not. Nine times out of ten the sensor and the input card disagree about which way current flows.

The symptom

A new inductive proximity sensor is installed. Hold a steel target in front of it and its yellow LED turns on — but the PLC input LED and the tag stay off. Swap the sensor for an identical one: same result.

The sensor works. The interface between sensor and card does not.

How current must flow

A digital input only turns on when current flows through it. There are two conventions:

  • PNP (sourcing) sensor: when active, it connects its output wire to +24 V. It needs a sinking input card whose common goes to 0 V. This is the European default.
  • NPN (sinking) sensor: when active, it connects its output wire to 0 V. It needs a sourcing input card whose common goes to +24 V. Common on older Asian machines.
  • Put a PNP sensor on a card whose common is wired to +24 V and both ends of the input sit at 24 V when the sensor fires. Zero volts across the input means zero current, so nothing happens — while the sensor's own LED happily lights.

    Measuring it in two minutes

    Set your meter to DC volts.

  • Sensor supply: brown to blue should read 24 V. If not, fix power first.
  • Sensor output: black to blue (0 V). Target present: a PNP sensor shows about 24 V, an NPN sensor shows about 0 V. Target absent: the reverse.
  • Across the input: measure between the input terminal and the card's common (often labelled 1M, COM or M). With the target present you need about 24 V here — at least the card's "ON" threshold, typically 15 V for IEC 61131-2 type 1 inputs.
  • If Step 2 is right and Step 3 is near 0 V, the common is on the wrong rail for this sensor type.

    Fixes, from best to worst

  • Order the correct sensor type for the card. Clean and permanent.
  • Rewire the input group common if the card is bidirectional (many compact PLCs accept either), and no other sensor in that group needs the opposite polarity.
  • Use an interface relay or a polarity-converter module when you must mix types on one card.
  • Never "fix" it by jumping the input directly to 24 V to test the program and leaving it — that removes the machine's real feedback.

    The opposite symptom: input flickers or stays on

    A 2-wire sensor leaks a small current when off (often 0.5–1.5 mA). On a sensitive input this is enough to read as ON or to flicker. Check the card's OFF-current limit in the datasheet; add a bleeder resistor across the input if the leakage exceeds it.

    Program-side check

    Once the wiring is correct, confirm the program uses the right sense. A sensor described as "normally open" in the drawing should map to PartPresent := %I0.3;. If you inverted it in code to compensate for a wiring error, remove that inversion after fixing the wiring — otherwise the next technician will be confused.

    Learn the full signal picture in the hardware chapter on presence sensors.

    Frequently asked questions

    Can I use an NPN sensor on a PNP input card?

    Not directly. Use a card that accepts both polarities with the common moved, an interface relay, or a polarity converter. The usual fix is to order the matching sensor type.

    Why does my sensor LED light but the input stays off?

    The sensor switches correctly but the input card common is on the wrong supply rail for that sensor type, so no current flows through the input. Measure the voltage between the input terminal and the card common.