Photoelectric sensors detect the presence, absence, distance or surface condition of an object by sending a beam of light toward it and measuring the light that returns to a receiver. They are the workhorse of industrial object detection on conveyors, packaging lines, assembly cells and material-handling systems, where they count parts, confirm placement, check fill levels and trigger actuators without any physical contact.
The category spans three classic sensing arrangements (through-beam, retroreflective and diffuse), several light sources (visible red, infrared, laser and blue), and dozens of housing and output variants. This guide decodes the modes, the spec sheet and the selection logic so a procurement or design engineer can specify the right device the first time. Switching elements of this kind are standardized under IEC 60947-5-2.
Photo: Lucasbosch, CC BY-SA 3.0, via Wikimedia Commons
This guide is written for industrial purchasing engineers and design engineers. Across 6 chapters it covers what a photoelectric sensor is, the three sensing modes, light-source technologies, target and environment compatibility, spec-sheet parameters and the selection decision sequence, with 7 selection FAQs and verified manufacturer series. All parameters reference public standards including IEC 60947-5-2 (proximity switches), IEC 60825-1 (laser safety), IEC 62471 (photobiological safety of lamps and LEDs), and ISO 20653 / DIN 40050-9 (IP69K ingress protection).
Chapter 1 / 06
What is a Photoelectric Sensor
A photoelectric sensor, sometimes called a photoeye or photoswitch, is a non-contact device that detects objects by emitting light from a source (an LED or laser diode) and evaluating the light that reaches a photodetector. When a target enters the optical path, it either blocks, returns or scatters the beam, changing the amount of light at the receiver. Internal electronics compare that level against a threshold and toggle a solid-state output. Because detection is purely optical, there is no mechanical wear, no actuating force, and detection is independent of the target being conductive or magnetic, which separates photoelectric sensors from inductive and capacitive proximity switches.
Functionally, every photoelectric sensor has four building blocks: a light emitter, a receiver (phototransistor or photodiode), a threshold and amplification circuit that decides light versus dark, and an output stage (typically a transistor, with a relay or analog variant available). In self-contained sensors all four sit in one housing; in fiber-optic systems the emitter and receiver live in a remote amplifier and the light is piped to the sensing point through plastic or glass fibers. Most industrial units modulate the emitted light at a fixed frequency so the receiver can reject ambient room light, sunlight and the output of neighboring sensors.
Photoelectric detection grew out of early relay-driven "electric eyes" used for door openers and counting in the mid-20th century. The arrival of solid-state LEDs and phototransistors in the 1960s and 1970s made compact, reliable, modulated sensors practical, and the move to PNP and NPN transistor outputs let them wire directly into programmable logic controllers. Modern devices add IO-Link communication, in-field teach buttons, laser-class optics for sub-millimeter targets, and time-of-flight measurement that reports actual distance as an analog or digital value rather than a simple present-or-absent bit.
In a process or machine, photoelectric sensors belong to the same discrete-input family as proximity sensors and limit switches, but they reach much farther and detect almost any material. A through-beam pair can guard a passage tens of meters wide; a diffuse sensor can confirm a label is present a few centimeters away. The trade-off is that optical performance depends on the target color, gloss and angle, plus the cleanliness of the lenses, so correct mode and margin selection matters more here than in magnetic sensing.
The international reference for this product class is IEC 60947-5-2, "Low-voltage switchgear and controlgear, control circuit devices and switching elements, proximity switches." It groups photoelectric proximity switches together with inductive, capacitive, ultrasonic and magnetic types, defines terms such as ambient light (any light at the receiver not originating from the emitter), and sets the test methods for repeat accuracy, switching frequency and electromagnetic compatibility. The standard limits these self-contained semiconductor switches to circuits not exceeding 250 V AC at 50 or 60 Hz or 300 V DC, and the 2019 fourth edition explicitly added requirements and tests for background-suppression photoelectric switches, designated type D.
The breadth of duty explains why photoelectric sensors outnumber almost every other detection device on a factory floor. On a packaging line a single machine may carry dozens: a through-beam pair confirming a carton has entered the former, a retroreflective sensor counting bottles past a star wheel, a diffuse sensor verifying a label is present, a contrast sensor reading a printed registration mark to phase a cutter, and a fork sensor checking a clear film web for splices. The same family detects pallets in a high-bay warehouse, edges of sheet metal in a press feed, fill level through a sight glass, and the leading edge of paper in a printer. Because the output is a simple solid-state switch or an IO-Link value, integration into a PLC scan is trivial, which is a large part of the category's dominance.
Chapter 2 / 06
Sensing Modes and Configurations
The single most important choice when specifying a photoelectric sensor is the sensing mode, because it sets the range, the reliability, the wiring and the susceptibility to target color. Three classic modes cover the vast majority of applications, with background suppression and fiber optics as important refinements of the diffuse approach. The table below compares the core engineering trade-offs.
Mode
Typical Range
Excess Gain
Color / Surface Sensitivity
Wiring
Through-beam
0 to 60 m
Highest
None (beam interrupted)
Two units, two cables
Retroreflective
0.1 to 10 m
High
Low
One unit + reflector
Diffuse (proximity)
10 mm to 2 m
Low
High
One unit, one cable
Diffuse with BGS
20 mm to 1 m
Low to medium
Reduced (distance-based)
One unit, one cable
Fiber-optic (any mode)
Few mm to ~2 m
Reduced
Mode dependent
Amplifier + fiber head
Through-beam (opposed) mode places the emitter and receiver in two separate housings facing each other. The receiver normally sees the beam; a target is detected when it interrupts the path. Because the light travels in one direction only, through-beam achieves the longest ranges (commonly 30 to 60 m and beyond) and the highest excess gain, and it is essentially blind to target color, gloss and angle. It is the right choice for long distances, heavy contamination, fast small parts and safety-adjacent positioning. The downsides are two mounting points, two cables and the need to align the two halves.
Retroreflective mode combines emitter and receiver in one housing aimed at a prismatic corner-cube reflector. The sensor sees its own returned beam and detects a target when that return is broken. Range is typically 0.1 to 10 m, wiring is single-sided, and alignment is far easier than through-beam because the reflector tolerates angular error. The classic pitfall is the shiny target: a polished or wrapped part can mirror enough light back to mimic the reflector. Polarized (anti-reflex) retroreflective sensors use a polarizing filter and a specific corner-cube reflector to reject this false return, and are the default for detecting glossy or film-wrapped goods.
Diffuse (proximity) mode also houses both elements together but has no reflector; it relies on light scattered back from the target surface itself. This gives the simplest installation (one device, one cable, no opposing part) but the shortest range and the strongest dependence on target reflectivity, so a white card may switch at 300 mm while a black rubber part at the same distance does not register. Background suppression upgrades diffuse sensing with a triangulating receiver that judges distance from the angle of the returned spot rather than its brightness, fixing a sharp cutoff that ignores the background and can even pick a dark target off a bright wall. IEC 60947-5-2 lists background-suppression photoelectric switches as type D.
Two related variants deserve mention because procurement engineers meet them constantly. Fork and slot sensors package a through-beam emitter and receiver in a single rigid U-shaped frame, so the optical path is permanently aligned at the factory; they excel at edge detection, label gap counting and small-part presence in a fixed gap, with no field alignment at all. Foreground suppression inverts the BGS logic to detect only objects nearer than a set distance, useful for sensing into a bin. There is also specular (mirror) reflection sensing, where emitter and receiver sit at matched angles to a glossy surface so a shiny target returns light and a matte one does not, the opposite assumption to ordinary diffuse mode. The right pick always follows from the target and geometry, not from habit.
As a quick mapping: choose through-beam for long ranges, fast or small parts, dirty air and any clear, dark or shiny target where reliability is paramount; choose polarized retroreflective for medium-range detection of cartons, cases and shrink-wrapped goods with single-side wiring; choose diffuse for short-range presence where no opposing mounting exists; and choose background suppression whenever the background is reflective or the target and background reflectivity vary. When the target itself is glossy and unavoidable, polarized retroreflective or a fork sensor almost always beats trying to tune a plain diffuse sensor.
Chapter 3 / 06
Light Sources and Detection Technologies
After the sensing mode, the light source sets spot size, target visibility, alignment ease and eye-safety classification. Four sources dominate: visible red LED, infrared LED, laser diode and (for color-critical work) blue or RGB LED. The table compares their engineering character; safety classifications follow IEC 60825-1 for lasers and IEC 62471 for LEDs.
Light Source
Typical Wavelength
Spot & Precision
Eye-Safety Basis
Best For
Visible red LED
620 to 660 nm
Medium spot, visible
IEC 62471
General use, easy alignment
Infrared LED
850 to 950 nm
Larger spot, invisible
IEC 62471
Long range, dusty / dirty air
Laser (red / IR)
650 / 780 nm typ.
Very small, precise
IEC 60825-1 Class 1 / 2
Tiny parts, edge detection
Blue / RGB LED
~465 nm (blue)
Fine spot
IEC 62471
Dark, glossy, color targets
Visible red LED is the default for most general-purpose sensors. The spot is visible, which makes alignment and troubleshooting straightforward without instruments, and the 620 to 660 nm band suits the majority of opaque targets. It is assessed under IEC 62471 photobiological safety and is normally treated as eye-safe for incidental viewing because LED light spreads over a large retinal area rather than focusing to a point.
Infrared LED emits in the 850 to 950 nm band, invisible to the eye but more efficient, so it penetrates light dust, smoke and translucent film better and supports the longest through-beam ranges. The drawback is that you cannot see the beam during setup, so IR units rely on alignment LEDs or signal-strength indicators. Like visible LEDs they fall under IEC 62471 rather than the laser standard.
Laser diode sources produce a very small, well-collimated spot (often well under 1 mm), enabling detection of tiny parts, thin wires, narrow gaps and precise edges that an LED spot would miss. Laser photoelectric sensors are classified under IEC 60825-1, most commonly Class 1 (safe under all reasonable conditions of use) or Class 2 (visible, under 1 mW, relying on the blink reflex). Read the label and never aim a Class 2 device at the eyes. Lasers cost more and are more sensitive to mounting vibration, but for small-target and long-range-with-precision work they are unmatched.
Blue and RGB LED sources have grown for difficult targets: dark, glossy, self-luminous (red-hot, displays) or color-graded surfaces, because shorter wavelengths scatter differently and contrast better on certain materials. Beyond simple presence detection, dedicated color sensors and contrast (registration mark) sensors use RGB emitters to read color or grayscale differences, and luminescence and UV variants detect fluorescent marks invisible under white light. These specialized variants share the same housings and outputs as standard photoelectric sensors but add a measurement function on top of detection.
A further branch reports actual distance rather than a present-or-absent bit. Triangulation measuring sensors read the position of the returned spot on a line array and infer distance, giving high resolution at short to medium range; time-of-flight (ToF) sensors time the round trip of a light pulse, trading some near-field resolution for much longer range, often several meters to tens of meters. Both output an analog 4 to 20 mA or 0 to 10 V signal, or stream a calibrated value over IO-Link, and overlap with the dedicated laser distance sensor category. They are the bridge between simple object detection and dimensional measurement, used for height checking, sag control, web-edge guiding and stack-height monitoring where a yes-or-no switch is not enough.
Chapter 4 / 06
Targets, Materials and Environment
Optical sensing is only as good as its margin against the target, the contamination and the surrounding light. Three factors decide whether a chosen mode will work in practice: the reflectivity and finish of the target, the optical excess gain available, and the environmental sealing of the housing. Getting any of these wrong is the usual cause of intermittent false trips that look like electrical faults but are really optical.
Target reflectivity governs diffuse and, to a lesser degree, retroreflective sensing. Sensor catalogs rate diffuse range against a standard reference: a sheet of white paper at a defined reflectivity (commonly Kodak 90 percent white). A matte black object may reflect only a few percent of that, cutting the effective range by a large factor, while a mirror-bright part can over-reflect and confuse a non-polarized retroreflective sensor. Through-beam sidesteps the issue entirely because it only cares whether the beam is interrupted, which is why it is preferred for clear, dark, shiny or oddly shaped parts.
Excess gain is the optical equivalent of a safety factor. It is the ratio of light actually reaching the receiver to the minimum required to switch the output, and it must stay comfortably above 1 across the life of the install. The widely used design margins are roughly 1.5x for clean air, 5x for light dust or film, 10x for visible dirt, water film or condensation, and 50x for heavy steam, smoke or fog. The table maps environment to recommended margin and the mode that most easily delivers it.
Ambient and stray light can blind a receiver if it is not modulated. Quality sensors pulse the emitter at a known frequency and filter the receiver to that frequency, rejecting sunlight, high-bay LED flicker and the beams of neighboring sensors. Where many sensors sit close together, mutual interference is still possible; staggered modulation frequencies, opposing-orientation mounting and physical baffles solve it. Direct sun aimed into a receiver remains the toughest case and favors through-beam with a tight aperture.
Housing and ingress protection follow the IEC 60529 IP code, extended by ISO 20653 and the legacy DIN 40050-9 for the IP69K high-pressure, high-temperature washdown rating. IP67 (dust-tight, temporary immersion to 1 m) suits general factory floors; IP69K (water jets at 80 degrees C and 80 to 100 bar) is mandatory for food, beverage and pharmaceutical lines and pairs with 316L stainless or sealed PBT bodies, FKM or EPDM seals and chemically resistant windows. In welding cells choose spatter-resistant lens coatings; in explosive atmospheres use an ATEX or IECEx fiber-optic head with the electronics outside the hazardous zone.
Chapter 5 / 06
Key Specification Parameters
A photoelectric sensor datasheet may list twenty or more lines, but a manageable set drives the buying decision: sensing range, light source, response time and switching frequency, hysteresis, output type, supply voltage and current, connection style, and protection rating. Each is decoded below so the numbers translate into machine behavior.
Sensing range is the rated maximum operating distance for the mode, always quoted against a defined condition: for through-beam it is emitter-to-receiver separation, for retroreflective it is the distance to a named reflector, and for diffuse it is the distance to a standard white card. Derate generously for real targets and dirty air. The hysteresis (differential travel) is the gap between the switch-on and switch-off points, expressed as a percentage of range, and exists deliberately to stop the output chattering when a target hovers at the threshold.
Response time is the delay between a change in the optical signal and the output changing state, usually a maximum value such as under 0.5 ms for fast models or 1 to 2.5 ms for general-purpose sensors. Switching frequency is the highest on-off rate the output can resolve, commonly several hundred hertz to a few kilohertz, with fiber-optic amplifiers and laser models reaching the top of that band. To catch a moving part, the in-beam dwell time must exceed the response time and the cycle rate must stay under the rated switching frequency, with margin.
Output type defines the electrical interface to the controller. The mainstream options are listed below.
PNP (sourcing): output switches to the positive supply, load returns to 0 V. The European and modern PLC default.
NPN (sinking): output switches to 0 V, load tied to the positive supply. Common in older Asian equipment.
Light-on / dark-on: selects whether the output energizes when light is present (LO) or absent (DO); often field-switchable by wire or DIP.
NO / NC contact behavior: the resulting normally-open or normally-closed action, derived from PNP/NPN combined with LO/DO.
Analog and IO-Link: distance-measuring and time-of-flight sensors output 4 to 20 mA or 0 to 10 V, or stream measured values and diagnostics over IO-Link.
Supply voltage and current are typically 10 to 30 V DC (24 V DC nominal) with a few tens of milliamps of consumption and an output rated to a few hundred milliamps with short-circuit protection; some retroreflective gate and door sensors also offer AC ranges. Connection is by integral cable or by M8 or M12 quick-disconnect connector, the latter preferred for field replacement. Protection rating (IP67, IP69K) and operating temperature (commonly minus 25 to plus 55 degrees C) round out the environmental envelope. For laser models the IEC 60825-1 class belongs here too, since it constrains where the sensor may be mounted relative to operators.
Chapter 6 / 06
Selection Decision Factors
To turn the previous chapters into a specific part number, work through the sequence below. Most selection errors are not a single wrong number but a decision taken at the wrong level, for example fixing the brand before the sensing mode. These eight steps double as a fixed RFQ template.
Sensing mode first: decide through-beam, retroreflective, polarized retroreflective, diffuse or background suppression from the target, the required range and the reliability demanded. Mode determines everything downstream.
Range and target: set the operating distance with margin, and characterize the target color, gloss, size and shape. For tiny or shiny parts move toward laser or through-beam; for variable backgrounds choose BGS.
Light source: visible red for easy alignment, infrared for long range and dirty air, laser for precision and small targets, blue or RGB for dark, glossy or color-critical work. Confirm the IEC 60825-1 or IEC 62471 safety basis for operator-facing positions.
Excess gain and environment: match the excess-gain margin (1.5x clean to 50x heavy contamination) to the air quality, and plan lens-cleaning intervals. Verify ambient-light immunity where sun or many sensors are present.
Output and controller interface: PNP or NPN to suit the PLC input card, light-on or dark-on for the logic, and NO or NC behavior. Choose analog or IO-Link if you need measured distance or diagnostics rather than a bit.
Speed: confirm response time and switching frequency against the part dwell time and line speed, with headroom for future throughput increases.
Housing, connection and protection: form factor (block, cylindrical M18, slim, fiber head), IP67 or IP69K, stainless or coated lens for washdown or welding, and M8, M12 or cable termination for serviceability.
Certifications and total cost: CE and the relevant functional-safety or hazardous-area approvals (ATEX, IECEx) where applicable, plus purchase price weighed against alignment effort, false-trip downtime, lens cleaning and spare-part availability over the equipment life.
One frequently overlooked dimension is serviceability and supply continuity: connector-style termination so a failed sensor swaps in seconds, in-field teach buttons so line staff can re-tune without a laptop, IO-Link diagnostics that flag a fouling lens before it false-trips, and a maker with local stock and a stable catalog. Mainstream series that combine these include Omron E3Z and the stainless E3ZM, SICK W series (including the laser WTB), Banner Engineering QS18, Q4X and World-Beam, Keyence PR and PZ, ifm O5 and OG, Pepperl+Fuchs ML and R-series, and Panasonic (SUNX) CX and FX, with Autonics, Leuze and OMCH covering cost-sensitive projects. Match the series to the mode, range, light source and IP rating rather than to brand reputation alone.
FAQ
What is the difference between through-beam, retroreflective and diffuse photoelectric sensors?
They differ in how the beam path is arranged. Through-beam uses a separate emitter and receiver facing each other; the target is detected when it interrupts the beam, giving the longest range (up to 30 to 60 m) and the highest reliability because color and surface finish do not matter. Retroreflective combines emitter and receiver in one housing aimed at a prismatic reflector, detecting when the returned beam is broken, with typical range 0.1 to 10 m and single-side wiring. Diffuse also houses both elements together but relies on light scattered back from the target itself, so range is short (a few centimeters to under 2 m) and depends on target reflectivity. Through-beam is the most robust, diffuse the easiest to install.
What does background suppression (BGS) mean and when do I need it?
Background suppression is a diffuse sensing variant that fixes a hard cutoff distance and ignores anything beyond it, regardless of how reflective the background is. It works by triangulation: a position-sensitive receiver or two-element detector measures the angle of the returned spot, which changes with target distance rather than with brightness. This lets the sensor see a dark target in front of a bright wall, or reject a shiny conveyor behind the part. Use BGS whenever you need a defined detection window, when target and background reflectivity vary, or when a plain diffuse sensor false-triggers on the background. IEC 60947-5-2 designates background-suppression photoelectric switches as type D.
What is the difference between PNP and NPN output, and between light-on and dark-on?
PNP (sourcing) outputs switch the load to the positive supply, so the load connects between the output and 0 V; NPN (sinking) outputs switch to 0 V, with the load between the output and the positive supply. PNP is the default in Europe and most modern PLC input cards, NPN is common in legacy Asian equipment. Light-on (LO) energizes the output when the receiver sees light; dark-on (DO) energizes when light is absent. For a through-beam guarding a passage, dark-on detects an object that blocks the beam; for a retroreflective counting reflective parts, light-on may be preferred. Many sensors offer a wire or DIP switch to invert LO and DO in the field.
What is excess gain and why does it matter for reliability?
Excess gain is the ratio of the optical energy reaching the receiver to the minimum energy needed to switch the output. An excess gain of 1 is the bare detection threshold; reliable industrial sensing wants a comfortable margin above that. As a rule of thumb, design for at least 1.5x in clean air, 5x in light dust, 10x in dirt or condensation, and 50x in heavy contamination such as steam, smoke or fog. High excess gain buys tolerance to lens fouling, reflector aging, alignment drift and atmospheric attenuation, so it is the single best predictor of how long a sensor will run before false trips. Through-beam delivers the highest excess gain, diffuse the lowest.
Are the laser and LED light sources in photoelectric sensors eye-safe?
LED sources (red 620 to 660 nm, infrared around 850 to 950 nm, or blue) are assessed under IEC 62471 photobiological safety and are generally considered safe for incidental viewing because the emission spreads over a large retinal spot. Laser-class photoelectric sensors are governed by IEC 60825-1 and are normally Class 1 or Class 2: Class 1 is safe under all reasonable conditions of use, while Class 2 (visible, under 1 mW) relies on the human blink reflex for protection and must not be stared into. Always read the rating label, never aim a laser sensor at the eyes, and prefer Class 1 for operator-facing positions. Laser sources give a small, precise spot for tiny targets but cost more than LED.
How do I read response time and switching frequency on the spec sheet?
Response time is the delay between the target entering or leaving the beam and the output changing state, typically quoted as a maximum, for example under 0.5 ms for fast models or 1 to 2.5 ms for general purpose. Switching frequency is the maximum number of on-off cycles per second the output can resolve, often 500 Hz to several kHz. To detect a moving part you must satisfy both: the object must remain in the beam longer than the response time, and the cycle rate must stay below the rated switching frequency. For a small part on a fast conveyor, divide the spot or beam width by the line speed to get dwell time, then add safety margin. Fiber-optic amplifiers and laser models reach the highest frequencies.
What IP rating and housing do I need for washdown or harsh environments?
IP67 means dust-tight and protected against temporary immersion to 1 m, which suits most general factory use. IP69K, defined originally in DIN 40050-9 and now in ISO 20653, adds resistance to high-pressure, high-temperature water jets (80 degrees C, 80 to 100 bar), and is required for food, beverage and pharmaceutical washdown. For those duties choose a stainless-steel (316L) or sealed PBT housing with FKM or EPDM seals and a chemically resistant window, for example the Omron E3ZM stainless family. In welding cells, prefer weld-spatter-resistant coated lenses; in explosive atmospheres, use an ATEX or IECEx rated fiber-optic head with the amplifier outside the zone.