Ultrasonic Sensors: How They Work, Range, Blind Zone and the HC-SR04 Explained
Ultrasonic sensors measure distance with sound. They detect almost any material, including glass and liquids, regardless of colour. This guide explains how they work, what limits their range and accuracy, how the popular HC-SR04 module works, and where industrial ultrasonic sensors fit best.
An ultrasonic sensor measures distance the way a bat does: it sends out a short burst of high-frequency sound and listens for the echo. Because sound reflects off almost any solid or liquid surface, ultrasonic sensors detect transparent glass, shiny metal, dark plastic and water equally well. They are used in car parking aids, robots, tank level measurement, and countless factory machines.

How an ultrasonic sensor works
- A transducer, usually a piezoelectric element, vibrates to send a short pulse of ultrasound, typically somewhere between about 40 kHz and a few hundred kHz.
- The pulse travels through the air, reflects off the target and returns.
- The same transducer, or a separate receiver, detects the echo.
- The electronics measure the time between sending and receiving and calculate the distance: distance = speed of sound × time ÷ 2. The division by two accounts for the trip there and back.
Example: in air at 20 °C, sound travels at about 343 m/s, so an echo that arrives after 5.83 ms means the target is 1 m away.
Temperature and the speed of sound
The speed of sound in air changes with temperature: about 331 m/s at 0 °C, 343 m/s at 20 °C and 355 m/s at 40 °C, or roughly 0.6 m/s per degree. Without correction, a 20 °C change causes an error of around 3.5 %. Industrial ultrasonic sensors therefore include a temperature sensor, often a thermistor, for automatic compensation. Humidity and air pressure have much smaller effects.
Range, blind zone and beam angle
- Range: lower frequencies travel farther but give a wider beam and lower resolution. Small sensors reach tens of centimetres to a few metres; large industrial and level sensors reach 10 m or more.
- Blind zone (dead band): right after sending a pulse, the transducer is still ringing and cannot hear an echo. Targets closer than this minimum distance cannot be measured.
- Beam angle: sound spreads out in a cone. A wide beam detects objects that are slightly off-axis; a narrow beam ignores nearby walls and tank fittings.
What can make readings unreliable
- Soft or absorbent targets such as foam, cloth and powders, which return weak echoes.
- Angled smooth surfaces, which reflect sound away from the sensor like a mirror.
- Foam on liquids, heavy dust, steam and strong air currents.
- Several sensors close together, which can hear each other's pulses unless synchronised.
The HC-SR04 module
The HC-SR04 is the low-cost ultrasonic module found in many Arduino and Raspberry Pi projects. It uses separate 40 kHz transmit and receive transducers and runs on 5 V. Its typical specified range is about 2 cm to 4 m, with a beam angle of around 15°.
- The microcontroller sends a 10 µs high pulse to the Trig pin.
- The module sends a burst of 40 kHz sound.
- The Echo pin goes high for as long as the sound takes to return.
- Distance in centimetres is roughly the echo pulse width in microseconds divided by 58.
The Echo pin outputs 5 V, so a voltage divider or level shifter is needed for 3.3 V boards. For outdoor or wet environments, waterproof modules with a single sealed transducer are available.
Industrial ultrasonic sensors
Industrial sensors come in rugged threaded barrels (commonly M18 and M30) or block housings, with automatic temperature compensation and outputs such as switching outputs, 4-20 mA, 0-10 V and IO-Link. Typical uses:
- Level measurement of liquids and bulk solids in tanks and silos.
- Detecting transparent objects such as glass bottles and clear film, which optical sensors miss.
- Roll diameter and loop control in paper, film and textile machines.
- Height and presence detection of vehicles, pallets and people.
Ultrasonic vs other distance sensors
| Ultrasonic | Infrared / laser ToF | Radar | |
|---|---|---|---|
| Transparent targets | Detected | Often missed | Detected |
| Colour and light effects | None | Some | None |
| Dust, steam, foam | Affected | Affected | Little effect |
| Beam | Wide | Narrow | Medium |
| Cost | Low | Low to medium | Medium to high |
Frequently asked questions
How accurate are ultrasonic sensors?
Industrial sensors with temperature compensation often achieve resolution of 1 mm or better and repeatability within a fraction of a per cent of range. Low-cost modules are typically accurate to a few millimetres to a centimetre in good conditions.
Can ultrasonic sensors work in water?
Yes, with transducers designed for water. Sound travels about four times faster in water than in air, which is the basis of sonar and underwater ranging.
Why does my ultrasonic sensor give random readings?
Common causes are targets at an angle, soft surfaces, the target being inside the blind zone or outside the beam, electrical noise, or echoes from nearby objects.
Related guides: lidar vs radar vs ultrasonic vs camera, level sensor types, proximity sensor types, and the Listen2Future acoustic sensor project.
Find ultrasonic sensor suppliers in the Sensor Times directory.