BeCuriouzLearn something new every day
Your mouse is a camera taking 1,000+ photos a second
💡 An optical mouse tracks motion by photographing the surface thousands of times a second and measuring how the image shifts between frames.
Flip over an optical mouse and you'll see a faint red glow but no moving parts — no ball, no rollers. So how does it know you moved? The answer is that it's really a tiny, very fast camera. An LED (or laser) lights up the surface at a steep angle, casting shadows in the microscopic texture of your desk. A small lens focuses that lit patch onto an image sensor — in early models just an 18×18 grid of pixels, a postage-stamp version of the chip in a phone camera.
The trick is speed and comparison. The sensor snaps over a thousand grayscale frames per second, and a built-in processor called a DSP (digital signal processor) compares each new frame to the last one. If the speckled pattern shifted three pixels to the left between frames, you must have moved the mouse right by that much. This technique — measuring motion by how a picture slides between frames — is called optical flow.
This is also why an optical mouse fails on glass or a shiny mirror: a featureless surface gives every frame the same blank picture, so the DSP sees no shift and the cursor freezes. It needs visible texture to track. Gaming sensors push the same idea to extremes — tens of thousands of frames per second — to stay accurate during fast flicks.