
Information Header
| Parameter | Details |
| Design ID | DB-0004 |
| Design Name | HC-SR04 Ultrasonic Distance Meter |
| Category | Sensors & Measurement |
| Subcategory | Distance Measurement |
| Application | Non-contact distance measurement |
| Controller | Arduino UNO R3 |
| Sensor | HC-SR04 Ultrasonic Sensor |
| Complexity Level | Beginner |
| Hardware Status | Reference Design |
| Design Platform | KiCad EDA |
| Design License | [LICENSE TO BE CONFIRMED] |
| Last Updated | 05 November 2026 |
Quick Summary
The HC-SR04 Ultrasonic Distance Meter is an Arduino-based hardware design for measuring the distance between a sensor and a target object without physical contact. It uses the HC-SR04 ultrasonic ranging module to transmit ultrasonic pulses and calculate distance from the time taken by the reflected signal to return.
An Arduino UNO processes the sensor’s trigger and echo signals and calculates the measured distance. The measurement can be monitored through the Arduino Serial Monitor. This design is suitable for distance measurement experiments, robotics, obstacle detection and object-position monitoring.
Key Features
- Non-contact distance measurement using the HC-SR04 ultrasonic sensor.
- Measurement range of approximately 2 cm to 400 cm under suitable operating conditions.
- Arduino UNO-based signal processing.
- 40 kHz ultrasonic transmission.
- Digital trigger and echo interface.
- Distance calculation using ultrasonic time-of-flight measurement.
- Real-time measurement output through the Arduino Serial Monitor.
- Simple hardware architecture with minimal external components.
Block Diagram
🔧
Need a modification?
Need changes in this design for your application?
🛠️
Need a new design?
Need changes in this design for your application?
Applications
- Distance Measurement
Hardware Specifications
| Parameter | Specification |
| Main Controller | Arduino UNO R3 |
| Microcontroller | ATmega328P |
| Ultrasonic Sensor | HC-SR04 |
| Sensor Operating Voltage | 5V DC |
| Sensor Operating Current | Approximately 15 mA (module-dependent) |
| Measurement Principle | Ultrasonic Time-of-Flight |
| Measurement Range | 2 cm – 400 cm |
| Ultrasonic Frequency | 40 kHz |
| Trigger Signal | 10 µs TTL HIGH pulse |
| Echo Signal | TTL digital output |
| Communication Interface | Digital GPIO |
| Measurement Output | Serial Monitor |
| Serial Baud Rate | 9600 bps (reference implementation) |
| PCB Dimensions | Not Specified |
| PCB Layer Count | Not Specified |
Design Overview
The design consists of an Arduino UNO R3 connected to an HC-SR04 ultrasonic ranging module.
The sensor uses ultrasonic time-of-flight measurement to determine the distance of an object.
The Arduino generates a trigger pulse on the TRIG pin of the HC-SR04 module. After receiving the trigger signal, the module transmits eight ultrasonic pulses at 40 kHz.
When these pulses encounter an object, a portion of the transmitted acoustic energy is reflected towards the sensor.
The HC-SR04 detects the returning signal and generates a HIGH-level pulse on its ECHO output. The pulse duration represents the total time taken by the ultrasonic signal to travel to the object and return.
The Arduino measures this pulse duration and calculates the distance.
Distance Calculation
The distance is calculated using the following equation:
Distance = (Time × Speed of Sound) / 2
Where:
- Time = Measured ECHO pulse duration.
- Speed of Sound = Approximately 343 m/s at 20°C.
- Division by 2 accounts for the outgoing and returning ultrasonic paths.
For distance in centimetres:
Distance (cm) = Echo Duration (µs) × 0.0343 / 2
The calculated distance is transmitted through the Arduino serial interface for monitoring.
Complete BOM
| Reference | MPN | MFR | Qty |
| C1,C3 | 25YXJ220M6.3X11 | Rubycon | 2 |
| C2,C4,C8,C9 | C315C104M5U5TA | KEMET | 4 |
| C5,C6 | C315C220K5G5TA | KEMET | 2 |
| D1 | WP710A10ID | Kingbright | 1 |
| D2 | 1N4007-E3/54 | Vishay | 1 |
| DS2 | WC1602A | Wincom Tech | 1 |
| IC1 | HC-SR04 | OSEPP Electronics | 1 |
| J1 | DCJ200-10-A-K1-K | GCT | 1 |
| R1,R3 | CFR-25JB-52-330R | Yageo | 2 |
| R2 | CFR-25JB-52-10K | Yageo | 1 |
| RV1 | 3296W-1-103LF | Bourns | 1 |
| SW1 | B3F-1022 | Aratas | 1 |
| U1 | ATMEGA328P-PU | Microchip | 1 |
| U2 | L7805CV | STMicroelectronics | 1 |
| Y1 | ABL-16.000MHZ-B2 | Abracon | 1 |
FAQ
1. What is the HC-SR04 ultrasonic distance meter?
It is an Arduino-based distance measurement system that uses ultrasonic time-of-flight measurement to determine the distance between a sensor and an object without physical contact.
2. What is the measurement range of the HC-SR04 sensor?
The commonly specified measurement range is approximately 2 cm to 400 cm. Actual performance depends on the target object and operating environment.
3. How does the HC-SR04 calculate distance?
The sensor transmits ultrasonic waves and measures the time taken for the reflected signal to return. The Arduino calculates distance using the speed of sound and the measured round-trip travel time.
4. Why does the HC-SR04 have separate TRIG and ECHO pins?
TRIG receives the trigger pulse from the microcontroller to initiate measurement. ECHO provides a pulse whose duration represents the ultrasonic signal’s round-trip travel time.
5. Can the HC-SR04 be used without Arduino?
Yes. The HC-SR04 can interface with other microcontrollers that support suitable digital trigger and echo signals.
6. Can I manufacture a custom PCB for this design?
Yes. The circuit can be converted into a custom PCB using KiCad EDA. PCB manufacturing and assembly can be requested through ICDigest manufacturing partners.
Schematic in pdf
KiCad File