Skip to main content Why Optical ToF Sensors Can Measure Distance and Proximity | IoT Worker

Why Optical ToF Sensors Can Measure Distance and Proximity

Optical distance sensors are often described as “using light to measure distance”. That is true, but too broad. Different optical sensors can mean very different output semantics.

A simple reflective proximity sensor may only know that reflected light became stronger or weaker. A ToF sensor estimates distance from light travel time or phase. The reported number is not simply “what the sensor sees”; it depends on reflectance, geometry, ambient light, optics, and algorithms.

The first model is: an optical distance or proximity sensor emits light, receives part of the reflection, and interprets intensity, time, or phase as proximity or distance.

Emit infrared or visible light
-> Light reaches target
-> Target reflects part of the light
-> Receiver measures returned light
-> Circuit or algorithm estimates proximity or distance

What the Optical Sensor Really Measures

The sensor does not measure “the object”. It measures returned light at its receiver.

The result depends on:

  • Emitter power
  • Receiver sensitivity
  • Target reflectance
  • Distance and angle
  • Ambient light
  • Cover glass and internal reflection
  • Algorithm confidence and thresholds

This is why a sensor can be accurate on one target and unstable on another target at the same distance.

Reflective Proximity Looks at Intensity

The simplest optical proximity sensor has an emitter and a photodiode. When an object is close, more emitted light may scatter back to the receiver. The circuit compares the returned signal with a threshold.

More reflected light -> likely closer or more reflective object
Less reflected light -> likely farther, darker, or absent object

This is useful for detecting whether something is near, but it is not a reliable distance measurement by itself. A white object far away may reflect more than a black object nearby. Angle and surface texture can dominate the reading.

Direct ToF Measures Flight Time

A direct ToF sensor tries to measure how long light takes to travel to the target and back:

distance = c * time_of_flight / 2

Because light is extremely fast, this is difficult at short distances. A 1 m one-way distance corresponds to about 6.7 ns round-trip time. Practical sensors need precise timing, optical design, and signal processing.

The advantage is that distance is less dependent on reflectance than pure intensity. The target still has to return enough photons for the measurement to work.

Indirect ToF Uses Phase

Some ToF sensors emit modulated light and measure phase shift between emitted and returned signals.

Modulated light
-> Return signal delayed by distance
-> Phase shift
-> Distance estimate

Phase is periodic, so it can be ambiguous beyond a certain range. That is a distance-aliasing problem. Practical devices choose modulation frequency, range, and algorithms to manage this tradeoff.

Triangulation Is Another Route

Some optical distance sensors use triangulation. They project a light spot or line and observe where it falls on a position-sensitive detector or image sensor.

Emitter projects light
-> Target reflects it
-> Image position changes with distance
-> Geometry gives distance

This can work well over a designed range, but it depends on optics, baseline, target reflectance, and alignment. It is a different measurement path from ToF.

Material and Color Still Matter

Optical ToF is not immune to the target surface.

Problems include:

  • Black or dark objects returning too little light
  • Transparent materials letting light pass through
  • Mirrors or glossy surfaces reflecting away or causing specular paths
  • Slanted surfaces sending light away from the receiver
  • Rough or multi-layer materials producing mixed returns
  • Very small targets returning too few photons

The sensor may output a distance, low-confidence value, saturation flag, or no reading depending on implementation.

Ambient Light Interference

Sunlight and strong lamps add background photons. The receiver must distinguish its own emitted signal from ambient light. Strong ambient light can reduce range, increase noise, or saturate the receiver.

A sensor can work well indoors and degrade outdoors because the receiver is not only seeing its own emitter. Optical filters, modulation, synchronous detection, and confidence flags are all used to separate signal from background.

Cover Glass and Openings Cause Crosstalk

The cover glass or plastic window also matters. It can create internal reflections from emitter to receiver, called crosstalk. Dust, fingerprints, water, and scratches can make crosstalk worse.

Good product design must consider:

  • Emitter and receiver separation
  • Optical barriers
  • Window material and coating
  • Mechanical tolerances
  • Calibration after final enclosure assembly
  • Dirt, water, and aging

Multiple Targets and Multipath

Real scenes often contain more than one reflecting surface. A ToF sensor may receive photons from a foreground edge, a background wall, a glossy reflection, and internal cover-glass reflection at the same time.

Depending on sensor type and algorithm, the reported distance may be:

  • The strongest return
  • A weighted average
  • The nearest valid return
  • A low-confidence or invalid reading

This is why small objects in front of a background, transparent covers, and corners can produce unstable distance.

How It Differs From Ultrasonic and mmWave

Ultrasonic sensors use sound. They are affected by sound speed, acoustic beam shape, target softness, and air path. They can work in darkness but struggle with soft or angled surfaces.

Optical ToF uses light. It can be compact and fast, but it is affected by color, transparency, gloss, ambient light, and cover-glass crosstalk.

mmWave uses electromagnetic radio waves. It can observe range, velocity, angle, and micro-motion, and is less sensitive to visible lighting. It depends heavily on radar signal processing and multipath handling.

Each sensor sees a different physical interaction. None of them directly sees “the object”.

Selection should start from the scene:

  • Use optical ToF when compact short-range sensing and fast response matter, and optical conditions are controllable
  • Use ultrasonic when light does not matter but acoustic reflection is reliable
  • Use mmWave when motion, presence, or micro-motion matters more than optical detail

Engineering Takeaway

Optical proximity and ToF sensors are useful when compact size and fast short-range sensing matter. They are not universal distance truth machines.

They are good for:

  • Phone proximity and gesture sensing
  • Robot short-range obstacle detection
  • Small device presence or distance estimation
  • Controlled indoor distance measurement

They are weak around:

  • Very dark, transparent, glossy, or angled targets
  • Strong sunlight or saturated optical paths
  • Dirty or reflective cover windows
  • Multipath and mixed surfaces

The key sentence is:

Optical sensors measure returned light.
Distance is an interpretation of intensity, timing, or phase under optical assumptions.