Don't stop me
Don't stop me
So last weekend I was opportuned to attend this blockchain tech event hosted by ICP hub Africa(a big thank you to them!). After completing the Google doc form on Thursday,I sat back,waiting for the arrival of Saturday when the event was scheduled to hold.
Fast forward to Saturday,I arrived promptly at the event only to discover that the registration was actually in two parts; an online pre-registration and an in-person finalization at the venue.
Considering how much people were present at the event,I couldn't even begin to imagine how much time I was going to spend in line only for the organizers to paste two A4 sheets on a table. Both sheets were printed with QR codes for the participants to scan on their phones and guess what? In less than five minutes more than a hundred people had completed their registrations!
Witnessing this seamless process sparked my curiosity about those ubiquitous QR codes. They've become an integral part of our daily lives, yet few people actually possess an understanding of the technology behind them.
This encounter left me wondering: How do QR codes work? What's the science behind those square patterns?
With my inquisitive personae worked up,I embarked on a journey to uncover the secrets behind QR codes.
So without further ado, let's get started!
HISTORY & BRIEF OVERVIEW
.
QR codes are basically square barcodes!
Yes,you heard that right,square barcodes!
Essentially,it's a type of 2D matrix barcode that is easier and faster to read than your typical barcode while also storing more information.The ‘QR’ in them is simply an acronym for ‘Quick Response' which highlights how fast they allow you to access the information they store,either with your smartphone or a dedicated scanner.
It consist of an array of contrasting pixels with the colours white and black,with white representing zero(0) and black representing one (1). These are what QR codes use to store information in them(zeros and ones,binary?)
Typical QR code.
So around the year 1994, Masahiro Hara,an employee at car component manufacturer,Denso Wave was having a hard time scanning barcodes for the same car parts due to their inherent defaults(check out another one of my articles on barcodes). Sick of the whole clumsy process he set out to develop an alternative to barcodes drawing inspiration from the game of Go(Asian chess).
Go board. Source:Redbubble
Following the matrix like pattern on Go boards,he applied the same concept to design the first QR code. It was an immediate success as it was a solution to a problem that plagued all industrial manufacturers. However,it's application in normal everyday life remained minimal until the reemergence of Mad cow disease in the UK in 2002 when this peculiar looking barcode made tracking beef easier,thus curbing the spread of infection.
Another factor that made it's adoption even faster was that it was free(yes FREE). He didn't apply for a patent for his QR codes making them open source,allowing anyone the right to use it as they might wish(all that lost money!).
From then on,QR codes became a common sight in every part of the world.
HOW QR CODES STORE INFORMATION
Okay enough history,now that you know how QR codes came about,let's dive into their working mechanism.
It's important you know that all QR codes contain some essential parts or elements which govern it's workings. I'll be touching upon them one after the other.
First of all,the quiet zone.
The quiet zone is that white border around the QR code that serves as an indicator for where the code starts,a background marker of sorts. It allows the scanner or your phone's camera to recognize where to start reading the code from.
Quiet zone.Source:Author
Next up is the position squares.
A distinguishing feature of QR codes is the three square patterns at the top left,top right and the bottom left corners. Their function is to allow the scanner to identify the orientation of the code,allowing easy recognition of the code and high speed deciphering of the information it holds.
Position markers(green). Source:Author
Actually, the square patterns on a QR code are not only three,on some QR codes there is a fourth square pattern albeit smaller than the other three.
This is the alignment pattern.
Alignment pattern(red).Source:Author
It's function is to rescale the QR code ensuring it's readability even when scanned from crazy, oblique angles using the relative size and distance between the alignment pattern and the three position squares. It essentially resizes the QR code into a proper square no matter how skewed your viewing angle is!
Source: YouTube (Uma Abu)
Up next is the timing pattern which tells your phone or QR code scanner what version it's scanning. There are many QR code versions each differing from the other by the number of pixels and information they contain. Hara’s QR code was a version 1 QR code measuring 21 by 21 pixels while today,the largest version boasts an amazing 177 by 177 pixels(version 40) which is large enough to hold three kilobytes of information!
QR code versions. Source: Vietnam Blockchain corporation(top) &Research gate(bottom)
Last but not the least is the format strip whose job is to tell the scanner how the code is meant to be read.
It consist of two parts:Data and error correction followed by a mask.
The data and error correction part allows the code to be read even if 30% is damaged or lost!
The mask on the other hand breaks up large blocks of code into chunks that are more legible to your scanner through a complicated algorithm.
So there you have it folks, all the parts that constitutes a QR code.The next step is how to actually store information,maybe a link,in it.
Here I'll be using www.futminna.edu.ng,my school's website as an illustration.
To start encoding information in a QR code you'll need to arrange the black and white pixels representing your information in a specified order starting from the bottom left corner. Considering that the QR code scanner doesn't understand the English language we convert the link into a form it recognizes. To do this you need to convert the letters in www.futminna.edu.ng into ones(1) and zeros(0) using byte encoding which is based on ASCII,which itself originates from Morse code.
It might seem confusing bu
t it's not that complicated. After completing all these you have a working, readable QR code.