A paper bag line prints two black squares near the ends of each bag, and quality wants the same verdict on every bag: square present, or bag rejected. You can buy a taught photoelectric mark sensor, wire it to a digital input and be running the same afternoon, or hang a small vision sensor over the bag and get position plus an image record. Three facts decide it: how far the mark moves between bags, how many print patterns the line runs, and whether anyone downstream needs proof. This guide gives you the standoff, field-of-view, pixel and exposure numbers for both routes, one worked example you can re-run with your own bag and line speed, and the decision for each case.
The decision rule
Commit on one question: does the mark hold its position?
- A taught contrast or color mark sensor wins when the mark is always the same pattern and stays within a couple of millimetres of the same spot. One teach routine, one discrete output, no programming.
- A small vision sensor wins when the mark can drift along the bag, arrive rotated, or when the line runs several print layouts. A camera inspects a window rather than a point, so position comes free with presence, and each product can carry its own taught job.
Black ink on light paper is the friendly case for both routes: the reflected-light contrast is several to one. The sensor route costs less per check and commissions faster. The camera route earns its keep the first time the print shifts and a point sensor starts missing it.
The sensor route: teach and ship
A contrast sensor, also sold as a color mark or registration mark sensor, is taught on the two states of the web. Show it the black square and teach the dark reading, show it plain paper and teach the light reading; from then on the output switches on which state it sees. Mount it close: 10-15 mm off the bag is the usual working range for this class, with a tolerance band around the taught distance of roughly ±2 mm, so bag flutter and sag must stay inside that. The light spot is small by design. Keep it inside the mark so a print edge never enters the reading.
For the plainest case, a black square on light paper at a repeatable position, a diffuse-reflective photoelectric sensor does the same job with less teaching: black ink returns little of the red LED light, paper returns a lot, and the output switches on that difference.
- Output
- NPN
- Light source
- Red LED
- Sensing range
- 100 mm - 1 m
- Type
- Diffuse-reflective
The MV-PE5502 is that class of part: a diffuse-reflective sensor with a 100 mm - 1 m sensing range, a red LED, a settable distance and an NPN output. Set its distance so the spot lands on the mark, then run the speed arithmetic. At a 0.5 m/s line speed, a 3 mm long mark dwells on the spot for 3 mm ÷ 500 mm/s = 6 ms, and a sensor switching in the typical 0.5-3 ms class leaves a clean, readable pulse. Check the printed response time of whichever model you choose and keep mark length divided by line speed comfortably above it.
Teach on your worst bags, not your best: lightest and darkest paper lots, wrinkled and flat, glossy spots included. If the mark pulse also clocks cutting or sealing on the machine, the PLC side is its own small project: black mark sensor synchronization with a PLC walks through it.
Why the plain diffuse cell lets you down
The tempting shortcut is any low-cost reflective cell aimed at the bag. It often disappoints, and the failure mode is the edge of the mark. A large spot straddling the edge averages light paper with black ink, the reading lands between the two states, and the output chatters. Paper adds noise of its own: kraft fiber scatters the spot, coated bags flash it with gloss, and a wrinkled bag shifts the background reading from bag to bag.
The fixes are mechanical. Use the contrast-sensor class with its tight, taught spot instead of a raw presence cell, mount square to the bag at the taught distance, shield the spot from sunlight and overhead lamps, and re-teach when the paper lot changes. If the line cannot hold the bag to a repeatable position under the spot, stop tuning and go to the camera route.
The camera route: one window, position and a record
A vision sensor with an integrated lens turns the check from a point into a window. You teach a dark region of a minimum size inside a taught area, so the square may drift a few millimetres or rotate a few degrees and the verdict is unchanged, and every verdict can keep an image for the day a batch is disputed. Both of these live in the smart cameras and vision sensors range:
- Interface
- Fast Ethernet
- Resolution
- Up to 3 MP
- Interface
- Fast Ethernet
- Resolution
- Up to 3 MP
The geometry is one formula:
Worked example, the mono fixed-focus model. A 1/6-inch format measures about 2.4 × 1.8 mm, and a 0.3 MP array is typically 640 × 480. With its 3 mm lens focused at 240 mm:
- FOV width = 2.4 mm × 240 ÷ 3 = 192 mm; height 144 mm.
- Pixel scale = 192 mm ÷ 640 pixels = 0.30 mm per pixel.
- A 3 mm square spans 3 ÷ 0.30 = 10 pixels; even a 2 mm square gives 7.
Presence checking wants about 5 pixels across the smallest feature, so this window clears the bar with margin. One 192 × 144 mm window covers one end of a standard bag with search margin; checking both ends of every bag takes one sensor per end. For a color mark, or a smaller framed window, the color model's 12 mm lens and manual focus set the working distance you want: a 1/2.9-inch format is about 4.9 × 3.7 mm, so at 150 mm the window is 4.9 × 150 ÷ 12 = 61 mm wide and a 3 mm mark spans about 70 pixels.
Need both ends in one image? Work the formula backwards. A 400 mm-wide window with the 3 mm lens and 2.4 mm sensor width needs WD = 400 × 3 ÷ 2.4 ≈ 500 mm, past that model's fixed focus. That is the point where you step up to a smart camera with a proper C-mount lens rather than force it.
Exposure and triggering
A camera over a moving line needs a trigger and a short exposure; over statically presented bags it can free-run. Keep motion smear under half a pixel:
At 0.5 m/s with the 0.30 mm pixel scale above: exposure ≤ 0.5 × 0.30 mm ÷ 500 mm/s = 0.3 ms. Paper reflects plenty under a red LED, so 0.3 ms is reachable without a strobe. The fine color window is harder: at 0.042 mm per pixel the same rule gives 0.5 × 0.042 ÷ 500 ≈ 42 µs, which is strobe territory. The pattern is general: the finer the pixels, the more light you must throw.
Trigger from a photoelectric sensor that sees the leading edge of each bag or the gap between bags, wired to the camera trigger input. Exposure then follows pulse width: why trigger pulse width sets your camera exposure time. One bag, one trigger; the pacing arithmetic for repeated pulses is in camera hardware trigger frame rate with external pulses, and strobe wiring in smart camera strobe output: enable it and wire the light. The trigger-mode choice, sensor versus serial versus free-run, is the same decision barcode readers face: fixed barcode reader trigger modes.
If the PLC needs to know where the bag is, not just that it passed, the mark pulse goes to a high-speed measuring input rather than a plain digital input: configuring a print mark sensor on a PLC measuring input shows that set-up.
Sensor or camera side by side
| Taught contrast / color-mark sensor | Fixed-focus mono vision sensor | Manual-focus color vision sensor | |
|---|---|---|---|
| What it learns | one dark/light reading pair | dark region of a taught size in a taught area | color and pattern regions, one job per product |
| Mounting | 10-15 mm standoff, spot inside the mark | fixed 240 mm focus, ~192 × 144 mm window | you set the distance; 61 mm window at 150 mm |
| Position tolerance | a couple of mm before the edge enters the spot | the whole window is the search area | the whole window |
| Speed at 0.5 m/s | 6 ms dwell on a 3 mm mark | 0.3 ms exposure | ~42 µs, plan a strobe |
| To the PLC | one discrete output | discrete verdict + Ethernet + image record | discrete verdict + Ethernet + image record |
| Pick it when | mark fixed, contrast high | mono marks that may shift | color marks, several layouts |
Five questions before you order
- How far can the mark drift between bags? Up to a couple of millimetres stays sensor territory; more than that is camera territory.
- How many print layouts does the line run? Re-teaching a sensor per layout gets old quickly; a camera stores a job per product.
- Is the contrast really black on light? Brown on kraft or white on white defeats a brightness pair; that needs a color sensor or a camera.
- Does anyone downstream need proof of inspection? A stored image settles a disputed batch; a pulse cannot.
- What is the line speed? Re-run the dwell and exposure arithmetic above at your own number before ordering either box.
Checks before you order
- Build the worst-bag set first: lightest and darkest paper lots, glossiest coating, wrinkled and flat, and test every one. A teach that passes only the best lot fails in production.
- Measure the smallest mark and divide by pixel scale or spot size: five pixels across, or a spot fully inside the mark, is the pass mark.
- Match the electrical sides: sensor NPN output to a sinking PLC input or the camera trigger input, and confirm which type your input expects.
- Control ambient light: a spot or window taught in a dark hall drifts under skylights, so shield it or teach under production lighting.
- Mount with a bracket square to the bag at the taught distance, and spend the flutter budget inside the tolerance band, not on top of it.
When the usual answer is wrong
- Black mark on dark kraft: the brightness contrast collapses. A color mark sensor reads color difference instead, or change the wavelength, because light color drives mono-camera contrast hard: which LED colour gives the best contrast in machine vision.
- Print under laminate or a glossy window: glare wipes the mark out. Diffuse or cross-polarized light helps, and some ink and substrate pairs separate better in the near infrared: near infrared lighting for printed packaging inspection.
- Ambient light that swings through the day: any taught threshold drifts with it. Enclose and light the station, as covered in ambient light variation in pick and place vision.
- The real question is print quality, faded or smudged print rather than presence. That is verification grading, and its verdict reaches the PLC the way code verifiers send theirs: bottle label barcode verification with a PLC serial link.
Next step
Both routes are configurable from the catalog: the trigger sensors finder for the photoelectric side and the cameras finder for vision sensors and smart cameras, with the configurator below walking the choice step by step. For a second opinion, send the bag samples, the mark size and the line speed through the contact page and we will run the numbers with you.
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.
Questions
Will a plain photoelectric sensor detect a black mark on kraft paper?
Often yes. Black ink returns little of the red LED light and kraft paper returns a lot, so a diffuse-reflective sensor switches on that difference. It holds only while the spot sits fully inside the mark and the paper lot stays consistent. Kraft fiber texture and an edge entering the spot cause chatter; if bags flutter more than a couple of millimetres, step up to a taught contrast sensor or a vision sensor.
How close does a color mark sensor mount to the bag?
This class is built for short range: around 10-15 mm from the web, with a tolerance band of roughly ±2 mm around the taught distance. The spot must sit inside the mark on every bag, wrinkled ones included, so keep flutter and sag inside the band. Re-teach when the paper lot changes.
How many pixels do I need across the print mark?
Plan on at least 5 pixels across the smallest feature. Divide window width by horizontal pixels for the pixel scale, then check mark size ÷ pixel scale ≥ 5. In the worked example, a 192 mm window on 640 pixels gives 0.30 mm per pixel, so a 3 mm square spans 10 pixels and a 2 mm square still gives 7.
Does the camera need a trigger on a moving line?
Yes. A free-running camera smears moving bags. A photoelectric sensor spotting each bag edge, wired to the camera trigger input, freezes every image at the same place, and the exposure must be short enough that blur stays under half a pixel: 0.3 ms in the worked example at 0.5 m/s. Over statically presented bags, free-run is fine.
What output does each solution give my PLC?
The mark sensor gives one discrete output: mark present or absent, straight into a digital input. A vision sensor gives the same discrete verdict plus an Ethernet connection, so you also get the mark position and a stored image per bag. The image is what settles a disputed batch; a pulse cannot.


