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
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!
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 !
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
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. :(
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
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?
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!
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
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!
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
When I unplug it from my computer, and attempt to use a 9v battery, it doesn't work. I see the little yellow light on the arduino fade away with no buzzing from objects near the sensor. How can I get it to run on just the 9v?
// 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
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
Bro not uploading
Itt stops at 9 percent
Bro how can we do it without resister
Please send me code
what to do if i got an error message
i had this project as an exam in my informatics class , and it worked and i got straight A. thank you.
can u send the code pls
really good video man, code is great and when i tried it worked the first time, keep the great work bro
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!
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!
thank you so much it worked with me.
your fan from middle east
اخوك من الشرق الاوسط
he man can u send the code if u got it please
اخوي ممكن الكود ضروري الله يسعدك
@@PachaHooper the code is in pinned comment
NICE!!! Saved me a thousand dlrs in school fees
OMG it works
thank you so much, please keep sharing projects like this.
got the uno and this is a great tutorial. thanks.
Thank you very much, i saw many vids but any of them din't work but your worked thank you very much.
It came in a kit, first thing that I acutally got to work with my UNO. Thanks for thie vid.
Such a beautiful project ❤
Thank you! This tutorial was very good and helped me a lot
thank you bro you are king of arduino
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
East or west mert is the best...... Thanks
Awesome 👌🏻
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)
I lke the video because is short and easy to understand
This is just what i needed and it's very simple😆😇😇🤤
Nice tutorial,,
Luckily find it in instructable..
Thank you..
Keep it
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 !
what is the code if i attach vibrator instead to led ???
Can u send me the source code
wow...u did it ....u saved me....i used it in science project...
i also have a science fair can you explain and the coding
Thanks for a well laid out and easy to understand tutorial. Keep up the good work!
I like your video, is very useful for our project. Keep making these videos :)
Thanks a lot you did it man!!! Thank again
Thank u sir ❤❤its working
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
lol 9 year old army is everywhere
A R the
Tq, why we want to multiple with 0.034
No fake
Thank you this was very clear and easy to understand
does it work?
Thank you for your nice and easy video editing
Surely helpful for beginners
hi. can you help me, im only using led and its only blinking
@@cubebrix5801 If you're only using the LED that is what it is supposed to do.
Well done Professor
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. :(
Bro just recode it to do that it's not that hard
great work....very helpful
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
Did you get the code? If yes please send it to me
@@y.osa269 no
i did not get it
Nice video, by the way, i'm John Blas everyone.
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.
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?
thanks it help a lot ❤❤
Great project! Why is my buzzer clicking instead of buzzing though?
Did you ever figure it out?
i'm brazilian and liked very good so much your video, congratulations!!!
digital pin 13 has a build in resistor
so why to put another one?
any reason why mine is reading out distances in the 2ks. I used the code you provided us with.
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!
Not really, you can use digital write/read
Thank you for the great video and what is the name of the background music
thanks this was good work
Great job yaar
I needed this help and....
Hi .... Can explain to me about this project that use of what system ? Hopefully in full description
Amazing video!!!!
THNKYOUU ITS WORKS
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
While coding should we connect the arduino board to the bread board please tell me soon
My Circuit Isn't working, can somebody help?
It is work. Thanks bro
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!
William Michael did you ever figure out?
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
@@alejandroacosta6495yeah, my friend and i are trying that and it's not working. do you have any other suggestions?
how i can add vibration motor with this project > same a smart blind stick please any one help me to add vibration motor
My buzzer is sounding like a Geiger counter??? it’s working but not properly, is it the buzzer or count I fix that somehow
to change the sound of the buzzer you need to replace the original piece of code with "if (safetyDistance
Hey, can I add an LCD to this project? and How will the code be written when the LCD is added?
merci beaucoup c'est astronomiquement instructif!!
Thanks for your helping, I make it
What type of resistor you use?
Thanks bro it helped in my project
Can u help me pls
I'd like the code, please
Why my led keeps on and the sensor is not working 😣
Hi bro, did you use passive or active buzzer?
دروستم کرد💘
What type of buzzer did you use?
Hey Bro, I Have 3 Pin Buzzer Sensor GND, I/O, VCC... So which connection should I do...?
How would i make it louder ? and also how would i make it longer range thanks you!!
Can I connect more than 1 LED? If i wish to disconnect the buzzer l, should I delete something in the code??
how do you change the distance of when the buzzer starts
Only we have to do this code with computer only or we can use cellphone
Thank yoou very much for your tutorials ! I'm a beginner on arduino, why don't you connect the buzzer (+) on VCC ?
When I unplug it from my computer, and attempt to use a 9v battery, it doesn't work. I see the little yellow light on the arduino fade away with no buzzing from objects near the sensor. How can I get it to run on just the 9v?
Arduino Uno R3 Development Board with USB Cable can we use this
yey it worked, but how do i make it so that it'll have longer distance?
// 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
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?
it worked
thanks.
I edited your script a bit so it goes beep stop beep stop within a set range thank you for the video
nice video........i want more ideas
can u make a vidio how to modify the distance
Can we directly use the led on pin 13
Thanks for tis tutorial !
Is there a way to change buzzer's volume ?
YEAH i rlly need it to be as loud as possible
Sir Mera coda upload nhi ho rha h uske liye mujhe library download Karna padega but Kon sa library download karu ye nhi samjh me aa rha
Por que quando a distância começa a marcar de 3 a 4 cm no monitor serial começa a ficar saltitada pra 3400 e o som tbm fica saltitando ?
Can we make it without led
what the problem i can't able to run this either the buzzer continuously sounds or sometimes not sounds ,i removed the light section from it
Same here
What's the solution for that?
remove the cover on the buzzer..
Can we do this project without led and resistor ? Please reply sir
Sir, how will it be if you connect this project with GSM modem?
How can I connect two sensors in series in this case?
it is working only on time if i remove the obstacle then it is still alarming and blinking led
how to display sierial monitor on to oled
Where do u write the code?
thanks it works
how to get the app for distance
Awesome I love it
Teşekkürler işime yaradı ve bir beğeni de benden
Can ve use another board uno small
what type of Resistor
Well done sir can you pls Guide me on using pic16f877A for this project
I will sincerely be grateful for quick response
what is the software used?? Is it keil or ardunio??
Can iake it with Arduino nano with same code