Guides

How does an ultrasonic sensor work? Range, blind zone and accuracy

DWIN Engineering, , 6 min read

How does an ultrasonic sensor work? Range, blind zone and accuracy

An ultrasonic distance sensor sends a short pulse of sound above 20 kHz, times how long the echo takes to come back from the target, and converts that time to distance: distance = speed of sound × time ÷ 2. In air at 20 °C sound travels about 343 m/s.

Time of flight

The transducer is a piezoelectric element that both speaks and listens. It is driven for a few cycles at its resonant frequency, typically 40 kHz for long-range air sensors, then switched to receive. The controller measures the time from the pulse to the first echo above a threshold.

Because the sound travels to the target and back, the one-way distance is half the path. A 10 ms echo in air at 20 °C means 343 m/s × 0.010 s ÷ 2 ≈ 1.72 m.

Why temperature matters

The speed of sound in air rises by about 0.6 m/s for every degree Celsius. Between 0 °C and 40 °C it changes by roughly 7%, which would be a 7 cm error at 1 m. Good sensors measure air temperature and correct the result; the datasheet tells you whether a model is temperature compensated.

Blind zone

After it transmits, the transducer keeps ringing for a short time and cannot hear an echo. Any target closer than this blind zone is not measured, or is reported at the blind-zone distance. Sealed waterproof probes usually ring longer, so they have a larger blind zone than open modules.

Beam angle

The sound leaves in a cone. A narrow beam reaches farther and ignores walls beside the target, which suits tanks and wells. A wide beam covers more space, which suits obstacle avoidance on robots and vehicles. The datasheet beam angle is usually measured at the −3 dB or −6 dB point.

Targets that measure well, and badly

  • Good: flat, hard surfaces facing the sensor, such as water, walls, boxes and vehicles
  • Harder: soft materials that absorb sound, such as foam, cloth and loose snow
  • Harder: surfaces at a steep angle that reflect the echo away
  • Harder: very small or thin targets, such as wires and branches

Choosing an output

UART modules send the distance as a digital frame and are easy to read from a microcontroller. PWM outputs encode distance as pulse width. RS485 with Modbus suits long cables and several sensors on one bus. Switch outputs simply change state at a set distance, and 4 to 20 mA suits industrial controllers.

Advantages and disadvantages of ultrasonic sensors

Ultrasonic sensors measure without contact, are not affected by the colour or transparency of the target, and work in darkness, dust and smoke at low cost. They detect clear liquids and glass that optical sensors miss.

Their limits follow from sound: a blind zone close to the sensor face, echoes lost from soft, foamy or steeply angled surfaces, readings that drift with air temperature unless compensated, a wide beam that can pick up nearby objects, and a slower update rate than a laser. Strong wind, steam and heavy condensation on the transducer also disturb the measurement.

Where ultrasonic sensors are used

  • Car parking sensors and automated parking
  • Blind-spot and collision warning on vehicles
  • Liquid level in tanks, wells and rivers
  • Waste-bin fill level
  • Obstacle avoidance on robots and AGVs
  • Presence and distance detection in factory automation

Frequently asked questions

How accurate are ultrasonic sensors?

A good temperature-compensated ultrasonic sensor is accurate to about a centimeter plus a fraction of a percent of the distance. DWIN's A01, A02 and A17, for example, are specified at ±(1 cm + 0.3% of distance), which is ±1.6 cm at 2 m. Real accuracy also depends on the target: flat, hard surfaces facing the sensor measure best.

How do you check if an ultrasonic sensor is working?

Power it at its rated voltage, point it at a flat wall at a known distance beyond the blind zone, and read the output: a UART frame, a pulse width or a switch state. Move the wall or the sensor and check that the reading follows. A reading stuck at the blind-zone or maximum value usually means no echo, a blocked or wet transducer, or a wiring fault.

Does an ultrasonic sensor need PWM?

No. PWM is one way a sensor can report distance, as a pulse whose width is proportional to the distance. Many sensors offer UART, RS485, switch or analog outputs instead or as well; DWIN's A01-V2.0 offers UART, PWM and switch outputs. Choose the output your controller reads most easily.

What is the maximum range of an ultrasonic sensor?

Air-coupled ultrasonic sensors typically reach from a few meters up to about 10 m on a flat target. DWIN's range runs from compact modules such as the A09 (20 to 350 cm) to the ME007-ULS (27 to 800 cm) and the A17 well sensor (25 to 1,000 cm). Soft, small or angled targets shorten the usable range.

Ultrasonic distance sensors, Ultrasonic level sensors, Ultrasonic parking sensors, Underwater sensors