Ultrasonic Sensor (HC-SR04)
Distance measurement using sound waves for obstacle detection
Overview
The HC-SR04 ultrasonic sensor measures distance by emitting ultrasonic sound waves and calculating the time taken for the echo to return. It is widely used in obstacle detection, robotics, and level monitoring applications due to its reliability, accuracy, and ease of interfacing.
Technical Specifications
Operating Voltage:
5 V DC
Operating Current:
15 mA
Frequency:
40 kHz
Range:
2 cm – 400 cm
Accuracy:
±3 mm
Measuring Angle:
15°
Trigger Pulse:
10 µs TTL pulse
Echo Pulse:
150 µs – 25 ms
Key Features
- Non-contact distance measurement
- High accuracy and stable performance
- Wide detection range up to 4 m
- Simple digital trigger and echo interface
- Low power consumption
- Compact and lightweight module
- No moving parts for long life
- Unaffected by ambient lighting
Wiring Diagram
Basic Connection (Arduino Uno)
HC-SR04 Pin
→
Arduino Pin
VCC
→
5V
GND
→
GND
Trig
→
Digital Pin 9
Echo
→
Digital Pin 10
Common Applications
Robot Navigation
Obstacle detection and autonomous movement
Distance Measurement
Non-contact object distance sensing
Security Systems
Motion and proximity detection
Level Monitoring
Water tank and liquid level sensing