Location

Based in New Delhi, India

Navigate

  • Home
  • Projects
  • Skills
  • Blog

Connect

Feel free to reach out through social media

© 2025 Odyssey | Ayushman Gupta. All rights reserved.

Designed & Built with ⚡

OdysseyCase Study
From Toyota's Assembly Lines to India's Streets: The QR Code Journey
VOL. I — NaN
Case Study

From Toyota's Assembly Lines to India's Streets: The QR Code Journey

Written by

Ayushman

29th Jan, 2025
Cover image for article: From Toyota's Assembly Lines to India's Streets: The QR Code Journey

Table of Contents

  • Introduction
  • History
  • Deconstructing QR Codes
  • Error Correction: How QR Codes Stay Readable Even When Damaged
Case Study
29th Jan, 2025
Back to Journal
artistic qr showcase
Fig.1 - An artistic deconstruction of a QR code, showcasing its structural components with a modern, abstract design

Introduction

In India, QR codes have become as common as auto-rickshaws dodging through traffic. No matter however small or remote you find a shop, chances are that they will have these pixelated printouts ready for you to make the payment. Yes, those are QR codes, and they've become as essential as a smartphone in the hands of every shopkeeper—integral and universally embraced.

Unlike traditional barcodes, which store information in a single direction (horizontally), QR codes store data both horizontally and vertically. This structure lets them encode much more data, from URLs and text to contact information and payment details.

This two-dimensional structure is what gives QR codes their distinctive square shape with patterns of black and white modules. A QR code is blazingly fast, thanks to some nifty techniques, it can store lots of data (upto 23,624 bits) and it can error correct itself if some part of the QR is missing. Things like these make the adoption of QR code so rampant.

qr art
Fig.2

History

Back in 1994, a couple of ingenious engineers at Denso Wave (a Toyota subsidiary) were wrestling with a problem: how to make tracking car parts on assembly lines more efficient. Barcodes were used extensively at that time but they had few limitations. They only stores tiny bit of information and forced workers to scan multiple barcodes for a single automotive component. Enter Masahiro Hara and his small team, who decided it make tracking of automotive component seamless and they introduced QR codes. A two-dimensional marvel that could pack in a whopping 7,000 characters, including kanji (漢字).

With its distinctive square shape and those funky patterns in the corners (called position detection patterns), the QR code allowed scanners to read data from any angle at lightning speed. Imagine upgrading from a bicycle to a starship in the world of data handling. This simple yet intuitive encoding and decoding of data helped Toyota to massive boost their manufacturing.

But the QR code didn't stop there. Someone thought, "If we can manage car parts with these codes, why not use them to pay the vegetable vendor at the local mandi?" And so, QR codes leaped from the Aichi Prefecture (HQ of Denso Wave) into bustling markets and remote villages. Now, they're not just tracking car parts; they're revolutionising commerce in India and many other developing countries.

Deconstructing QR Codes

qr code breakdown
Fig.3 - How Each Section Plays a Role in Encoding Data

Position Markers: The QR Code's Guiding Stars

Ever wondered how your phone miraculously deciphers a QR code even when you're holding it at a bizarre angle? Meet the Position Markers—the three large squares chilling in the corners of every QR code. Think of them as the QR code's very own GPS satellites, ensuring your scanner doesn't get lost in a sea of tiny squares.

These markers are like the North Star for your scanner, helping it figure out which way is up, down, left, or right—no matter how you're holding your phone. Even if you're scanning sideways like a curious parrot 🦜, these squares have got your back. They reduce the chances of misreading the code, which is especially handy when the QR code is wrapped around a steaming cup of chai or printed on a slightly crumpled receipt from your favourite street vendor.

  • Each position marker is a square-in-a-square-in-a-square—a 7x7 black square, surrounded by a white border, which is then enclosed by another black border. It's like the matryoshka doll of squares!
  • The innermost black square is known as the Finder Pattern—think of it as the QR code's homing beacon that your scanner locks onto amidst the sea of tiny squares.
  • Once these three key markers are identified, your scanner establishes a coordinate grid to map out all the tiny modules (the black and white squares). This grid allows the scanner to accurately read the data encoded within the QR code.
  • Whether you're tilting your phone or scanning from an angle to avoid glare, the position markers help correct any rotational issues. They ensure that, no matter how you hold your device, the scanner reads the code accurately.

Alignment Pattern

It's a small square, typically nestled near the bottom-right corner of larger QR codes (Version 2 and up). In more expansive codes, you'll find multiple Alignment Patterns strategically placed like seasoned coaches on a sports field.

When your QR code is scanned at an odd angle, wrapped around a coffee cup, or crumpled in your pocket, the Alignment Pattern swoops in to save the day. It helps the scanner straighten things out, correcting any perspective wonkiness so your data doesn't end up looking like a Picasso painting. In larger QR codes, these Alignment Patterns are sprinkled throughout, much like checkpoints in a marathon, ensuring everything stays on track from start to finish.

Timing Patterns: The QR Code's Built-In Gridlines

Timing patterns are sequences of alternating black and white modules that run both horizontally and vertically between the position markers. Think of them as the QR code's gridlines, laying out the precise design so your scanner knows exactly where to read. It's the QR code's way of laying down a coordinate grid, much like a Cartesian plane, providing precise "x" and "y" axes for your scanner to navigate.

These patterns help the scanner determine the size of the data grid—the number of rows and columns—essentially acting like the gridlines on graph paper.

  • The horizontal timing pattern connects the two position markers at the top, while the vertical one links the top-left and bottom-left markers.
  • By counting the modules in the timing patterns, the scanner can figure out the version of the QR code and adjust its decoding algorithm accordingly.

Version

The Timing Patterns tells us about the version of the QR code. The versioning in QR ranges from 1 to 40, 1 being the smallest and 40 being able to store humongous amount of data.

qr code breakdown
Fig.4 - QR Code Version

The Version Information is an 18-bit binary sequence encoded using a BCH (Bose-Chaudhuri-Hocquenghem) error-correcting code. Think of it as the QR code's way of proofreading its own genetic instructions to errors.

  • For versions 7 and above, the Version Information is strategically placed in two locations:
    • Above the bottom-left position marker.
    • To the left of the top-right position marker.
  • For versions 1 to 6, the QR code is small enough that explicit version information isn't needed. The scanner can determine the version based on the size of Timing Patterns.

Data Encoding: Turning Information into Binary Patterns

Modules and Bits
Each little square in the QR code grid, known as a module, represents a bit of data—black for 1, white for 0. Think of modules as the QR code's version of binary Morse code, dotting and dashing your data into a scannable pattern.

Encoding Modes
QR codes are versatile—they use different modes to efficiently encode various types of data:

  • Numeric Mode: Handles only numbers, storing up to 7,089 digits. That's enough to include your entire contact list's phone numbers.
  • Alphanumeric Mode: Accommodates numbers and letters (up to 4,296 characters). Perfect for encoding website URLs or short messages.
  • Byte Mode: For more complex data like ASCII and UTF-8 characters, storing up to 2,953 bytes. Ideal when you need to include email addresses, passwords, or other special characters.
  • Kanji Mode: Specifically designed for Japanese Kanji characters, storing up to 1,817 characters. A nod to the QR code's Japanese origins.

Data Masking
To keep scanners from getting confused by patterns that resemble the positioning markers or by large blocks of the same colour, QR codes use data masking. Think of it as applying a filter that rearranges the modules to avoid misleading patterns while preserving the underlying data.

Error Correction: How QR Codes Stay Readable Even When Damaged

Ever wondered how a QR code still works even after it's been scratched, smudged, or partially obscured? The magic lies in Error Correction, a feature that makes QR codes remarkably robust and reliable. Let's dive deep into how this works.

Reed-Solomon Error Correction

At the heart of QR code error correction is the Reed-Solomon algorithm, a mathematical method used in various data transmission and storage technologies, from CDs and DVDs to deep-space communications. In QR codes, Reed-Solomon error correction allows for the reconstruction of data even when parts of the code are missing or damaged.

Imagine You're Building a Castle with Blocks. You have a set of colourful blocks to build a castle. Each block is important to make the castle look complete.

But sometimes:

  • Blocks might get lost.
  • Blocks might get broken.

To make sure your castle can still be built even if some blocks are missing, you have extra special blocks that can replace any block you lose.

  • These extra blocks are like magic blocks.
  • They can fit anywhere and become any colour you need.

This way, your castle always gets built, even if some blocks are missing or broken.

QR codes work kind of like your block castle.

  • The QR code is the castle.
  • The tiny black and white squares are the blocks.
  • Reed-Solomon error correction is the magic extra blocks.

When creating a QR code:

  • We add extra helper squares (magic blocks).
  • If some squares get smudged or dirty, the helper squares fill in the missing pieces.

Error Correction Levels

qr code error correction
Fig.5 - QR Code Error Correction Levels

QR codes offer four levels of error correction to balance data capacity and resilience:

Level L (Low):
  • Approximate Recovery Capability: Can correct up to 7% of errors.
  • Use Case: Ideal when data capacity is a priority, and the environment is controlled (e.g., scanning from screens).
Level M (Medium):
  • Approximate Recovery Capability: Can correct up to 15% of errors.
  • Use Case: Suitable for general use, offering a balance between capacity and error correction.
Level Q (Quartile):
  • Approximate Recovery Capability: Can correct up to 25% of errors.
  • Use Case: Good for codes that may suffer moderate damage or are printed on uneven surfaces.
Level H (High):
  • Approximate Recovery Capability: Can correct up to 30% of errors.
  • Use Case: Best for harsh conditions where the code might be significantly damaged (e.g., industrial settings).

Note: Increasing the error correction level adds more redundant data, which reduces the amount of space available for actual information.

qr code error correction
Fig.6 - QR Code Examples

Conclusion

From Toyota's assembly lines to the bustling markets of India, QR codes have come a long way—evolving from a specialized tool for tracking car parts into a ubiquitous payment and information-sharing system. Along the way, they've proven just how powerful a simple square can be when backed by smart engineering and thoughtful design.

It's easy to look at a QR code and see just black and white squares, but beneath that unassuming grid lies a blend of robust mathematics, error correction, and clever encoding. This synergy of design and tech ensures QR codes remain both highly accessible and remarkably reliable.

Their versatility, efficiency, and resilience remind us that making things appear simple often demands the greatest ingenuity and care. What seems straightforward to the user—just point and scan—belies the careful planning and problem-solving at play behind the scenes. And with continued evolution and adoption, QR codes will likely remain at the heart of digital interactions for years to come, exemplifying how even the most routine technologies can reflect some of our most brilliant ideas.