Tue. May 7th, 2024

I learned this today. All of the black squares in a QR code represent certain pieces of information.

QR stands for Quick Response. They were invented in 1994 by Masahiro Hara. He was working for the Japanese company Denso Wave and he got the idea by looking at the black and white pieces on a Go board. His company was asked by supermarkets to come up with a different version of a barcode. Barcodes had become prevalent on almost every item in a shop, and they were used to track things. The problem with barcodes was that they could only store up to 20 pieces of information. This wasn’t enough for tracking products. The barcode is a 1-D code (1 direction of coding). This means it can only be read one way. The supermarkets wanted a 2-D code that could be read in two different directions.

Masahiro Hara came up with a square because it was easily recognizable, and it allowed for horizontally and vertically coded information. This also meant that the information could be read much faster by machines. He released the invention in 1994 and didn’t keep the patent rights. He allowed it to be used freely and the technology took the world by storm.

The first place they took off was in the automobile industry. They were used to track automobile parts across the factory and make sure they were at the right place. This soon spread from manufacturing to shipping as well. Other industries began to take note and QR codes spread.

A QR code has 7 parts. Each part conveys information about the print direction, timing, error tolerance, and empty spaces so the reader can separate the areas. It is detected by a 2-dimensional digital image sensor and then digitally analyzed by a programmed processor. This is different from a barcode, which is read by a narrow beam of light.

The detector first looks for the three squares in the corners of the code. It does this to center the image and work out its orientation and size. There are several parts of the code that cannot be changed. The three large squares, the spaces round them, the section just above the bottom square and just to the left of the top right square, and the smaller square in the bottom right. These are the same in all QR codes. The reader needs these to be the same so it can read the code. Then, all of the dots are converted to binary numbers and processed by an error-correcting algorithm.

The information on the code is written from left to right in a zig-zag pattern. It is broken up into different areas: the area between the two boxes at the top, the area between the two boxes at the right, the main area. The main area starts on the bottom right and continues until it finishes at the top left of the square.

Two of the areas that must be on every code contain important information. The information in the line around the three large squares tells the reader what kind of code it will be reading. It could be a URL, SMS, alphanumeric, numeric, etc. This is called the mode indicator. The information in the section above the bottom square and to the left of the top right square tell the scanner what version of code it will be. There are many different types of QR code now. This is called the character count indicator. The larges type of QR code can hold 31,329 points of data.

When you scan the code, the scanner first finds the three squares to orient the code. It then scans the mode indicator to see what kind of code it will be. Then it scans the character count indicator to see how much code it will have to read. Then it zigzags along the path reading the data. All of the letters and numbers we use can be encoded as different white and black blocks. It keeps going until it gets to the end.

After it has finished, the processor error checks the code. Then it processes the code and performs the steps that the code requires. For example, if it is a URL, it will open up the browser and direct you to the site.

So, QR codes were invented in Japan in 1994 because barcodes don’t hold enough information. QR codes are read horizontally and vertically. They contain information that tells the scanner what kind of code they are, what size they are, and what to do when they have been read. And now they are absolutely everywhere. And this is what I learned today.

Sources

https://www.fastprint.co.uk/blog/quick-response-codes-what-are-they-and-how-do-they-work.html

https://www.sproutqr.com/blog/how-do-qr-codes-work

https://en.wikipedia.org/wiki/QR_code