Barcode reader

From Wikipedia, the free encyclopedia

A typical barcode scanner.
Enlarge
A typical barcode scanner.

A barcode reader (or barcode scanner) is a computer peripheral for reading barcodes printed on various surfaces. Like a flatbed scanner, it generally consists of a light source, a lens and a photo conductor translating optical impulses into electrical ones. Additionally, nearly all barcode readers currently produced contain decoder circuitry analyzing the barcode's image data provided by the photo conductor and sending the barcode's content to the scanner's output port.

Contents

[edit] Types of Barcode Readers

Many different types of barcode scanners are available. They can be distinguished as follows:

[edit] By light source

  1. LED scanner : also referred to as CCD scanners, even though the CCD is in fact the photo imaging sensor, not the light source.
  2. Laser scanner : scans one dimensional or "linear codes". Typically less rugged than LED scanners since they have moving parts.
  3. 2D Imaging scanner : These scanners take a 2D image of the barcode as in a camera and can be used to scan 2D barcode types such as Datamatrix as well as the more common linear barcode types.

[edit] By housing

  1. Handheld scanner : with a handle and typically a trigger button for switching on the light source.
  2. Pen scanner (or wand scanner) : a pen-shaped scanner that is swiped.
  3. Stationary scanner : wall- or table-mounted scanners that the barcode is passed under or beside. These are commonly found at the checkout counters of supermarkets and other retailers.
  4. Fixed position scanner : an industrial barcode reader used to identify products during manufacture or logistics. Most often used on conveyer tracks to identify cartons or pallets which need to be routed to another process or shipping location.
  5. PDA scanner : a PDA with a built-in barcode reader or attached barcode scanner e.g. Grabba.

[edit] Types of Connectors

Most barcode readers use a PS/2 or USB cable for output: PS/2 cables are connected to the host computer in a Y formation, the PS/2 keyboard port with its first end, to the keyboard with its second, and to the barcode reader with its third end. The barcode characters are then received by the host computer as if they came from its keyboard decoded and converted to keyboard input within the scanner housing. Many readers can also be equipped with an RS-232 output port so that the decoded characters arrive at the computer via one of its RS-232 connectors. USB is supported by many newer scanners, in many cases a choice of USB interface types (HID, CDC) are provided.

There are a few other less common interfaces. The proprietary IBM interfaces (port 5B, port 9B and port 17) that use an SDL type connector and are based on an RS485 protocol. OCIA is sometimes still variety of connector types. Undecoded interface is an amplified output of the raw wave received back from the barcode and requires a decoder found, mostly used on older stand alone cash registers with a wide to be built into the terminal that the scanner connects to which is more common on industrial terminals. Wand emulation is another output type that takes the raw wave and decodes it, normalizing the output so it can be easily decoded by the host device. Wand emulation can also convert symbologies that may not be recognized by the host device into another symbology (typically Code 39) that can be easily decoded.

[edit] Barcode Symbologies

A Barcode Symbology defines the technical details of a particular type of barcode: the width of the bars, character set, method of encoding, checksum specifications, etc. A symbology is equivalent to a language. Each symbology has strengths and weaknesses. Many symbologies are around for historical or political reasons, while others have definite technical advantages.

In many systems, you must conform to a company-specified symbology. If this is the case, then you don't have much choice unless you can give the company a good reason to change. In other systems, you are given the choice to use any symbology you wish. Choose your symbology carefully. There are several factors to use in choosing a symbology, including:

Symbol Set: All symbologies have some limitations on the number of characters that can be encoded. UPC (Universal Product Code) is the most limiting. It is a numeric-only bar code that must consist of 11 digits. Furthermore, the value of these digits is determined by a grocery industry committee. Code 128 is the most flexible, with the full (128-character) ASCII set available.

Standards: Many bar code applications must share common bar codes between different vendors. The UPC symbology has a standards committee that assigns manufacturer and product codes for well over one million products. That is the reason that a product manufacturer can put a bar code on a package without fear of duplication. If you are in a situation where some type of industry committee has set up standards, it is frequently in your best interest to conform to that standard, even if it imposes other limitations.

Density: Each symbology can encode a different number of characters in a given space with all other factors being the same. Numeric-only bar codes such as Interleaved 2 of 5 can encode many more numbers in a given space than a more flexible symbology such as Code 128. In many cases this is critical. Even if one symbology is capable of making a bar code of the required size, you may get a better first read rate using a different symbology. Note that some scanners, particularly wands, are built for a particular density. Make sure that your input device matches the density of the bar code you will use.

Readability: Some bar codes are inherently more readable than others. For example, our tests show that Code 128 (which is one of the most flexible symbologies) is easily and successfully read by most readers. This is a case where the symbology is better in nearly every way than the competition. In other cases, you may sacrifice readability for some other requirement. Always use the most readable symbology you can, and test it using the actual equipment you plan to use.

Durability: Some symbologies are more durable than others. As a rule of thumb, those with better readability are more durable than others. You should always test your bar codes by subjecting them to some abuse and making sure your equipment will still read them.

Setup: Many bar code readers have certain symbologies disabled in their default configuration. If at all possible, it is best to use a symbology that the reader will read "out of the box." This will cut down on your setup time and reduce user confusion when a reader is added or replaced. If a new reader requires configuration, be sure to leave detailed instructions and materials at the site. (Keep a copy for yourself for when users lose the ones you gave them.)

Acceptance: Your bar codes may need to be compatible with those of companies you do business with. Whenever possible, use symbologies that are already in place.

Conflicts: Your bar codes should avoid conflicts. For example, if you disable symbologies that you're not using, you can keep an employee's candy bar out of your inventory.

Different kinds of Barcodes:

  • Numeric-only barcodes
  • Alphanumeric barcodes
  • 2-Dimensional barcodes

Numeric-only barcodes

EAN-13 - European Article Numbering international retail product code

EAN-13 is used world-wide for marking retail goods. The symbol encodes 13 characters: the first two or three are a country code which identify the country in which the manufacturer is registered (not necessarily where the product is actually made). The country code is followed by 9 or 10 data digits (depending on the length of the country code) and a single digit checksum. 2-digit and 5-digit supplemental barcodes may be added for a total of 14 or 17 data digits.

The checksum is a Modulo 10 calculation:

  • Add the values of the digits in the even-numbered positions: 2, 4, 6, etc.
  • Multiply this result by 3.
  • Add the values of the digits in the odd-numbered positions: 1, 3, 5, etc.
  • Sum the results of steps 2 and 3.
  • The check character is the smallest number which, when added to the result in step 4, produces a multiple of 10.

Example:

  1. Assume the barcode data = 001234567890
  2. 0 + 2 + 4 + 6 + 8 + 0 = 20
  3. 20 * 3 = 60
  4. 0 + 1 + 3 + 5 + 7 + 9 = 25
  5. 60 + 25 = 85
  6. 85 + X = 90 (nearest equal or higher multiple of 10), therefore X = 5 (checksum)

Here is a sample Visual Basic function to calculate the checksum:

   Function Append_EAN_Checksum(RawString as String)
       
       Dim Position as Integer
       Dim CheckSum as Integer
       
       For Position = 2 to 12 step 2
           Checksum = Checksum + Val(Mid$(RawString, Position, 1))
       Next
       
       CheckSum = CheckSum * 3
       
       For Position = 1 to 11 Step 2
           CheckSum = CheckSum + Val(Mid$(RawString, Position, 1))
       Next
       
       CheckSum = CheckSum Mod 10
       CheckSum = 10 - CheckSum
       
       If CheckSum = 10 Then
           CheckSum = 0
       End If
       
       Append_Ean_Checksum = RawString & Format$(CheckSum, "0")
       
   End Function

Many countries have EAN coding authorities which regulate the use of retail barcodes. For names, addresses, and telephone numbers, check our list of standards organizations


EAN-8 - Compressed version of EAN code for use on small products

EAN-8 is a shortened version of the EAN-13 Code. It includes a 2 or 3 digit country code, 4 of 5 data digits (depending on the length of the country code), and a checksum digit. While it is possible to add a 2-digit or 5-digit extension barcode, the primary purpose of the EAN-8 code is to use as little space as possible.

Unlike the UPC-E symbol, this compresses data that could also be printed as a full-size UPC-A symbol by squeezing out zeroes, the data digits in an EAN-8 symbol specifically identify a particular product and manufacturer. Since a limited number of EAN-8 codes are available in each country, they are issued only for products with insufficient space for a normal EAN-13 symbol. For example, a 2-digit country code permits a total of only 100,000 item numbers.

UPC-A - Universal product code seen on almost all retail products in the USA and Canada

UPC-A is used for marking products which are sold at retail in the USA. The barcode identifies the manufacturer and specific product so point-of- sale cash register systems can automatically look up the price.

The UPC-E symbol for small items The UPC-E code is a compressed barcode which is intended for use on small items. Compression works by squeezing extra zeroes out of the barcode and then automatically re-inserting them at the scanner. Only barcodes containing zeroes are candidates for the UPC-E symbol. The Uniform Code Council is very stingy when it comes to handing out manufacturer ID numbers with extra zeroes; these are reserved for products which have a genuine need for the UPC-E symbol. If you need a small symbol, tell the UCC when you apply for a manufacturer's ID number and be prepared to substantiate your need.

Structure of the UPC-A Code

UPC-A encodes 12 numeric digits. The first digit identifies the numbering system being used:

• 0: regular UPC codes • 1: reserved • 2: random weight items marked at the store • 3: National Drug Code and National Health Related Items code • 4: no format restrictions, for in-store use on non-food items • 5: for use on coupons • 6: reserved • 7: regular UPC codes • 8: reserved • 9: reserved

The next group of 5 digits identifies the manufacturer. This number is assigned by the Uniform Code Council (UCC). The next 5 digits identify the particular product and are assigned by the manufacturer. The last digit is a Modulo 10 checksum.

Calculating the Checksum The checksum is a Modulo 10 calculation.

1. Add the values of the digits in positions 1, 3, 5, 7, 9, and 11. 2. Multiply this result by 3. 3. Add the values of the digits in positions 2, 4, 6, 8, and 10. 4. Sum the results of steps 2 and 3. 5. The check character is the smallest number which, when added to the result in step 4, produces a multiple of 10.

Example:

Assume the barcode data = 01234567890

1. 0 + 2 + 4 + 6 + 8 + 0 = 20 2. 20 X 3 = 60 3. 1 + 3 + 5 + 7 + 9 = 25 4. 60 + 25 = 85 5. 85 + X = 90 (next highest multiple of 10), therefore X = 5 (checksum)

2-Digit Supplemental Codes for Periodicals

A UPC-A code may be augmented with a two-digit supplemental barcode to indicate the issue number for a periodical. Weekly publications are generally numbered 1-52, while semi-monthlies are numbered 1-24 and monthlies 1-12. Here is an example for issue No. 3:

Audio and Video Recordings Companies which produce recordings are assigned a 6-digit number. The final digit of the company identification also serves as the first digit of the selection number, and can be requested on the application to the Uniform Code Council.

Code Audio Recordings Video Recordings 0 n/a n/a 1 12" LP or 12" single 12" CDV 2 CD, CD-ROM, CDI, VCD n/a 3 n/a VHS 4 Cassette, Maxi-Cassette, Cassette Single n/a 5 DCC BETA 6 n/a Laserdisc 7 7" single n/a 8 MiniDisc 8mm tape 9 DVD (all music formats) DVD music video

The next 4 digits encode the rest of the selection number. In the past, the RIAA recommended using the 11th digit to indicate the type of recording medium. However, by request of the UCC, the RIAA no longer recommends this.


UPC-E - Compressed version of UPC code for use on small products.

UPC-E is a variation of the UPC-A symbol that is used for number system 0. By suppressing zeroes, UPC-E codes can be printed in a very small space and are used for labeling small items.


In addition to the requirement that the first digit of the barcode (number system) must be zero, there are four rules that determine what UPC codes can be printed using the compressed UPC-E format: • If the last 3 digits of the manufacturer's number are 000, 100, or 200, the valid product code numbers are 00000 - 00999 (1,000 numbers). • If the last 3 digits of the manufacturer's number are 300, 400, 500, 600, 700, 800, or 900, the valid product code numbers are 00000 - 00099 (100 numbers). • If the last 2 digits in the manufacturer's number are 10, 20, 30, 40, 50, 60, 70, 80, or 90, the valid product code numbers are 00000 - 00009 (10 numbers). • If the manufacturer's number does not end in zero, the valid product code numbers are 00005 - 00009 (5 numbers).


Code 11 (USD-8) - Used primarily for labeling telecommunications equipment

Code 11 is used primarily for labeling telecommunications equipment. The character set includes the digits 0 through 9, a dash ( - ), and a start/stop code. Each character is encoded with three bars and two spaces.

Character Bar Space Bar Space Bar 0 0 0 0 0 1 1 1 0 0 0 1 2 0 1 0 0 1 3 1 1 0 0 0 4 0 0 1 0 1 5 1 0 1 0 0 6 0 1 1 0 0 7 0 0 0 1 1 8 1 0 0 1 0 9 1 0 0 0 0 - 0 0 1 0 0 S/S 0 0 1 1 0


Of these five elements, there may be two wide and three narrow, or one wide and four narrow. Wide elements represent a binary 1 while narrow elements represent a binary 0.Two check digits, named C and K, are used; often only the first check digit (C) is used when the length of the data is 10 characters or fewer.

The check digits are the result of a Modulo 11 division of the sum of the products of each digit times a weight factor. The weights for the C check digit range from 1 to 10 while the weights for the K check digit range from 1 to 9. Weights start at the right end of the data and increment towards the left. The dash character has a value of 10 for purposes of check digit calculation.

1. Starting at the right end of the data, assign a weight to each character starting with 1 and incrementing to 10. If the data is longer than 10 characters, cycle back to 1 and continue.

2. Calculate the product of each data character times its weight. For the dash use a character value of 10. 3. Sum the products, divide by 11, and take the remainder 4. Append the result of Step 3 to the end of the data. 5. Starting at the right end of the data which now includes the C check digit, assign a weight to each character starting with 1 and incrementing to 9. If the data is longer than 9 characters, cycle back to 1 and continue. 6. Calculate the product of each data character times its weight. 7. Sum the products, divide by 11, and take the remainder.

Format the complete barcode by concatenating a start character + data + C + K + stop character.


Interleaved 2 of 5 (Code 25, I2of5, ITF, I25) - Compact numeric code, widely used in industry, air cargo, other applications

Interleaved 2 of 5 is a numeric-only barcode widely used in warehouse and industrial applications. The data must consist of an even number of digits.

Each data character is composed of 5 elements, either 5 bars or 5 spaces. Of these 5 elements, two are wide and three are narrow. Adjacent characters are interleaved, alternating the spaces from one character with the bars of the other.

Note: on the "Code 25" name": Interleaved 2 of 5 are sometimes referred to as Code 25. This is not a precise term, as Code 25 is also sometimes used to mean Standard 2 of 5 or Industrial 2 of 5.


Alphanumeric barcodes Code 39 (3 of 9) - General-purpose code in very wide use world-wide

Code 39 is widely used in many industries and is the standard for many government barcode specifications, including the U.S. Department of Defense. Code 39 is defined in American National Standards Institute (ANSI) standard MH10.8M-1983, and is also known as USD-3 and 3 of 9.

The Code 39 character set includes the digits 0-9, the letters A-Z (upper case only), and the following symbols: space, minus (-), plus (+), period (.), dollar sign ($), slash (/), and percent (%). A special start/stop character is placed at the beginning and end of each barcode. The barcode may be of any length, although more than 25 characters really begin to push the bounds.

Each character consists of 9 elements: 5 bars and 4 spaces. Each character includes 3 wide and 6 narrow elements. Characters are separated by an inter-character gap which is the same width as a narrow bar. The ratio of wide: narrow bar width may be in the range of 1.8 to 3.4. Barcodes with a narrow bar width of less than 0.020 inches (0.508mm) should have a ratio of at least 2.5. A ratio of 3.0 is recommended. Every Code 39 barcode should be preceded and followed by a quiet zone the width of at least 10 narrow bars.

Code 39 does not require a checksum, although a modulo 43 check digit may be appended for increased data integrity (the Mod 43 checksum is seldom used). Code 39 is just about the only type of barcode in common use that does not require a checksum. This makes it especially attractive for applications where it is inconvenient, difficult, or impossible to perform calculations each time a barcode is printed.

For example, when performing a word processor merge operation there is generally no easy way to calculated a checksum if one of the merge data fields is to be bar-coded. With Code 39, however, no checksum is needed; the merge template document must simply add a fixed asterisk (*) before and after the data and print the field using a Code 39 barcode font.

Tips: Code 39 can be read by just about every scanner on the market. It is widely used for in-house solutions; that is, applications where the barcodes will be used internally. It is also used for transferring data between companies. For example, the Automotive Industry Action Group (AIAG) defines a set of labeling standards for marking inter-company shipments within the industry; these labels use Code 39.

When planning a system, a useful technique to help protect against errors is to include a prefix character in every barcode. For example, product identification numbers might begin with a "P" while quantities might begin with a "Q". If the operator is asked to scan a part number, the scanner can check for the presence of the "P" prefix and immediately reject the scan if it is not there.


Code 93 (USS-93) - Compact code similar to Code 39

Code 93 is a more compact version of Code 39. It encodes exactly the same characters as Code 39, but uses 9 barcode elements per character instead of 15. The Modulus 43 checksum is optional, just as with Code 39.

Code 128 - Very capable code, excellent density, high reliability; in very wide use world-wide

Code 128 provides excellent density for all-numeric data and good density for alphanumeric data. It is often selected over Code 39 in new applications because of its density and because it offers a much larger selection of characters. The Code 128 standard is maintained by AIM (Automatic Identification Manufacturers).

The Code 128 character set includes the digits 0-9, the letters A-Z (upper and lower case), and all standard ASCII symbols and control codes. The codes are divided into three subsets A, B, and C. There are three separate start codes to indicate which subset will be used; in addition, each subset includes control characters to switch to another subset in the middle of a barcode.

• Subset A includes the standard ASCII symbols, digits, upper case letters, and control codes. • Subset B includes standard ASCII symbols, digits, upper and lower case letters. • Subset C compresses two numeric digits into each character, providing excellent density. Here is a sample that contains 12 digits; compare its size to the sample at the top of the page that contains 12 assorted characters:

Each character is 11 times the width of the narrowest bar; using a minimum bar width of 0.010" each character would be 0.11" wide. Using the 0.010" figure, 20 data characters plus start code, check digit, and stop code would measure 2.55" wide (the stop code is 13 times as wide as a narrow bar). Using Subset C with all-numeric data provides 2:1 compression of the data for a total width of 1.45".

Each character consists of 3 bars and 3 spaces, each of which may be 1, 2, or 3 elements wide (1 element = 1/11th of the character width). The bars always use an even number of elements and the spaces use an odd number. This provides the basis for a character-by-character consistency check during scanning. In addition, each Code 128 barcode includes a Modulo 103 checksum.

The Checksum

Calculating the checksum can be a little tricky. Each Code 128 character has a numeric value from 0 to 102. In Subset A and B, the numeric value of a character is its ASCII code minus 32. For instance, a space (ASCII 32) has a value of 0, the exclamation point (ASCII 33) has a value of 1, etc. Subset A permits printing of ASCII control characters, those with ASCII codes between 0 and 31. For these characters add 64 to the ASCII code to obtain the numeric value. For example, the value of NUL (ASCII 0) is 64, SOH (ASCII 1) is 65, STX (ASCII 2) is 66, etc. Subset C prints numeric digits in pairs, and the value of the character for checksum purposes is the numeric value of the pair (00, 01, 02... 99).


To calculate the checksum, follow these steps:

1. Initialize the checksum variable with the value of the start character (103, 104, or 105 for Subsets A, B, or C, respectively). 2. Initialize a multiplier to 1. 3. Starting at the left end of the barcode data, add the numeric value of each character times the multiplier to the checksum. Increment the multiplier after each character. 4. Divide the result by 103. The remainder is the checksum. 5. Convert the numeric checksum into an ASCII character.

The details of converting the numeric checksum to an ASCII character may vary depending on the particular font being used. Special handling may be required in cases where the resulting ASCII character code equals zero or is above 95.

Generally speaking, in Subset A if the checksum is between 0 and 63 inclusive, add the checksum and the ASCII code for a space (32) to obtain the character code. If the checksum is 64 or higher, subtract 64 to obtain the character code. In Subset B, add the checksum and the ASCII code for a space (32). In Subset C, the checksum is the ASCII value of the character.


2-Dimensional barcodes

PDF-417 - Excellent for encoding large amounts of data

PDF-417 is a two-dimensional barcode which can store up to about 1,800 printable ASCII characters or 1,100 binary characters per symbol.

The symbol is rectangular; the shape of the symbol can be adjusted to some extent by setting the width and allowing the height to grow with the data. It is also possible to break large amounts of data into several PDF-417 symbols which are logically linked. There is no theoretical limit on the amount of data that can be stored in a group of PDF-417 symbols.

The capacity of PDF-417 can be helpful in applications where the data must travel with the labeled item, where a host database is not always available for quick look-up. PDF-417 is being used for hazardous materials labeling; storing technical specifications and calibration data on electronic instruments; encoding fingerprints and photographs on the backs of drivers' licenses.

The maximum data density is determined by the smallest elements which can be reliably printed and scanned. Using the smallest recommended element size of 0.0075 inch wide and 0.010 inch high, the maximum data density in the binary mode is 686 bytes per square inch (106.2 bytes per square centimeter). In the printable ASCII mode the density is 1,144 characters per square inch (177.2 characters per square centimeter).

PDF-417 symbols require a 2-D scanner; or a standard CCD or laser scanner and special decoding software (a wand scanner will not work). A number of scanners are on the market using both laser and CCD camera technologies. PDF-417 symbols can be printed using most professional-grade thermal transfer label printers on the market.

DataMatrix - Can hold large amounts of data, especially suited for making very small codes

DataMatrix is a two-dimensional barcode which can store from 1 to about 2,000 characters. The symbol is square and can range from 0.001 inch per side up to 14 inches per side. As an example of density, 500 numeric only characters can be encoded in a 1-inch square using a 24-pin dot matrix printer. The sample shown above encodes 20 ASCII characters.

DataMatrix is being used to encode product and serial number information on electrical rating plates; to mark of surgical instruments in Japan; to identify lenses, circuit boards, and other items during manufacturing.

DataMatrix symbols require a 2-D scanner; they cannot be read using an ordinary linear barcode scanner. A number of scanners are on the market using both laser and CCD camera technologies. DataMatrix symbols can be printed using most professional-grade thermal transfer label printers on the market.


MaxiCode - Fixed length, used by United Parcel Service for automated package sorting

MaxiCode is a fixed-size code which holds up to 93 data characters. The symbol is composed of a central bulls-eye locator and offset rows of hexagonal elements; the overall dimensions of the symbol are approximately 1.11 x 1.054 inches. Each element measures 0.035 x 0.041 inches.

Created by United Parcel Service, the MaxiCode symbol was designed for quick automated scanning of packages on high-speed conveyor lines (special cameras can read a MaxiCode on a carton traveling at up to 500 feet per minute).

A 2-D scanner is required; MaxiCode cannot be read using an ordinary linear barcode scanner. The Barcode Software Center carries several label design and printing programs that can create MaxiCode symbols; we also have function libraries for programmers, programs for creating master artwork, and add-in hardware modules for Hewlett-Packard printers.


QR Code - Used for material control and order confirmation

The QR Code (Quick Response Code) is a 2-dimensional matrix code. It can encode up to 2509 numeric or 1520 alphanumeric characters and offers three levels of error detection.

The smallest QR Code measures 21 X 21 cells (each cell encodes one bit) and can grow in increments of 4 cells to a maximum size of 105 X 105 cells. The squares in the bottom left, top left, and top right corners are locator patterns.

The QR Code was developed in Japan by the Nippondenso Company; it was introduced in 1994 at the Japan Scan-Tech show and was submitted to AIM for consideration as a standard in 1996.

[edit] Uses

It is used in many important places like:

  • Supermarkets
  • ID recognition
  • Product ID Recognition
  • Book Tag Identification

[edit] See also

[edit] Barcode Reader Manufacturers