Most of us regularly see barcodes and barcode scanners at the time of purchase. But little do we know how exactly they work.
As most of us presume, these barcodes are more than lines and spaces present on the items.
It may need a little intelligence to find out what happens after you pass out a flashing red light over a barcode.
Here we are with this article to decode the encrypted ideology behind the barcode scanners. Through this write-up, we will try to understand how a barcode and a barcode scanner work.
Let us first learn what a barcode is and its significance.
What Is a Barcode?
As we all know bar code is a series of black and white stripes of varying widths. These lines come printed on a product label or stamped directly onto the item itself. Each bar code comes with a start bar and a stop bar that tells the scanner which way to scan the code.
The barcode readers are basically of two types, and they are – linear and 2D barcodes. Let us understand about each type below:
1. Linear Barcode
A linear barcode typically consists of two crucial parts. They are the barcode and the 12-digit UPC number. UPC is nothing but the Universal Product Code, which is most visually recognizable to the scanner and the consumer.
In the 12-digit UPC number, the first six numbers signify the manufacture identification numbers. The next five digits indicate the item number of the product. That said, these five numbers represent the product. Coming to the last or the 12th digit, it is the Check Digit. It is this number that enables the scanner to check and ensure the proper scanning of the code.
2. 2D Barcode
Contrary to the linear barcode, a 2D barcode is more complex to figure out. This is because it includes more information in the code, like the price of the product, quantity, web address, or image.
You cannot use a linear barcode scanner to scan a 2D barcode, because it will not read it. To read it, the linear scanner requires an image scanner that can read the information embedded in a 2D barcode.
The popular QR codes that we regularly see and use are 2D barcodes. These 2D barcodes are capable of storing vast information when compared to a 1D barcode.
Now that we know what a barcode is, let us see how a barcode scanner works.
How Does a Barcode Scanner Work?
The primary job of a barcode scanner is to scan or read the barcode symbol by illuminating it with a red light. It then converts the code into matching text and sends the output to a computer via a decoder and cable.
A barcode scanner usually consists of three different parts that assist in the scanning and decoding process. They are:
- Illumination System
- Sensor
- Decoder
Let us look into the step-by-step process of how a barcode scanner works:
Step 1: The Scanner Throws a Ray of Light or Lasers to Scan the Barcode
The very first step in the scanning process is where the barcode scanner illuminates the code with a ray of light or laser. The scanner does this only when you push its scanning button on the product’s barcode. Some advanced scanners work by capturing the image of the whole barcode at once. A few more models do the job partially by scanning the barcode line by line.
Step 2: The Rays get Reflected at the Scanner and Fall on the Light Sensor
Here is the second step. As mentioned earlier, the job of a barcode scanner is to scan or read the barcode symbol by illuminating it with a red light. It then converts the code into matching text.
We will try to understand this in detail. When the light from the barcode scanner passes across the barcode, two things will happen. Either the barcode will reflect the light or absorb it. When it reflects the light using white modules, the barcode sends the light back into the photoelectric cell of the scanner. The photoelectric cell will, in turn, generate a set of off-on pulses depending on the light that gets reflected to it. Furthermore, it gets converted via an electronic circuit to on-off pulses and registers the output as 0s and 1s in the computer.
When the barcode absorbs the light using dark modules, the scanner will register it as 1. Similarly, if it reflects the light using white modules, the scanner will mark a 0. These readings get transferred to the computer database. The pattern of 0s and 1s for a series of modules will generate a number, that corresponds to the product. It can be the country of origin or other information for identifying the product.
Using the same phenomenon, the light sensor can easily detect the spacing of the dark lines in the barcode. It further distinguishes between their widths also, generates an analog signal, and finally sends it to the decoder.
Step 3: The Scanned Code gets Pushed for Decoding
In this step, the scanner sends a matching text to the computer. The decoder comes into play here by interpreting the analog signal received from the scanner. It validates the barcode using the check digit and then converts it into text. The scanner delivers this converted text to a computer software system that has a database of all the information. This includes the manufacturer of the product, its cost, and the quantity of all products sold.
A QR code scanner also works similarly. However, here, instead of sending the information to a computer, the decoder sends it to your mobile phone. The QR scanner app downloaded for your phone contains the illuminator, sensor, and decoder. The illuminator is nothing but the red light that runs across your mobile phone screen when you open the QR scanner. The QR code now gets decoded by the sensor and decoder. After decoding, the decoder delivers back the information to your phone. As a result, you can see the final output where the QR code intended to take you.
What Is The Key Component of a Barcode Scanner?
The barcode scanner has a crucial component, and it is glass. If you observe closely, there is optics inside the scanner. You can see this from behind the protective window of the scanner. This optics consists of a First Surface Mirror, i.e., a high-precision ultra-flat mirror. This mirror comes with a coating on the face of the glass to ensure accuracy. You cannot use a standard mirror, as it has a double reflection and would not work the way the optics should.
The scanner reads the barcode quickly and accurately using this high-precision optical mirror. This is of a huge benefit and prevents the scanner from double scanning. Moreover, the software has a time delay programmed into it. This prevents the double scan.
While scanning, the imager takes a picture of the barcode, decodes it, and then sends the output data as a string to a host system. The data storage and further processing take here. Nevertheless, to read the barcode the imager needs to see the entire code. However, this is not always possible, as you can position the image directly in front of the barcode.
The ideal way to counter this issue is by implementing single or multiple bounce mirrors in the scanner. Doing so keeps the direction of sight of the imager in alignment with the barcode.
Conclusion:
I hope this article helped you decode the encrypted method behind the working of barcode scanners. You should by now have a fair idea of how a barcode scanner works. Next time you make a purchase, you will know how the entire process is taking place. Now that you are equipped, you can share this important information with your friends and enlighten them, as well.
Write to us if you have any questions. Do share your feedback with us by posting them in the comments section below. Please feel free to add your inputs to this article. We would love to hear and learn from you.
Stay healthy and stay safe!!!