ARDUINO With Ultrasonic Sensor (distance Measurement)

by KJ ELECTRONICS in Circuits > Arduino

10322 Views, 34 Favorites, 0 Comments

ARDUINO With Ultrasonic Sensor (distance Measurement)

ULTRASONIC SENSOR.png

In the following video a distance measuring equipment has been designed with the help of the ultrasonic sensor.
the following tutorial will be helpfullto get the overall idea about the ultrasonic sensor in very short time

WATCH THE VIDEO

ARDUINO With ultrasonic sensor (distance measurement)

SMALL OVERVIEW ABOUT HC SR04

1.jpg
2.JPG

SPECIFICATION

Power supply : 5V DC

Quiescent current : <2mA

Effectual angle : <15°

Ranging distance : 2cm – 500 cm

Resolutio n: 1 cm

Ultrasonic Frequency : 40k Hz

HOW DOES THAT WORKS

3.JPG

Initially a pulse is transmitted by the ultrasonic sensor and if there is any object detected by the ultrasonic sensor then it will return that waves to the sensor. On the base of the distance a pulse is generated at the ultrasonic sensor to send the data to arduino or any other microcontroller. the stating pulse is about 10us and the pwm signal will be 150 us-25us on base of the distance

if no obstacle is there then a 38us pulse is generated for arduino to conform that there are not objects detected

Arduino With HC SR-04

4.jpg

connect the arduino as showing in the following schmatic

ARDUINO UNO HC SR-04

+5v ----------------------------------------vcc

gnd ---------------------------------------gnd

12 pin ------------------------------------trig

11 pin ------------------------------------echo

Upload the Program

5.png

upload the following sketch to the arduino ny using the arduino ide

in the code this part is used to calculate the distance

long microsecondsToInches(long microseconds)
{

return microseconds / 74 / 2; }

long microsecondsToCentimeters(long microseconds)

{

return microseconds / 29 / 2;

}

Thanks for Watching

You can modify the following code and make something innovative and don forgot to subscribe to my instructables as well as my youtube channel

in my youtube you can get so many projects in the electronics side as well as so creative videos about the leds and fan dc motors etc..

link to my youtube is

https://www.youtube.com/channel/UCZE35bOktFxu8dIad...

thanks for watching