Ultrasonic sensors are used to measure distance or detect objects without any physical contact. The ultrasonic sensor work on the principle of ECHO. There are many articles available on the internet showing the complex method of measuring distance that’s why I have decided to make the simplest project.
Please click here to download the Proteus simulation
Distance Measurement Proteus File
Working and Explanation
Sound waves from the sensor travel in an environment when striking with any object it came back to the origin. As the speed of the sound is known we have to calculate the outgoing and incoming time of the wave. These calculations are done through the Arduino program.
This has many applications like mini radar, in parking to avoid accidents, etc.
what is an ultrasonic sensor?
- Operating voltage: +5V
- Theoretical Measuring Distance: 2cm to 450cm
- Practical Measuring Distance: 2cm to 80cm
- Accuracy: 3mm
- Measuring angle covered: <15°
- Operating Current: <15mA
- Operating Frequency: 40Hz
Distance =1/2* (Speed × Time)
- Arduino Uno
- 16×2 LCD
- Ultrasonic sensor Module
- battery source
- Connecting wires
- variable resistor
- At pin no 1 and 2, the virtual terminal to display data is connected.
- At PINs, 3 to 7 LCD is conned.
- At PINs 11 and 12 echo and trig pin of the ultrasonic sensor are connected.
Coding (Distance Measurement using Ultrasonic Sensor and Arduino):
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
const int trigPin = 12;
const int echoPin = 11;
lcd.print(” Distance “);
Serial.print(” Distance “);
lcd.print(” Measurement “);
Serial.print(” Measurement “);
lcd.print(“Geeky Engineers: “);
long duration, inches, cm;
duration = pulseIn(echoPin, HIGH);
inches = microsecondsToInches(duration);
cm = microsecondsToCentimeters(duration);
long microsecondsToInches(long microseconds)
return microseconds / 74 / 2;
long microsecondsToCentimeters(long microseconds)
return microseconds / 29 / 2;
After reading this article “How To measure distance using ultrasonic sensor” you will be able to make this project. We have tried to cover each aspect of the ultrasonic sensor and will look for more and try to add those in the next update. Do you know anything else about this project? Let us know in the comments section below.
As an affiliate, we may earn a commission from qualifying purchases. We get commissions for purchases made through links on this website from Amazon.