How does a self-checkout machine work?
A scanner reads the stripes, a computer looks up the price, and a scale checks what goes in the bag.
The big idea: A barcode is a number written in stripes. The scanner reads the number with light, and a computer looks up that number to find the name and the price.
It's like a class list: the teacher reads your name, then looks along the row to find your seat. The checkout reads a number, then looks along its row for the price.
The interactive parts didn't load. The explanations below still work; try reloading the page.
From stripes to price
- At a self-checkout you scan your own shopping. Slide a carton past the window and the screen shows its name and price. How does it know?
- Every package has a barcode: thick and thin stripes with a number underneath. The stripes and the number say the same thing. Each kind of product has its own.
- The scanner sweeps red light across the stripes. White bounces lots of light back to a sensor and black bounces very little. Bright, dark, bright, dark: that pattern is the number.
- The stripes do not hold the price. The computer takes the number and looks it up in the store's list. The matching row says: milk, two dollars.
- The bag sits on a hidden scale. When the milk goes in, the scale should feel the weight of one carton of milk. If the weight matches, the machine is happy.
- The screen adds up the prices. Mina pays with a pretend play card, the printer rolls out a receipt, and the light on top glows green. All done!
Look inside a self-checkout
Tap each part of the machine. Each one does a job when you find it!
- Barcode. The stripes on the package. They spell out a number that belongs to this kind of product.
- Scanner. Behind the glass, red light sweeps out in many directions, so the stripes can be read even if you hold the box crooked.
- Computer and price list. The computer takes the number from the scanner and looks it up in the store's list to find the name and price.
- Touchscreen. The screen lists each item and its price, and adds up the total. You can also tap it to pick things with no barcode, like loose fruit.
- Bagging scale. A scale under the bag. After every beep it checks that the bag got heavier by the right amount.
- Card reader. This is where shoppers pay. In our model it reads a pretend play card and says the sale is paid.
- Receipt printer. A small printer rolls out the receipt: a list of what you bought and what it cost.
- Help light. The light on the pole glows green when things are fine. It turns yellow to call a store helper when something needs checking.
Scan it, bag it, and test the scale
Drag each item over the scanner and watch the screen and the scale. Then see what the machine does when a scan is forgotten.
Experiment: What happens if something goes into the bag without being scanned?
- Drag one item over the scanner and let it drop in the bag. Read the scale.
- Press "Forget to scan one".
- Watch the light on the pole and the message on the screen.
What we found: The scanner told the computer how heavy each scanned item should be. When something lands in the bag without a beep, the scale feels weight that is not on the list, so the light turns yellow and a helper is called. The scale is there to catch honest slips, so always scan everything.
Turn on JavaScript to try it yourself.
You are the checkout computer
Match each scanned number to its row in the price list, find the item that was never scanned, then pay with the pretend play card.
How a checkout reads stripes
Look at almost any package and you will find a barcode: a patch of black and white stripes with a number under it. The stripes and the number mean the same thing. People read the digits; machines read the stripes.
The scanner shines red light across the stripes. White paper bounces most of the light back to a sensor, and black ink soaks it up. As the light sweeps along, the sensor sees bright, dark, bright, dark. The widths of those patches spell out the number.
Here is the surprise: the price is not in the barcode. The barcode only says which product this is. The checkout sends the number to the store's computer, which looks along its list and sends back the name and the price. That is why a shop can change a price without printing new packages.
The bag sits on a scale. The store's list also knows about how heavy each product is, so after every beep the scale checks that the bag got heavier by the right amount. If something lands in the bag with no beep, the weights do not match and the light calls a helper. Our model is simplified, and it uses a pretend play card to pay.
Key words
- Barcode
- A number written as black and white stripes that a machine can read.
- Scanner
- The part that reads a barcode by shining light on it and measuring what bounces back.
- Database
- A giant list kept on a computer, here with every product's name and price.
- Check digit
- The last digit of a barcode, worked out from the others, which lets the scanner catch a misread.
- Load cell
- A sensor that turns weight into an electrical signal; it is the heart of an electronic scale.
- Tolerance
- How big a difference is allowed before something counts as wrong.
Check your thinking
-
What does a barcode tell the checkout?
Show the answer
A number that says which product it is. The stripes only spell a number. The computer looks that number up to find the name and price.
-
A shop wants milk to cost less tomorrow. What has to change?
Show the answer
The price in the store's computer list. The price lives in the list, not in the stripes, so changing one row changes the price at every checkout.
-
Why do white stripes and black stripes look different to the scanner?
Show the answer
White bounces back lots of light and black bounces back very little. The sensor sees bright where the paper is white and dark where the ink is black.
-
You scan a carton of milk but put two cartons in the bag. What does the machine notice?
Show the answer
The bag is heavier than the list says it should be. The scale expects the weight of one carton. Two cartons weigh twice as much, so the weights do not match.
-
A store sets the bagging scale's tolerance very tight. What is the downside?
Show the answer
Honest shoppers are stopped when an item weighs a little more or less than average. Real items vary in weight. A tight tolerance catches more mistakes but also raises more false alarms.
You're a Money, shops & services expert!
You watched, looked inside, tried it, solved the challenge and went deeper. Pick another question below, or switch the age at the top to see this topic another way.
Keep exploring
Games to play next
- Shopping RushA list, a little planning and a supermarket full of possibilities.
- Supermarket StockerRoll out your cart and make every shelf ready for the day.
- Coin MarketRun a pretend market stall: pay exactly, use the fewest coins, and give the right change.
Guide for grown-ups
- How to start homeschooling: a step-by-step guide for familiesA guide for parents · 7 min read