An ultrasonic sensor is a device that uses sound waves above 20 kHz to detect how far away something is, where it is, whether it’s there, or the level of a liquid. It works by sending out sound waves and listening for the echoes, which answers a key question: “Is it there? How far is it? Where is it?” Common types include distance-measuring, switching, liquid-level, fork, and module types.
Ultrasonic sensors use sound waves above 20 kHz to detect objects without touching them. The most common way to measure distance is called time of flight (ToF): the sensor sends out a sound wave, the wave hits an object and bounces back, and the sensor records the time from sending to receiving. Then it calculates the distance using:
Distance = speed of sound × time ÷ 2
You divide by 2 because the sound wave travels there and back. The speed of sound changes with temperature, so high-precision applications need temperature compensation. Besides ToF, Doppler is used to measure speed, through-beam/fork-type sensors are used for position and counting, and ultrasonic communication is a communication application.

An ultrasonic sensor really has only a few specs that truly stand out — the signature parameters that set it apart from photoelectric, laser, and magnetic sensors.
|
Parameter |
When Most Critical |
Selection Guideline |
Reference Examples / Typical Values |
|
Range / Blind Zone |
Long-range liquid level |
Add 20–50% margin to the max distance |
General modules: 2–400 cm, blind zone approx. 2 cm |
|
Beam Angle |
Robot obstacle avoidance |
Choose a narrow beam when obstacles are nearby |
General modules: approx. 15° |
|
Frequency |
Long-range liquid level |
Long distance = high attenuation, choose low frequency |
General: 40 kHz |
|
Response Time |
Conveyor counting |
Calculate detections per second |
General modules: 20–60 ms |
|
Temperature Compensation |
High-precision ranging |
Choose built-in compensation if temperature difference is large or high accuracy is required |
General modules: usually none |
Q: Why do ultrasonic sensors have a blind zone?
A: After transmitting, the sensor has to switch to receive mode, and the transducer is still ringing (its residual vibration hasn’t died down), so nearby echoes can’t be separated. When selecting a sensor, the minimum distance must be greater than the blind zone.
Q: How do you prevent crosstalk between multiple sensors?
A: Use time-staggered triggering, different frequencies, narrow beams, lower transmit power, and isolation barriers.
Q: Can it measure foam or steam?
A: Usually not reliably. Foam absorbs or scatters sound waves, and steam changes the speed of sound and the propagation path. Consider radar, guided-wave, or high-frequency solutions.
Q: How do you choose between ultrasonic, laser, and radar?
A: Ultrasonic is not affected by color or transparency and is good for liquid level and dirty environments, but it has slower response, a wider beam, and is affected by wind and temperature. Laser is highly accurate and fast, but struggles with transparent, black, or contaminated targets. Radar penetrates steam and foam better, but costs more.
