Photoelectric Sensor Lens Cleaning: Dust, Stability LED and Maintenance

The Sensor That Stopped Seeing Parts: Teach, Sensitivity, and Lens Contamination

A photoelectric sensor (through-beam) detecting parts on a conveyor. It worked on day one. Two weeks later, it stopped detecting every other part. The sensor wasn’t broken. The sensitivity had drifted. The lens was dusty. This is the three-step debug that gets a photoelectric sensor back to reliable detection.

Step 1: Check the lens

The first thing. Photoelectric lenses get dusty, oily, or covered with spray from the machining coolant. A dirty lens reduces the received light by 50-80 percent. The sensor still sees the beam, but the margin is gone. Small variations in the part (reflective vs matte) make it intermittently fail.

We wiped both the emitter and receiver lenses with a clean cloth and isopropyl alcohol. The detection was immediately more reliable. But it still missed every 10th part. The lens was part of it, not all of it.

Step 2: Re-teach the sensor

Through-beam sensors have a teach button. You teach them with the beam blocked (part present) and unblocked (no part). The sensor sets a threshold between the two. Over time, the light output of the LED drifts (aging), and the lens gets dirty. The threshold is no longer optimal. Re-teach it.

The procedure: with no part in the beam, press teach (LED flashes green). With a part in the beam, press teach again (LED flashes red). The sensor now knows “part present” vs “no part.” We re-taught it. The missed detections dropped from 1 in 10 to 1 in 50.

Step 3: Adjust the sensitivity

Through-beam sensors have a sensitivity potentiometer. We turned it up one turn. The sensor now has more margin between “beam blocked” and “beam passing.” Small variations in the part (translucent plastic, shiny metal, thin objects) don’t push it over the threshold. The missed detections stopped entirely.

Sensor type What it sees Common failure
Through-beam Emitter and receiver separate Lens contamination, drift over time
Retro-reflective Emitter + receiver in one unit, reflector Reflector gets dusty or misaligned
Diffuse (proximity) Senses reflected light from the part Reflective parts confuse it
Fiber optic Light through a fiber cable Fiber breaks or gets crimped

The detection margin

A reliable sensor has a margin: the “part present” reading should be at least 2x the “no part” reading. If the sensor reads 5V when blocked and 4.8V when clear, the margin is tiny. Any drift and it fails. If it reads 5V when blocked and 0.5V when clear, the margin is 10x. It will work for years.

After re-teaching and sensitivity adjustment, our sensor read 4.8V blocked, 0.3V clear. Margin: 16x. It hasn’t missed a part in 6 months.

The mounting

After the sensor was working, we checked the mounting. The sensor bracket was a thin sheet-metal piece. The conveyor vibration had loosened it. The sensor shifted 2 mm. We bolted it to a rigid extrusion with two screws. No more drift.

The sensor rule: A photoelectric sensor that starts missing parts isn’t broken. Clean the lens, re-teach the sensor, and turn up the sensitivity. If it still fails, check the mounting bracket. A sensor on a flexible bracket drifts. A sensor on a rigid bracket with clean lenses and proper teach will work for years.