DISCONNECTED
Controls
Distance
ULTRASONIC

The HC-SR04 ultrasonic distance sensor measures distance by emitting a 40 kHz sound pulse and timing the echo return. It outputs a digital pulse whose duration is proportional to the distance of the reflecting object.

Specifications
Supply voltage5 V
Measuring range2 – 400 cm
Accuracy± 3 mm
Ultrasonic frequency40 kHz
Trigger pulse10 µs TTL
Echo pulse150 µs – 25 ms
Beam angle15°
Package4-pin through-hole
How It Works

Send a 10 µs HIGH pulse on the TRIG pin. The sensor emits 8 bursts of 40 kHz ultrasound and raises the ECHO pin HIGH. Measure the HIGH duration: distance (cm) = pulse_µs / 58. Minimum cycle time is 60 ms to avoid false echoes.

Typical Use Cases
Obstacle avoidance Liquid level Parking sensor Robotics Smart bins Height gauge
Limitations

Minimum range 2 cm creates a blind spot. Soft/angled surfaces absorb or deflect sound. Unreliable in noisy ultrasonic environments or with very thin objects. Temperature affects speed of sound (343 m/s at 20 °C).

Data In
System
Q & A

Sign in to chat with Claude about this sensor.

Settings

Reference Document

Uploaded docs ground Claude's answers in your course material. Stored per user, persists across sessions.

Sign in