Science · Interactive demo
How does your phone camera focus?
Drag a flower toward a phone camera and watch a tiny motor slide the lens until it runs out of travel at about 10 cm.
Created by ExplainerTools.
About this explainer
- Made by
- ExplainerTools
- Format
- Interactive demo
- Subject
- Science
- Where it runs
- Plays here
- Full tool
- Open the tool page
- Published
- Added to collection
- camera focus
- lenses
- autofocus
- optics
How the model works
Point your phone at a flower and the picture snaps from soft to sharp in a blink. Nothing in the camera seems to move. So what changed?
- Flower distance5 cm → 2 m
- Lens position
- Aperturef/1.6 · wide → f/2.8 · narrow
Presets Across the room · 2 mArm’s length · 50 cmMacro limit · 10 cmToo close · 6 cmAutofocus off · lens at rest
A single thin lens of 6.0 mm focal length with a fixed 0.383 mm motor stroke, where real phone lenses are stacks of several plastic elements.
Model notes and sources
Model. The camera is a single thin lens with focal length f = 6.0 mm, typical of a phone's main camera (they range from about 5 to 7 mm). A point at distance d in front of the lens is imaged at v behind it, from the lens equation 1/f = 1/d + 1/v, so v = f·d/(d − f). The sensor sits f + s behind the lens, where s is how far a voice-coil motor has pushed the lens forward from its rest position, in which a spring holds it focused at infinity. A point is focused when s = v − f = f²/(d − f): 0.073 mm at 50 cm, 0.32 mm at 12 cm and 0.38 mm at 10 cm. The light from the point fills the aperture, of diameter A = f/N (3.3 mm at f/1.8). Where the cone crosses the sensor it is a disc of diameter b = A·|v − (f + s)|/v, the blur disc. We call the picture sharp when b is under 8 µm, about the sensor's diagonal ÷ 1,500.
Fixed values. The motor's stroke is set to 0.383 mm, which makes the minimum focus distance exactly 10 cm (measured from the lens). That is in the range of real modules: voice-coil autofocus actuators typically travel about 0.25 to 0.4 mm, and phone main cameras typically focus no closer than about 10 to 20 cm, which is why phones switch to the ultrawide camera for macro shots. The viewfinder assumes a sensor 7.2 mm across its short side, so its blur is b ÷ 7.2 mm of the picture's width; the flower photo is framed as seen from 12 cm and scaled by 12 cm ÷ d (held at a minimum size beyond 2 m). The film uses f/1.8 and moves the flower from 50 cm to 12 cm, then to 6 cm.
Not to scale. In the diagram, lens and image movements are drawn about 7 times larger, relative to the lens, than the lens-to-sensor distance, and flower distances are compressed. The real camera module is only about 6 mm deep.
Not modeled. Real phone lenses are stacks of 5 to 8 plastic elements, not one thin lens; diffraction, aberrations and sensor pixel size; how the phone decides where to move the lens (phase-detection pixels or contrast hunting); optical image stabilization, which uses similar coils sideways; and the slight change in focal length some lens designs use instead of moving the whole lens. The photos are AI-generated illustrations; the blur in the viewfinder is computed from the model (a disc blur of the photo), and every number comes from the model.
Sources: Analog Devices, “Lens driver focus in camera modules”, Analog Dialogue 40 (2006) (voice-coil motor, spring return to infinity focus, stroke of a few hundred micrometres); Halide / Lux, “iPhone Macro: A Big Day for Small Things” (main camera focuses to about 15 cm, macro needs the ultrawide); Thin lens; Circle of confusion; Voice coil; E. Hecht, Optics, 5th ed., ch. 5 (thin lenses).
An ExplainerTools Original.
Watch it move
- How does your phone camera focus?35-second Short
Go deeper
Explore interactive ideas in space, science, math, and more. Try a demo, read an interactive article, watch a short video, and follow what makes you curious.
New Originals
Change one thing and see why.
The three newest models, each with a short film. Watch the question, then play with the answer.
Follow your curiosity
A collection of small doors into big ideas.
Format
Swipe or scroll for more formats →
Subject
Swipe or scroll for more subjects →
Topic
Swipe or scroll for more topics →
Sort by
Rankings count activity here on ExplainerTools. Newest means added to this collection.
Loading collection…
Make something click.
Made an explainer, or found one you love? Give it a place in the collection.


