TECHNOLOGY

How Do Barcodes Work?

Products in a grocery store
Credit: Enkhjin photography/Unsplash.com
Darren Orf
Author
Darren Orf is a writer and editor living in Portland, Oregon, who covers science and the natural world for places like Popular Mechanics, National Geographic, and Smithsonian Magazine, among others.

Walk into any supermarket and the chirp of barcode scanners easily dominates the ambience of squeaky shopping cart wheels and corporate-approved pop songs filling your ears. Without barcodes, though, buying groceries — and all kinds of retail products — would be a logistical nightmare.

Ever since the first commercial barcode was scanned some 50 years ago, these mysterious collections of black and white lines have revolutionized the shopping experience by transforming checkout queues from tedious drudgery to a streamlined process. Those lines aren’t random, though — they deliberately convey a surprising amount of information by using an efficient, tried-and-true method.

Credit: dfphotonz/stock.adobe.com

The concept behind barcodes is deceptively simple, but one that was also decades ahead of its time: binary code. Early computers were already using binary by the time the retail barcode was conceived of in the late 1940s, but the barcode is a very novel approach to employing the machine language.

The Language of Lines

The modern universal product code (UPC) features two elements: parallel black and white lines of varying thicknesses, with 12 numbers running along the bottom. Because black lines absorb light emitted from a laser scanner and white space reflects it, a laser-based barcode scanner can translate the bars into binary code — the same language used by computers. 

Black lines represent “1” and white lines represent “0,” while the thickness of the bars determines how many 1s and 0s are in a sequence. Included within the bars that represent binary are additional, longer “guard” bars that serve as boundary markers.

When scanned, a typical UPC barcode will produce a 95-character binary code that’s tied to a store’s product database, providing the correct price (along with any weekly discounts). The 12-digit code along the bottom is what’s known as a 1-5-5-1 pattern. The first number is the product type, followed by the five-digit manufacturer code, the five-digit product code, and a final check digit for the computer to ensure the barcode is read accurately. 

While UPC codes are the most common in retail stores, a variety of different barcode types are available for other applications, including logistics, distribution, or packaging too small to fit a normal barcode. A global organization known as GS1 regulates UPCs and ensures that the 2 million companies using the system have completely unique codes that work worldwide. Today, 10 billion barcodes are scanned each day — now imagine all the extra time spent waiting in line to buy your groceries if they were never invented.

Short Answer

The sequence and varying thicknesses of the black and white lines that make up a barcode translates into a string of binary code assigned to a specific product in a store’s database. The lasers in a barcode scanner are absorbed by the black bars and reflect back from the white space, generating the 1s and 0s that form the binary code, with the thickness of each bar providing additional information.

 

ENGINEERING

Why Do Elevators Have Mirrors Inside?

Elevator with mirrors
Credit: Petr Magera/Unsplash.com
Darren Orf
Author
Darren Orf is a writer and editor living in Portland, Oregon, who covers science and the natural world for places like Popular Mechanics, National Geographic, and Smithsonian Magazine, among others.

Traveling at high speeds in an enclosed box suspended high above the ground, filled with total strangers powered by a pulley system? It sounds like some daredevil stunt, or perhaps an amusement park ride — yet that’s an accurate way to describe riding an elevator. Elevators make 21st-century urban life possible. Without them, buildings could never have grown much higher than a handful of stories, let alone into the glass-and-steel monoliths that now dominate city skylines around the world. 

The weights and pulley system that allows elevators to work is a feat of modern engineering, but an unsung design feature is the mirrors often lining the interiors. But when you think about how your standard elevator works, the prospect of standing in a windowless box while it whisks you away at dizzying speeds — upwards of 50 miles per hour in some cases — can make even the most brave among us a little anxious.

Elevator
Credit: Bruno Kelzer/Unsplash.com

Elevator Mirrors Are for Sanity, Not Just Vanity

The fear of confined spaces is a fairly common phobia, which means there’s a trade-off between convenience and anxiety for many people relying on elevators. To help ease this claustrophobia, elevator manufacturers began installing mirrors on the inside of the cab. Just as they can liven up living spaces, mirrors help make small spaces feel bigger. 

This can calm the nerves of those temporarily trapped in the enclosed space of an elevator. According to the lift supplier Gartec, mirrors work better than transparent glass, which can exacerbate problems such as vertigo. For some folks, trading in cramped walls for an exposed view of the elevator’s shaft, gears, and wires — or the ground that is hundreds of feet below — isn’t exactly an upgrade.

But the benefits don’t stop there. Mirrors also provide a welcome distraction during the vertical trips, especially in tall buildings such as skyscrapers when trips may take a few minutes.

Woman in wheelchair in elevator
Credit: Getty Images/Unsplash.com

Mirrors also improve safety for elevator passengers in a few different ways. They help prevent pickpockets or assaults since it’s easier for everyone to keep their eyes on one another. Mirrors also help people with wheelchairs exit elevators more safely. It can be very difficult, if not impossible, to do a 180-degree turn in a wheelchair, especially with other people on board. Mirrors allow wheelchair users to see their surroundings while facing the rear of the cab and make it much easier to back out safely. 

There are around 30 elevator-related deaths reported in the U.S. every year across an estimated 18 billion trips, so it’s fair to say that they’re safe to ride. For people who still can’t shake that uneasy feeling, hopefully the inclusion of mirrors makes elevator trips a little less stressful.

Short Answer

Mirrors in elevators alleviate anxiety and the fear of enclosed spaces by making smaller spaces feel bigger and offering a distraction during long rides. They also provide security by allowing passengers to see their surroundings and offer a much-needed benefit for wheelchair users backing out of elevators once they’ve reached their floor.