The first publication that I ever read concerning barcodes was one written by someone at NCR (National Cash Register) titled: "Keyless Data Entry". This was around 1973. The publication described a method of entering data into a Point of Sale System without having to use the keys. We had gotten to the point where Cash Registers had become data terminals attached to a main computer in large retail and grocery stores. This is why they were no longer even called Cash Registers. When the clerk "rang up" your items this new Cash Register did a lot more than total up your bill and calculate your change.
Actually, the clerk didn't even enter the price of the items any more; but rather a series of numbers that described what the item was. This number was sent to the computer. The computer looked up the price and sent it back to the Point of Sale System and also subtracted the product from the store inventory. When the inventory got low enough the computer could process the paperwork to order more products. The computer also compiled various reports for the store management so they knew all about their inventory; what the fast moving products were; the slow moving ones and a lot of other things about how their store was running. Of course the key to accurate transactions and accurate information for management all relied on the clerk entering those numbers accurately.
Well, It didn't take long to realize that human beings are not very good at reading a series of numbers from an object and entering them correctly on a keyboard. A lot of mistakes are made, especially when the clerk is expected to do this hundreds or even thousands of times a day.
People just aren't good at this kind of thing! Somehow, a method had to be devised to mark the necessary information on each product in a manner that some type of "machine" could read the information accurately provided that the clerk just held the item so the machine could see this special marking. It would also be necessary that this special marking be added to the product at very little or no cost.
The bars are either wide or narrow and the spaces between the bars are likewise either wide or narrow. There are codes where more than two different widths are used but, as I said, I'm keeping it simple. The length of the bars have no significance other than to make it easier for the scanner to find the code.
Barcodes are printed using normal printing processes. Since most items that are identified by a barcode have some type of printed package or tag, the barcode can be added as part of the normal printing process.
Barcodes are "read" using some type of optical pickup.
There are many different types of optical pickups, or "scanners"
as they are usually called. We'll consider the simplest of these;
the barcode wand. The wand is a pen shaped scanner. It is held
like a pen and the scanning optics are in the tip. The wand is
passed over the code with the tip in contact, like drawing a line
through the bars. There are two basic components to any scanner;
a light source and a light detector. The light source projects
a spot of light onto the barcode. The detector looks at this illuminated
area through a narrow aperture, about the width of one of the
If the scanner is looking at a white space it receives a reflection. If it is looking at a black bar it receives little or no reflected light. White surfaces reflect light. Black surfaces absorb most of the light. As the wand is passed over the code the detector sees the white spaces and black bars. Now here's the important part. When the wand passes over a wide space the detector will see light for a longer time than when the wand passes over a narrow space. The same for the bars. A wide bar causes the detector to be dark for a longer time than a narrow bar. If we could see the electrical signal generated by the photodetector, it would look something like figure one.
The top signal represents the electrical output from the photodetector, while the bottom signal has been processed in preparation for decoding. Notice that bars generate a positive signal, while spaces generate a signal close to zero. So we can tell a bar from a space by the signal level. Notice that there are both wide and narrow pulses and spaces between the pulses. These represent the bars and spaces in the code.
Next this signal is analyzed by a microcomputer circuit programmed for the specific job of decoding barcodes. First the microprocessor times the duration of each of the pules and divides them into two categories wide and narrow. From this signal the microcomputer can reconstruct the original barcode as patterns of bars and spaces. In each type of barcode each character is represented by a specific pattern of bars and spaces.
Also the number of bars and spaces in each character is always the same. So the microcomputer can divide up the entire code into individual characters and then translate each individual pattern into the character it represents. Next, and last, the microcomputer has to send the decoded information to some other device that will use it. This is usually done using some type of computer data transfer protocol, like RS-232.
For more information about types of barcodes see Linear Symbologies and 2-Dimensional Symbologies.