A part-present photoelectric sensor is the cheapest reliable trigger for a smart camera, and the wiring is a ten-minute job once one rule is clear: the sensor's output type decides where the camera's input common goes. PNP switches the positive rail onto the wire. NPN pulls the wire down to the return rail. Wired right, the camera fires on every part. Wired wrong, you get a camera that never fires, or one that fires at nothing. This guide walks the wire colours on a 3-wire sensor and the connections for each output type. It adds a bench test that settles the output type with one meter reading, and the numbers that show the wiring adds almost nothing to your timing budget.
What do you need before you open the cabinet?
You need a 3-wire DC photoelectric sensor with a PNP or NPN output, a 24 V DC supply rail, an I/O cable that breaks the camera's connector out to open leads, and a multimeter — no PLC input card, no relay and no signal conditioning for a single camera input.
That is the whole kit. The sensor's solid-state output switches the load current directly, and a camera trigger input takes a 24 V signal, so the two connect wire to wire. A relay joins only when you fan the pulse out to several devices.
- A 3-wire DC sensor, PNP or NPN output, in the standard 10-30 V DC supply class
- A 24 V DC supply with a few tens of milliamps spare for the sensor
- A camera power and I/O cable with open leads on the sensor end — the camera power and I/O cables page sorts them by connector and length
- A multimeter for the bench prove-out
Which wire is which on the sensor's cable?
On a standard 3-wire DC sensor, brown lands on the positive rail, blue lands on the return rail, and black is the switching output — the only wire that reaches the camera. A 4-wire sensor adds a grey or white control wire that stays on the sensor side of the panel.
The colour code is the international convention for DC 3-wire sensors and holds across the photoelectric sensors range. Read the housing label as the authority if a special cable differs.
| Wire | Purpose | Where it lands |
|---|---|---|
| Brown | +V supply | +24 V DC from the supply |
| Blue | 0 V return | The supply's return rail |
| Black | Switching output | The camera trigger input |
| Grey or white (4-wire types) | Light-on/dark-on select or teach | Sensor side, per the housing marking |
Brown and blue are the sensor's own power loop; black is the signal. Keep that separation in your head and every connection in the rest of this guide follows.
How do you tell a PNP output from an NPN output?
Read it off the label or the order code: PNP (sourcing) switches the positive rail onto the black wire when the part is seen. NPN (sinking) pulls the black wire down to the return — PNP means switched positive, NPN means switched negative.
The first letter names the switched rail, which keeps the pair easy to tell apart: PNP's P switches the Positive rail, NPN's N switches the Negative rail. Sensor makers call the same thing sourcing (PNP) and sinking (NPN).
The trigger sensor finder filters by Output, so you can shortlist the right output type before a panel is drawn. If the sensor is already on the bench and unlabelled, one meter reading settles it: power the sensor on brown and blue, block and clear the beam, and probe black to blue. A PNP output reads about 24 V with the part present and near ground without it; an NPN output reads near ground with the part present.
How do you wire a PNP sensor to a smart camera trigger input?
Land the sensor's black output on the camera trigger input and the camera's input common on the return rail. The sensor pushes +24 V down the black wire on each part; the current crosses the opto-isolated input and returns through the common.
Three wires and a supply:
- Brown to the positive terminal, blue to the return, at the supply.
- Black to the camera's trigger input, through the open lead of the I/O cable.
- The camera's input common (the COM terminal of the input group) to the supply's return.
- Power up, hold a part in front of the sensor, and watch the input state flip in the camera's I/O monitor.
The loop to trace on the drawing runs: positive rail, through the sensor's output transistor, into the camera input, out of the common, back to the return. PNP is the wiring most European-style panels expect, and it needs nothing else for a one-camera cell.
Two follow-ups sit on the same connector. If the input should start the inspection job itself, the software side is in control vision routines on a smart camera with GPIO or serial input. If the same pulse should fire a light, the output side is wired in smart camera strobe output: enable it and wire the light.
How does an NPN sensor wire to the same input?
The black wire still lands on the trigger input, but the input common moves to the positive rail. The sensor pulls the input line down to the return while the part is present, so set the camera's trigger activation to the falling edge.
- Brown and blue as before — same supply terminals, same rails.
- Black to the same trigger input lead.
- The camera's input common to +24 V instead of the return.
- Select the falling edge (or active-low activation) for that input in the trigger settings.
Now the loop runs the other way: the rail waits on the input through the common until the sensor's output transistor turns on and drags the black wire to the return. That is the moment the opto sees current — exactly when the part arrives. Same sensor position, same cable, one common moved and one edge flipped.
What goes wrong when the output type and the input do not match?
A PNP sensor with the common tied to the positive rail, or an NPN sensor with the common tied to the return, leaves the opto with no voltage difference. The input never changes state; the fix is to move the common to the opposite rail, a two-minute change.
Four symptoms cover nearly every bad first trigger:
- Camera never fires, sensor switches fine. Sensor and common on the same rail — no voltage across the opto. Move the common.
- Camera fires on its own, with no part. The input common is left unconnected, so the input floats. Tie it to the rail the output type needs.
- Random triggers a few times a shift. The sensor shares its supply feed with inverters, contactors or valve banks. Give the sensor a clean pair from the supply and keep its cable out of the motor channel.
- Sensor switches, camera ignores it. The camera is still running continuous acquisition. Flip the acquisition mode — continuous camera acquisition mode for live image loops shows the other side of that setting, and GigE camera ignores external trigger: check acquisition mode first is the checklist when it still ignores the line.
Triggers that vanish or double can also come from commons shared between devices, which has its own diagnosis in camera trigger common reference: diagnose missing pulses.
How do you prove the trigger works before tuning the vision job?
Prove it electrically, then in software: watch the black wire swing full rail to rail as parts pass — rising for PNP, falling for NPN — then switch the camera from continuous acquisition to hardware trigger and count one frame per part for a full minute.
- Meter first: probe black to blue while a colleague passes parts, and confirm the swing your output type should make.
- In the camera, move the acquisition mode from continuous to hardware trigger, then pick rising edge for PNP or falling edge for NPN.
- Set a fixed exposure rather than pulse-width exposure, unless you want the part's block time to become the exposure — why trigger pulse width sets your camera exposure time shows how that mode couples the two.
- Run parts at line speed for a minute and count trigger events against parts: one event per part, none at the gaps.
- Only when the count is exact do you start tuning lenses, lights and tools.
Edge, gated, timed and PTP-scheduled triggering are compared in industrial camera trigger modes compared: free run to PTP scheduled, for cells that need more than one image per part.
How much delay does the wiring add to the timing budget?
Almost none: a standard diffuse-reflective output answers in about 1 ms and the cable adds nanoseconds. The 16.7 ms frame period of a 60 fps camera dwarfs the wiring — the sensor-to-field offset and the frame-delay setting dominate the budget.
Take a 60 fps camera over a belt at 0.2 m/s, photoeye 150 mm upstream of the field-of-view centre. Frame period T = 1/60 s = 16.7 ms. Travel per frame: 0.2 m/s × 0.0167 s = 3.3 mm. Offset delay: t = 0.150 m ÷ 0.2 m/s = 0.75 s, which is 0.75 ÷ 0.0167 ≈ 45 frames — that is the number you program, and camera trigger delay timing for offset inspection sensors covers the setting. Against 45 frames the wiring vanishes: about 1 ms of sensor response moves the image 1 ms × 0.2 m/s = 0.2 mm, and a 7 m cable's propagation at roughly 5 ns per metre adds 35 ns. Order the wiring by noise immunity, not speed; order the layout by the offset.
Which sensor, camera and cable do you order?
Match the output type to the panel's convention — PNP where inputs source from the rail, NPN where they sink to the return — then choose sensing range and camera by the part, and take an open-ended I/O cable long enough for the run plus service slack.
For a part-present eye beside the camera, diffuse-reflective sensing is the default: one box, no reflector to align. The MV-PE5502 is the NPN example from this guide — diffuse-reflective type, red LED, NPN output, settable distance, sensing range 100 mm - 1 m — and the PNP versions sit one filter away in the same range.
- Output
- NPN
- Light source
- Red LED
- Sensing range
- 100 mm - 1 m
- Type
- Diffuse-reflective
On the camera side, buy image quality, not trigger circuitry — the input wiring above is the same story across the range. The LS-SMC-0063 captures 60 fps at 1.6 MP with a 16 mm lens for small, fast parts. The MV-SC5060XM-08M-WBN steps up to 6 MP over GigE, though its rolling shutter makes a global-shutter model the better choice on a quick belt. The camera finder filters smart cameras by resolution, shutter and interface.
- Interface
- GigE
- Resolution
- Up to 3 MP
- Interface
- GigE
- Resolution
- 6-10 MP
The I/O lead carries the supply pair and the trigger in one sheath. The LS-CBL-0300 runs 8 cores from an M8 8-pin male connector to open leads over 7 m, rated for drag-chain use. SC6000 cameras take the MV-SCA-P-M12A17pF-open-ST-7m, which brings the 17-pin M12 A-coded connector out to open leads for static runs, also 7 m. The accessories finder sorts camera power and I/O cables by length and type.
- Type
- Power and I/O cables
- Length
- 6-8 m
- Type
- Smart Camera Power and I/O Cables
Cable length costs almost nothing here: 50 mA over a 7 m out-and-back pair of 0.2 mm² copper cores, at about 0.0175 Ω·mm²/m, drops 2 × 7 × 0.05 × 0.0175 ÷ 0.2 ≈ 0.06 V — so any length a cabinet layout will ever ask for stays well inside the sensor's supply class.
Work the sensor, the lead and the camera as one chain in the configurator, starting at the trigger sensor step:
The configurator matches a camera, lens, light, light controller and cables to each other, step by step, and lists only parts that fit what you already picked.
Wire to the output type, prove the pulse on the bench, and tune the job last — that order keeps a trigger problem from masquerading as a vision problem. If a PLC, a second camera or a light controller joins the same pulse, send the I/O drawing through the contact page and we will check the commons with you; the systems topic page holds the rest of the trigger wiring and timing notes.
Questions
Can one photoelectric sensor drive a camera trigger and a light strobe at the same time?
Yes, if the output has the current for both. Two typical opto-isolated inputs draw about 20 mA together, well inside the roughly 100 mA a solid-state sensor output switches, so no relay is needed. Interpose a relay when the second device is an electromechanical coil or sits in another cabinet; the strobe wiring itself is covered by the smart camera strobe output guide.
Can I feed the camera trigger from 5 V logic instead of a 24 V sensor?
Keep the two worlds apart. The industrial trigger input is built for the full rail swing; a 5 V logic pin is not, so level-shift or opto-couple between them. If one low-voltage pulse must fan out to several cameras, follow the safe fan-out wiring for multiple cameras rather than paralleling pins directly.
Does the wiring change if the sensor is through-beam or retro-reflective instead of diffuse?
No. Through-beam, retro-reflective, diffuse and time-of-flight sensors all use the same 3-wire output stage, so brown, blue and black land in the same places and the PNP or NPN decision is identical. Choose the sensing type by the part: through-beam for dark or shiny parts, retro-reflective when only one side can be mounted, diffuse for the simplest install.
What pulse width does the sensor need to send?
For edge-triggered capture with a fixed exposure, a few milliseconds is generous; industrial inputs register much shorter pulses. Width only matters in pulse-width exposure mode, where the pulse sets the exposure: a 5 ms block becomes a 5 ms exposure. If exposure must stay fixed, trigger on the edge and set exposure in software.
How far can the sensor sit from the camera?
Tens of metres are electrically trivial: at sensor currents the drop is tens of millivolts per 10 m of typical core, and propagation is nanoseconds. The practical limits are mechanical — drag-chain flexing, channel space, and keeping the sensor feed away from inverter and motor wiring that couples noise into a run. The camera cable usually sets the ceiling first.




