How Does a Barcode Scanner Function?

We've all come across barcode scanners at various occasions. How does a barcode scanner function? How does it decode those vertical lines to give us values that make sense? Read right ahead to find out.
Every time you go shopping, you see these sticks, that look like half-nozzled hair dryers, that are run across the surface of price tags of goods stacked for billing and as soon as the scanners mounted on their heads flash upon those barcodes, the output port shows the retail price value of the merchandise you just purchased. I don't know about you, but I've always been curious to know how these scanners decipher the barcodes, which are nothing more than a cluster of vertical lines in our eyes, to give us a meaningful output value that makes sense to us. If you've ever pondered upon similar lines while waiting your turn at the billing queue, you've come to the right place where you'll get what you seek. The following segment will give you a clear idea of how a barcode scanner functions.

How Does a Barcode Scanner Work?

Before we get to the part about the way a barcode scanner works, let's get to understand barcodes from a closer perspective. What is a barcode? It's just a bunch of straight, parallel black lines of uniform length appearing on the price tag of a merchandise, right? Well, it is but there's more to a barcode than just those lines. Take a closer look - what do you notice? I'll tell you what else there is to notice. First, although of uniform length, those black lines vary in thickness. Second, all the lines have a little white space between them, meaning that between every two lines, there is a white space. These white spaces are also not uniform in width. These specifications are what enable a scanner to read these linear codes and give a meaningful output based upon the discrepancies in the thickness of the lines and width of the spaces. The following points will enumerate the details of how a barcode scanner reads and decodes these barcodes in an easy and comprehensible manner.
  • The first and the last bar on a barcode are known as start bar and end bar, respectively. These demarcate the point of commencement and conclusion of the reading. Certain barcodes also include an additional bar, known as the checksum bar, which is like a cross checking method to determine whether the readings given by the scanner are correct or not.
  • The black lines on the barcode absorb the light flashed upon the barcode surface by the scanner. The thicker a line, the more light it absorbs. On the other hand, the white spaces between the bars reflect light back to the scanner.
  • Photodiodes are present on the scanner that detect and quantify the intensity of the light reflections that are hurled back at the scanner by the white spaces. Coupled with the luminary gaps created at places along the scanning surface where the black bars absorb light, these light reflections detected by the photodiodes appear in a wavelike pattern.
  • This waveform generated by the photodiode enables the scanner to get an idea of the actual pattern of the barcode by way of a light-and-shadow replication of the same.
  • Now, the scanner software proceeds to decode this waveform in the same way as we would decipher a Morse code. The dots and dashes are substituted by the light reflections and shadows of varying intensity. After the value has been decoded thus, it is translated in the form of cognizable values such as alphabets and numbers.
A lot of different varieties of barcode readers are available such as pen type readers, laser readers, charge coupled devices, etc. However, the basic scanning, decoding and translating process is more or less the same as all of these different types of barcode readers use photodiodes for capturing and measuring the shadows and reflections given off by the barcodes when light emitted from the scanner is absorbed and reflected at different areas of the code surface.

The latest technology in barcode scanning comes in the form of a small video camera capture device which captures the picture of the barcode and then uses advanced digital picture processing technology to break the code. A lot of smartphones, especially those that use an Android OS, give you the option of downloading and installing barcode reading apps which are nothing but the picture processing software which use the picture captured by the inbuilt phone camera to decode a barcode and give you a meaningful reading.