COMPONENTS AND SUPPLIES
1. Arduino Uno
2. Ultrasonic Sensor(HC-SR04)
3. Jumper Wires (Male & Female)
4. Bread Board
About This Project:-
Want to make a tool that measures distance without using ruler, then this mini project will be the best solution for it. Here we are going to make a Arduino distance measuring device with a ultrasonic module,Arduino Uno and Bread Board. So lets get started!
How Does a Ultrasonic Module Work?
This module consists of two drums, one of which is a emitter that emits ultrasound and other is receiver which receives the reflected ultrasound from the object. The emitter drum emits ultrasound when we trigger the module using the trigPin by sending a 10 microseconds high pulse.
As soon as the ultrasound is emitted through the emitter the module makes the echoPin high. Emitted ultrasound travels forward till it gets reflected by object and then travels backward. The reflected ultrasound is detected by the receiver.
When the reflected ultrasound is received by the receiver, echoPin is made low. Now we have the time take by the ultrasound to reach the object and again reach the source which is also equal to the duration for which the echoPin was high. This time is stored in the microcontroller. Therefore travel time of ultrasound between just source to object is half the time take to travel source-object-source we know that: Distance = Speed x Total Time But time take to travel distance is half of total time:
(2*distance)Distance=(Time/2) x Speed
Distance=(Time/2) x 29.1
Where 29.1 is the speed of ultrasound in centimeter/microseconds.