Digital input wiring helps your PLC read signals from sensors. Knowing NPN and PNP types tells you how to connect sensors correctly.
Digital input wiring (NPN vs PNP sensors) in PLC Programming
NPN Sensor Wiring: - Sensor output connects to PLC input. - Sensor switches the input to 0V (ground) when active. - PLC input is pulled up to positive voltage internally or externally. PNP Sensor Wiring: - Sensor output connects to PLC input. - Sensor switches the input to positive voltage when active. - PLC input is pulled down to 0V (ground) internally or externally.
NPN sensors are called 'sinking' because they connect the input to ground when active.
PNP sensors are called 'sourcing' because they provide positive voltage to the input when active.
NPN Sensor: Sensor output -> PLC input PLC input pulled up to +24V When sensor activates, input reads 0V (LOW)
PNP Sensor: Sensor output -> PLC input PLC input pulled down to 0V When sensor activates, input reads +24V (HIGH)
This simple program checks two inputs. For the NPN sensor, the input reads 0 when active. For the PNP sensor, the input reads 1 when active.
// Pseudocode for reading NPN and PNP sensor inputs // Assume input1 is wired to NPN sensor // Assume input2 is wired to PNP sensor if (input1 == 0) { print("NPN sensor is active") } else { print("NPN sensor is inactive") } if (input2 == 1) { print("PNP sensor is active") } else { print("PNP sensor is inactive") }
Always check your PLC input specifications before wiring sensors.
Mixing NPN and PNP wiring without proper understanding can damage equipment.
Use the correct pull-up or pull-down resistors as required by your PLC and sensor.
NPN sensors connect the input to ground when active (input reads LOW).
PNP sensors connect the input to positive voltage when active (input reads HIGH).
Correct wiring ensures your PLC reads sensor signals properly and safely.
Practice
Solution
Step 1: Understand NPN sensor behavior
NPN sensors connect the input to ground (0V) when active, sinking current.Step 2: Understand PNP sensor behavior
PNP sensors connect the input to positive voltage (e.g., 24V) when active, sourcing current.Final Answer:
NPN sensors pull the input to ground; PNP sensors supply positive voltage. -> Option AQuick Check:
NPN sinks, PNP sources = A [OK]
- Confusing which sensor sinks or sources current
- Assuming both sensors behave the same
- Mixing up voltage levels for NPN and PNP
Solution
Step 1: Identify PNP sensor wiring
PNP sensors source positive voltage to the PLC input; sensor positive terminal connects to +24V, negative to 0V.Step 2: Confirm correct PLC input connection
Sensor output wire connects directly to the PLC digital input to supply voltage when active.Final Answer:
Sensor output connected to PLC input; sensor negative to 0V; sensor positive to +24V. -> Option CQuick Check:
PNP sources +24V to input = D [OK]
- Reversing sensor positive and negative connections
- Connecting sensor output to 0V instead of PLC input
- Mixing NPN wiring rules with PNP sensors
Sensor output connected to PLC input; sensor negative to 0V; sensor positive to +24V.Solution
Step 1: Understand NPN sensor active state
When active, NPN sensor pulls output to 0V (ground), sinking current.Step 2: Determine PLC input voltage
Since sensor output connects to PLC input and is pulled to 0V, PLC input reads LOW (0V).Final Answer:
PLC input reads LOW (0V) -> Option DQuick Check:
NPN active pulls input LOW = B [OK]
- Assuming NPN sensor outputs positive voltage when active
- Confusing sensor wiring polarity
- Thinking input voltage fluctuates instead of stable LOW
Solution
Step 1: Review correct PNP wiring
PNP sensor output must connect to PLC input to supply positive voltage when active.Step 2: Identify wiring mistake
If sensor output is connected to 0V instead of PLC input, input never receives voltage, so PLC reads LOW always.Final Answer:
Sensor output connected to 0V instead of PLC input. -> Option AQuick Check:
Output must connect to input, not 0V = A [OK]
- Connecting sensor output to 0V instead of input
- Swapping sensor positive and negative wires
- Assuming PLC input reads HIGH without proper wiring
Solution
Step 1: Understand PLC input expecting sourcing (PNP) sensor
PLC input expects positive voltage from sensor output when active.Step 2: Adapt NPN sensor output for sourcing input
NPN sensor sinks current (pulls to 0V), so add pull-up resistor to +24V on PLC input to provide voltage when sensor is inactive.Step 3: Wire NPN sensor output to PLC input and sensor negative to 0V
This wiring allows PLC input to read HIGH when sensor is inactive (pull-up voltage) and LOW when sensor is active (pulled to ground).Final Answer:
Use an external pull-up resistor to +24V on the PLC input and connect the NPN sensor output to the input and sensor negative to 0V. -> Option BQuick Check:
Pull-up resistor adapts NPN sinking to sourcing input = C [OK]
- Wiring NPN sensor directly without pull-up resistor
- Connecting sensor output to +24V directly
- Ignoring PLC input type requirements
Ready to prove it?
Pass the test and this pattern moves unknown
