Back to blog

Light-On and Dark-On Photoelectric Sensor Logic

Learn how light-on and dark-on photoelectric sensor modes interact with through-beam, retroreflective, and diffuse sensing, PNP/NPN wiring, PLC logic, commissioning, and fault detection.

Light-on and dark-on describe when a photoelectric sensor energizes its switching output. They do not describe transistor polarity, wiring type, or whether an object is physically present. That distinction prevents many commissioning errors because the same optical condition can mean opposite things in through-beam, retroreflective, and diffuse sensing arrangements.

Start with the received light

In light-operate mode, often shortened to LO, the output turns on when the receiver sees enough light to exceed its switching threshold. In dark-operate mode, or DO, the output turns on when received light falls below that threshold. Banner Engineering gives the same basic definitions in its official photoelectric-sensor training material.

The words refer to the optical receiver, not the room. A dark target in a well-lit factory can reduce the returned beam below the threshold. Dust on a lens can do the same. A shiny object can return more light than expected. Commissioning therefore has to prove the actual optical margin, not just observe whether the sensor LED changes once.

Sensor geometry changes what the output means

Through-beam sensing

A through-beam pair places the emitter and receiver opposite each other. With no object between them, the receiver normally sees the beam. Light operate therefore produces an on output in the clear-beam condition, while dark operate produces an on output when an object blocks the beam.

Retroreflective sensing

A retroreflective sensor sends light toward a reflector and receives the returned beam in the same housing. The logic is similar to through-beam operation: an unobstructed reflector creates the light condition, and a target crossing the path usually creates the dark condition. Highly reflective objects, transparent materials, poor alignment, or a damaged reflector can complicate that simple model.

Diffuse sensing

A diffuse sensor relies on the target itself to return light. Here, an object entering the sensing zone usually creates the light condition. Light operate can therefore correspond to object present, which is the opposite of a typical through-beam installation. Background suppression and foreground suppression add optical geometry, so the exact switching behavior must be checked against the selected model's manual.

Do not confuse LO/DO with PNP/NPN

LO and DO define the optical condition that commands the output. PNP and NPN describe the output transistor's electrical behavior. A PNP sensor sources current to the PLC input when active. An NPN sensor sinks current when active. Either electrical output type may be configured for light operate or dark operate.

The PLC input common must match the selected output type. A correctly selected light/dark mode cannot fix a mismatched input circuit. Before applying power, confirm supply voltage, conductor function, output type, load current, input common, and whether the sensor has one configurable output or two complementary outputs.

For related controller and input hardware, the site's PLC and PAC systems collection provides examples of the equipment that receives these discrete signals. The PLC program should use a tag name that describes the process meaning, such as PartAtStop, rather than a raw name such as SensorDark.

Selectable and complementary outputs

Some sensors provide a setup button, remote teach input, switch, or software parameter that selects LO or DO. Others expose two outputs at the same time: one operates in light and the other in dark. The wiring diagram determines which behavior is available. Wire colors are common conventions, not proof of function.

A remote teach conductor may select operating mode, initiate a threshold teach, lock the buttons, or perform several functions depending on pulse duration and wiring. Leaving that conductor open does not always create the same state across product families. Follow the exact product instructions instead of transferring assumptions from a similar sensor.

Select the mode from the safe process state

Engineers sometimes choose LO or DO only to make the ladder logic convenient. A better method starts with the machine response to loss of light, loss of power, broken cable, dirty lens, failed emitter, and failed receiver. Many of those faults appear as a dark condition, but not every sensor output can distinguish them from a legitimate blocked beam.

For a guard or personnel-protection function, a standard photoelectric sensor and ordinary PLC logic are not substitutes for safety-rated sensing and safety logic. For process detection, the chosen mode should still make common failures visible when practical. Diagnostic bits, complementary channels, plausibility timers, or a second sensor may be needed where a single output cannot reveal enough.

Commissioning workflow

1. Write the truth table first

List receiver light state, target state, sensor output LED, electrical output, PLC input bit, and machine interpretation. Include clear path, target present, lens covered, cable disconnected, and power removed. This exposes inverted assumptions before the machine moves.

2. Verify electrical behavior

Measure the sensor supply and confirm the PLC input changes at the terminal. Check voltage in both active and inactive states. Watch for leakage current, input threshold, shared commons, and unexpected behavior from test lamps or interposing devices.

3. Teach with production samples

Use the darkest, brightest, smallest, most transparent, or most reflective expected parts, plus the real background. Banner's official QS18 light and dark set guide illustrates that teaching establishes a threshold from observed conditions. The exact procedure and threshold strategy remain model-specific.

4. Check operating margin

Move the target across the full allowed position, rotate it where orientation varies, and test at maximum distance. Contaminate the lens only through a controlled test method. A sensor that switches once during setup may still chatter when vibration, dust, or product color reduces excess gain.

5. Test recovery and restart

Interrupt sensor power, disconnect the signal, block the beam, and restore the system in a controlled state. Confirm alarms, debounce time, sequence recovery, and restart prevention. Verify that maintenance personnel can identify whether a fault is optical, electrical, network-related, or logical.

Troubleshooting inverted or unstable detection

If the PLC bit appears backward, check the optical mode first, then the PNP/NPN circuit, and finally any inversion in the program. If the output chatters, inspect alignment, sensing distance, reflector condition, target contrast, vibration, contamination, supply stability, and teach margin. Changing LO to DO may reverse the symptom without correcting the weak optical signal.

When replacing a sensor, compare more than sensing range and connector style. Verify sensing principle, beam type, output polarity, LO/DO configuration, response time, protection rating, teach method, and connector pinout. The Knowledge library includes additional wiring and commissioning guidance for integrating field devices into industrial controls.

Make the process meaning explicit

Light operate and dark operate are precise optical terms when engineers keep them separate from object presence and output polarity. A short truth table, correct electrical checks, production-sample teaching, and deliberate fault tests turn that terminology into predictable machine behavior.

Leave a comment

Please note, comments need to be approved before they are published.