How a Computer Mouse Works

It never touches the thing it measures. A red light skims your desk, a chip compares 1,500 photos a second, and the difference between them becomes your cursor.

How a Computer Mouse Works — interactive 3D animation

Step 01 of 07

1 · The shape your hand already knows

Under one moulded shell: two buttons, a wheel, and — facing down at the desk — a camera. Not a metaphor for a camera. An actual one, photographing the surface underneath at a rate no eye could follow, and never once touching it.

Step 02 of 07

2 · Four jobs, one board

Ghost the shell and almost all of it is a single circuit board. A microswitch sits under each button, an encoder rides the wheel's axle, and the sensor hangs off the underside looking at the desk. One microcontroller reads all four and speaks for them.

Step 03 of 07

3 · The click is a spring giving up

Press a button and it pivots on its back edge, driving a stem down about half a millimetre. Inside, a bent metal leaf is held just short of collapsing — until that last fraction of travel pushes it past its own centre and it buckles, slapping the contact shut. The sound you hear and the signal the computer gets are the same event.

Step 04 of 07

4 · Twenty clicks to a turn

The wheel turns a disc cut with slots, spinning it through a beam of light. Two detectors sit slightly apart, so their signals rise and fall out of step — whichever one leads tells the mouse which way you turned. Counting slot edges tells it how far. A sprung arm dropping into notches supplies the clicks your finger feels.

Step 05 of 07

5 · Why the light comes in sideways

Here is the gap under the sensor, magnified enormously. The LED does not shine straight down — it skims across the desk almost flat. At that angle every speck and fibre throws a long shadow, so a surface that looks perfectly smooth turns into a landscape of light and dark. A lens gathers that patch and lands it on a CMOS array: about 1,500 photographs every second.

Step 06 of 07

6 · It never knows where it is

The chip does not recognise your desk, and it has no idea where the mouse sits. It only lines each photo up against the one before and measures how far the speckle pattern slid. That shift — a few thousandths of an inch, fifteen hundred times a second — is the whole signal. It leaves as a stream of "moved this much, this way", up to a thousand times a second.

Step 07 of 07

7 · A camera you drive with your palm

Sealed up, it goes back to looking like a lump of plastic. Underneath, a red light is still skimming your desk, a chip is still comparing photographs faster than you can blink, and a tiny spring is still waiting to give up the moment you decide to click.