Distance Measurement With Ultrasonic Sensor and Arduino

Introduction: Distance Measurement With Ultrasonic Sensor and Arduino

Here I have shown a simple way to measure distance and detect objects using ultrasonic sonar and Arduino. I have mentioned the connection diagram and provided the coding as well. Also I made a video on the topic in DIY style and uploaded to my channel. The video link also is provided in the last step.

Thanks for all the websites where the images are downloaded from.

Please find my channel and subscribe for more DIY projects and tutorials: https://www.youtube.com/channel/UCZHxq0gM-m-sDQIjP...

Step 1: Arrange the Equipment

The Equipment you need are:

1. Arduino (I used a Uno board)

2. Ultrasonic sonar (https://www.ebay.com/p/1pcs-Ultrasonic-Module-Hc-s...

3. Jumper wires (male to female)

4. Computer to read the serial monitor

Step 2: Connection

Connect the wires of the sonar to the Arduino as follows:

Sonar Arduino

Gnd Ground

Echo Digital pin 10

Trig Digital pin 9

Vcc 5V

Provide power to the Arduino using usb cable with computer.

Step 3: Coding

Please find the coding in the following link: https://drive.google.com/file/d/1_BWU5w-HfGABOPc2A...

Attachments

Step 4: Upload and Test

Upload the code to the Arduino and open your serial monitor.

Bring an object near to the sonar and you will see the distance value in centimeters.

The demonstration you can find in the video (at the end of the video) :

Good Luck!!!

Be the First to Share

    Recommendations

    • Mason Jar Speed Challenge

      Mason Jar Speed Challenge
    • Bikes Challenge

      Bikes Challenge
    • Remix Contest

      Remix Contest

    3 Discussions

    0
    DIY Hacks and How Tos

    Great first tutorial. You should enter this into the First Time Authors contest.

    0
    Nova Technologies
    Nova Technologies

    Reply 2 years ago

    Hi Thanks. Can you guide me how to apply for the contest?

    0
    DIY Hacks and How Tos
    DIY Hacks and How Tos

    Reply 2 years ago

    Go to the contest page here: https://www.instructables.com/contest/
    Then select the contest that you are interested in.
    Right below the contest banner graphic you will see a button that says "Enter Now" Click it.
    Then just follow the instructions and select the Instructable to enter.