Barcodes are extensively used in every grocery, clothing and many other materialistic shops and industries to represent data like price of the commodity, the country code, company name etc.
The need of Barcode was felt when it became tedious for the vendors to keep track of the inventory and their prices. So now the solution of the above problem was scanned and their came various techniques to represent information on the commodities. Among them most popular was the use black and white lines, the information being coded and decoded by the absence and presence of lines.
In the year 1973, the Universal Product Code (UPC) symbol was invented. In 1974 the first scanning of the UPC barcode was made on a pack of chewing gum.
After that the UPC barcode was being extensively used for commercial purposes. After that there came a number of ways of representing a barcode, whether it be black and white lines or dots or patches.
The UPC barcodes were created for grocery stores to help in the checkout process and keep track of inventory, and later revolutionised the process in nearly every field.
The UPC barcodes are used extensively so here only these are discussed.
The UPC symbol consists of human readable 12- digit code along with the machine readable barcode. In these 12 digits, the first two depicts the country issuing the barcode, next four digits give the manufacturer identification number. Some countries may have 3-digit country code, corresponding to which the MID number will be of 3-digit. Next six digits correspond to the product code assigned by the manufacturer.
The last digit is called the check digit. The scanner undergoes a mathematical calculation for the previous 11 digits. Is the result equals the check digit, then the code is right, else there is something wrong with the code and the scanner rescans the bar code.
Now when the scanner scans the barcode of a product, the UPC number is sent to the base computer, which further sends back the actual price of the item.
Decoding the barcode
- Each UPC barcode begins and ends with 101 (‘0’ corresponds to the thin white line and ‘1’ to the thin black line).
- There are four different thicknesses corresponding to each white and black line. So the thinnest denotes ‘1’, then ‘2’, then ‘3’ and then the thickest denote ‘4’.
- Corresponding to these thicknesses each digit is assigned the pattern as follows: 0->3211, 1->2221, 2->2122, 3->1411, 4->1132, 5->1231, 6->1114, 7->1312, 8->1213 and 9->3112. The sum of these widths is 7, so it means that each code is 7 units wide.
- The first six digits are separated from last six digits by 01010. After that the barcodes reverse their pattern i.e it starts from black lines. This is done to provide some error checking for the scanner.
Now from this information you can try decode the bar code that would be labelled on any of your household material.
Types of barcode
The barcode discussed so far are called linear barcodes. Since these include spacings of parallel lines of white and black colour. These are also called 1-D barcodes. There are other types of barcodes that called 2-D barcodes that may be in the form of rectangles, dots, hexagons, patches and other different patterns.
The technique of decoding the 2-D barcodes is different from that for 1-D barcodes. They cannot be read by simple laser used for linear barcodes. 2-D barcodes are scanned by image based scanner. They are more costly but carry more information and data than that by 1-D barcodes. These are used in encoding URLs for cellular phone use and higher end applications.
- The illuminator illuminates the barcode with red light. The illumination can be done using red LEDs or with other light sources. The reflected light is sensed by the sensor present inside of barcode scanner.
- The sensor coverts these optical signals into analog signals. The voltage of this analog signal fluctuates based on whether the sensor sees the reflected light from the white spaces or the black spaces. This is because the black part absorbs the red light. This analog signal is passed through the decoder.
- At the decoder, these signals are converted into digital form by the A/D convertors. The decoder then converts and decodes these digital signals into the required information that was encrypted in the form of barcode. The decoder then sends the information to the computer connected with the scanner.