Around 1.4 million Kiwis have so far downloaded the Ministry of Health’s NZ COVID-19 Tracer App. It’s very simple to use. Just point your phone at what looks like the black and white mosaic-patterned tile displayed in shops and offices, and the app will record your visit. But how does it do that? What’s it actually recording? That’s where things get interesting …
Those patterned tiles are QR (“Quick Response”) codes and date back to 1994 when they were developed by a subsidiary of Toyota. The problem with traditional barcodes – as anyone who’s ever used a self-checkout wil know – is that unless they’re flat and presented at right-angles to the scanner, they can be difficult to read. The developers of the QR code needed a way to track parts in motor vehicle assembly plants, parts that rarely conform to the neat, square box shapes found on supermarket shelves. What they came up with was a two-dimensional barcode, one that can be read at high speed from almost any angle. (You can easily recognise a QR code from the square-eyed position detection patterns set in top-left, top-right and bottom-left corners. By calculating the relative differences between those squares, the reader software essentially ‘flattens’ image before decoding it.)
QR codes can hold a lot of data. Traditional barcodes hold around 30 numeric characters. QRs can contain more than 7,000. Or 4,296 alphanumeric characters, or almost 3K of binary data. That’s a lot of storage in a space that can be as small as a postage stamp. They even have built-in error correction, meaning that a dirty or partially damaged code will still work.
For COVID-19 tracing, QR codes are just used to identify locations, but they can also take you to a website, record a business contact’s details in your address book, add an event to your calendar, find a Google Maps location or log you in to a Wi-Fi hotspot. In short, they provide a sort of digital missing link – a quick, convenient way of linking physical objects to the virtual world.
For the technically minded, or just curious
QR codes hold data both horizontally and vertically, building it up in squares with an equal number of rows and columns in what are called “modules” – that series of black and white rectangles. The smallest – Version 1 – is a 21×21 grid that can store 25 alphanumeric characters. Each version increase adds four squares to each axis – so Version 2 is a 25×25 grid (storing 47 characters). By the time you reach the biggest, Version 40 – a 177×177 grid – you have room for more than 4,000 characters. (QRs also require a four-module border irrespective of their capacity so they can be differentiated from their surroundings.)
A couple of variations have subsequently emerged. Micro QR codes are suited to current barcode applications and hold up to 35 numeric characters in a 13×13 grid, while Design QRs build the code around actual pictures or corporate logos.
To get a flavour of what you can do with them, pop over to qrstuff.com and check out the possibilities, and even build your own.
QR codes are a free ISO standard, and you’re not just restricted to black and white squares generated by computers. Any sort of mosaic will work. People have even put QR codes on toast!