QR code scanner

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

QR code scanner

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. How does a QR code scanner capture the QR code?
A It uses a microphone to listen to the pattern
B It uses a camera to capture an image of the square pattern
2. How is data stored in a QR code?
A Across a 2D grid of black and white squares (modules)
B Only in a single row of vertical lines
3. Which holds much more data?
A A QR code
B A standard barcode
4. What do the three large squares in the corners of a QR code do?
A They show the scanner the orientation of the code
B They store the price of the product
5. A QR code is upside down or turned sideways. What happens?
A It cannot be read until it is turned the right way up
B It can still be read, because it can be scanned from any angle

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1QR code scanner AA QR code is two-dimensional, using a square grid of black and white modules, not just parallel lines. This is why it stores more data than a barcode.
2Three corner squares BUses a camera to capture a 2D square grid of black and white modules and decodes the pattern into data such as a web address or text.
3A QR code stores data across a grid in two dimensions, so it holds much more data than a barcode, which only uses lines. Chttps://www.example.com
4A QR code scanner can decode a pattern into a web address, so scanning a poster takes you straight to a website. DPosition markers in three corners of a QR code that show the scanner its orientation, so the code can be read from any angle.
5A QR code is a 1D pattern of lines, like a barcode EThe three corner squares show the scanner the orientation, so a QR code can be read from any angle and does not need to be upright.
6A QR code must be held upright to be scanned F2D grid of modules

Definitions

QR code scanner

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
A QR scanner uses a ______ to capture the QR code image
2.
A QR code is a __ grid of black and white squares called modules
3.
A QR code has _____ corner squares that show its orientation
4.
A QR code can be read from any _____
5.
The scanner will ______ the pattern into data such as a web address

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A image ← camera.capture()
B pattern ← findLines(image)
C data ← decode(pattern)
D OUTPUT data
Question 2
A image ← camera.capture()
B grid ← findGrid(image)
C data ← decode(grid)
D OUTPUT image
Question 3
A corners ← countSquares(grid)
B IF corners = 4 THEN
C rotate(grid)
Question 4
A image ← camera.capture()
B orient ← findCorners(image)
C data ← decode(image, 0)
D OUTPUT data
Question 5
A data ← encode(grid)
B IF isLink(data) THEN
C openBrowser(data)
D ENDIF

Answer Key

QR code scanner
Section A: Quick Questions
Q1
B — It uses a camera to capture an image of the square pattern
Q2
A — Across a 2D grid of black and white squares (modules)
Q3
A — A QR code
Q4
A — They show the scanner the orientation of the code
Q5
B — It can still be read, because it can be scanned from any angle
Section B: Match the Pairs
Q1
QR code scanner → Uses a camera to capture a 2D square grid of black and white modules and decodes the pattern into data such as a web address or text.
Q2
Three corner squares → Position markers in three corners of a QR code that show the scanner its orientation, so the code can be read from any angle.
Q3
A QR code stores data across a grid in two dimensions, so it holds much more data than a barcode, which only uses lines. → 2D grid of modules
Q4
A QR code scanner can decode a pattern into a web address, so scanning a poster takes you straight to a website. → https://www.example.com
Q5
A QR code is a 1D pattern of lines, like a barcode → A QR code is two-dimensional, using a square grid of black and white modules, not just parallel lines. This is why it stores more data than a barcode.
Q6
A QR code must be held upright to be scanned → The three corner squares show the scanner the orientation, so a QR code can be read from any angle and does not need to be upright.
Section C: Definitions
Q1
QR code scanner — Uses a camera to capture a 2D square grid of black and white modules and decodes it into data like a web address or text. It holds more data than a barcode and reads from any angle.
Section D: Fill in the Blanks
Q1
A QR scanner uses a camera to capture the QR code image
Q2
A QR code is a 2D grid of black and white squares called modules
Q3
A QR code has three corner squares that show its orientation
Q4
A QR code can be read from any angle
Q5
The scanner will decode the pattern into data such as a web address
Section E: Spot the Error
Q1
B — A QR code stores data across a two-dimensional grid of modules, not in lines like a barcode. The line should be pattern ← findGrid(image).
Q2
D — The scanner must output the decoded data, such as a web address or text, not the raw camera image. It should be OUTPUT data.
Q3
B — A QR code has three corner squares that show its orientation, not four. The line should be IF corners = 3 THEN.
Q4
C — The three corner squares give the orientation, so the scanner can read the code from any angle. Decoding must use orient, not assume the angle is 0.
Q5
A — A QR code scanner decodes the grid into data such as a web address. It does not encode. The line should be data ← decode(grid).