N° of component

## QR Code - How It Works (ART424E)

In 1987, we wrote a "how it works" explaining how the common bar code works (soon in the site). Widely used in a multitude of applications and already alerted to the coming of two-dimensional code, where in a smaller space it was possible to put more information. A second article from 2004 dealt with the two-dimensional codes which already had as a representative the QR Code that actually became popular after 94. In this article, we explain it in more detail, which is now one of the most popular codes used with the cell phones.

QR Code comes from Quick Response, so QR Code is a fast response code consisting of a two-dimensional bar code type. See our article to understand how it works.

This code was created in 1994 by the Japanese company Denso-Wave to control the storage of parts in a quick and simple way.

With the development of more and more accurate camera phones, the code scanning process was also used in these devices in 2003. The advantage is that even mobile phones with not very good cameras can capture the images and interpret them.

From its launch, the code has become popular and its use, as well as the applications which interpret it, have become free and can be used in any application and installed on any cell phone.

How it works

Unlike a common bar code, as shown in Figure 1, the QR Code is a two-dimensional or 2D code.

Figure 1 - Common 1-dimensional barcode (1D)

In this code, the information is encoded by the width and separation of the bars according to a standardized code, adopted internationally.

In the two-dimensional bar code, we have the representation of information by small rectangles which form a mosaic pattern, as shown in Figure 2.

Figure 2 - The two-dimensional QR Code

Thus, by taking the lines of rectangles, we can read the sequence of the light and dark regions by converting them into bits, as shown in Figure 3.

Figure 3 - Reading the data

There are several versions that may contain more or less data as the amount of "squares" can be used in the data representation.

Thus, we have in Figure 4 some versions with the amount of bits that it can store;

Figure 4 - The higher the number of points the greater the amount of information stored.

Versions of 117 x 117 and 177 x 177 also exist allowing storage of up to 7.089 characters.

However, when thinking about reading these codes though the camera of a cell phone, we need to take into account several factors.

We must first have a reference (A) which allows the correct positioning of the camera so that the information can be captured without error.

We also need to inform the application which format is the information being read, since there are variations, in some cases we can only have numbers, alphanumeric characters, binary bits, etc.

There are also standardizations of different dates given by ISSO/IEC standards and the cell phone needs to know what it is reading.

Also, we need to have a reference to get the alignment (B) so that the application knows what the top and bottom sides of the code are for reading.

Another information is the format information (C) which is also important for reading.

The same way as in the tickets that use common bar codes, an information is added which allows us to know if the bits transmitted in each block are correct, that is, an information that allows us to verify the integrity of the data read, that is given in (D).

We have the "timing" which is a reference for the appropriate reading speed, shown in (E).

Finally, we have in (F) the version.

Figure 5 shows how this information is placed in the QR Code.

Improvements are yet to come, such as the use of colors. It would be more or less what you do with a Quadrature Amplitude Modulation (QAM) where the rectangle could contain more than 1 bit. If we use 16 different colors, for example, each rectangle can contain 4 bits.

The capabilities of cell phone cameras could easily differentiate these colors and with them, for a certain format, we would multiply by 4 the capacity of information storage.

In Figure 6, we give an example of this code.

Figure 6 - QR Code using colors

Benefits

The main advantage of QR Code is certainly the easy use which allows its effortless integration into the cell phone.

In addition, it is easy to generate a QR Code to put information about your product in an accessible and complete way, allowing a simple label to access a URL or even have data recorded on the phone immediately for later consultation or even contact like, e-mail, phone, address, etc.

On the internet, you will find several programs and applications which allow you to generate a QR code to place on your product or at some important point, as well as applications which can be downloaded on your mobile phone.

How to read a label with QR Code is very simple:

- Open the application and point your camera to the QR Code, as shown in Figure 7.

Figure 7 - Reading the QR Code

As soon as the application recognizes the code, the information appears on your screen and if it is a link to access a website or an e-mail, just tap it so that it opens normally.

### Circuit Bench

• UCC20520 Isolated Gate Drivers

July 2017 - The new Texas Instruments UCC20520 isolated drivers are already in the stock of Mouser...

• Power Zener (CB216E)

Using in operational amplifier is possible to increase the dissipation power of a zener. This...