New section
PLC and industrial automation
The most common time-waster in the field: the sensor is installed, the wiring looks right, yet the PLC input never lights up. This section explains PLCs through circuit logic, step by step, with animations.
PNP or NPN? Wiring a sensor to a PLC correctly
Most inductive, capacitive and photoelectric sensors have three wires: brown +24V, blue 0V, black output (signal). What makes the difference is what the black wire does.
PNP sensor: sources +24V to the output
When an object is detected, the PNP transistor inside the sensor switches on and puts +24V on the black wire. So a PNP sensor goes to an input whose common (COM) is tied to 0V (sinking input). This is the most common type on European machines.
NPN sensor: pulls the output to 0V
When an object is detected, the NPN transistor connects the black wire to 0V. Current flows from the PLC input into the sensor. So an NPN sensor goes to an input whose common (COM) is tied to +24V (sourcing input). Common on Japanese and Asian machines.
The rule to remember
30-second field check
- Set the multimeter to DC volts, black probe on 0V.
- Hold metal in front of the sensor. If you read 24V on the black wire, it's PNP.
- If you read nothing, put the red probe on +24V and the black probe on the black wire; 24V means it's NPN.
- Compare the result with the PLC's COM wiring.
Coming next
Each lesson comes with an animated video and a real field example. Sign up below to hear when a new lesson is added.
Lesson 2 · soon
Relays and contactors: how a PLC output runs a motor
Coil, contacts, self-holding, and why a motor never goes straight on a PLC output.
Lesson 3 · soon
PLC input and output types
Digital/analog inputs, relay vs transistor outputs; 4–20 mA and 0–10 V signals.
Lesson 4 · soon
Introduction to ladder logic
Contacts, coils, AND / OR; building a start-stop circuit in ladder.
Lesson 5 · soon
Timers and counters
TON, TOF, counters; conveyor, door and pump examples.
Lesson 6 · soon
Troubleshooting: input not lighting, output not pulling
Step-by-step measurement order and the 10 most common faults.
📬 Get notified about new lessons and simulators
At most a few emails a month as new lessons, simulators and repair cases are added. Unsubscribe any time.
Related: How a transistor works · How a relay works · Virtual circuit bench