How to Wire a Photoelectric Sensor: PNP & NPN Wiring Guide
What is a Photoelectric Sensor
Why Correct Wiring Matters for Photoelectric Sensors
Basic Wiring Structure of a Photoelectric Sensor
Standard Wire Colors and Functions
| Wire Color | Function | Description |
| Brown | +V (Power) | Connects to the positive DC supply (usually 24 VDC) |
| Blue | 0V (Ground) | Connects to power supply ground |
| Black | Output | Sends detection signal to PLC or control device |
Understanding PNP and NPN Output Wiring
PNP Output Wiring (Sourcing Output)
NPN Output Wiring (Sinking Output)
Wiring a Through-beam Photoelectric Sensor (GM12 Series Example)
Power Wiring for Emitter and Receiver
Alignment and Signal Check
Connecting Photoelectric Sensors to PLC Inputs
Common Wiring Mistakes and How to Avoid Them
| Mistake | Result | Prevention |
Reversed polarity | Sensor damage | Double-check power wiring |
PNP/NPN mismatch | No PLC signal | Verify output type |
| Poor grounding | Signal noise | Use proper grounding |
Shared high-voltage cables | Interference | Separate sensor wiring |












