ToF sensor: how a phone measures distance with light

A ToF (time-of-flight) sensor measures the distance to objects by timing how long infrared light takes to reach them and bounce back.

A ToF sensor measures distance like a mountain echo, but with light

In plain words

Shout in the mountains and you hear an echo. The farther the mountain, the longer you wait. A ToF sensor "shouts" with invisible light and times the "echo". Only light travels so fast that the time is counted in billionths of a second - and from that you get the distance to every point in the scene.

How it works

  1. The sensor emits pulses or modulated infrared light that people cannot see.
  2. The light bounces off objects and returns to a special sensor array.
  3. Each pixel of the array measures how long the light travelled.
  4. From the travel time, distance is calculated - giving a depth map of the scene.
  5. Software uses this map for focusing, background blur, measuring or navigation.

The depth map a ToF sensor builds

Where you'll see it

In some smartphones next to the main camera (for fast autofocus and portrait mode), robot vacuums (obstacle sensors), drones (holding altitude), gaming motion sensors, face and gesture recognition systems and proximity sensors.

Does it matter when buying

In a smartphone it is not critical: modern autofocus and AI often manage without ToF. In a robot vacuum, front ToF sensors help it avoid bumping into chair legs. If you see ToF in the specs, it is a nice bonus but not a reason to pick a model.

Myths

  • Myth: ToF is just another camera for photos. Reality: It does not take regular pictures; it measures depth.
  • Myth: ToF and lidar are the same. Reality: The principle is similar, but a ToF camera usually captures the whole scene at once at short range, while lidar scans and sees farther.

FAQ

Why does a phone need ToF if it has two cameras?

It measures depth faster and more accurately in the dark and on plain surfaces.

Is ToF infrared light dangerous?

No, the power is very low and safe for the eyes.

Can ToF see through glass?

Poorly: glass passes or reflects the light unpredictably.

Related terms

LiDAR, SLAM, Computational photography, Robot vacuum navigation

← Glossary