Summary of Arduino Based Distance Measurement using Ultrasonic Sensor
This project utilizes an Arduino Pro Mini and an HC-SR04 ultrasonic sensor to measure obstacle distances precisely without contact. By transmitting 40 KHz sound waves and calculating the echo return time, the system determines distance using the known speed of sound. The setup includes a 16x2 LCD for display and is powered by a 9V battery.
Parts used in the Ultrasonic Distance Measurement Project:
- Arduino Pro Mini
- Ultrasonic sensor Module
- 16x2 LCD
- Scale
- Bread board
- 9 volt battery
- Connecting wires
Ultrasonic sensors are great tools to measure distance without actual contact and used at several places like water level measurement, distance measurement etc. This is an efficient way to measure small distances precisely. In this project we have used an Ultrasonic Sensor to determine the distance of an obstacle from the sensor. Basic principal of ultrasonic distance measurement is based on ECHO. When sound waves are transmitted in environment then waves are return back to origin as ECHO after striking on the obstacle. So we only need to calculate the travelling time of both sounds means outgoing time and returning time to origin after striking on the obstacle. As speed of the sound is known to us, after some calculation we can calculate the distance.

Components Used
- Arduino Pro Mini
- Ultrasonic sensor Module
- 16×2 LCD
- Scale
- Bread board
- 9 volt battery
- Connecting wires
Ultrasonic Sensor Module
Ultrasonic sensor HC-SR04 is used here to measure distance in range of 2cm-400cm with accuracy of 3mm. The sensor module consists of ultrasonic transmitter, receiver and the control circuit. The working principle of ultrasonic sensor is as follows:
- High level signal is sent for 10us using Trigger.
- The module sends eight 40 KHz signals automatically, and then detects whether pulse is received or not.
- If the signal is received, then it is through high level. The time of high duration is the time gap between sending and receiving the signal.
Distance= (Time x Speed of Sound in Air (340 m/s))/2

Timing Diagram
The module works on the natural phenomenon of ECHO of sound. A pulse is sent for about 10us to trigger the module. After which the module automatically sends 8 cycles of 40 KHz ultrasound signal and checks its echo. The signal after striking with an obstacle returns back and is captured by the receiver. Thus the distance of the obstacle from the sensor is simply calculated by the formula given as
Distance= (time x speed)/2.
Here we have divided the product of speed and time by 2 because the time is the total time it took to reach the obstacle and return back. Thus the time to reach obstacle is just half the total time taken.
Read More
Read More: Arduino Based Distance Measurement using Ultrasonic Sensor
- What is the primary function of the ultrasonic sensor in this project?
The sensor measures the distance of an obstacle from the sensor. - How does the ultrasonic sensor determine distance?
It calculates distance based on the travelling time of outgoing and returning sound waves. - What is the operating range of the HC-SR04 module?
The module measures distance in a range of 2cm to 400cm. - What signal duration is sent using the Trigger pin?
A high level signal is sent for 10us using the Trigger. - At what frequency does the module send ultrasound signals?
The module sends eight 40 KHz signals automatically. - Why is the product of speed and time divided by two?
The division accounts for the total time taken to reach the obstacle and return back. - What formula is used to calculate the distance?
The formula used is Distance equals Time multiplied by Speed of Sound in Air divided by two. - What component is used to display the measured distance?
A 16x2 LCD is used to display the results.
