PartAndStock
Sensors

What Is a Distance Sensor (ToF / Ultrasonic)?

1 min read
Quick answer

A distance sensor is a sensor that measures the distance to an object. It has two common methods: ultrasonic (sound) and ToF (light).

Ultrasonic Sensor

It sends a sound pulse and measures the return time of the echo. Since the speed of sound is known, this time is converted to distance (e.g. the HC-SR04). It's cheap and simple.

ToF (Time of Flight)

It applies the same logic with light (laser): it measures the round-trip time of the light. It's faster, more precise and clearer at short range.

Comparison

PropertyUltrasonicToF
MediumSoundLight
PrecisionMediumHigh
Surface effectSoft surface is weakTransparent/shiny surface is hard

Where Is It Used?

Robot obstacle avoidance, parking sensors, water-level measurement and contactless distance measurement.

Beam Angle

Ultrasonic sensors radiate in a narrow cone; this beam angle determines what width of objects it detects. A wide angle scans more area but can't distinguish small objects; a narrow angle gives a more precise direction but sees a narrow region.

Common Mistakes

  • Not accounting for surface/angle: slanted or soft surfaces weaken the echo.
  • Using it out of range: every sensor has a min/max measurement range.
  • Ignoring temperature: the speed of sound changes with temperature; precise ultrasonic measurement needs correction.

Frequently Asked Questions

How does the HC-SR04 work?+
It sends an ultrasonic pulse and measures the echo's return time; it multiplies the time by the speed of sound to find the distance.
ToF or ultrasonic?+
ToF for precise and fast measurement; ultrasonic for a cheap and simple solution.

Search parts related to "What Is a Distance Sensor (ToF / Ultrasonic)?"

Find the right part by comparing price, stock and distributors.

Search These Parts