Skip to Content

Digital input not reading: NPN or PNP, step by step

Short answer: when the sensor LED changes but the PLC input does not, check the hardware before the program. Check in this order: sensor type, input type, wiring, voltage at the input, reference and, last, the pulse length.

Download the checklist (PDF, 2 pages)

Descarga la lista de comprobación (PDF, 2 páginas)

These checks work for any PLC or I/O module with digital inputs. At the end you will find the page for your PLC range.

The idea in one minute

A PNP sensor switches the positive supply to its output. An NPN sensor switches its output to 0 V. The words sourcing and sinking are used in opposite ways by different manufacturers, so PNP and NPN are clearer for the sensor.

A PNP sensor needs an input whose common goes to 0 V, and an NPN sensor needs an input whose common goes to the positive. Some PLC inputs accept both types, depending on how the common is wired; others accept only one. If sensor and input do not match, the sensor LED changes but the input never sees the signal.

Six checks, in order

CheckWhat to doGood result
1. Sensor typeRead the label or the datasheet: PNP or NPN, NO or NCYou know the output type of the sensor
2. Input typeCheck in the PLC datasheet which sensor types the input accepts and how its common is wiredThe input type matches the sensor
3. WiringUsual colour code on 3-wire DC sensors: brown +V, blue 0 V, black to the input. Confirm it in the sensor datasheetEach wire in its place
4. Voltage at the inputMeasure the input against the reference shown in the PLC wiring diagram, with the sensor active and inactiveInside the ON range when active and the OFF range when inactive, as the datasheet gives them
5. Common referenceCheck that the sensor supply and the input common close the same circuit, also when they come from different suppliesCurrent path closed as the wiring diagram shows
6. SpeedCompare the shortest pulse with the input filter time and the scan time in the datasheetPulses detected every time, or a fast counter or interrupt input if the PLC has one

What the readings tell you

  • Sensor LED changes, input voltage does not: possible causes are a sensor type that does not match the input, a wire in the wrong terminal or an open wire.
  • Some volts with the sensor off: possible causes are the leakage current of a 2-wire sensor, a floating input or capacitive coupling on long cables. A voltage reading alone does not show whether enough current flows to switch the input. With 2-wire sensors, compare the sensor off-state current with the input OFF limit, or use a 3-wire sensor.
  • Right voltage at the input but the input stays off: possible causes are the input common not connected, an input for another voltage range, the wrong channel in the program or a faulty channel.
  • The input works but misses short pulses: the pulse is shorter than what the input filter and the scan can capture reliably. Lengthen the pulse, or use a fast counter or interrupt input if the PLC has one.

If the input has never worked

  • Test the input channel alone, with care. Change the wiring with the supply off, disconnect the sensor output and apply the input's rated voltage with a protected test lead (fused or current-limited), as the wiring diagram shows. If the input responds, the channel is likely working: check the sensor and its wiring. If the machine is running, check first what the input controls.
  • NPN sensor and an input that only accepts PNP: the best option is a sensor of the right type. Otherwise, use a signal converter or an interface relay rated for the sensor and the input.
  • Check that the program reads the right input. Pin names and switches depend on your PLC range.

Commenting is not enabled on this course.