Ultrasonic Sensor (HC-SR04) Range Detector Using Arduino:-

//prem narayan


Pineapple           1. Arduino Uno

Pineapple           2. Ultrasonic Sensor(HC-SR04)

Pineapple           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?

(HC-SR04 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:


Distance=(Time/2) x Speed
Distance=(Time/2) x 29.1

Where 29.1 is the speed of ultrasound in centimeter/microseconds.

Related Articles


Your email address will not be published. Required fields are marked *