An ultrasonic sensor is a range sensor that emits a pulse of high-frequency sound, usually between 40 kHz and a few hundred kHz, and measures the time until the echo returns from an object. Among sensors in robotics it is one of the simplest and cheapest ways to detect obstacles and measure distance, typically from a few centimeters to several meters.
Because sound reflects from almost any solid surface regardless of color or transparency, an ultrasonic sensor sees glass, dark objects and clear plastic that can confuse optical sensors. Its weaknesses are a wide, coarse beam, sensitivity to angled surfaces and a slow update rate compared with LiDAR or depth cameras.
How an ultrasonic sensor measures distance
The sensor uses a piezoelectric transducer that vibrates when driven by a voltage burst and produces an electrical signal when an echo strikes it. Many robotics modules use one transducer to transmit and a second to receive, while automotive parking sensors use a single transducer for both.
Distance follows from the time-of-flight principle: distance equals the speed of sound multiplied by the round-trip time, divided by two. In air at 20 degrees Celsius sound travels at about 343 meters per second, so an echo after 5.8 milliseconds corresponds to roughly one meter.
After transmitting, the transducer keeps ringing for a short time, and echoes arriving during this ringdown period cannot be detected. This creates a blind zone, often 2 to 30 centimeters depending on the design, inside which the sensor reports nothing useful.
Key parameters and typical values
Selecting an ultrasonic sensor means matching its frequency, range and beam width to the task. Higher frequencies give finer resolution and narrower beams but are absorbed faster in air, which shortens the range.
| Parameter | Typical range | What it affects |
|---|---|---|
| Operating frequency | 40 to 400 kHz | Range, resolution and beam width |
| Measuring range | About 2 cm to 10 m | Usable working distance |
| Beam angle | About 10 to 60 degrees | Lateral coverage and ambiguity |
| Resolution | About 1 mm to 1 cm | Smallest detectable distance change |
| Update rate | About 10 to 50 Hz per sensor | Reaction time at speed |
| Blind zone | About 2 to 30 cm | Minimum measurable distance |
The update rate is limited by physics: the sensor must wait for echoes from the farthest expected target before firing again. For a 5 meter range the round trip already takes about 30 milliseconds, which is why ultrasonic arrays often fire sensors in staggered sequences to avoid crosstalk.
Ultrasonic sensors compared with other range sensors
In robotics, the ultrasonic sensor competes with infrared, time-of-flight and LiDAR sensors. Each uses a different physical signal, so each has a distinctive pattern of strengths and blind spots, and robust robots often combine two of them.
| Sensor | Signal | Strength | Weakness |
|---|---|---|---|
| Ultrasonic sensor | Sound pulse | Sees glass and dark objects, low cost | Wide beam, slow, angle sensitive |
| Infrared sensor | Reflected infrared light | Small, fast, cheap | Affected by color and sunlight |
| Time-of-flight sensor | Modulated light | Precise, narrow field | Fails on transparent surfaces |
| LiDAR | Scanned laser pulses | Detailed maps, long range | Costly, misses glass |
| Radar | Radio waves | Works in dust, fog and rain | Lower angular resolution |
This complementarity explains a common design pattern: a robot navigates with LiDAR but carries a ring of ultrasonic sensors around its base as a safety layer, catching glass doors, table legs and low obstacles that the laser scanner can miss.
Using ultrasonic sensors on a robot
Good results depend more on placement and signal handling than on the sensor itself. Mounting height, spacing between sensors and filtering of noisy readings determine whether the data is useful for obstacle avoidance.
| Situation | Recommended choice | Reason |
|---|---|---|
| Several sensors side by side | Fire them in sequence | Prevents one sensor hearing another |
| Robot moving quickly | Combine with a faster sensor | Update rate limits reaction time |
| Large temperature swings | Compensate the speed of sound | Speed changes about 0.6 m/s per degree |
| Noisy or spurious readings | Apply median filtering | Removes isolated false echoes |
| Liquid or bin level sensing | Use a narrow-beam industrial unit | Avoids echoes from container walls |
Ultrasonic readings are usually treated as a cone of uncertainty rather than a point. Classic occupancy grid mapping marks the whole arc at the measured distance as possibly occupied and the space inside the cone as probably free, which turns coarse measurements into a useful map over time.
Limitations and failure modes
Most ultrasonic errors arise from how sound reflects. Smooth surfaces act like acoustic mirrors, so a wall hit at a shallow angle sends the echo away from the receiver and the sensor reports no obstacle at all.
- Specular reflection: angled smooth walls beyond about 30 degrees may return no echo.
- Multipath echoes: sound bouncing via a second surface makes objects appear farther away.
- Soft absorbing materials such as foam, curtains and clothing return weak echoes.
- Crosstalk between neighboring sensors produces phantom obstacles.
- Wind, temperature gradients and acoustic noise from compressed air can disturb readings.
A common misconception is that the reported distance belongs to the object straight ahead. In reality the sensor returns the nearest echo anywhere inside its beam, so a narrow doorway can appear blocked by its frame, and a small object off to the side can look as if it sits in the robot path. Treating each reading with its full beam geometry, rather than as a single ray, prevents many false stops and missed openings in narrow spaces.
Put simply
An ultrasonic sensor works like a bat or a dolphin. It makes a very high-pitched click that people cannot hear and listens for the echo. The longer the echo takes to come back, the farther away the object is.
It is cheap and can notice things that cameras and lasers miss, like a glass door. The catch is that it sees only a blurry cone in front of it, so it tells a robot that something is there, not exactly what or where.
In practice
A small delivery robot operating in an office building uses a 2D LiDAR for navigation, but during trials it repeatedly drove toward glass partitions and the transparent doors of meeting rooms. The laser beams passed through the glass, so the map showed open space where there was a wall.
Engineers added six ultrasonic sensors around the front bumper, firing in sequence at about 15 Hz each, and configured the planner to stop when any reading dropped below 40 centimeters. The glass collisions stopped, and the robot also began detecting the thin metal legs of chairs that the scanner had missed. The ultrasonic layer did not replace the LiDAR; it closed its blind spots at very low cost.