Arduino Tutorial – Ultrasonic Sensor HC-SR04 with Buzzer and LED | Mert Arduino and Tech
|Arduino Tutorial – Ultrasonic Sensor HC-SR04 with Buzzer and LED | Mert Arduino and Tech
New Video November 8, 2018: https://youtu.be/tl6A7EKicjo
The Last Few Days Save 40% More for Electronics: https://goo.gl/covX9J
In this Arduino Tutorial we will learn how the HC-SR04 Ultrasonic Sensor works and how to use it with Buzzer and LED.
Required Hardware
Arduino Board – https://goo.gl/UyGYeF
Ultrasonic Sensor HC-SR04 – https://goo.gl/dRkWUg
Buzzer
LED
220ohm Resistor
Breadboard – https://goo.gl/yCa8hX
Wires – https://goo.gl/VRzUN4
Recommended Shopping Site — https://goo.gl/GMS5uK
Arduino Starter Learning Kit — https://goo.gl/7euGGy
Arduino Compatible Tools — https://goo.gl/pR5FsF
Arduino Modules Boards — https://goo.gl/bSCfwv
Professional Tools — https://goo.gl/9Ym9MM
3D Printer and Tools — https://goo.gl/rnN9At
Flash Deals for Electronic — https://goo.gl/wvZAJG
Mobile Device Deals — https://goo.gl/LzAwSu
—————————————————————————
Connections:
HC-SR04 Sensor
– The HC-SR04 Ultrasonic Module has 4 pins, Ground, VCC, Trig and Echo. The Ground and the VCC pins of the module needs to be connected to the Ground and the 5 volts pins on the Arduino Board respectively and the trig and echo pins to any Digital I/O pin on the Arduino Board.
– The HC-SR04 sensor attach to the Breadboard
– The Sensor VCC connect to the Arduino Board +5V
– The Sensor GND connect to the Arduino Board GND
– The Sensor Trig connect to the Arduino Board Digital I/O 9
– The Sensor Echo connect to the Arduino Board Digital I/O 10
Buzzer and LED
– The Buzzer attach to the Breadboard
– The Buzzer long leg (+) connect to the Arduino Board Digital 11
– The Buzzer short leg (-) connect to the Arduino Board GND
– The LED attach to the Breadboard
– The Resistor connect to the LED long leg (+)
– The Resistor other leg (from LED’s long leg) connect to the Arduino Board Digital 13
– The LED short leg (-) connect to the Arduino Board GND
About Source Code:
– First you have to define the Trig and Echo pins. In this case they are the pins number 9 and 10 on the Arduino Board and they are named trigPin and echoPin. Then you need a Long variable, named “duration” for the travel time that you will get from the sensor and an integer variable for the distance.
– In the setup you have to define the trigPin as an output and the echoPin as an Input and also start the serial communication for showing the results on the serial monitor.
– If the object is 10 cm away from the sensor, and the speed of the sound is 340 m/s or 0.034 cm/µs the sound wave will need to travel about 294 u seconds. But what you will get from the Echo pin will be double that number because the sound wave needs to travel forward and bounce backward. So in order to get the distance in cm we need to multiply the received travel time value from the echo pin by 0.034 and divide it by 2.
—————————————————————————
Get the Source Code — https://goo.gl/Y1WwYs
—————————————————————————
Arduino Tutorial – Ultrasonic Sensor HC-SR04 with Buzzer and LED | Mert Arduino and Tech
Arduino Tutorial – Ultrasonic Sensor HC-SR04 with Buzzer and LED | Mert Arduino and Tech
Thank you very much i am starting to learn arduino and thanks to you i can learn the hardware and then i will work on software
Thank you sir, it's working
My buzzer not working … how can i fix ?
thanks dude
please how to add servo
nice video……..i want more ideas
wow
wow
wow
Is there any way to make it beep when something is not present?
شكرا لك لقد افدتني كثيرا شكرا
your one is wrong
bro i want the led to stop when something comes near to it…….plz someone help
Yaptıgınız sistemin aynısını yaptım fakat buzzerin sesi cok az cıkıyor ve bip sesi gelmiyor.İnternetten set halinde sipariş vermiştim.
Nice bro
good work very nice I say pewdiepy I hate pewie pie
Hey! I love this project tysm. But I was wondering How would I increse/decrese the range so that it will turn buzzer on when someone is more farther away?
Thanks!
lol, i think my ultrasonic sensor is fried, should i change the power cord from 5V to 3.5v
hai
tnx
nice
it says distance was not declared in this scope
pls help
merci beaucoup c'est astronomiquement instructif!!
how to extend it's range to 10 cm
wow…u did it ….u saved me….i used it in science project…
May you send the code.
how do i contact you plz tell me its urgent
can it measure meter too?
bu içeriğin raspberry pi için olanını da çekermisin acaba 🙂
Awesome I love it
can i get circuit diagram? please..
how i can add vibration motor with this project > same a smart blind stick please any one help me to add vibration motor
without ohm resistor the will work or not
niiiiiiiiiiiiiiiiiiiiiiiiiiiiiccccccccceeeeeeeeeeeeeeee
I only have 2 GND pins and your video requires 3 (so far). What do I do?
beyler kodu acıyorum kod gozukmuyor kodu bana yollayabilirmisiniz
source code is not available man pls fix it
😎😎😎😎😎😎😎😎
When I click the source code link it just shows a blank screen? Please help.
Do you have the circuit diagram for this project? Urgently need it..thanks
'void setup()'
yanlış diyor neden acaba