HC-SR04 Ultrasonic Distance Sensor Module
HC-SR04 Ultrasonic Distance Sensor Module
Accurate Affordable Widely Used in Robotics
The HC-SR04 Ultrasonic Distance Sensor Module is one of the most popular distance-measuring sensors used in electronics, robotics, and IoT projects. It measures the distance between the sensor and an object using ultrasonic sound waves, making it ideal for obstacle detection, automation, and smart systems.
Infographic Overview
Basic Specifications
Feature | Details |
Measuring Range | 2 cm 400 cm |
Accuracy | 3 mm |
Operating Voltage | 5V DC |
Working Current | ~15 mA |
Working Frequency | 40 kHz |
Measuring Angle |
Pin Configuration
Pin | Function |
VCC | Power supply (5V) |
Trig | Trigger input signal |
Echo | Output signal (pulse width indicates distance) |
GND | Ground |
How It Works (Simple Explanation)
1 The microcontroller sends a 10 s pulse to the Trig pin.2 The sensor emits 8 ultrasonic sound waves at 40 kHz.3 The waves travel through the air and reflect from an object.4 The reflected wave returns to the sensor and is received by the Echo pin.5 The sensor calculates distancee Formula
Distance=Time'Speed of Sound2Distance = \frac{Time \times Speed\ of\ Sound}{2}Distance=2Time'Speed of Sound
(Speed of sound 343 m/s)
Main Components of the Sensor
Ultrasonic Transmitter Sends sound waves
Ultrasonic Receiver Receives reflected waves
Control Circuit Processes timing signals
Pin Interface Connects to microcontrollers
Common Applications
Obstacle avoidance robots Smart parking systems Distance measuring devices Water level monitoring Automatic door systems Smart trash bins Drone altitude measuremer short distances Works in dark environments (not affected by light)
Limitations
Soft materials absorb sound waves Not ideal for very small objects Performance affected by temperature and air conditions Limited detection angle
Compatible Microcontrollers
The HC-SR04 works easily with:
Arduino Uno
ESP32
Raspberry Pi
Arduino Nano
Typical Sensor Layout
[ Ultrasonic Transmitter ] [ Ultrasonic Receiver ]( O ) ( O )HC-SR04 Ultrasonic Sensor-----------------------------------------| VCC | Trig | Echo | GND |-----------------------------------------
Tip: Since you often work with robotics kits and sensors (like ESP32 anobstacle avoidance and distance detection systems.

