Time of Flight Sensor: 6 Smart Uses and Amazing Range Tips

Share:
Electronic Sensors
Time of Flight Sensor: 6 Smart Uses and Amazing Range Tips

Light covers about 30 centimetres in a single nanosecond, so timing its trip to a target and back reveals the distance with remarkable precision. Tiny laser modules now do this thousands of times per second at very low cost.

c × t ÷ 2 SPAD Direct ToF Phase Indirect ToF 940 nm VCSEL

Robots, smartphones and automated vehicles all need to know how far away things are. Optical ranging measures the travel time of light, giving fast, compact and non contact distance data.

Hello everyone, today we are going to learn how a time of flight sensor measures distance, how direct and phase based methods differ, what limits accuracy and where these sensors are used.
time of flight sensor

What Is a Time of Flight Sensor?

A time of flight sensor is an optical distance sensor that emits light, usually infrared, and measures how long the light takes to reach a target and return. Since the speed of light is known, the round trip time converts directly into distance, much like the echo principle in the HC SR04 ultrasonic sensor.

Modern modules combine a 940 nm vertical cavity laser, a single photon detector array and timing logic in one small package. STMicroelectronics VL53L0X and VL53L1X parts are popular examples that talk to a host over I2C.

Diagram comparing direct pulse timing and indirect phase shift time of flight methods
Image credit: Terabee. Diagram courtesy of Terabee, shown here for educational reference.

Unlike a simple photoelectric sensor that only reports presence, the ToF module reports an actual distance in millimetres. That makes it useful for measuring, not just detecting.

Advertisement

Direct and Indirect Measurement Methods

Direct ToF

Sends short laser pulses and times each return with SPAD detectors and a time to digital converter.

Best for: compact ranging modules and lidar
Pulse timing
Indirect ToF

Sends continuously modulated light and measures the phase shift of the returning wave.

Best for: 3D depth cameras and short range mapping
Phase shift
Multizone ToF

Uses a SPAD array with several zones to give a coarse depth map.

Best for: gesture, people counting, obstacle maps
Zones

A single photon avalanche diode, or SPAD, can detect individual photons, so direct ToF chips build a histogram of arrival times from many pulses. The histogram peak gives the round trip time even when the return signal is weak.

Indirect ToF cameras sample the returning light at four points of the modulation cycle, as Terabee explains, and calculate the phase from those samples. Each pixel of such a camera becomes its own tiny rangefinder, which is the basis of the 3D lidar sensors used in industry.

Do You Know?

Resolving 1 mm of distance with direct timing needs about 6.7 picoseconds of time resolution. That is why ToF chips average many pulses instead of relying on one measurement.

How a Time of Flight Sensor Measures Distance

EmitVCSEL sends a 940 nm pulse or modulated beam
ReflectTarget returns a small part of the light
DetectSPAD array or photodiode pixels capture photons
Time or PhaseTiming circuit finds delay or phase shift
ReportDistance is sent over I2C in millimetres

The raw photons are weak, so the chip repeats this cycle many times per reading and filters the results. A host microcontroller then reads the result, often using the bus described in SPI vs I2C.

Distance and Ambiguity Range Formulas

Direct method: d = c × t ÷ 2
Phase method: d = c × φ ÷ (4π × f)
Maximum unambiguous range: R max = c ÷ (2 × f)

c = 299792458 m/s, t = round trip time, φ = phase shift in radians, f = modulation frequency

Example:
t = 20 ns, d = 299792458 × 0.00000002 ÷ 2 = 2.998 m
φ = 90 degrees = π ÷ 2 at f = 10 MHz, d = 3.747 m
R max at 10 MHz = 299792458 ÷ 20000000 = 14.99 m

The factor of two appears because light travels to the target and back. In the phase method, a full 360 degree shift corresponds to half the modulation wavelength, which is why the range repeats.

ToF Distance and Range Calculator

Optical Time of Flight Distance
Result
Distance 2.998 m, phase distance 3.747 m, max unambiguous range 14.99 m

Lower modulation frequencies give a longer unambiguous range but coarser precision. Higher frequencies give finer precision but wrap around sooner.

Advertisement

Second Worked Example: Phase Wrap Around

Terabee gives a clear example: a 10 MHz wave completes one cycle over 30 m, so the maximum measurable distance is 15 m. A target at 22.5 m would be reported as 7.5 m, because the sensor cannot tell that an extra cycle has passed.

The fix is to measure with two modulation frequencies, which Terabee uses in its TeraRanger Evo. Only one distance fits both phase readings, which extends the usable range while keeping fine resolution.

Quick Tip

When a reading suddenly jumps from far to near, suspect phase wrap around from a bright distant object. Limit the field of view or use a dual frequency mode.

ToF vs Ultrasonic vs IR Triangulation

FeatureOptical ToFUltrasonicIR Triangulation
PrincipleLight travel timeSound echo timeSpot position on a detector
BeamNarrow, about 25 degrees or lessWide coneNarrow spot
Speed of signalLight, 300000 km/sSound, about 343 m/s in airNot time based
Temperature effectVery smallSound speed changes with air temperatureSmall
OutputLinear distanceLinear distanceNonlinear voltage
WeaknessSunlight, dark or glass targetsSoft or angled targets, foamShort range, colour

Ultrasonic sensors, like those in ultrasonic level transmitters, cope well with dust and glass but have a wide beam. For long process ranges, industrial radar level transmitters and laser level transmitters use the same time of flight idea with more power.

400 cmVL53L1X max range, dark
940 nmInvisible Class 1 laser
50 HzRanging rate
27 degreesTypical field of view

These figures come from the ST VL53L1X datasheet, which also lists a 2.6 to 3.5 V supply and I2C at up to 400 kHz. The same datasheet shows range dropping to 73 cm in strong sunlight in long distance mode.

What Affects Accuracy

Ambient infrared light, especially sunlight, adds photons that raise the noise floor and shorten the range. Filters at 940 nm help, but outdoor range is always shorter than indoor range.

Target reflectance matters too, since a white card returns far more light than black rubber or dark cloth. Mirrors and glossy surfaces can send the beam away, while transparent objects may let it pass straight through.

Cover glass in front of the sensor reflects part of the emitted light back into the detector, a problem called crosstalk. ST provides offset and crosstalk calibration routines, and the cover must be tested in the final product.

Myth: Optical ToF works equally well outdoors.
Fact: Sunlight adds noise, and ST lists much shorter range in strong ambient light.
Myth: Any colour of target gives the same range.
Fact: Dark, low reflectance targets reduce the maximum range considerably.
Myth: A clear window has no effect.
Fact: Cover glass causes crosstalk that must be calibrated.
Myth: Higher modulation frequency is always better.
Fact: It improves precision but shortens the unambiguous range.

Installing a Time of Flight Sensor

1
Pick the Window
Use an IR transparent cover with minimal air gap.
2
Clear the Field
Keep the cone free of frames and nearby edges.
3
Calibrate Offset
Measure a known target and store the offset.
4
Calibrate Crosstalk
Run the crosstalk routine with the final cover.
5
Set Timing Budget
Trade measurement time for noise and range.

A longer timing budget averages more photons, reducing noise at the cost of update rate. General guidance on matching sensor, range and environment is in sensor selection criteria.

Do You Know?

The VL53L1X laser is rated Class 1 under IEC 60825 1, so it is eye safe in normal use. Its 940 nm light is invisible, yet many phone cameras can see the faint glow.

Advertisement

6 Smart Uses of a Time of Flight Sensor

Mobile Robots
Obstacle and cliff detection on floor cleaners and service robots.
Solids Level
Short range level of small bins, hoppers and feeders.
People Counting
Multizone sensors count entries at doors and gates.
Gesture Control
Hand swipes and presence without touch.
Smartphones
Camera autofocus and face detection assist.
AGVs
Close range safety and docking on automated vehicles.

In factories, ToF modules often sit beside inductive proximity sensors and other industrial automation sensors to add real distance values. For presence only, a PIR sensor is cheaper, but it cannot measure how far a person is.

Depth cameras based on indirect ToF also support machine vision for quality inspection, measuring box sizes and fill heights. The receiver inside such systems is a fast photodiode, compared in photodiode vs phototransistor.

Advantages
  • Linear distance output in millimetres.
  • Small, low power and low cost modules.
  • Narrow beam compared with ultrasonic.
  • Fast readings, up to tens per second.
Limitations
  • Range falls in bright sunlight.
  • Dark, shiny or clear targets are difficult.
  • Cover glass crosstalk needs calibration.
  • Short range compared with industrial radar.

Time of Flight Sensor Selection Checklist

  • Required range with margin for dark targets.
  • Indoor or outdoor ambient light level.
  • Field of view and single or multizone output.
  • Update rate and timing budget.
  • Supply voltage and I2C address conflicts.
  • Cover window material and crosstalk calibration.
  • Eye safety class and certification.

Several identical modules on one bus need unique addresses, usually set at start up by holding the others in shutdown with their XSHUT pins. Plan this in the wiring before the board is built.

Quick Tip

Mount the sensor slightly recessed and black out the gap around the window. This one step removes most crosstalk and false short readings.

VL53L1X Datasheet PDF

PDF
VL53L1X Time of Flight Laser Ranging Sensor Datasheet
STMicroelectronics datasheet with range, timing and calibration details

VL53L0X Lidar Demonstration Video

Time of Flight Sensor FAQ

What is a time of flight sensor?

It is an optical sensor that emits infrared light and measures how long the light takes to return from a target. The round trip time is converted into distance using the speed of light.

Most compact modules use a 940 nm laser and SPAD detectors on one chip. They report distance in millimetres over I2C to a microcontroller.

How is distance calculated?

For the direct method, distance equals the speed of light times the round trip time divided by two. A 20 ns round trip gives about 2.998 m.

For the phase method, distance equals c times the phase shift divided by 4π times the modulation frequency. A 90 degree shift at 10 MHz gives about 3.747 m.

What is the ambiguity range?

It is the largest distance a phase based sensor can measure before the phase repeats. It equals the speed of light divided by twice the modulation frequency.

At 10 MHz it is about 15 m, so a target at 22.5 m wrongly reads 7.5 m. Dual frequency measurement, as used in the Terabee TeraRanger Evo, removes this error.

How far can a VL53L1X measure?

ST specifies up to 400 cm in the dark with a suitable white target. The range becomes much shorter in bright light, down to 73 cm in strong sunlight in long distance mode.

Target colour and surface also change the usable range. Always test with the real target material, mounting and lighting before finalising a design.

Is a time of flight sensor better than ultrasonic?

Optical ToF has a much narrower beam, a faster response and very small temperature error. It is ideal for compact robots, gesture sensing and short range detection on machines.

Ultrasonic sensors work better with clear glass, dusty air and bright sunlight. The better choice depends on the target material, the environment and the required range.

Why does cover glass cause errors?

Part of the emitted light reflects from the inside of the window straight into the detector. This crosstalk makes the sensor read shorter distances or report false targets.

Use an IR transparent window with a small air gap and run the crosstalk calibration with the final cover fitted. ST provides dedicated routines for this in its driver software.

Are these lasers safe for eyes?

Modules such as the VL53L1X are rated Class 1 under IEC 60825 1, which is safe under normal use. The 940 nm light is invisible to the human eye.

Do not modify the optics or the laser drive current, since that can change the safety rating. Follow the datasheet guidance on cover windows, spacing and assembly.

Advertisement

Related Articles

External References

What We Learn Today

  • A time of flight sensor times light travelling to a target and back, so distance equals the speed of light times time divided by two.
  • Phase based sensors use d = c × φ ÷ (4π f), and their unambiguous range is c ÷ (2f), about 15 m at 10 MHz.
  • Sunlight, dark or shiny targets and cover glass crosstalk limit accuracy, so calibration and careful mounting are essential in every design.
I hope you like above blog. There is no cost associated in sharing the article in your social media. Thanks for reading!! Happy Learning!!

Leave a Reply

Your email address will not be published. Required fields are marked *