What you'll learn
A **retro-reflective photoelectric sensor** (photoeye) emits an infrared beam toward a fixed reflector. While the return beam reaches the receiver the output is inactive. When an object breaks the beam — a part on a conveyor, a pallet at a station — the output fires. This make-on-detect behaviour is the basis for countless presence, counting, and positioning tasks in industrial automation.
Lab time: ~10 minutes.
Lesson briefing
Photoeye Sensor to PLC Digital Input
A retro-reflective photoelectric sensor (photoeye) emits an infrared beam toward a fixed reflector. While the return beam reaches the receiver the output is inactive. When an object breaks the beam — a part on a conveyor, a pallet at a station — the output fires. This make-on-detect behaviour is the basis for countless presence, counting, and positioning tasks in industrial automation.
The standard 3-wire colour code
Almost every industrial sensor you encounter follows the same wiring convention regardless of brand:
- Brown (BN) — 24 VDC supply positive.
- Blue (BU) — 0 V / DC common.
- Black (BK) — signal output to the PLC input.
The brown and blue wires power the sensor's internal electronics. The black wire is the output — it carries the detection signal to the PLC.
PNP output — sourcing
This lesson uses a PNP (sourcing) sensor. When the sensor detects a target, its internal PNP transistor connects the black wire to the +24 V rail, sourcing current into the PLC input. The PLC input sees a HIGH (+24 V) signal. PNP is the dominant standard on modern European- style PLCs and is the safest choice when in doubt.
Closing the loop with an indicator lamp
The PLC output Y0 drives a small indicator lamp. When the PLC ladder program detects the X0 input (from the photoeye), it can energise Y0 to light the lamp. This lesson only covers the wiring side — the signal path from sensor to input and from output to lamp. Writing the ladder rung that connects X0 to Y0 is a separate concern, but wiring both ends now proves the full I/O path before programming begins.
Tip: never connect the brown or blue supply wires to the PLC input terminal. Only the black signal wire goes to the PLC input. The supply wires power the sensor body; the signal wire carries the detection state.
The power rail is already wired. The supply feeds the +24 V and 0 V strips, the strips feed the PLC, and the supply's protective earth is bonded to the ground bar. Those greyed, locked wires are the ones Wiring 1A: Power the PLC teaches. You only wire what is new in this lab.
Hints
The power rail is already fitted and locked. Take the sensor supply from the +24 V and 0 V strips: any free slot of a strip is the same rail.
Sign up to unlock the full hint sequence.
Sign up to unlock the full hint sequence.
Sign up to unlock the full hint sequence.
This lesson uses 8 placed components on the lab canvas. Components are vendor-neutral (no proprietary trademarks); the wiring rules apply to any equivalent industrial part.
Sign up free to start
This foundation lab is included on Free — sign up takes a minute.
Sign up free to start →