BAR CODEs

BAR CODE FOR ACCESS CONTROL

The bar code was invented for product identification purposes. However, today it is also used for inventory, ID, security and access control, among other applications.

Bar codes are machine-readable symbols made of patterns of black and white bars. The specific arrangement of bars and spaces follow strict rules defined by the specific bar code “language”, named as symbology.

There are different styles of bar code symbologies, including 1D and 2D (1/2D means “one/two dimensional”, respectively), linear and circular. Here, we emphasize only the most common symbologies. Some of them have only numeric values, like Interleaved 2 of 5, and other ones accommodate alphanumeric information, like Code 39 and Code 128, just to mention a few.

The above examples are the classical/conventional bar codes. However nowadays already 2D codes exist, as the PDF417. 2D bar codes contain more information than the conventional one dimensional bar codes. Conventional bar codes get wider as more data is encoded. 2D barcodes make use of the vertical dimension to pack in more data. PDF417 is the latest development in the trend to pack the greatest amount of data in the smallest space.

Code 39

Code 39 (sometimes called Code 3 of 9, as Code 39 was a registered trademark till 1981) is one of the oldest and most popular bar code.

It’s used for ID, inventory, and tracking purposes. It is a discrete bar code, which means that a fixed pattern of bars represents a single character. Each character is made up of 9 bars (5 black and 4 white bars), 3 of them are wider than others. Except for characters $, /, +, and %, where all wider bars are white, for the 3 wider bars in each character, two of them are black bars and one is a white bar.

Note: sometimes “black bar” is referred as “bar”, while “white bar” is referred as “space”.
Logic ‘1’ is encoded as a wide element, while logic ‘0’ is encoded as a narrow element. Individual characters are separated by an inter-character space.

Taking as an example, the character “1” is represented in Figure 1, which corresponds to the code 100100001, where black bars encode 10001, and white bars encode 0100.

bar code 39

Figure 1 Representation of character “1” using Code 3 of 9

The Code 39 barcode symbology supports the following 43 characters (36 numeric and upper case alphabetic characters, and seven special characters):

1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ-.$/+% SPACE.

Beyond these characters an additional one is used: the character *, used only as start and end symbol, which is not part of the data.

Figure 2 presents the encoding scheme for the supported set of characters. It is clear that the white bars part of the code allows the identification of a group of characters, with special interest for reader implementations.

Code 3 of 9 character set encoding

Figure 2 Code 3 of 9 character set encoding

Normally is not used a check digit within code 39, but for specific applications is possible to include one check digit as the last data character. In those cases, the check digit is the modulus 43 of the sum of the all character values in the message. Figure 3 shows the character and value used for this calculation.

check digit calculation

Figure 3 Character associated values for check digit calculation

As an application example, consider that we need to produce a label with the following nine-character string: 12345ABCD. For check digit calculation purposes, we have the following:


Data: 12345ABCD
Sum of values: 1+2+3+4+5+10+11+12+13 = 61
99 divided by 43 = 1 remaining 18. Therefore the check digit is I.

In this sense, the label should be produced containing *12345ABCDI* (including start and end symbol *, and check digit I, in this situation), as presented in Figure 4.

Label encoding example in 3 of 9 Code

Figure 4 Label encoding example in 3 of 9 Code

Code 128

Other common alphanumeric bar code is Code 128. It is used extensively by the shipping industry as well as for inventory, ID, and tracking purposes. Code 128 is part of many labelling specifications.

Code 128’s character set supports the lower 128 ASCII (American Standard Code for Information Interchange) characters, including upper and lowercase letters, numbers, punctuation, and control codes. Code 128 bar codes include a mod 103 check digit to insure data integrity.

Due to a specific encoding technique, Code 128 is much dense than Code 39 and is the choice whenever space is a concern. To achieve this purpose the code has three different character sets: Code Set A allows encoding all the standard alphanumeric keyboard characters plus control characters and special characters;

Code Set B includes all standard alphanumeric keyboard characters plus lower case alpha and special characters; and Code Set C includes a set of 100 digit pairs from 00 to 99 and can be used to double the density of encoding numeric-only data.

Within a symbol, one can shift between code sets by using the special character CODE and SHIFT. The CODE character shifts the code for all subsequent characters to the specified code set. The SHIFT character just changes the next character and only changes between Code Set A and Code Set B or the reverse.
The barcode symbol structure consists of:

  • A quiet zone, or white space to the left of the bars
  • Start character
  • A variable number of data characters
  • Check digit
  • Stop character
  • A quiet zone or white space to the right of the bars

Figure 5 presents an example of the referred structure

bar code 128

Figure 5 Code 128 example

The quiet zone should be at least ten times the width of the narrowest bar/space element.
Each character in the bar code symbol is composed of three bars and three spaces.

(The stop character has four bars and three spaces as the final symbol will always have a final (extra) bar). Each bar or space can use one of four different unit widths. The narrowest possible bar or space will thus be one quarter the width of the widest.

2 of 5 code

A third code bar that deserves individual presentation is the 2 of 5 bar code families. It is used throughout the shipping industry. We can found it on the sides of corrugated boxes and are also used by the medical industry and in laboratories.

There are three well-known members of this family: the Industrial, Matrix and Interleaved. In common, all of them use five binary elements to encode each character, and they have the following characteristics:

  1. Two wide elements per five-element character;
  2. Black bars and white spaces
  3. Numeric-only character set
  4. Binary encoding: wide= 1 and narrow=0; a wide element is typically two to three times wider than a narrow element width

The encoding scheme used by this family of bar codes is presented in Figure 6, and use the ten possible different encoding having two-1’s and three-0’s in a five-bit binary encoding scheme. It uses a quasi-weighted binary type with even parity.

The least significant bit (LSB) is located on the left, and the parity bit follows the most significant bit (MSB) on the right.
The weighted propriety allows the decoder to perform a simple calculation based on associated weights, rather than to perform a comparison search between decoded bit patterns and the specific pattern acquired from label reading. The only exception for the weighted propriety is the character ‘0’ (easily handled by the decoder algorithm).

2 of 5 bar code character set encoding

Figure 6. 2 of 5 bar code character set encoding

The oldest member of the 2 of 5 family is the Industrial 2 of 5 bar code. Each character is represented by five black bar elements, width modulated, separated by inter-element spaces. Each character is separated from the adjacent characters by an inter-character space. Figure 7 present a simple character representation using the Industrial 2 of 5 bar code.

Representation of character 2 using Industrial 2 of 5 bar code

Figure 7. Representation of character 2 using Industrial 2 of 5 bar code

The next member of the 2 of 5 family is the Matrix 2 of 5 bar code, where higher information density is possible through usage of black bars and white bars in the same character;
each character includes three black bars and two white spaces. In this sense, the inter-element spaces are removed; although, the inter-character space still is necessary. Compared to the Industrial 2 of 5, this will result in a 28%-33% information density improvement.

An even higher information density can be achieved with the elimination of the inter-character space. The Interleaved 2 of 5 bar code accomplished this goal as every pair of characters are encoded together, one using the black bars and the other one using the white spaces in between.

Figure 8 present a simple character representation using the Interleaved 2 of 5 bar code. As Interleaved 2 of 5 bar code doesn’t use a inter-character space, it is termed as a “continuous code”, in opposition to the other presented codes, termed as “discrete codes”, as they need a inter-character space.

Representation of characters 56 using Interleaved 2 of 5 bar code

Figure 8 Representation of characters 56 using Interleaved 2 of 5 bar code

Interleaved 2 of 5 bar code has the highest information density of the 2 of 5 family members. Interleaved is 36%-42% more dense than Industrial and 10%-12.5% more dense than Matrix. This is a very important feature, supporting its selection by many industries.

Bar code printing devices

For printing bar codes is possible to use any type of printer, namely laser, dot matrix or ink jet printers. However those printers have one or other serious limitation to print labels that are durable enough, or have the longevity and/or clarity required for the most of the applications using bar codes.

Printing techniques

Figure 9 Printing techniques

Figure 9 presents a list of commercial printing processes widely used for many years in many products that we can find in our everyday life.

From the practical point of view, for small volume printing, the most widely used technology for dedicated bar coding printing is direct thermal or thermal transfer printing. For large volume of pre-printed bar code symbols, any of the methods referred as having high throughput can be used.
Using those technologies we can obtain an excellent print quality with excellent readability.

An additional problem that can arise, especially for usage within access control applications, is how to deal with duplication of a specific printed bar code (we should be prepared to assure avoidance of duplication of a card used for access control). For that end, an infrared option is available for security-based applications, where bar codes are overprinted to prevent duplication or the bar code is covered with a dark plastic sheet, only readable using infrared.

Bar code readers

There are different readers available for bar code reading.
Bar codes are read by sweeping a small spot of light across the printed bar code symbol. The sweep starts at the white space before the first bar and continues passing the last bar and ends in the white space which follows the last bar.

Because a bar code cannot be read if the sweep wanders outside the symbol area, bar heights are chosen to make it easy to keep the sweep within the bar code area. As the length increases (longer the information to be coded, longer the bar code), the height of the bars must be increased to allow for more wandering during reading.
The words "reader" and "scanner" are often used interchangeable to des

cribe the device which is used to read a bar code. Strictly speaking, a bar code scanner only designates the opto-electronic part of the device which transforms the optical image of the bar code into electrical signals. A bar code reader, on the other hand, includes the bar code scanner and the decoder which transforms the electrical signal from the scanner into ASCII representations of the data. The preferred term is "bar code reader."
There are five basic types of barcode readers:

  1. A pen wand is the simplest barcode reader. It contains no moving parts and is known for its durability and low cost. A pen wand can present a challenge to the user, however, because it has to remain in direct contact with the bar code, must be held at a certain angle, and has to be moved over the bar code at a certain speed.
  2. A slot scanner remains stationary and the item with the bar code on it is pulled by hand through the slot. Slot scanners are typically used to scan bar codes on identification cards.
  3. A CCD (Charge-Couple Device) scanner has a better read-range than the pen wand and is often used in retail sales. Typically, a CCD scanner has a "gun" type interface and has to be held no more than one inch from the bar code. Each time the bar code is scanned, several readings are taken to reduce the possibility of errors. A disadvantage of the CCD scanner is that it cannot read a bar code that is wider than its input area.
  4. An image scanner, also called a camera reader, uses a small video camera to capture an image of the bar code and then uses sophisticated digital image processing techniques to decode the bar code. It can read a bar code from about 7 to 22cm away and generally costs less than a laser scanner.

A laser scanner, either hand-held or stationary, does not have to be close to the bar code in order to do its job. It uses a system of mirrors and lenses to allow the scanner to read the bar code regardless of orientation, and can easily read a bar code up to 60cm away. To reduce the possibility of errors, a laser scanning may perform up to 500 scans per second. Specialized long-range laser scanners are capable of reading a bar code up to 9 meters away.

Privacy | About Us
Copyright © 2008 Home Automation - JAEC - All the rights reserved