Industrial sensor selection guide
Ultrasonic Sensor vs Photoelectric Sensor: Choose by Target and Failure Mode
Choose photoelectric sensing for fast, narrow-beam detection of small parts or beam interruption. Choose ultrasonic sensing when target color, opacity, or surface appearance varies and the target can return a stable sound echo. Transparent, black, shiny, dusty, wet, angled, soft, and fast-moving targets each change that answer.
- No universal range comparison
- Photoelectric mode matters
- Real-target testing is essential
Direct answer
Which one should you choose?
Use a photoelectric sensor when the machine needs a small light spot, precise edge detection, rapid counting, or a dependable through-beam gate. Use an ultrasonic sensor when the target's color and transparency vary, the target is large enough to return sound, and the process can accept its blind zone, wider detection cone, and model-specific cycle time.
The comparison starts here
One listens for an echo; the other evaluates light.
An ultrasonic sensor emits a burst of high-frequency sound and measures the returning echo. A diffuse ultrasonic model typically calculates distance from sound travel time. Its output depends on the target returning enough acoustic energy to the transducer.
A photoelectric sensor emits visible, infrared, or laser light and evaluates whether that light is interrupted or returned. The target may block a beam, reduce a reflector return, reflect light directly to the receiver, or appear at a distance different from the background. These are different optical tasks, not one behavior.
Operating principles
Both are non-contact sensors, but they solve different signal problems.
A reliable application needs a measurable signal margin between “target present” and “target absent.” The physical path that creates this margin is different for sound and light.
Sound pulse → target echo → travel time
The transducer sends a sound burst, then changes to receive mode. Distance-capable models use the return time with the speed of sound to estimate distance. Switching models compare the measured target position with one or more taught limits.
Main dependency: enough echo must return after the transmit ringing has settled. This creates a model-specific blind zone near the sensor.
Typical risks: soft or porous targets, steep target angle, very small parts, air turbulence, heavy face buildup, nearby echoes, and crosstalk from adjacent ultrasonic sensors.
Light beam → interruption or reflection → receiver level
The emitter produces modulated light and the receiver evaluates a change in the optical path. A through-beam sensor watches for beam interruption. A diffuse sensor watches for light returned by the target. Other modes use a reflector or triangulation.
Main dependency: the receiver needs enough optical contrast and excess gain for the chosen mode, distance, target, and environment.
Typical risks: lens contamination, poor alignment, changing reflectivity in diffuse mode, transparent-object attenuation, shiny reflections, background return, and uncontrolled ambient light.
Do not compare the wrong optical mode
“Photoelectric sensor” contains at least four practical selection paths.
Many inaccurate comparisons describe only a basic diffuse photoelectric sensor. Before choosing ultrasonic, check whether another photoelectric arrangement removes the actual failure mode.
Through-beam
Separate emitter and receiver face each other. The target is detected by interrupting the effective beam, so target color and diffuse reflectivity are usually less important.
Best starting point: speed, range, small parts, strong signal marginRetro-reflective
One sensor faces a reflector and detects a reduction in returned light. Polarized or clear-object models help address shiny or transparent targets.
Best starting point: one-side wiring with a reflectorDiffuse
The target itself returns light. It is simple to install, but usable distance and stability can change with color, finish, angle, size, and background.
Best starting point: stable targets at short or moderate distanceBackground suppression
Optical geometry or time-of-flight helps detect the target while reducing response to a surface beyond the set range. Model behavior on dark, shiny, or uneven targets still needs validation.
Best starting point: target in front of a nearby machine surfaceSide-by-side comparison
Ultrasonic sensor vs photoelectric sensor: the useful differences.
Exact range, response time, resolution, repeatability, enclosure, and operating limits are model specifications. Use this table to shortlist a principle, then verify the exact datasheet.
| Decision factor | Ultrasonic sensor | Photoelectric sensor | What the buyer should verify |
|---|---|---|---|
| Primary signal | Returned sound energy and, for distance models, time of flight. | Interrupted or returned light; method depends on through-beam, retro-reflective, diffuse, background suppression, or optical distance sensing. | Whether the target creates a stable present/absent margin in the selected geometry. |
| Target appearance | Color and optical transparency are usually not the main variables. | Diffuse mode can depend on reflectivity; beam-break and specialized modes reduce that dependency. | Minimum and maximum color, gloss, transparency, labels, shape, and surface variation. |
| Target acoustics | Soft, porous, angled, irregular, tiny, or perforated targets may return a weak or redirected echo. | Acoustic behavior does not matter, but optical contrast and beam geometry do. | Sound absorption, target angle, minimum face area, holes, edges, and movement. |
| Close distance | Diffuse ultrasonic sensors have a blind zone whose size varies by model. | Some optical modes can work close to the face, but each model has a specified working range. | Nearest target position, tolerance, mounting movement, and any forbidden zone. |
| Small or fast target | Wider sound cones, cycle time, and target area can limit small-part and high-speed work. | Narrow optical beams, lasers, slot sensors, and fiber optics are strong candidates. | Minimum feature size, pitch, dwell time in beam, switching frequency, and PLC scan. |
| Long path | Available range depends on transducer, target size, echo quality, and selected cycle. | Through-beam photoelectric systems can achieve long paths; diffuse range is much shorter and target-dependent. | Never compare one ultrasonic maximum with one diffuse optical rating as a category rule. |
| Dirty or wet process | Minor dust or moisture may be tolerated, but heavy buildup and air disturbance can degrade the echo. | Optical attenuation depends on contamination, excess gain, washdown design, lens condition, and sensing mode. | Real contamination, cleaning method, protection rating, material compatibility, and maintenance interval. |
| Multiple sensors | Nearby ultrasonic units can cross-talk; spacing, synchronization, or multiplexing may be required. | Optical interference is also possible; modulation, channel settings, beam direction, and shielding help. | Exact mounting layout, opposing units, spacing, timing, and vendor instructions. |
| Setup evidence | Echo curve, blind zone, detection zone, switching window, temperature compensation, diagnostics. | Excess-gain curve, beam size, mode, cutoff/background data, light/dark operate, diagnostics. | Measure signal margin at every target and environmental extreme. |
Application selector
What does your machine need to detect?
Select the closest task. The result is a technical starting point, followed by the evidence needed before model approval.
Select the primary challenge
Recommended comparison
Compare ultrasonic with dedicated clear-object photoelectric sensing
Ultrasonic can detect a clear object's surface without relying on optical opacity. Clear-object retro-reflective, foreground-suppression, or other specialized photoelectric designs can provide a smaller beam and faster response.
Target-by-target guidance
Material names do not decide the sensor; the signal path does.
A glass bottle can be detected by sound, by interrupting light, by attenuating a reflector return, or by measuring a change against a background. The best method depends on the required beam size, speed, mounting, and failure risk.
Transparent glass or plastic
Ordinary diffuse photoelectric sensing may receive too little contrast, but dedicated clear-object photoelectric models are designed for this task. Ultrasonic can detect the front surface if its size, shape, angle, and speed provide a stable echo.
Compare: clear-object retro-reflective, specialized optical distance, ultrasonicBlack or matte target
A simple diffuse optical sensor may lose range because the target returns less light. Through-beam only needs interruption; retro-reflective watches a reflector; background-suppression and distance sensors may handle dark targets when correctly selected.
Do not replace the entire optical category based on diffuse behaviorShiny or mirrored surface
Specular light can miss a diffuse receiver or imitate the reflector in a basic retro-reflective layout. Polarized optics, suitable geometry, or application-specific optical sensing can help. Ultrasonic also fails if the smooth target redirects sound away.
Test both target angle and sensor angleFoam, fabric, or porous material
Soft or porous targets can absorb ultrasonic energy and produce weak echoes. Photoelectric through-beam often provides a clearer presence signal if the material blocks enough light; very open structures may require a wider beam or another layout.
Start with optical interruption, then validate material transmissionWire mesh, perforated tray, or irregular part
A narrow beam may pass through a hole and a broad sound cone may average several surfaces or detect a nearby frame. Choose beam shape deliberately: line beam, array, multiple fibers, retro-reflective ultrasonic, or controlled background sensing.
Specify the smallest solid feature and every allowed orientationSmall component or precise edge
The sound cone and minimum target area often make ultrasonic a poor first choice. Photoelectric laser, through-beam, slot/groove, or fiber-optic systems can create a smaller effective beam and a repeatable crossing point.
Start with photoelectric or fiber optic for fine resolution
Environment and contamination
Dust, moisture, airflow, sunlight, and temperature affect the two technologies differently.
Photoelectric systems need enough received light after losses from distance, optics, target, dust, smoke, mist, spray, or lens film. An excess-gain curve helps show how much signal remains above the switching threshold at a stated distance. Through-beam typically offers more optical reserve than diffuse, but the exact design matters.
Ultrasonic sensing can tolerate conditions that obscure visible light, but it is not immune to the environment. Strong air turbulence from fans, compressed air, wind, or thermal boundaries can disturb sound propagation. Heavy material on the transducer face can reduce performance. Fast temperature transitions can also matter before model-specific compensation represents the air path.
Range, speed, and precision
Do not publish one response time or maximum range for an entire sensor technology.
A sensor family can contain short-range diffuse units, long-range through-beam systems, distance sensors, high-speed models, and slower measurement devices. Compare the exact operating point, not the largest number in either catalogue.
Working range
Use the guaranteed or specified working range for the real target and mode. For ultrasonic, check blind zone, operating range, limiting range, detection cone, and standard target. For optical, check the stated target or reflector, excess-gain curve, beam pattern, and minimum background separation.
Response and switching frequency
Photoelectric sensing is often the stronger candidate for rapid counting, but the application still depends on sensor response, on/off delay, target dwell time, output circuit, PLC input filter, and scan time. Ultrasonic cycle time generally grows with the listening range and multi-sensor timing strategy.
Resolution versus repeatability
Resolution is the smallest detectable change; repeatability describes variation when the same event is repeated. Neither is identical to accuracy. Ask whether the task is presence detection, switch-point repeatability, edge position, or a measured distance value.
Beam or cone geometry
A laser spot can isolate a small feature, while a wider optical beam may detect a perforated edge more reliably. An ultrasonic cone can provide broad target coverage but may include unwanted brackets or nearby products. Inspect the response curve at the real distance.
Liquid level is not an automatic win
Ultrasonic can measure an open liquid surface, but the vessel decides whether it is suitable.
Transparency does not prevent a liquid surface from returning sound, which makes ultrasonic a practical candidate for non-contact level measurement. However, the sensor must see the intended liquid surface rather than a nozzle wall, agitator, ladder, filling stream, foam layer, or false echo.
Provide minimum and maximum level, blanking distance, vessel diameter, nozzle length and diameter, internal obstructions, surface turbulence, foam, vapor, condensation, pressure, temperature, chemical exposure, and the required output. A switching sensor and a continuous level transmitter are also different products.
Photoelectric sensing still has liquid applications. Specialized wavelengths can detect water-containing liquids through suitable containers, and optical point sensors can distinguish air from liquid at a sensing tip. Those are specific optical methods, not ordinary diffuse object detection.
Clear bottle and film detection
Transparent targets require a controlled contrast strategy.
Ultrasonic sensing can avoid the optical transparency problem, but the bottle must remain large enough, correctly oriented, and inside the valid acoustic range for long enough. Bottle shoulders, curved walls, gaps, closely spaced containers, and line vibration can change the echo.
Dedicated clear-object photoelectric sensors measure small attenuation or a controlled change from reflector or background. Coaxial optics, polarization, automatic compensation, foreground suppression, or specialized optical distance methods may improve stability. These can be better when the line needs a narrow beam, defined leading edge, or faster switching.
Cross-talk and adjacent sensors
Multiple heads need a timing and beam-management plan.
One sensor may work perfectly on the bench and fail when identical units are mounted around the same machine. Test the final array, not only an isolated device.
Ultrasonic arrays
- Nearby sensors can receive another unit's pulse or echo and report an incorrect target.
- Follow the exact parallel and opposing mounting distances in the product instructions.
- Synchronization can coordinate pulses; the behavior depends on the mode and sensor family.
- Multiplexing activates sensors in sequence and can avoid mutual interference, but total reaction time increases as channels are added.
- Brackets, guards, walls, conveyors, and angled products can create secondary echoes.
Photoelectric arrays
- An emitter can reach a neighboring receiver when beams overlap or opposing heads are misassigned.
- Use model-supported crosstalk prevention, alternate channels, opposite orientation, shielding, or physical separation.
- Keep visible beams and reflector paths clearly identified during commissioning.
- Account for reflections from stainless steel, safety tape, glossy packaging, windows, and nearby indicators.
- Test all sensors active, with every machine light and direct sunlight condition expected in service.
Installation and commissioning
Validate the complete detection window in four passes.
Teach-in is not proof of application margin. A useful acceptance test challenges target, environment, motion, and electrical integration separately.
Define the two states
Write what “present,” “absent,” “too close,” “too far,” or “level reached” means. Include minimum target size, allowed position tolerance, transition direction, and required fail response.
Map the sensing path
Record sensor position, nearest and farthest target, angle, background, reflector or receiver, blind zone, beam/cone width, nearby metal, guards, brackets, and cable routing.
Challenge the process
Run every target variant at maximum speed with dust, moisture, light, vibration, air movement, temperature, line gaps, jams, startup, cleaning, and adjacent sensors represented.
Measure the output chain
Confirm voltage under load, PNP/NPN, NO/NC or light/dark logic, output current, connector pinout, input filter, PLC scan, alarm delay, diagnostics, and power-cycle behavior.
Total cost of ownership
The lowest sensor price can be the most expensive machine decision.
Compare the installed detection function, not only the device. Brackets, reflector, receiver wiring, alignment, cleaning, commissioning, downtime, replacement access, and engineering time all belong in the cost.
Hardware and installation
A one-housing diffuse or ultrasonic layout may use less wiring. Through-beam needs a second powered unit but can deliver greater signal margin. Retro-reflective needs a reflector and clean return path. Include bracket rigidity and protective hardware.
Commissioning time
Count alignment, teaching, echo or excess-gain review, array synchronization, PLC changes, product recipe setup, and validation. A technically suitable sensor with useful diagnostics may reduce future investigation time.
Routine maintenance
Optics may need cleaning; acoustic faces may need inspection for heavy buildup. Reflectors, receivers, brackets, and cables can move or become damaged. Set maintenance by measured signal degradation, not a generic calendar claim.
Failure cost
Assign a cost to missed products, false stops, spills, scrap, manual checks, delayed shipments, and unsafe bypass behavior. The acceptable sensor margin should reflect what one incorrect signal can cause.
Supplier and quotation checklist
Send application evidence, not only “ultrasonic or photoelectric?”
A supplier can shortlist a model faster when the enquiry describes the target, geometry, timing, environment, and control system in measurable terms.
Target and machine
- Material, color range, transparency, surface finish, shape, smallest size, holes, and allowed orientation
- Nearest and farthest target position, background distance, reflector or receiver access, and mounting drawing
- Maximum speed, target pitch, dwell time, count rate, vibration, and stop/start behavior
- Photos or video from sensor position showing normal, empty, jammed, and worst-case states
Environment and electrical
- Ambient and target temperature, airflow, dust, fog, steam, spray, sunlight, cleaning, and chemical exposure
- Supply voltage, PNP/NPN, NO/NC or light/dark operate, analog or IO-Link needs, connector, and cable length
- Required response, repeatability, measurement output, diagnostics, enclosure rating, and approvals
- Number and spacing of adjacent sensors, PLC input filtering, alarm logic, and sample-test acceptance criteria
Troubleshooting guide
Diagnose the signal path before changing sensitivity.
Repeatedly increasing gain or widening the switching window can hide the real cause and create a new false-trigger path. Reproduce the fault and inspect the physical signal first.
| Observed problem | Ultrasonic checks | Photoelectric checks | Corrective evidence |
|---|---|---|---|
| Target is missed | Target inside blind zone; face too small; angle redirects echo; absorbent surface; wrong taught window; air disturbance. | Poor alignment; target does not interrupt effective beam; low diffuse return; clear-object attenuation too small; background or reflector setup wrong. | Record echo or received-light margin for every target position and orientation. |
| False target appears | Bracket, wall, filling stream, adjacent product, multiple echo, or neighboring sensor creates a return. | Reflective background, adjacent emitter, shiny target, direct light, dirty reflector, or over-wide sensing field creates a response. | Block or move suspected paths one at a time and compare diagnostics. |
| Works slowly or misses count | Listening range or multiplex sequence extends cycle time; target dwell is too short. | Response or delay setting, PLC filter, scan time, beam position, or target gap limits counting. | Measure target dwell and total input timing at maximum line speed. |
| Changes after cleaning | Face coating, water film, bracket movement, connector ingress, or changed acoustic path. | Lens film, scratched lens, wet reflector, bracket shift, changed background, or chemical damage. | Compare before/after alignment, signal level, photographs, and material condition. |
| Unstable with nearby sensors | Crosstalk, opposing ultrasonic heads, unsynchronized cycle, or secondary echoes. | Beam overlap, neighboring receiver capture, reflector crossover, or ambient optical interference. | Test one channel at a time, then all channels with approved spacing and settings. |
| PLC state is wrong | Verify supply under load, common reference, PNP/NPN compatibility, NO/NC or light/dark logic, output current, leakage current, connector pinout, cable damage, input filter, and diagnostic status. | Measure voltage at the PLC input in both states and compare it with the wiring diagram. | |
Application support
Send the target, distance, speed, background, and environment before choosing a sensor.
XSZ can help compare photoelectric modes and application constraints for OEM equipment. Include target samples or photos, minimum and maximum distance, required response, mounting layout, supply and output, contaminants, cleaning, and the acceptance test you need the sensor to pass.
Next selection step
Compare the optical mode that fits your mounting layout.
These pages narrow the photoelectric side of the decision by beam path, background, target surface, and wiring access.
Frequently asked questions
Ultrasonic sensor vs photoelectric sensor FAQ
Is an ultrasonic sensor better than a photoelectric sensor?
Neither technology is universally better. Ultrasonic sensing is a strong candidate when target color or optical transparency varies and a stable acoustic echo is available. Photoelectric sensing is a strong candidate for small or fast targets, narrow beams, precise edges, and through-beam interruption. Select from target size, surface, angle, speed, distance, background, environment, mounting, output, and failure risk.
Which sensor is better for transparent bottles?
Compare ultrasonic sensing with a dedicated clear-object photoelectric sensor. Ultrasonic does not require optical opacity, but bottle contour, angle, size, gap, speed, and acoustic blind zone matter. Specialized photoelectric designs can detect small attenuation or a controlled change from a reflector or background and may offer a narrower beam or faster response. Test all bottle variants, labels, fill states, moisture, and line conditions.
Can photoelectric sensors detect black objects?
Yes. Black targets can reduce the range of simple diffuse photoelectric sensors because less light returns from the target. Through-beam sensing only needs the target to interrupt the effective beam, while retro-reflective, background-suppression, distance-sensing, or high-excess-gain models may also work. Validate the darkest target, angle, distance, background, and contamination rather than rejecting all photoelectric sensing.
Does ultrasonic sensing work in dust, steam, or water spray?
It may tolerate optical obscuration better than some photoelectric layouts, but it is not immune. Air turbulence, rapid thermal gradients, dense vapor conditions, heavy deposits on the face, droplets, false echoes, and chemical exposure can degrade performance. Photoelectric systems also vary by sensing mode and excess gain. Reproduce the real contamination and cleaning cycle during testing.
Which technology is faster?
Photoelectric sensing is usually the first choice for very fast counting or short target dwell because many optical sensors offer high switching frequencies and small effective beams. The exact result depends on the model, delay settings, target dwell time, output circuit, PLC input filter, and scan time. Ultrasonic cycle time depends on the listening range and can increase when several sensors are multiplexed.
Can ultrasonic sensors detect small objects?
Some can, but target face area, distance, orientation, echo strength, and sound-cone geometry limit the result. Small parts may only work at reduced range or with a focused design. For tiny components, narrow edges, holes, labels, wire, or high-speed counting, compare laser photoelectric, through-beam, slot/groove, or fiber-optic sensing first.
Can an ultrasonic sensor measure liquid level through a tank wall?
A standard air-coupled ultrasonic level sensor is normally mounted above the liquid and measures the surface through the vessel's air space; it does not simply see through an arbitrary tank wall. External through-wall liquid detection may use capacitive, specialized ultrasonic coupling, optical, or other methods depending on the wall and required result. Confirm the exact sensing principle and installation specified by the manufacturer.
How do I test ultrasonic and photoelectric sensors before ordering?
Use production targets covering minimum size, worst color, transparency, gloss, angle, position, and speed. Recreate the real distance, background, reflector or receiver, blind zone, brackets, vibration, dust, spray, sunlight, airflow, temperature, cleaning, and adjacent sensors. Log missed detections, false triggers, signal margin, switching timing, diagnostics, and output behavior through startup and power cycles.
Technical references and image credits
Sources used to verify the comparison
- ifm Ultrasonic Sensor Technology — operating principle, blind zone, detection zone, target angle, speed, soiling, airflow, and crosstalk considerations.
- Banner Engineering Photoelectric Sensors — through-beam, retro-reflective, diffuse, background suppression, excess gain, clear-object, and optical beam guidance.
- Banner Clear and Reflective Target Detection — specialized photoelectric approaches for transparent and reflective objects.
- ifm Photoelectric Sensor Technology — diffuse, background-suppression, retro-reflective, and through-beam comparison.
- Pepperl+Fuchs Ultrasonic Synchronization Guide — common, multiplex, and external synchronization behavior.
- SICK Ultrasonic Parameterization Instructions — blind zone, working range, measurement repetition, and temperature compensation.
- Hero image: Keegan Checks / Pexels.
- Conveyor image: Frans van Heerden / Pexels.
- Industrial tank image: Brett Sayles / Pexels.
- Clear bottle image: Vladimir Srajber / Pexels.
- CTA image: Vladimir Srajber / Pexels.
- XSZ photoelectric product image and product-category context.
Technology comparisons describe sensing principles and model-dependent behavior, not guaranteed performance for every product. Final selection should follow the exact datasheet, installation instructions, risk assessment, electrical review, and representative application test.