Barcode scanner

On this page 8

A barcode scanner is an input peripheral that optically captures a printed or displayed barcode, decodes the symbol into characters and transmits that data to a host computer, point-of-sale terminal or mobile device. Among computer peripherals in hardware, it is one of the most specialized: it replaces manual typing of product codes, serial numbers and tracking identifiers with a read that takes a fraction of a second and has a far lower error rate than keyboard entry.

Modern scanners combine three functions in one housing: an optical front end that illuminates and captures the code, a decoder that interprets bar widths or module patterns, and an interface that delivers the result. Most units present themselves to the computer as a keyboard, which is why a scanned code appears in any text field exactly as if someone had typed it.

How a barcode scanner reads a symbol

A barcode scanner works by measuring contrast between dark and light elements and converting that pattern into a digital signal. In a one-dimensional code, the information sits in the relative widths of bars and spaces; in a two-dimensional code, it sits in a grid of square modules. The scanner does not need to understand what the code means, only to recover the exact sequence of elements.

The process runs in four stages. First, a light source such as a laser diode or red and white LEDs illuminates the code. Second, a photodiode or image sensor records the reflected light. Third, the decoder firmware locates the start and stop patterns, measures element widths, and validates the check digit or error correction data. Finally, the scanner formats the result, optionally adds a prefix or suffix such as a carriage return, and sends it to the host.

Error checking is what makes scanning reliable. Retail symbologies such as EAN-13 and UPC-A include a modulo-10 check digit, so a misread almost always fails validation instead of producing a wrong number. Two-dimensional codes such as QR Code and Data Matrix use Reed-Solomon error correction, which can reconstruct data even when part of the symbol is scratched or covered.

Scanner technologies and their trade-offs

Barcode scanners fall into four main optical technologies, and the choice determines which codes can be read, at what distance and from which surfaces. The table below summarizes the practical differences.

TechnologyHow it capturesReads 2D codesTypical strength
Pen or wandSingle photodiode dragged across the codeNoVery low cost, now largely obsolete
CCD linear imagerRow of photosensors captures one lineNoRobust, no moving parts, short range
Laser scannerOscillating mirror sweeps a laser beamNoLong range and fast on 1D labels
Area imagerCamera sensor captures a full imageYesOmnidirectional, reads screens and damaged codes
Main barcode scanner technologies

Area imagers have become the default for new installations because they read both linear and two-dimensional codes in any orientation, including codes displayed on phone screens, which laser scanners usually cannot read. Laser scanners remain common in warehouses where long-range reading of large linear labels is the main task, and some industrial models read labels 10 meters or more away when the label is reflective.

Form factors and host interfaces

The physical design of a barcode scanner follows the workflow it serves. Handheld scanners suit checkout counters and receiving desks, presentation scanners sit on a stand and read items passed in front of them, in-counter scanners are built into supermarket checkouts, and fixed-mount scanners read items on conveyor belts without human involvement. Mobile computers combine a scan engine with a rugged handheld running a full operating system.

The interface determines how data reaches the software. The following table compares the common connection modes and their effects on integration.

Interface modeHow the host sees itBest suited for
USB HID keyboardAs a standard keyboardPlug-and-play entry into any application
USB virtual COMAs a serial portSoftware that parses data programmatically
RS-232 serialAs a physical serial deviceLegacy point-of-sale and industrial systems
BluetoothAs a wireless keyboard or serial linkMobile workers and tablets
Proprietary 2.4 GHz baseThrough a cradle connected by USBLong range with a paired base station
Common host interfaces for barcode scanners

Keyboard emulation is convenient but limited: the scanner types characters as keystrokes, so data can be corrupted by a mismatched keyboard layout, and the application cannot easily distinguish scanned input from typed input. Serial or virtual COM modes avoid both problems and are preferred for custom inventory software.

Symbologies a scanner must support

A symbology is the encoding scheme of a barcode, and each scanner supports a defined list of them. Retail, logistics, healthcare and manufacturing rely on different symbologies, so matching the scanner to the codes in use is the first selection criterion.

SymbologyTypeTypical use
EAN-13 and UPC-ALinear, numericRetail product identification
Code 128Linear, alphanumericShipping labels and logistics
Code 39Linear, alphanumericIndustrial and government labeling
QR CodeTwo-dimensional matrixTickets, payments and links
Data MatrixTwo-dimensional matrixSmall parts and medical device marking
PDF417Stacked linearIdentity cards and boarding passes
Widely used barcode symbologies

Many symbologies are disabled by default to reduce misreads. Administrators typically enable only the codes they need by scanning configuration barcodes from the manufacturer’s programming guide, which is also how prefixes, suffixes and timeouts are set without any driver software.

Choosing a scanner for the task

Selecting a barcode scanner means matching code types, distance, environment and volume. A device that performs well at a café counter may fail in a cold-storage warehouse or on a hospital ward that requires disinfection.

SituationRecommended choiceReason
Small shop checkoutCorded USB area imagerReads products and phone coupons cheaply
Warehouse high shelvesExtended-range laser or imagerReads labels several meters away
Hospital bedsideDisinfectant-ready imagerSurvives cleaning and reads wristbands
Conveyor sortingFixed-mount imagerReads moving items without an operator
Field inventoryBluetooth or mobile computerFreedom from cables and a host PC
Scanner selection by situation

Durability ratings matter in demanding settings. An IP rating such as IP65 indicates dust-tight construction and resistance to water jets, and manufacturers specify drop resistance as the number of falls onto concrete from a given height, commonly 1.5 to 2 meters.

Limitations and common problems

Most scanning failures come from the label, not the scanner. Poor print contrast, insufficient quiet zone around the code, glossy laminates that cause glare, and codes printed too small for the scanner’s resolution all reduce read rates.

  • Wrong characters appear when keyboard emulation meets a different system keyboard layout; matching the layout setting solves it.
  • No read on phone screens usually means a laser scanner is being used; an area imager is required.
  • Missing leading zeros often result from a spreadsheet converting the scanned code to a number.
  • Duplicate entries occur when a presentation scanner rereads an item still in its field; a same-code timeout prevents this.
  • Laser safety requires that Class 2 devices never be aimed directly at the eyes.

A barcode scanner also differs from the general document scanner listed among related peripherals: a document scanner produces an image file, whereas a barcode scanner outputs decoded text only, typically without saving any image.

In everyday language

A barcode scanner is a device that reads those striped or square patterns printed on products, parcels and tickets. It shines light on the pattern, sees which parts are dark and which are light, and turns that into the number or text hidden inside.

For the computer, the scanner behaves almost like a very fast, very accurate typist. Instead of a cashier typing thirteen digits for each item, the scanner reads them in a blink and sends them straight to the till. The key point is simple: it saves time and prevents typing mistakes.

Seen in the real world

A regional parts distributor receives about 400 inbound cartons a day. Before introducing scanners, staff typed each Code 128 shipment number into the warehouse system by hand, and roughly one carton in a hundred was booked against the wrong order. The company equipped its receiving desk with corded area imagers in USB keyboard mode and gave pickers Bluetooth imagers with extended-range reading for labels on upper racks.

Each scanner was configured by scanning programming barcodes to enable only Code 128 and Data Matrix and to append a carriage return after every read. Within the first month, receiving time per carton fell from about 40 seconds to under 10 seconds, and booking errors almost disappeared, because the check characters in Code 128 rejected damaged reads instead of letting wrong numbers through.