BAR CODES

 

1985

 

 

What those banded patterns mean, and microcomputer products for reading and writing them

 

By Leslie Solomon

 

THERE is one aspect of computers that has become a part of every one’s life—whether he knows anything about computers or not. This is the bar code that, in the last few years, has been imprinted on practically every thing we buy—from magazines and books to packaged foodstuffs. In fact, bar codes are found on just about any item that can be inventoried. There are even magazines and books, publishing mostly computer software, that use bar codes to simplify program entry.

 

Bar codes are digital messages whose data are encoded as a series of dark bars and light spaces arranged across a simulated sticker. The data provides information on the item to which it is affixed—information required to maintain a complete record of that particular product. This may include its description, its generic identification, its price, its inventory control number, etc.

 

There is no “standard” bar code, and each of those described here came about with a particular purpose in mind. The only thing that can be considered standard is that each code is composed of a series of wide and narrow dark bars and light spaces (two-level code), in which a wide bar or space represents a binary 1 while a narrow bar or space represents a binary 0 — or vice versa. (Although the bars and spaces making up a bar code may look familiar to digital enthusiasts, the binary systems used in bar codes are not in the ASCII format.)

 

Not all bar codes include alphabetic characters, although all of them do include numeric symbols and special control (nonprinting) characters. Many bar codes have a prefix (tag) that is used to define the value of a narrow width. Once this has been decoded, binary values of 1 or 0 are assigned to the other bars and spaces depending on their respective widths.

 

Some bar codes pass information only via the dark bars while others use

groups of bars and spaces to represent a single coded character. Some use color contrast or changes in reflectivity between the bars and spaces. (For example, a reflective space could be a binary 0 while a non-reflective bar or space would be interpreted as a binary 1.) To keep the data “honest,” most codes use some form of parity or checksum check after each character.

 

Decoding

 

Bar-code decoding is similar to data flowing from a modem into the serial port of a computing system. In both cases, the digital data that started out as a series of is and Os have been converted into another form.

 

In the case of the modem, two discrete tones are used, one for a digital 1 and another for a digital 0. In the case of the bar code, one element of a particular bar code represents a digital 1 while another element represents a digital 0. In both instances, special techniques are used to convert the codes into binary signals of the required voltage level.

 

In the basic example shown in Fig. 1, the photo-sensitive device is connected in series with R1 between the positive voltage and ground. (Note that this circuit is for illustration purposes only. Actual circuits may be quite different.) When the photoresistor is dark, its resistance is maximum, which may be sever hundred thousand ohms or more. When the sensitive surface of the photoresistor is illuminated, its resistance drops very low. Thus, as the black-and-white pattern (illuminated by an external light-source) passes in front of the photosensitive device, the output of the amplifier will be high when the dark element is present, and low when the light element is present.

 

The main element of most bar-code readers is a relatively small, hand-held “wand” that contains a light source, photodetector, and an electronic circuit used to shape the photodetector signal (Fig. 2). In operation, light from the light source is focused at a point slightly in front of the wand-tip opening and is reflected back into the probe where it is focused on the sensitive surface of a photodetector. An amplifier/shaper converts the slow rise-and-fall times of the analog output signal into crisp, sharp-edged signals (at the required voltage levels) for computer entry.

 

Although two discrete elements are shown in Fig. 2A for the light source and photodetector, at least one company (Hewlett-Packard) has produced a composite unit—the HEDS-l000 High Resolution Reflectance Sensor—that contains the light-emitter, photodetector, and lenses. The cable connecting the wand to the computing system also carries the required power leads.

 

In a typical wand, the optical sensor can read a bar code having widths as small as 0.3 mm (0.012 inch). This makes it ideal for reading bar codes produced by dot-matrix printers. Most light sources and sensors are designed for black-and-white bar-code displays, but there are some wands that read colored bar codes.

 

As the decoded data flow into the associated computer system, the software “waits” until a character is complete before entering it into the system.

 

Since most bar codes are read with a hand-held scanner, the proper reading technique is important. The desired scan trajectory is usually straight across the bars from left to right. However, some codes can be read bidirectionally. The trajectory can be at a slight angle, of course, but it must cut all the bars. The scanning velocity—how fast the wand tip should pass over the bar code— usually ranges from 3 to 30 inches per second. (Manufacturers of bar code equipment usually specify a range.)

Since both the light source and photo detector within the wand are focused at the tip of the shroud, when reading a bar code, the wand must be angled as close to 90 degrees from the printed material as possible. The H-P HEDS-l000 detector will function properly if it is within 30° from the vertical. Failure to follow this rule may produce a faulty readout.

 

Codes

 

Several bar codes have been introduced, some better than others. But, as previously mentioned, there is no standard. Here we will attempt to provide enough information so that the reader will know the essential operation and purpose of each of the bar codes now in use.

 

The 2-of-5 Family. This industrial bar code gets its name from the use of two wide elements per five-element character. There are three members of the family industrial, matrix, and interleaved.

 

The bar code itself is formed from black bars and white spaces to provide the numeric character set from 0 to 9. In this case, a wide element (two to three times wider than a narrow element) is a binary 1 while a narrow element is a bi nary 0. Other features include non character start/stop, bar/space pattern, numeric data from 0 to 9, plus six special characters. Four different start/stop characters are available to allow the use of different data bases.

 

As its name suggests, this code uses seven binary bits of information en coded within the bars and spaces of each character. Two of these elements are bi nary is.

 

The 2-of-7 code can use a total of 18 different widths for bars and spaces. This structure was designed to account for printing errors, a problem common to early printers.

 

Code 11. This bidirectional bar code features 11 characters, including the ten numerics from 0 to 9, and the dash (—) symbol. A twelfth is used as a start/stop character. Each character is encoded in five binary bits formed from three bars and two spaces. However, not all characters have two wide elements out of the five. Instead, eight characters (1 through 8) have two wide elements while the other three (0, 9, and—) have only one wide element. This makes Code 11 non-self-checking.

 

Universal Product Code (UPC). The UPC bar code, the most commonly recognizable code, was designed for use with automatic checkout equipment to improve productivity in the grocery industry. Today, almost every grocery store item carries the code.

A 10-digit numbering system was adopted for product identification. Each participating supplier is issued a 5 digit manufacturer’s identification number, with the remaining five digits assigned to generic product categories (tomato soup, canned peas, tissue paper, etc.). The 10-digit number, called UPC A is combined with error-checking features and encoded. Certain small items, cigarette packs for example, use the UPC-E code which consists of only five characters without a checksum. Without the checksum, the E-version is less reliable than the A version.

 

The right and left ends of the UPC code (Fig. 4) contain a guard bar pattern (bar-space-bar) to prevent tampering. The first five encoded characters are separated from the second five by a tall space-bar-space-bar-space pattern. The numbers that have been encoded are seen under the bar code and are designed for use by an optical character recognition system.

 

Unlike the other bar codes, the printed UPC bar code provides only half of the desired information. The parallel light and dark bar pattern is properly called the “bar code” to distinguish it from the “UPC code” that it represents. The data encoded in the bars include only the manufacturer’s specifications. They do not include price or other store information. To complete the data, the 10-digit binary code is entered into a computer with a look-up table to append the required information.

 

The look-up table is created by the store management and can be updated for pricing or other information as needed.

 

What’s Available

 

Industrial bar-code readers have, for many years, been used for data capture in portable systems and as minicomputer and mainframe peripherals for ware house inventory control. Some large-size (definitely not portable) bar-code readers have been installed at the checkout counters of large supermarket chains.

 

With the increasing popularity of microcomputers, several bar-code manufacturers are coming out with Wands and software that can be used with popular microcomputers. Here is a look at some products now available.

 

The Bar Code Reader Wand and Decoder from Intertelephon USA (1200 Levin Ave., Mountain View, CA 94040; 415-969-3175) uses a LED and photo detector to drive a microprocessor whose decoding algorithms are stored within an internal EPROM. Resolution is 0.3 mm width and the wand will re solve a line width or space as small as 0.2 mm. The preferred inclination of the wand to the printed bar code is plus or minus 15 degrees off the vertical.

     

Interface to the host computer is via the RS-232 port and software is provided to read most bar codes.

 

The decoder is available in two major configurations: stand alone, with a built-in speaker to alert the user that the code has been read and transmitted; and two pc-board arrangements, for use within a system.

 

The BarWand from Advanced Business Technology, Inc. (1180 Coleman Ave., San Jose, CA 95110; 408-2759880) uses the Hewlett-Packard HEDS 300Q Digital Bar Code Wand and inter faces with the Apple II, II+ and III computers. BarWand features 0.3-mm resolution, an integral push-to-read switch, and a seven-foot cable.

 

The Datawand from MSI Data Cor poration (34 Fischer Ave., Costa Mesa, CA 92626; 714-549-6000) is a little different than the other bar-code readers. Measuring 6.25” long and 0.85” in diameter, the l.8-oz wand is not cable connected to the host computer and reads, decodes, and stores up to 4000 digits of UPC/EAN bar code in its battery-powered CMOS memory. Provisions are made for tone and LED indications of good scan, delete, memory near full, memory full, and transmission complete. It transmits the decoded in formation only when it is placed in its charger. The pen like Datawand, at $265, can be carried in a shirt pocket.

 

The charger, called Datawell, not only serves as a recharger for Datawand’s internal NiCd batteries, it also interfaces with the host computer (8-bit ASCII, even parity, asynchronous) via a telephone line or an RS-232 port at 1200 bps. Reading velocity is 5 to 30 ips.

 

The Digital Wand 1.3 from Prodigital Systems, Inc. (1532 Elbridge St., Philadelphia, PA 19149; 215-744-5582) features a Hewlett-Packard HEDS-3000 wand, an interface and connector to piggyback with a parallel printer port, and software allowing control from BASIC, BASCOM, or dBase-II statements. Bar code formats supported include Codabar, Code 39, and UPC-A/E. Versions are available for the IBM PC and CP/M. The complete package, including disk software, is $399.95.

 

The PC-300 Bar Code Reader ($695) (TPS Electronics, 4047 Transport, Palo Alto, CA 94303; 415-856-6833) for the IBM PC (and clones) features a built-in CPU within its 6” x 5” x 1 3/4" enclosure. It is connected between the keyboard and the computer and does not require an RS-232 port. It reads Codabar and 3-of-9 codes. The PC-350 Bar Code Reader ($695) is similar, but for the DEC Rainbow computer.

 

The Series 200 Bar Code scanner ($789) from Caere Corp. (100 Cooper St., Los Gatos, CA 95030; 408-3957000) uses an RS-232 serial port or terminal. It reads 3-of-9, interleaved 2-of5, and UPC A and E codes. The wand is stainless steel and has 0.0 10” resolution, although a 0.006” resolution wand is available. The wand emits an audible beep on successful read. Baud rate and parity are switch selected. The PCS scanner ($745) is for use with the IBM PC and XT. The Series 240 bar code scanner is the same as the Series 200 but uses an IBM plug-in board. The Series 220 ($944) is for 3278-type displays for the IBM 3278, 3178, 5251, Memorex 2078, Telex 178, 278, Mohawk 2192, and ITT Currier 2700.

 

The Model 100 Bar Code Reader from Bi-Tech (10 Carlough Rd., Bohemia, NY 11716; 516-567-8155) features 0.3-mm resolution, and has a digital output suitable for TTL or CMOS. It was designed for the TRS-80 Model 100 Computer. Bi-Tech also offers the Epson HX-20 Bar Code Reader, obviously designed for the Epson HX-20 machine and the PC-820lA Bar Code Reader, for the NEC computer.

 

 

Copyright by Bill Bytheway, K7TTY February 2012