Тёмный

Using Ultrasonic Distance Sensor HC-SR04 with Buzzer, LED and Arduino 

Maker 101
Подписаться 166 тыс.
Просмотров 558 тыс.
50% 1

Опубликовано:

 

6 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 356   
@maker101io
@maker101io 3 года назад
Source Code: create.arduino.cc/editor/mertarduinotech/b7022e05-f709-4003-b2a7-5c487ee25007/preview Recommended Items: Use Your Muscles in Project - amzn.to/3wdL45C​ 37 Sensor & Module Packages - amzn.to/3m66WeQ​ Try this Robot Arm - amzn.to/3fq8DCl​ Best Resin 3D Printer - amzn.to/39tY8KB​ Arduino Compatible Kits - bit.ly/2J2AFF7​ Banggood Spring Sale - bit.ly/3slMbOn​
@hyperandaimbot
@hyperandaimbot 2 года назад
Bro not uploading
@hyperandaimbot
@hyperandaimbot 2 года назад
Itt stops at 9 percent
@hyperandaimbot
@hyperandaimbot 2 года назад
Bro how can we do it without resister
@hyperandaimbot
@hyperandaimbot 2 года назад
Please send me code
@Cxpys
@Cxpys Год назад
what to do if i got an error message
@Kona-bona
@Kona-bona 5 лет назад
i had this project as an exam in my informatics class , and it worked and i got straight A. thank you.
@PachaHooper
@PachaHooper 4 года назад
can u send the code pls
@AVolt
@AVolt 7 лет назад
thank you so much it worked with me. your fan from middle east اخوك من الشرق الاوسط
@PachaHooper
@PachaHooper 4 года назад
he man can u send the code if u got it please
@y.osa269
@y.osa269 3 года назад
اخوي ممكن الكود ضروري الله يسعدك
@Epic_stickman90
@Epic_stickman90 5 месяцев назад
@@PachaHooper the code is in pinned comment
@lecongquyen2189
@lecongquyen2189 2 года назад
What a great detailed guideline! I followed step by step and it work. I will use it for my final electrical engineering project. Thanks a lot!
@mrbowlingalley
@mrbowlingalley 4 года назад
3 years later and we are still building this. I set safetyDistance to 25. With only LED and no buzzer. Detects my cat coming in the room. Pretty cool - I guess!
@quentinb9692
@quentinb9692 5 лет назад
It came in a kit, first thing that I acutally got to work with my UNO. Thanks for thie vid.
@muhammadfirdauz5272
@muhammadfirdauz5272 3 года назад
NICE!!! Saved me a thousand dlrs in school fees
@shlb3692
@shlb3692 Год назад
OMG it works thank you so much, please keep sharing projects like this.
@Ganondalf_the_grey
@Ganondalf_the_grey 3 года назад
got the uno and this is a great tutorial. thanks.
@theelectromaker6215
@theelectromaker6215 3 года назад
Thank you very much, i saw many vids but any of them din't work but your worked thank you very much.
@AdityaYadav-mk4ye
@AdityaYadav-mk4ye 6 лет назад
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
@crinnovator9444
@crinnovator9444 7 лет назад
East or west mert is the best...... Thanks
@AR-dy3fu
@AR-dy3fu 5 лет назад
If anyone has any problems to get the code...just copy mine. // defines pins numbers const int trigPin = 9; const int echoPin = 10; const int buzzer = 11; const int ledPin = 13; // defines variables long duration; int distance; int safetyDistance; void setup() { pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output pinMode(echoPin, INPUT); // Sets the echoPin as an Input pinMode(buzzer, OUTPUT); pinMode(ledPin, OUTPUT); Serial.begin(9600); // Starts the serial communication } void loop() { // Clears the trigPin digitalWrite(trigPin, LOW); delayMicroseconds(2); // Sets the trigPin on HIGH state for 10 micro seconds digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); // Reads the echoPin, returns the sound wave travel time in microseconds duration = pulseIn(echoPin, HIGH); // Calculating the distance distance= duration*0.034/2; safetyDistance = distance; if (safetyDistance
@eleanorrigby226
@eleanorrigby226 5 лет назад
lol 9 year old army is everywhere
@issrasaid4822
@issrasaid4822 5 лет назад
A R the
@maneesh2377
@maneesh2377 4 года назад
Tq, why we want to multiple with 0.034
@kinderparahahahah0616
@kinderparahahahah0616 Год назад
No fake
@HAYRISHEENVASUDEVANMoe
@HAYRISHEENVASUDEVANMoe 8 месяцев назад
thank you bro you are king of arduino
@marcelnalewajko3537
@marcelnalewajko3537 4 года назад
Thank you! This tutorial was very good and helped me a lot
@alvaronicolasgamarrapena5596
really good video man, code is great and when i tried it worked the first time, keep the great work bro
@mohdnaqibhaiqal2974
@mohdnaqibhaiqal2974 11 месяцев назад
I lke the video because is short and easy to understand
@chaturbhujbiyani4633
@chaturbhujbiyani4633 6 лет назад
wow...u did it ....u saved me....i used it in science project...
@eoz8985
@eoz8985 5 лет назад
i also have a science fair can you explain and the coding
@hkiceman001
@hkiceman001 7 лет назад
very interesting , I change the LED to a servo motor, it works .... good According to your code information , it means can do anything when change the led or buzzer, thank you !
@AhmedHassan-qe2hs
@AhmedHassan-qe2hs 7 лет назад
what is the code if i attach vibrator instead to led ???
@srikanthch5858
@srikanthch5858 6 лет назад
Can u send me the source code
@thomasalexander1563
@thomasalexander1563 7 лет назад
Nice tutorial,, Luckily find it in instructable.. Thank you.. Keep it
@dylansworld54321
@dylansworld54321 2 года назад
Great project! Why is my buzzer clicking instead of buzzing though?
@SG-gr3fl
@SG-gr3fl 2 года назад
Did you ever figure it out?
@williamkakooza4603
@williamkakooza4603 3 месяца назад
Well done Professor
@purple_clouds3797
@purple_clouds3797 2 года назад
This is just what i needed and it's very simple😆😇😇🤤
@rushabhvaidya7930
@rushabhvaidya7930 2 года назад
Thanks a lot you did it man!!! Thank again
@melihapa3884
@melihapa3884 2 года назад
Hello. There are already a lot of these examples on youtube. In your circuit the lights are either on or off. The sound either squeaks or it doesn't. I wish you had made a circuit where the intensity of sound and light increases as you get closer. :(
@ArzenikRawr
@ArzenikRawr 9 месяцев назад
Bro just recode it to do that it's not that hard
@Sheik_ULEM
@Sheik_ULEM 3 года назад
Thank you this was very clear and easy to understand
@kaipeen2523
@kaipeen2523 2 года назад
does it work?
@AyushRaj-me8ly
@AyushRaj-me8ly 4 года назад
I like your video, is very useful for our project. Keep making these videos :)
@ahmedomaar
@ahmedomaar 10 месяцев назад
Thanks for your helping, I make it
@MarkSmith-rb5mc
@MarkSmith-rb5mc 6 лет назад
Thanks for a well laid out and easy to understand tutorial. Keep up the good work!
@ArzenikRawr
@ArzenikRawr 9 месяцев назад
I edited your script a bit so it goes beep stop beep stop within a set range thank you for the video
@emilusfiogbe3450
@emilusfiogbe3450 6 лет назад
merci beaucoup c'est astronomiquement instructif!!
@belaaa522
@belaaa522 13 дней назад
THNKYOUU ITS WORKS
@iqratareen-mh4xw
@iqratareen-mh4xw 4 месяца назад
Thank u sir ❤❤its working
@AnupamaNagaratne
@AnupamaNagaratne 2 года назад
Thank u very much it works
@jwf677
@jwf677 3 года назад
// defines pins numbers const int trigPin = 9; const int echoPin = 10; const int buzzer = 11; const int ledPin = 13; // defines variables long duration; int distance; int safetyDistance; void setup() { pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output pinMode(echoPin, INPUT); // Sets the echoPin as an Input pinMode(buzzer, OUTPUT); pinMode(ledPin, OUTPUT); Serial.begin(9600); // Starts the serial communication } void loop() { // Clears the trigPin digitalWrite(trigPin, LOW); delayMicroseconds(2); // Sets the trigPin on HIGH state for 10 micro seconds digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); // Reads the echoPin, returns the sound wave travel time in microseconds duration = pulseIn(echoPin, HIGH); // Calculating the distance distance= duration*0.034/2; safetyDistance = distance; if (safetyDistance
@hyperandaimbot
@hyperandaimbot 2 года назад
Hi 2nd line from last do we have to write any number after serial.print(distance)
@איילהחלק
@איילהחלק Год назад
Is this a code that causes a bulb to light up at a certain distance?
@andreisantos5088
@andreisantos5088 4 года назад
i'm brazilian and liked very good so much your video, congratulations!!!
@pizzulgaming6253
@pizzulgaming6253 3 года назад
Hi .... Can explain to me about this project that use of what system ? Hopefully in full description
@namithss7966
@namithss7966 5 лет назад
thanks this was good work
@STudyTime4UVikasMishraSir
@STudyTime4UVikasMishraSir 2 года назад
Thank you for your nice and easy video editing Surely helpful for beginners
@cubebrix5801
@cubebrix5801 2 года назад
hi. can you help me, im only using led and its only blinking
@InkByt3
@InkByt3 3 месяца назад
@@cubebrix5801 If you're only using the LED that is what it is supposed to do.
@jacoblewis8543
@jacoblewis8543 3 года назад
Nice Job Ur Great with the tutorial which is very understandable and the code. One problem is that when I went to the source code to look it took me to ur website with no code
@y.osa269
@y.osa269 3 года назад
Did you get the code? If yes please send it to me
@jacoblewis8543
@jacoblewis8543 3 года назад
@@y.osa269 no i did not get it
@vishnutripathi2885
@vishnutripathi2885 Год назад
great work....very helpful
@djeastreofficial
@djeastreofficial 3 года назад
Awesome 👌🏻
@Dofusvidss
@Dofusvidss 7 лет назад
Thank yoou very much for your tutorials ! I'm a beginner on arduino, why don't you connect the buzzer (+) on VCC ?
@Si-uy8qg
@Si-uy8qg 9 месяцев назад
Nice video, by the way, i'm John Blas everyone.
@TusharSharma-is1mi
@TusharSharma-is1mi 7 лет назад
Great job yaar I needed this help and....
@JaydiEntenia
@JaydiEntenia 6 месяцев назад
yey it worked, but how do i make it so that it'll have longer distance?
@LhorKhan214
@LhorKhan214 Год назад
hi, can you explain where did you get this value 0.034? Edited: i did a google search, its the speed of sound (343 m / s)
@williammichael3913
@williammichael3913 6 лет назад
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!
@Kirtymonma
@Kirtymonma 5 лет назад
William Michael did you ever figure out?
@alejandroacosta6495
@alejandroacosta6495 4 года назад
Just look the code, he configured the "Safe Distance to 5", if you want to make it in different length just change the safe distance to a greater number
@cheshire793
@cheshire793 Год назад
@@alejandroacosta6495yeah, my friend and i are trying that and it's not working. do you have any other suggestions?
@phonepaseuthkhounthachack9459
@phonepaseuthkhounthachack9459 3 года назад
It is work. Thanks bro
@dhirajmandal715
@dhirajmandal715 3 года назад
thanks it help a lot ❤❤
@_Simon
@_Simon 5 лет назад
do the trig and echo pins need to be on a PWM signal for them to work? I am doing a project on the Arduino mega and using 3 of these sensors, but all of the PWM pins are being used on motor drivers. Love your videos. Best Arduino channel. Keep up the good work!
@hrithikjain1806
@hrithikjain1806 5 лет назад
Not really, you can use digital write/read
@salmanijaz8326
@salmanijaz8326 4 года назад
thanks it works
@nurinqasrina7826
@nurinqasrina7826 5 лет назад
Why my led keeps on and the sensor is not working 😣
@kevinpriadinata1184
@kevinpriadinata1184 Год назад
can u make a vidio how to modify the distance
@thesensiblecoderguy
@thesensiblecoderguy 3 года назад
thanks
@sreekarbss5475
@sreekarbss5475 4 года назад
Thanks bro it helped in my project
@janellguerriero1361
@janellguerriero1361 4 года назад
Can u help me pls
@y.osa269
@y.osa269 3 года назад
I'd like the code, please
@codgamerandmore3205
@codgamerandmore3205 4 года назад
thanks a lot
@manufacturingengineering-bp8il
@manufacturingengineering-bp8il 2 месяца назад
دروستم کرد💘
@emersonrocha1097
@emersonrocha1097 7 лет назад
ola,fiz esse projeto com seu codigo. mas ele ficou aprando com led vermelho sem nada na frente,como se houvesse um obstaculo sem ter.
@jamesmay4547
@jamesmay4547 2 года назад
Thank you for the great video and what is the name of the background music
@juanbriones1760
@juanbriones1760 7 лет назад
Mert Thanks for your videos tutorials. .can you please do ir remote control car with old fashion motor shield no who you solder the pins up like the video number 2
@giancarlosgza
@giancarlosgza 6 лет назад
Amazing video!!!!
@dylansworld54321
@dylansworld54321 2 года назад
How can i use two led in the project
@Sore_YT
@Sore_YT 10 месяцев назад
My Circuit Isn't working, can somebody help?
@deadchords4919
@deadchords4919 7 лет назад
digital pin 13 has a build in resistor so why to put another one?
@Umutt1316
@Umutt1316 3 года назад
Teşekkürler işime yaradı ve bir beğeni de benden
@AvighnaDaruka
@AvighnaDaruka 2 года назад
Hi bro, did you use passive or active buzzer?
@chandanjha3379
@chandanjha3379 6 лет назад
Awesome I love it
@assampwd
@assampwd 7 лет назад
digital pim 13 already has a resistor attatched to it. So need of that extra resisitor
@mr.nobodoy5976
@mr.nobodoy5976 6 лет назад
teşekkürler, adamsın :)
@aryansuratkar1980
@aryansuratkar1980 4 года назад
My project was unsuccessful can you help me please
@engineernabil3857
@engineernabil3857 6 лет назад
tnx
@akshathas4397
@akshathas4397 4 года назад
hey could you please froward the code to me ? i'm unable to access it.
@nupurnoida
@nupurnoida Год назад
very good
@G.V.Ramnivedan
@G.V.Ramnivedan 7 лет назад
While coding should we connect the arduino board to the bread board please tell me soon
@nyaneiko5455
@nyaneiko5455 6 лет назад
Mert abey harikasın
@HotDoggyStand
@HotDoggyStand 5 лет назад
any reason why mine is reading out distances in the 2ks. I used the code you provided us with.
@egorkorbasov3422
@egorkorbasov3422 7 лет назад
Hi! I tried to do 2 things together, Like a bell ring (you push the button and hear the buzzer rings) and LDR+3colorLED. But when I press the button when there is no light it rings only when the loop of LED is over. Why is it so?
@avishai827
@avishai827 4 года назад
‏i can't use the arduino file
@anannt7777
@anannt7777 4 года назад
yes
@haritahiranvasu8288
@haritahiranvasu8288 3 года назад
@Barna Lengyel Thanks!! Needed this, wasn't able to access it from link in description.
@davilabs
@davilabs 6 лет назад
super legal!!!!!
@MohamedAzizYazidi
@MohamedAzizYazidi Месяц назад
why do when i check the monitor to see the distance every time it put the disance then a 0 again and again and that makes the buzzer make noise even when the is nothing infront of the sensor
@aveekaumsingh5398
@aveekaumsingh5398 6 лет назад
nice video........i want more ideas
@prempanchal7721
@prempanchal7721 3 года назад
Hey Bro, I Have 3 Pin Buzzer Sensor GND, I/O, VCC... So which connection should I do...?
@linmgkhine344
@linmgkhine344 2 года назад
I would like to know How much Safety factor ? How to calculate? Thanks
@charliebell7163
@charliebell7163 3 года назад
How would i make it louder ? and also how would i make it longer range thanks you!!
@afnanrahman6905
@afnanrahman6905 Год назад
it is working only on time if i remove the obstacle then it is still alarming and blinking led
@chalsu
@chalsu 2 года назад
Hey, can I add an LCD to this project? and How will the code be written when the LCD is added?
@harshithraj6055
@harshithraj6055 Год назад
Only we have to do this code with computer only or we can use cellphone
@faiksoydemir1877
@faiksoydemir1877 6 лет назад
bu içeriğin raspberry pi için olanını da çekermisin acaba :)
@lacombegaetan
@lacombegaetan 7 лет назад
Thanks for tis tutorial ! Is there a way to change buzzer's volume ?
@charliebell7163
@charliebell7163 3 года назад
YEAH i rlly need it to be as loud as possible
@_vishnu2142_
@_vishnu2142_ 2 года назад
Can we do this project without led and resistor ? Please reply sir
@katianuriu7506
@katianuriu7506 8 месяцев назад
What type of buzzer did you use?
@applefinn3933
@applefinn3933 5 лет назад
how do you change the distance of when the buzzer starts
@wicked9737
@wicked9737 4 года назад
No way it works the dislike button works but the circuit doesn’t
@robotberhasil5130
@robotberhasil5130 5 лет назад
hello can you make include lcd , so i want see how long distance from lcd but still have buzzer and led , thanks
@rumaishafatima6053
@rumaishafatima6053 2 года назад
Sir, how will it be if you connect this project with GSM modem?
@cassandraservo
@cassandraservo 4 года назад
Where do u write the code?
@africantech5
@africantech5 3 года назад
Well done sir can you pls Guide me on using pic16f877A for this project
@africantech5
@africantech5 3 года назад
I will sincerely be grateful for quick response
@xeniongamer2263
@xeniongamer2263 3 года назад
thx
@ikramnazri6748
@ikramnazri6748 7 месяцев назад
What type of resistor you use?
@shrutiverma9077
@shrutiverma9077 4 года назад
Can we directly use the led on pin 13
Далее
Сделка 😂
00:27
Просмотров 90 тыс.
ВЫЖИЛ В ДРЕВНЕМ ЕГИПТЕ!
13:09
Просмотров 301 тыс.
Sensors - which one to use
17:06
Просмотров 1,3 млн
The coolest robot I've ever built!
19:40
Просмотров 4,7 млн
Sub-Surface Simon
8:16
Просмотров 134 тыс.
Arduino Ultrasonic Distance Alarm
5:13
Просмотров 82 тыс.
Activate Buzzer and LED using LDR and Arduino
6:50
Просмотров 317 тыс.
You can learn Arduino in 15 minutes.
16:34
Просмотров 10 млн