Please note, circuit diagram at 0:56 should be: 5v to VCC, GND to GND, D10 to Trig, D9 to Echo.

https://howtomechatronics.com/tutorials/arduino/ultrasonic-sensor-hc-sr04/ ► More details, circuit schematics and codes from my official website.

In this Arduino Tutorial you will learn how to use the HC-SR04 Ultrasonic sensor. It can measure distance from 2 cm to 4 meters with a ranging accuracy up to 3mm. The working principle of this module is quite simple.

Visit HowToMechatronics.com for more Tutorials, Tips, Projects and How It Works videos:
► https://howtomechatronics.com/

Like my page on Facebook:
► https://www.facebook.com/howtomechatronics

Add me on Google+:
►https://plus.google.com/+Howtomechatronics

Music: Aduro by Jens Kiilstofte (machinimasound.com/music)

, https://i.ytimg.com/vi/ZejQOX69K5M/hqdefault.jpg

source

45 Comments

  1. i have a question. i tried the ultrasonic buzzer but the distance kept on showing 0 for me… i looked at all my steps and also verified the code and the code works… im not actually sure what i did wrong, but if anyone knows how to help me pls tell me.

  2. Can somebody pls tell me the range of this sensor? Want to build a rangefinder with it but only if it can measure longer distances

  3. Hi, im thinking about build this for my car. do i need more then one sensor for front and back or is the angle of this sensor to small?

  4. hello my sensor us – 015, it does not detect less than <11cm even when the distance is between 2 and 11cm. Do you know why it could be? Thank you.

  5. Hope this measurement can not be accurate. because speed of sound is not constant. Speed of sound vary based on temperature of air.

  6. OMG all the stupid youtubers give their website and not the diagram in the video with LCD, thumbs up if u agree

  7. Is there something like an expansion of this code on the timetravel?
    duration=pulsIn(echoPin, HIGH);

    Because i’m planning to use other radio frequency module but still same concept of getting distance as ultrasonic

  8. on my serial monitor only zeros show up (and sometimes numbers like 890 and 1238) what did i do wrong.

  9. Could you somehow code a trigger for when the distance is shorter than a certain length, then have a count of how many times that happens on the lcd

  10. For people who keep getting 0000000,
    If you did exactly like the video you properly burned the ultrasonic sensor because the circuit in the video is wrong.

  11. i am gonna use this and putt it on my sister's door every time the door opens i will program it to remind her that her name is " Precious "

  12. i have an arduino nano 33 iot, that works at 3.3V, is there a way to use this sensor with it?

  13. why my serial monitor show the wrong value of distance? even I put the barrier in front of the sensor but it shows 120++

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.