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

1 See

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?

2 Change
  • 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

Model · thin lens, diagram not to scale

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

See how the world works.

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.

Find your next rabbit hole

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.

All Originals

Follow your curiosity

A collection of small doors into big ideas.

Format

Subject

Topic

Sort by

Rankings count activity here on ExplainerTools. Newest means added to this collection.

Loading collection…

Opening the collection…

Make something click.

Made an explainer, or found one you love? Give it a place in the collection.

Your next question

What do you wish someone would explain?

Send one question. If it becomes an ExplainerTools Original, you can hear when it is ready.

One weekly email with new explainers. We send a confirmation link first, and you can unsubscribe at any time.

We save your question, your email if you add one, and whether you asked to subscribe. Privacy

Share something worth understanding.

An interactive demo, an interactive article, or an educational video. Every suggestion is reviewed before it joins the collection.

Submit the creator’s original link. We credit creators and link to their work.

A collection for the curious.

ExplainerTools collects interactive explainers, visual essays, and educational videos that help an idea make sense. Browse by subject, follow a topic, or find a creator whose way of explaining speaks to you.

The work belongs to its creators.

Every entry credits its original creator. Supported experiences play here, with a link to the creator’s original work available in the player. Inclusion does not imply a partnership or endorsement.

How rankings work

Views, likes, and bookmarks count activity on ExplainerTools. They don’t include views or likes from a creator’s website or social accounts. Newest means most recently added to this collection. Ties are ordered by date added, then our curated catalog order.

Your collection

New likes and bookmarks require a free account and sync across devices when sign-in is available. Previously saved items from this browser may remain visible here.

Browse the catalog data or read about privacy.