How to choose an industrial sensor for vision triggering and part detection
A practical guide to selecting discrete sensors that trigger cameras, index parts and gate inspection on a vision station. Covers sensing principle, range, target, PNP/NPN/IO-Link outputs, response time and IP rating, plus wiring the trigger to the camera.
Why a discrete sensor, not the PLC, should trigger the camera
A machine-vision station only works if it captures the image at the right instant: when the part is in the field of view, correctly positioned, and the lighting is on. On a moving line that instant is short. The cleanest way to define it is a discrete sensor whose output transitions exactly as the part reaches the inspection position. That edge becomes the camera trigger, and often the strobe trigger too. Asking the PLC to issue the trigger from its program scan adds scan-cycle latency and jitter: scan time depends on program size and load and is not synchronous with part arrival, so on a fast line the part can travel an unpredictable distance between the true trigger condition and the actual capture.
Hardware triggering removes that variability. The sensor output is wired, directly or through an isolated input, to the camera's opto-isolated trigger line, so the frame is grabbed within microseconds of the sensing edge. The payoff is repeatable part position in every frame, which is the single biggest lever on measurement repeatability and on how tightly you can constrain the region of interest and the lighting. It also lets you fire a short, bright strobe synchronised to the exposure, freezing motion and decoupling the inspection from ambient light.
Around a vision station, discrete sensors do three related jobs, and it helps to keep them separate. Triggering captures the image on part-present. Indexing tells the system which station or pocket is in position on a rotary table, conveyor or walking-beam transfer. Gating qualifies whether an inspection should run at all, for example only triggering when a part is present and the upstream reject gate is clear. One sensor can serve more than one of these roles, but conflating them in the logic is a common source of mistriggers and missed parts.
Choosing the sensing principle by target and environment
The first decision is the physical sensing principle, driven by what you are detecting and the conditions around it. Photoelectric sensors are the workhorse for part-present detection at range and across most materials. Inductive sensors detect only metal and only at short range, but they are extremely robust and largely immune to dirt, which makes them ideal for index marks, cam followers and metal carriers. Capacitive sensors respond to almost any material, including non-metals and liquids, and can sense fill level through a container wall when the wall is thin and non-conductive, at the cost of sensitivity to humidity and product buildup. Magnetic and Hall-effect sensors read embedded magnets in pneumatic cylinders and carriers for position confirmation. Ultrasonic sensors handle transparent, glossy or colour-varying targets where light-based sensing struggles and tolerate dust and mist, though they respond more slowly and depend on beam geometry and a stable sound path.
Within photoelectric sensing, the mode matters as much as the technology. Through-beam (opposed) uses a separate emitter and receiver, and the part breaks the beam: it gives the longest range, the best dirt and target-variation immunity, and the crispest, most repeatable switch point, which makes it the preferred choice for high-speed triggering when you can mount both halves. Retroreflective uses a reflector and a single combined head, so it is easier to wire and has moderate range, but shiny or reflective parts can fool it unless you use a polarised (anti-reflective) version. Diffuse (reflective) senses light bounced off the part itself, needs only one head and no reflector, but its range and switch point depend on target colour, gloss and angle, so it is the least repeatable for precise triggering. Background-suppression diffuse sensors fix much of this by switching on measured distance (triangulation) rather than reflected intensity, giving a stable switch point across colours and ignoring a busy background behind the part.
Match the principle to the failure modes you can actually live with. A diffuse sensor aimed at a varying, shiny or dark part may switch early on one part and late on the next, smearing part position from frame to frame. A through-beam across a wide, dirty conveyor keeps working long after a diffuse sensor has drifted out of tolerance. If the target is transparent, such as clear bottles or film, choose a sensor explicitly rated for clear-object detection, or use ultrasonic, or a through-beam set up for the reduced contrast.
- Photoelectric through-beam: longest range, best repeatability and dirt immunity; best for high-speed triggering when you can mount emitter and receiver.
- Photoelectric retroreflective: one head plus reflector, moderate range; use a polarised version for shiny or reflective parts.
- Photoelectric diffuse / background-suppression: single head, easy install; background-suppression switches on distance for a stable switch point across colours.
- Inductive: metal only, short range, very robust; ideal for index marks and metal carriers in dirty environments.
- Capacitive: detects non-metals and liquids and can sense level through a thin non-conductive wall; watch humidity and product buildup.
- Ultrasonic: transparent, glossy or colour-varying targets and dusty air; slower and beam-geometry dependent.
- Magnetic / Hall: embedded magnets in pneumatic cylinders and pallets for position confirmation.
Range, switch-point repeatability and mounting
Choose sensing range with margin, not at the datasheet maximum. Diffuse range collapses on dark, matte or angled targets, so derate it generously. Through-beam and retroreflective sensors are rated by excess gain, the ratio of received light to the minimum needed to switch the output; specify several times the minimum excess gain so that dust, alignment drift and component aging do not push you below the switching threshold. For triggering, switch-point repeatability, meaning the hysteresis and how consistently the output flips at the same physical position, matters far more than absolute range, because it directly sets how repeatably the part lands in the field of view.
Geometry and approach direction strongly affect timing. A beam that crosses the part's leading edge perpendicular to travel gives a sharp, well-defined trigger position, whereas an oblique beam or a wide spot smears that edge over distance and time. When you need a precise leading-edge trigger at speed, use a sensor with a small, well-collimated spot, or add an aperture or slit. Mount the sensor rigidly: vibration that shifts it by a millimetre shifts your captured part position by the same amount and can cause double-triggering.
Account for the whole timing budget before fixing a mounting position. The part keeps moving during the sensor's output delay, any debounce, the camera's trigger-to-exposure latency and the exposure itself. Place the sensor upstream of the field of view by the distance the part covers during that total budget, or use a programmable trigger delay in the camera or a controller so the frame is grabbed when the part is centred. On indexed machines, prefer triggering off the mechanism's in-position signal or a hard index mark rather than the part itself, so timing does not depend on part length or how the part is seated.
Output type: PNP, NPN, push-pull and IO-Link
The electrical interface has to match your camera or frame-grabber trigger input, and getting it wrong is a frequent integration delay. Most modern industrial cameras and 24 V European-style machines expect a PNP (sourcing) output: the sensor connects the trigger line to +24 V when active. NPN (sinking) outputs pull the line to 0 V instead and are common in legacy and some regional equipment. Push-pull (sometimes called complementary) outputs actively drive both states and are the safest default when you are unsure. Confirm three things together: PNP versus NPN, whether the camera input is wired to source or sink current, and the voltage the camera trigger accepts. Many camera GPIO lines are opto-isolated with a stated input range, so check the rated voltage and current and add a series resistor or level shifter if the sensor's 24 V level exceeds what the input is rated for.
Also decide between normally open and normally closed (light-on versus dark-on for photoelectric) and which edge you trigger on. For part-present triggering you usually want a clean rising edge as the part arrives, so make sure the chosen NO/NC configuration and the camera's active edge agree, or you will trigger on part-leaving instead of part-arriving. Keep the trigger output dedicated where you can; sharing it with a PLC input through a tee adds load that can round the edge and shift the effective switch point.
IO-Link is a point-to-point digital communication layer that runs over the same standard three-wire sensor cable, and it changes how you think about integration. It lets you read live process values and diagnostics, store and restore parameters for fast changeover, remotely teach switch points, and spot a fouled or failing sensor before it causes scrap. The important nuance for a vision trigger is timing: the IO-Link process-data cycle, which is typically on the order of a few milliseconds and varies by device, is not the right path for a precise capture edge. The clean approach is to take the hardware trigger from a discrete switching output and use IO-Link for configuration, monitoring and diagnostics. Note that on a single-channel device the C/Q pin (pin 4) is either communicating in IO-Link mode or acting as a switching output, not both at once, so if you need simultaneous IO-Link data and a discrete trigger, choose a sensor that provides a second switching output (commonly on pin 2). That combination gives you a microsecond-clean edge plus full digital observability.
- PNP (sourcing): switches the line to +24 V; most common for modern cameras and 24 V machines.
- NPN (sinking): switches the line to 0 V; common in legacy and some regional equipment, so verify camera input polarity.
- Push-pull / complementary: actively drives both states; safest when the camera input type is uncertain.
- NO vs NC and light-on/dark-on: must agree with the camera's active edge so you trigger on part-arriving, not part-leaving.
- IO-Link: use it for parameters, diagnostics and remote teach; take the actual trigger from a discrete switching output, since the C/Q pin cannot communicate and switch simultaneously.
Response time, switching frequency and the capture window
On any moving line the sensor's speed has to comfortably beat the available capture window. Two datasheet figures govern this. Response time is the delay between the target reaching the sensing condition and the output actually changing state; switching frequency is the maximum rate at which the output can toggle on and off and still be resolved. For triggering you mostly care about response time and its consistency, because every millisecond of delay is distance the part travels before the edge arrives. A fast inductive or through-beam sensor may respond in well under a millisecond, while some diffuse and ultrasonic sensors are an order of magnitude slower, which matters when parts pass quickly.
Work the capture window as a budget. Convert line speed into distance per millisecond, then add up everything that consumes time between the true trigger condition and the end of exposure: sensor response time and its jitter, any input debounce or filtering, the camera's trigger-to-exposure latency, and the exposure duration itself, which is often kept very short and paired with a strobe to freeze motion. The part must stay within the usable field of view, and acceptably sharp, across that whole interval. If the numbers are tight, you can move the sensor upstream, dial in a programmable trigger delay, shorten the exposure with more light, or pick a faster sensor, but you cannot wish the latency away.
Closely spaced parts add a second constraint. If two parts can arrive within the sensor's minimum off-to-on recovery time, or faster than the camera can finish one capture and rearm, you will merge or drop triggers. Check that the sensor's switching frequency and the camera's maximum trigger rate both exceed your worst-case part rate with margin, and design the gating logic so a new trigger is ignored until the previous inspection has released.
Environment: IP rating, connectors and electrical immunity
More vision triggers fail in the field for environmental reasons than for imaging ones, so specify the housing to the real conditions, not the nominal ones. Match the IP rating to exposure: IP65 or IP67 for splash and washdown, and a higher rating or a sealed housing where high-pressure cleaning, coolant or oil mist are present. Confirm chemical compatibility of the housing and lens material with the cleaning agents actually used, and check the rated ambient temperature range against the hot or cold spots near the process rather than the room average.
Stray light is the photoelectric sensor's equivalent of an imaging artefact. Direct sunlight, high-bay LED or fluorescent fixtures, and even the vision station's own strobe can couple into a receiver and cause false or missed switching. Modulated and coded emitters, tighter apertures and through-beam geometry all help, as does shielding the sensor from the strobe and from reflective machine surfaces. Treat the sensor's light immunity the same way you treat the camera's, since both share the same optical environment.
The connector and cable are part of the specification, not an afterthought. M8 and M12 are the common industrial choices, with A-coded M12 typical for discrete and IO-Link sensors; pick the keying and pin count that match both the sensor and the camera or junction box. Use shielded cable for the trigger run where drives, contactors or welders are nearby, ground the shield correctly at one end, and keep the trigger line away from motor and servo power to avoid coupled noise that mimics or masks a real edge. Allow drip loops and proper strain relief, and on moving axes use cable rated for continuous flexing.
Putting it together: a selection checklist
Selecting a vision-trigger sensor comes down to walking a short sequence and writing down the worst case at each step. Start from the target and environment to fix the sensing principle and mode, then size range and switch-point repeatability with margin, then match the output type and edge to the camera input, then prove the timing budget against line speed, and finally lock down IP rating, connector and cable for the actual cell. Each choice constrains the next, so taking them in order keeps you from re-spinning the design late.
The recurring theme is that a vision station is only as repeatable as its trigger. A correctly chosen sensor in the right place, wired cleanly into an opto-isolated input and strobed to freeze motion, puts the part in the same position in every frame and lets the rest of the imaging chain do its job. A sensor chosen on range alone, mounted loosely, or expected to both talk IO-Link and switch on one pin, undermines an otherwise good camera, lens and lighting selection.
When the trigger, indexing and gating logic get involved, or when you are unsure whether a sensor can meet your timing at line speed, it is worth sizing the whole capture window with the camera and lighting together. Send the part size, line speed, cycle time and the inspection you need, and we can help match the sensor, its mounting and its wiring to the rest of the vision station.
Frequently asked questions
Related categories
- Industrial sensors
- Photoelectric sensors
- Vision sensors
- Encoders
- Acquisition and control
Related guides
How to choose an industrial camera
A practical, application-first method for selecting an industrial camera: derive resolution from field of view and smallest detail, then match shutter, speed, interface, lens and lighting.
How to choose machine vision lighting
A practical guide to choosing machine vision lighting: geometry, wavelength, strobe vs continuous, ambient control and how to maximise feature contrast for reliable inspection.
High-speed imaging for inspection
How to build a high-speed machine-vision system: balance frame rate against resolution, freeze motion with short exposure and strobe lighting, and size the interface and frame grabber for sustained throughput.