Barcodes: you can’t escape them, and all along the supply chain from raw source to end-user purchase, we can’t function without them. They are pre-printed on neatly everything we buy or use, they can be added later as stick-on labels, or they can be printed on demand as needed for custom projects.
Barcodes are now so ingrained in our thinking and logistical systems that we don’t give much thought to them, how they work, and how they came to be what they are. This FAQ will briefly explore the elements and function of the barcode itself and its overall system, as well as the interesting twenty-year-long path of their development and adoption.
Q: What is a barcode (sometimes written as bar code)?
A: Starting with the Universal Product Code (UPC) for retail products and sales (Figure 1), the basic barcode is a standard one-dimensional (linear) series of black bars printed on a white background, initially representing ten digits and then expanded to 12 digits. The bars have a variable width, similar to pulse-width modulation
Q: What are the elements of a barcode system?
A: In concept, it’s elegant and simple: there’s the printed code, a scanner which reads the code bars, decodes the numbers or alphanumeric characters they represent and sends them as data to a computer, and a database in the computer (Figure 2).
Q: What do the bars represent?
A: Although there are now many encoding schemes in use, the basic original structure of a barcode has a leading and trailing quiet zone, a start pattern, one or more data characters, (optionally) one or two check characters, and a stop pattern (Figure 3) in a standard field size. The system was initially designed for retail environments, and that first code scheme is still widely used, with some extensions.
Q: How does the barcode scanner (reader) work?
A: There are several types of scanners with different complexity, arrangement, and cost. A simple scanner (Figure 4), uses a red laser LED to illuminate the bars; as the scanner is moved manually across the bars, a photocell in the scanner reads the reflected light pattern and generates a stream of high and low signals (with dark/light level thresholds, of course).
The dark/light pattern and timing (remember, this is a pulse-width bar-encoding scheme) is then decoded to a string of 1s and 0s, which is further decoded to determine the actual character, and the rest is fairly straightforward.
Q: What’s the next scanner type?
A: The laser scanner uses a LED laser beam as the light source and directs the light across the barcode using a moving mirror or a rotating prism to scan the laser beam back and forth across the barcode. Some systems use a lower-precision version of a more-complex mechanical arrangement called a mirror galvanometer (Reference 9) to direct the laser in one or two dimensions (depending on chosen type), so it can easily read any barcode in any orientation. More-advanced scanners use a CMOS imaging array to “see” the barcode as a two-dimensional image rather than just a scanned linear dark/light response, and then interpret this image. There are also scanners which steer the LED beam using MEMS-based devices such as the digital micromirror devices and digital light projection technology from Texas Instruments, Reference 16.
You can also now use a smartphone as a barcode “scanner.” An app in the phone takes a picture of the barcode, then uses image-analysis software to interpret the bar pattern (Figure 5). Note that regardless of whether you are using a dedicated scanner, a video capture unit, or a smartphone, the same scanner hardware can used for different barcode standards (and there are many now standards in use, as well as proprietary ones) since the scanner’s front-end function is to “see” the light and dark patterns, while the interpretation s an independent back-end function.
Q: What are some of the virtues of the bar code?
A: In addition to its obvious benefits in supply-chain and retail management, the basic code itself costs nothing to add to a product if it is pre-printed (and add-on labels are cheap, too), and can be read by eye if it doesn’t scan properly, since the numbers are also printed under the bars. The cost of the scanning hardware is modest, and the return on investment for retailers (and others) was seen as very favorable soon after introduction.
Q: Do you have to use that standard encoding, or any of the dozen or so other standards now available?
A: It depends on the situation; for “external” use, yes. But nothing prevents a company or individual from setting up their own proprietary encoding scheme, barcode length, or printed field size, and there are many in use. Sometimes a standard code scheme and data set does not meet the needs, or perhaps there’s a need to prevent external access and insight. Some of the newer standards do allow the barcode to encode alphanumeric data (not just numbers), use longer fields, or barcode fields which are larger or smaller.
Q: Does the UPC barcode actually have the product name and information?
A: No, the barcode numeric (or alphanumeric) field) just an identifier of the vendor name and a product ID code. Once decoded, it is an entry to a table of stock-keeping units (SKUs). When the barcode is decoded, the vendor name and product number point to an entry in the database in the system computer, which then presents the information the system user needs to see, such a make, model, size, or price. Note that the UPC is “universal” and can be understood by any system designed for UPCs, as they are registered and listed, In contrast, an SKU is an internal number set up and used by the store, manufacture, or warehouse and can vary from site to site.
Q: It is standard In communication links to add a simple checksum of some sort as a basic way to ensure there are no errors, and sometimes a more complicated CRC (cyclic redundancy check), or even error detection and correction (ECC) scheme is used. What does the barcode system use?
A: For the standard 12-digit UPC retail coding, a simple checksum is used:
- First, add the digits in odd positions (digits 1, 3, 5, 7, 9 and 11).
- Multiply that number by 3.
- Add the digits in even positions (digits 2, 4, 6, 8 and 10).
- Add this sum to the value in step 2
- Take the number in Step 4, and then create a check digit by determining the number that, when added to the number in step 4, is a multiple of 10. So, if the number in step 4 is 106, then 106 + 4 = 110, and the check digit is 4. Add that to the end of the data field.
Q: What the error rate in scanning?
A: Answers vary, but the goal is not more than one scan error in millions of scans. Of course, this is separate from errors in matching the database or pricing; these are just scan-read errors.
Q: How are these UPCs assigned?
A: For retail items in commercial distribution (UPC in the US, or EAN in Europe), applications for a manufacturer number go through the Uniform Code Council; in Europe, it is EAN International in Belgium. The manufacturer pays an annual fee and the UCC issues the manufacturer a six-digit manufacturer identification number (for the newer 12-digit coding). The formal UPC symbol consists of both the machine-readable bar code and a printed, human-readable 12-digit UPC number underneath.
Q: How are the numbers physically encoded in the back bars/white spaces?
A: In the standard initial design of UPC coding), each digit is represented by a unique pattern of two bars and two spaces. The bars and spaces are variable-width modules and are 1, 2, 3, or 4 modules wide. The total width for a digit is always 7 modules; consequently, a 12-digit number requires a total of 7×12 = 84 modules. For more details (it gets complicated), Reference 8.
Q: Barcodes seem like a simple idea and scheme, so what did it take to make them happen?
A: Yes, it looks simple in hindsight, but was not. On the other hand, unlike some “lucky” or accidental developments or inventions, the barcode system is the result of a determined, highly focused project and effort driven not only by a presumption that it was something which retailers would want but by their tangible requests for a solution to a vexing problem. Part 2 will discuss this further.
- Photonics, “A History of the Laser“
- IEEE GlobalSpec Engineering 360, “Color TV: How One Man’s Obsession Produced a Technology Revolution“
- Explain That Stuff, “Barcodes and barcode scanners”
- The New York Times, “Who Made That Universal Product Code?”
- Simple Barcodes, “FAQs”
- Smithsonian, “The History of the Bar Code“
- ID History, “UPC History – ID History Museum”
- Wikipedia, “Universal Product Code”
- Laser Focus World, “Galvonometer Scanners: What you need to know to buy a galvo-positioner”
- Wasp Bar Code, “Barcode: The Ultimate Guide to Barcodes”
- How Stuff Works, “How UPC Bar Codes Work”
- Tal Technologies, “Barcode Basics”
- Barcodes, Inc., “Barcoding Frequently Asked Questions (FAQ)”
- TechSpirited, “Here’s How to Read Universal Product Code (UPC) Barcodes Easily”
- Washington University, “Bar code Encoding of Strings”
- Texas Instruments, “Overview for Display & Projection”