Sensors tell the PLC what the machine is doing. Get the wiring type wrong and a perfectly good sensor will never turn on an input.
PNP (sourcing) vs NPN (sinking)
- PNP / sourcing: the sensor switches +24 V out to the input. Pairs with a sinking PLC input card (input common to 0 V). Most common in North America.
- NPN / sinking: the sensor switches the input to 0 V. Pairs with a sourcing input card. Common on Asian machinery.
- 3-wire DC sensor colors (typical): brown +24 V, blue 0 V, black output, white second output.
Photo-eye types
| Type | How | Strength / weakness |
|---|---|---|
| Thru-beam | Separate emitter and receiver | Longest range, most reliable; two devices to wire |
| Retro-reflective | Bounces off a reflector | One device; shiny targets can fool it (use polarized) |
| Diffuse | Bounces off the target itself | No reflector; dark or far targets are hard |
Light-operate vs dark-operate (or N.O./N.C. output) decides whether the output is on with the beam made or broken.
Proximity sensors
Inductive prox senses metal only (a few mm). Capacitive senses almost anything, including liquid through a plastic tank wall. Both have an LED that shows the output state: your first troubleshooting clue.
Troubleshooting an input that won't come on
- Sensor LED on? No: power, alignment, target, sensor.
- Sensor LED on, PLC input LED off? Measure at the input terminal: 24 V = bad input/card; 0 V = wire or PNP/NPN mismatch.
- Input LED on but logic doesn't respond? It's the program (wrong address, or bit used elsewhere).
🔧 Field Pro2-wire sensors leak a small current when off. On a high-impedance input that can be enough to light the input. A bleeder resistor or a 3-wire sensor fixes it. If a sensor works on the bench and not on the machine, look for electrical noise (route sensor cables away from motor leads) and a missing 0 V reference between separate supplies.