How to barcode scanners instantly detect what an item is, despite the barcode being at any angle and often on a crinkled surface, completeley changing the look of the code from the scanner’s perspective?

921 views

How to barcode scanners instantly detect what an item is, despite the barcode being at any angle and often on a crinkled surface, completeley changing the look of the code from the scanner’s perspective?

In: Technology

6 Answers

Anonymous 0 Comments

A scanner uses a laser to shine at the code, and it just detects how bright the reflection is.

Because the laser beam is small and doesn’t spread out, it doesn’t matter how far away the product is. It is always being lit by a tiny spot moving across the code.

The numbers aren’t coded by the width of the stripes, as many people say. The information is coded by whether the pattern changes, dark-to-light or light-to-dark, at a certain point. If it changes, that’s a 1, if it doesn’t change, that’s a 0. So a thick black line and a thick white line are the same thing = 3 ‘places’ where it doesn’t change, a pattern of 1 0 0 0 1 – the front edge of the line, 3 places where it doesn’t change, and the rear edge of the line. So it doesn’t matter if the barcode is printed as black on white, or white on black. Or matt ink on shiny aluminium. Just as long as the light reflected off it changes.

Or at an angle. Or even backwards – the scanner can recognise if a code comes to it backwards, and can flip it around.

If you have noticed a supermarket scanner, you’ll see many lines at different angles. The mirrors inside the scanner – mirrors attached to a spinning wheel – are at all different angles, so they make the laser sweep at different angles, so it will always manage to sweep across the code, from one end to the other, at some point.

An important point that allows it to scan at different distances or angles is the codes themselves – they always start and end with two thin vertical lines. These vertical lines represent 5 changes – two changes for the edges of each line, and the change for the front edge of the first line of the first number – and this sequence of 5 1’s allows the scanner to determine how fast the laser is sweeping across the barcode, and so where to expect the changes, allowing it to compensate for the barcode being at an angle, or at a different distance. There are also 2 vertical lines in the middle, so the scanner can make sure that things haven’t changed, because of a crease in the code or the person moving the item too fast. (We call this process, ‘clock recovery’)

You are viewing 1 out of 6 answers, click here to view all answers.