Code readingHow-to

Barcode match verification: build a pass/fail check station

Set up a fixed code reader that compares every scan with the expected code and switches pass and fail outputs to a light and buzzer, with sizing and checks.

LumaSpec Vision12 min read Share on LinkedIn

On this page 9 sections
  1. 01What match checking does, and what it does not
  2. 02What you need at the station
  3. 03Worked example: sizing a 0.25 mm Code 128 label at 150 mm
  4. 04Build the station step by step
  5. 05Prove the judgment before the first shift
  6. 06When the usual answer is wrong
  7. 07Common mistakes that sink match stations
  8. 08Checks before you order
  9. 09Questions

Parts arrive at the bench in mixed order, each one barcoded, and every so often the wrong fitting still ends up in the assembly. Commercial verification systems stop that, but they are built for capabilities a match station does not need: serial records, line-side databases, shift statistics. If all you want is a chime on the right part and a buzzer on the wrong one, a fixed code reader with content-match checking does the whole job at the station — it stores the expected code, judges every scan against it and switches discrete outputs, so no PC sits at the bench. This guide takes you from label measurement through wiring to a proven acceptance run.

What match checking does, and what it does not

The decoder holds one or more expected strings for the station. Every decode is compared against the stored judgment string: a match sets the pass output, a mismatch or a failed read sets the fail output. The comparison runs inside the reader at decode speed, which is why the bench needs no computer, no spreadsheet macro and no operator watching a screen. The reader is the judge; the lamp and buzzer are its verdict.

Two different jobs both get called verification. Match checking asks 'is this the right code for this part'. Print-quality grading asks 'is the symbol printed well', scoring it under ISO/IEC 15416 for 1D codes or ISO/IEC 15415 for 2D codes; the barcode reader verification guide covers that route when you qualify a label supplier. A station built to stop wrong parts needs the match check.

It is also not record keeping. The reader judges and signals but stores no history of which serial passed at which time. Add the host link described near the end of this guide when traceability enters the picture.

What you need at the station

Six things, and none of them is a PC:

  • A fixed code reader with a trigger input, result outputs and a content-match check in its setup tool.
  • A trigger source: a photoelectric sensor watching the fixture, or a foot switch.
  • A green indicator lamp or stack light and a buzzer or chime on 24 V DC, wired through an interposing relay or a PLC input card.
  • A bracket or stand that holds the reader square to the label.
  • The label specification: symbology, module width, and the exact expected string with its case, prefix characters and leading zeros.
  • The reader's setup tool; the USB first-connection walkthrough shows the connection and readback checks to finish before anything is wired to the IO block.

Model choice follows from the mount. Tight bench fixtures below 150 mm suit compact short-focus readers; conveyor stations want global-shutter sensors and a codes-per-second rating clear of the line's parts-per-second rate. The code-reader finder filters by interface, resolution and mount.

A handheld code reader gives the operator the same good-read feedback, but the comparison against the expected code then lives in a PLC or PC rather than in the scanner; the wireless handheld to PLC over TCP guide is the usual pattern there. For a station that judges at the reader, the fixed model is the simpler build.

Build the whole station

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.

Start with the camera

Worked example: sizing a 0.25 mm Code 128 label at 150 mm

The inputs, with their sources:

  • Label: Code 128 with a module (narrow bar) width of 0.25 mm, from the label drawing or measured with a magnifier scale.
  • Rule: fixed-mount reading is reliable at 3 pixels per module or more, and 2 px per module is the floor below which print spread and tilt start costing reads. This is a decoding rule of thumb, not a datasheet limit.
  • Sensor: the example assumes a 1.3 MP-class imager with 1280 × 1024 pixels and a 7.2 mm-wide, 1/1.8 inch type sensor. A smaller sensor with the same pixel count narrows the field and raises the pixels per module, so the wide-sensor assumption is the harder case.
  • Stand-off: 150 mm, chosen to keep the reader clear of hands and fixture hardware.

The rule in words: find the largest pixel footprint the label tolerates, convert it into the largest field of view the sensor can cover, then pick the focal length that delivers that field at the stand-off.

p = module width / pixels per module FOVmax = sensor pixels × p m = sensor width / FOV f = WD × m / (1 + m) check: m = f / (WD − f) and FOV = sensor width / m

The arithmetic:

  1. Pixel footprint: p = 0.25 mm / 3 px = 0.083 mm per pixel.
  2. Largest field that keeps 3 px per module: 1280 px × 0.083 mm = 106.7 mm.
  3. Design margin: aim for a 90 mm field, about 16 percent under the ceiling, so tilt, blur and print spread cannot push a read under the line.
  4. Magnification: m = 7.2 mm / 90 mm = 0.080.
  5. Focal length: f = 150 mm × 0.080 / 1.080 = 11.1 mm, so a standard 12 mm lens is the pick.
  6. Check the real field with the 12 mm lens: m = 12 mm / (150 mm − 12 mm) = 0.087, so FOV = 7.2 mm / 0.087 = 82.8 mm.
  7. Pixels per module: (1280 px / 82.8 mm) × 0.25 mm = 3.9 px per module.
How sensor width, working distance and field of view set the focal length Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.CameraField of view (FOV)Working distance (WD)≈ fsensor width slensm = s / FOVf = WD × m / (1 + m)
How sensor width, working distance and field of view set the focal length. Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.

The decision: mount the reader 150 mm from the label behind a 12 mm lens and the 0.25 mm label reads at 3.9 px per module, 29 percent above the comfort line. If the fixture forces a 200 mm stand-off, move to a 16 mm lens: f = 200 mm × 0.080 / 1.080 = 14.8 mm rounds up to 16 mm, the field stays at 82.8 mm and the margin is unchanged. The distance is free; the field is the constraint — hold the field at or below 107 mm for this label on a 1280-pixel sensor and any stand-off works with the focal length that produces that field. An 83 mm field also swallows generous placement slop: the label can sit anywhere in that window. Halve the module width to 0.125 mm and the allowed field halves with it, so the 150 mm stand-off then wants a 25 mm lens.

The same focal-length math is what the calculator runs:

Lens focal length, field of view and working distance
Units
Solve for
Focal length
– mm
Field of view
– mm
Working distance
– mm
Magnification
– x
Angle of view
– °
Pixel on the part
– mm

Thin-lens model: m = sensor width / field of view, f = WD × m / (1 + m). Accurate to a few percent above about 150 mm; check the lens's minimum object distance.

Find lenses with this focal length Open the full calculator

That result lands on a catalog part: the MV-ID3013PM-12M-WBN pairs a 12 mm lens with a 1.3 MP sensor over Fast Ethernet on an M12 mount.

Fixed code readersHikrobot MV-ID3013PM-12M-WBN 12mm focal length 1.3 MP Compact Industrial Code ReaderMV-ID3013PM-12M-WBN
Interface
Fast Ethernet
Resolution
Up to 3 MP
Shutter
Global
Lens mount
M12
$1,979.00View part

Build the station step by step

  1. Fix the label spec. Symbology, module width, and the exact string the decoder emits — case, prefixes, leading zeros. Take the string from the reader's readback after a trial scan, not from the drawing; a trailing space or a lowercase letter turns good parts into fails. On labels carrying more than the part number, match only the field that identifies the part; the scan-string splitting guide shows how the fields separate.

  2. Mount at the worked distance. Set the stand-off from the sizing example and square the reader to the label. Keep tilt inside the reader's reading-angle envelope; the module size, reading angle and distance guide explains what each degree of tilt costs in effective pixels.

  3. Focus at the rated distance. Aim at a production label at the real stand-off, set focus, then lock the bracket. Short-focus models arrive factory-focused for a rated distance: mount them at that distance and confirm with a read.

  4. Wire the trigger. Part-presence sensor or foot switch into the reader's trigger input, and switch free-run off — the GPIO trigger guide shows the wiring and the settings. A triggered read belongs to a known part; a free-running reader reads whatever wanders into view.

  5. Wire the verdict. Pass output to the green lamp and chime, fail output to the buzzer, each through an interposing relay or a PLC input card. If the model splits mismatch and no-read onto separate outputs, keep them split: a no-read means re-seat and rescan, a mismatch means stop and check the kit, and the operator's next move differs.

  6. Store the judgment string and bind the outputs. In the setup tool, enable the content-match check, paste the expected string from the readback, set exact match, and tie the result outputs to the verdict. Stations that see several models either keep one stored string per reader — one reader dedicated to one part, the simplest build — or take the target from the work order: the PLC recipe lookup pattern holds per-model targets, and the smart camera to PLC over TCP guide shows the trigger-and-result exchange when the host judges instead.

  7. Teach with real parts. Trigger on a correct part and confirm the pass lamp and chime. Then trigger on every wrong part the station can actually receive — the near-misses with one character different — and confirm the buzzer; the barcode to part verification guide is built around exactly those near-miss assemblies. Trigger once with no label in view and confirm the no-read result.

Prove the judgment before the first shift

Three hard numbers decide acceptance:

  • Zero false passes in 200 scans of correct parts. A station that passes a wrong fitting once has failed at its only job.
  • At least 99 percent first-pass good reads on correct parts. Over 200 scans that allows two re-triggers; a worse rate means the optics need another look before operators learn to distrust the station.
  • Every near-miss part fails, every time. One escape outweighs every good read the station will ever report.

Spread the 200 scans across at least three labels from two cartons; print spread varies between print lots. A false pass sends you to the stored string first — case and trailing characters are the usual culprits — then to a narrower field. No-reads above 1 percent send you back to the sizing example: fewer pixels per module, more tilt, or tired illumination.

When the usual answer is wrong

You need records. The moment someone asks which serial passed at which station and when, the verdict must reach something that stores it. Send results, not images: the pass-fail to PLC guide covers the result link, and the PLC string storage guide covers holding the strings in memory.

You already own USB readers. The laptop-and-macro setup works, and one compact box can carry several readers and sound every verdict on a bench. Keep the readers, replace the office laptop with one of these industrial mini PCs bolted beside the fixture, and each station stays independent. For mounts in the 60-120 mm band, the LS-CRD-0047 is a 1.2 MP USB 2.0 reader with a specified 60-120 mm reading distance.

Fixed code readersCompact fixed industrial barcode reader, 1.2 MP, USB 2.0, 60-120 mm reading distance (LS-CRD-0047)LS-CRD-0047
Resolution
Up to 3 MP
Shutter
Global
Interface
USB
$559.00View part

The line runs fast or the codes run small. For conveyor rates, the reader's codes-per-second rating must clear the parts-per-second rate with margin: the LS-CRD-0028 reads up to 60 codes/s from a 2560 × 2048 sensor at 30 fps with its 8 mm lens. Dense little labels buy pixels by stepping resolution up instead of shortening the stand-off: the MV-ID5120RM-08M-RBN carries a 12 MP sensor on GigE. Keep rolling-shutter readers on stopped parts; on-the-fly reads want a global shutter.

Fixed code readers2560 x 2048 fixed code reader, 30 fps, 60 codes/s, 8 mm lens (LS-CRD-0028)LS-CRD-0028
Interface
Fast Ethernet
Resolution
5 MP
$920.00View part
Fixed code readersHikrobot MV-ID5120RM-08M-RBN Industrial Code ReaderMV-ID5120RM-08M-RBN
Interface
GigE
Resolution
12 MP
$1,969.00View part

Common mistakes that sink match stations

  • Free-run left on. The reader scans the tote, the paperwork, sometimes the neighbouring station's label through the rack. Trigger from the fixture sensor and switch free-run off during setup.
  • Matching the whole string on a multi-field label. Part number plus lot code plus date will never equal a part-number-only target. Match the identifying field alone.
  • Glossy labels without polarization. Shrink wrap and laminated labels throw a specular flash that saturates the read. Polarized optics cut it: the MV-IDB005EXI-05NRP is a polarized reader factory-focused at 70 mm with a 4.63 mm lens at 1.3 MP.
Fixed code readersHikrobot MV-IDB005EXI-05NRP Fully isolated version, 1.3 MP resolution, 4.63 mm focal length, 70 mm focus distance, Polarized industrial code readerMV-IDB005EXI-05NRP
Interface
Fast Ethernet
Resolution
Up to 3 MP
Shutter
Global
Lens mount
M5.8
$719.00 · quotedView and quote
  • A string pasted from the drawing. Case, trailing space, an en dash where the reader outputs a hyphen — each one turns good parts into fails. Paste from the readback.
  • Two readers aimed across each other. Fields per the sizing example stay narrow, and each reader gets baffled or angled so its field ends at its own fixture.

Checks before you order

Tick each one before the order goes in; every line prevents a specific failure:

  • Module width measured in millimetres, not estimated — the whole sizing scales from it, and a halved module width halves the allowed field.
  • Pixels per module at your stand-off at or above 3 by the worked example.
  • IO block confirmed on the model's data page: trigger input, pass and fail outputs, and a separate no-read output if your operators need the distinction.
  • Load plan: lamp and buzzer behind a relay or PLC input card, never hanging directly off the reader's own transistors.
  • String list written per model, taken from readbacks, with the near-miss parts named beside each string.
  • Acceptance criterion agreed before commissioning: 200 scans, zero false passes, at least 99 percent good reads.

With the list clean, the build is an afternoon of wiring and an hour of proving. Send the label spec through the quote form if you want the read checked against your label before ordering, and the contact page is open for anything the datasheets leave open. More decode-and-judge builds sit on the code reading topic page.

Questions

Can a fixed code reader judge pass and fail without a PC?

Yes, when the reader's setup tool includes a content-match check. Store the expected string once, and the decoder compares every read against it before driving its result outputs, so a lamp and buzzer run straight from the reader. If a model lacks that mode, route the scan string to a small PLC and compare it there; the serial, USB and Ethernet input routes cover the wiring options.

How many pixels per module does a barcode reader need?

Two pixels per module is the practical floor, and three or more is the design target once print spread, tilt and blur take their share. Work backwards from the label: a 0.25 mm module at the 3 px target allows a pixel footprint of 0.083 mm, so a 1280-pixel sensor must cover no more than about 107 mm of field. Miss that and shorten the stand-off or lengthen the focal length.

Can the reader's outputs drive a lamp and buzzer directly?

Fixed readers switch discrete outputs, but the lamp and sounder should sit behind an interposing relay or a PLC input card rather than on the reader's own transistors. The relay isolates the reader from lamp inrush and wiring faults, and it lets you hang a stack light the whole cell sees and hears instead of a buzzer only the operator at the bench notices.

How is match checking different from barcode verification grading?

Match checking asks whether this scan is the right code for this part, which is what stops the wrong fitting going into the assembly. Grading asks whether the symbol is printed well, scoring parameters under ISO/IEC 15416 for 1D codes or ISO/IEC 15415 for 2D. Stations that qualify a label supplier or a printing process need grading; stations that stop wrong parts need the match.

How do I check several different parts at one station?

Dedicated stations are simplest: each reader keeps one stored string and never changes. Where models mix with the work order, the reader stays the decoder and the target changes instead; the PLC holds a per-model table and writes the active expected string at job change, or the host judges the scan and returns the verdict. The first keeps judgment local and fast, the second adds the record trail for free.

Why trigger the reader instead of letting it free-run?

A triggered read fires once, on the part-presence sensor, so the decode belongs to a known part and cannot pick up a label on a tote, a clipboard or the neighbouring station's fixture. Free-run also ages the illumination for nothing and buries the operator in repeat tones. Switch free-run off at setup and let the fixture say when to read.