How Does a Battery Work?
A battery keeps two materials apart and lets them trade electrons only through your device. Here is what happens inside an ordinary AA, and…

You push a small brass key into the front door, feel it slide over a row of tiny bumps, and turn. If you want to know how does a pin tumbler lock work, those bumps are the answer: spring-loaded pins inside the cylinder, and a key cut to lift each one to exactly the right height.
At KKSLNews.com the front-door lock earned a slot because nearly every home has one and the whole idea fits in your palm. Here is what is inside the cylinder and what the jagged edge of a key is really doing.
A pin tumbler lock has two main parts, a fixed outer housing and a round plug that turns inside it. Holes drilled through both parts hold small stacks of pins pushed down by springs. Most household cylinders have five or six of these stacks in a row.
The key slot itself has ledges along its sides. They stop the pins from dropping all the way into the plug when no key is inside.
The shear line is the thin boundary where the outside of the plug meets the housing. If any pin sits across that boundary, it acts like a bolt dropped through two plates and the plug cannot rotate. The lock opens only when the split in every stack lines up with the shear line at the same moment.
With no key inside, the springs push each driver pin partway down into the plug. Every stack then straddles the line, half in the housing and half in the plug, so five or six little pegs are holding the plug in place.
Because the driver pins are uniform, the difference between one lock and the next lives in the key pins. Change their lengths and you change which key will work.
Each cut on a key sits under one pin stack, and its depth decides how high that stack rises. A long key pin needs a deep cut, and a short key pin needs a shallow one. Cut correctly, the key leaves the top of every key pin flush with the shear line.
Locksmiths record the depths as a row of digits called the bitting, such as 372164. Each digit matches a fixed position on the blade, counted from the handle end or from the tip depending on the maker. A smaller digit usually means a shallower cut, though some brands run the scale the other way, so the same number can mean different depths on different keys.
That code is what a locksmith uses to cut a replacement or duplicate key. Set the digits into a key-cutting machine and the machine reproduces each depth on a fresh blank.
Diagram · KKSLNews.com
Inside a pin tumbler lock with the right key
Read each column from top to bottom: spring, driver pin, the red shear line, then a key pin resting on its cut in the key.
Source: US Patent 48,475: Improvement in Locks (Linus Yale Jr., 1865), Wikipedia: Pin tumbler lock
With the wrong key, at least one stack ends up at the wrong height. A cut that is too shallow pushes a key pin up across the shear line, while a cut that is too deep leaves a driver pin hanging down into the plug. Either way a single pin still bridges the gap, and the plug stays put.
The same rule explains a small daily habit. Linus Yale Jr. described his 1865 design so that the key goes in and comes out only when the pin divisions line up with the slot. That is why you turn the key back to its starting position before you can pull it out.
Once the key leaves, the springs push every stack back down across the shear line. The lock is locked again without you doing anything.
A master-keyed lock adds a thin extra pin, called a spacer or master wafer, to some stacks. That gives those stacks two possible splits, so two different keys can each bring one of them to the shear line. A tenant’s key uses one set of splits and the building manager’s key uses the other.
The rest of the lock does not change. Springs, driver pins and the plug work exactly as before; the stack simply has two places where it can come apart.
The idea is ancient, but the cylinder on your door comes from Linus Yale Jr. in the 1860s. ASME, the engineering society, traces the pin tumbler principle to large wooden locks built in ancient Egypt some 4,000 years ago. Yale’s father, Linus Yale Sr., used pin tumblers in his own locks before his son made the design small.
The patent records show the steps. US Patent 31,278, granted on January 29, 1861, covers a drawer lock in which each hole holds a pair of parts, called pistons and drivers, pressed by a helical spring. US Patent 48,475, dated June 27, 1865, describes a thin steel key in a narrow slit and two-part tumblers of different lengths that line up with the edge of a turning cylinder. That is the layout still used today.
In October 1868 Yale and Henry R. Towne began the Yale Lock Manufacturing Company in Stamford, Connecticut, to make cylinder locks. Yale died about two months later, on Christmas Day, but the company and the lock kept his name.
It is named after Linus Yale Jr., whose 1860s patents set out the flat key and cylinder layout used today. The company he started with Henry R. Towne in 1868 carried his name.
A dimple key has its cuts drilled as small dimples into the flat face of the blade instead of notches along the edge. The lock still uses pin stacks and a shear line; the pins simply meet the key from the side.
No. Household cylinders typically have five or six pin stacks, and the count depends on the design and how many different keys the maker wants to offer.
Sources
Spotted an error? Read our editorial policy or tell us. Fixes are logged on the corrections page.

A battery keeps two materials apart and lets them trade electrons only through your device. Here is what happens inside an ordinary AA, and…
6 min read

A microwave oven does not heat food from the inside out. It makes water molecules twist billions of times a second, and conduction does…
5 min read

A hybrid car shares the work between a gas engine and an electric motor, and it refills its battery every time the driver brakes.
6 min read