Know-How
Completed
Choosing a PLC 1: count the I/O and leave spare
166 Views •4-20 mA input reading wrong: check it step by step
330 Views •Scaling a 4-20 mA signal in the PLC: formula, constants and code
309 Views •Digital input not reading: NPN or PNP, step by step
342 Views •Relay or transistor output: which one and how to check it
266 Views •Digital input not reading: NPN or PNP, step by step
342 Views •4-20 mA input reading wrong: check it step by step
330 Views •Scaling a 4-20 mA signal in the PLC: formula, constants and code
309 Views •RS-485: how to check a bus step by step
304 Views •Relay or transistor output: which one and how to check it
266 Views •Modbus RTU timeout: 6 checks before blaming the wiring
266 Views •Upload fails: 6 checks before blaming the code
224 Views •LoRa works on the desk, fails in the field: 6 checks before you install
209 Views •SD card corrupted? 6 habits for Linux in the field
193 Views •4G PLC not connecting: 6 checks before blaming the code
188 Views •Touch panel: screen turned, touch didn't. 6 checks
178 Views •Choosing a PLC 1: count the I/O and leave spare
166 Views •Arduino IDE compile error: 6 checks before the code
166 Views •LoRaWAN node won't join: 6 checks, in order
156 Views •Choosing a PLC 2: which communications do you really need
149 Views •Node-RED not starting after a reboot? 6 checks
116 Views •Modbus RTU master and slave with two ESP32 PLC, step by step
107 Views •Modbus register 40001 or address 0? 6 checks
101 Views •PLC on Ethernet with no ping? 6 checks
88 Views •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
| Check | What to do | Good result |
|---|---|---|
| 1. Sensor type | Read the label or the datasheet: PNP or NPN, NO or NC | You know the output type of the sensor |
| 2. Input type | Check in the PLC datasheet which sensor types the input accepts and how its common is wired | The input type matches the sensor |
| 3. Wiring | Usual colour code on 3-wire DC sensors: brown +V, blue 0 V, black to the input. Confirm it in the sensor datasheet | Each wire in its place |
| 4. Voltage at the input | Measure the input against the reference shown in the PLC wiring diagram, with the sensor active and inactive | Inside the ON range when active and the OFF range when inactive, as the datasheet gives them |
| 5. Common reference | Check that the sensor supply and the input common close the same circuit, also when they come from different supplies | Current path closed as the wiring diagram shows |
| 6. Speed | Compare the shortest pulse with the input filter time and the scan time in the datasheet | Pulses 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.