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
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
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!
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. :(
// 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
// 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
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
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?
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?
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
NICE!!! Saved me a thousand dlrs in school fees
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
No way it works the dislike button works but the circuit doesn’t
My Circuit Isn't working, can somebody help?
Why my led keeps on and the sensor is not working 😣
i can't use the arduino file
yes
@Barna Lengyel Thanks!! Needed this, wasn't able to access it from link in description.
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
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!
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)
East or west mert is the best...... Thanks
Great project! Why is my buzzer clicking instead of buzzing though?
Did you ever figure it out?
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
where the frick is the code can somepaste a sorce link to it
// 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
@@21mejia25 your a legend
@@21mejia25 does it work??
@@neev_pro if I remember correctly, yes. But I couldn’t help now, since this was over 2 years ago.
@@21mejia25.
'void setup()'
yanlış diyor neden acaba
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
If I open the source code I can't find the code
My project was unsuccessful can you help me please
How can i use two led in the project
// 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?
Where do u write the code?
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
Hi, I would like to cantacting with you somehow, because i have question about this project.
Please send me any contact information.
Thank you
Gergely
the code doesent work help
I want the code, did you get it?
Merhabalar ben engel algılayan robot için buzzer eklemek istiyorum engel gördüğünde buzzer ötsün direk bu kodu eklesem çalışır mı acaba?
const int trig=10;
const int echo=8;
const int sol_i=2;
const int sol_g=3;
const int sag_i=4;
const int sag_g=5;
int sure=0;
int mesafe=0;
void setup() {
pinMode(trig,OUTPUT);
pinMode(echo,INPUT);
pinMode(sol_i,OUTPUT);
pinMode(sol_g,OUTPUT);
pinMode(sag_i,OUTPUT);
pinMode(sag_g,OUTPUT);
Serial.begin(9600);
}
void loop()
{
digitalWrite(trig,HIGH);
delayMicroseconds(1000);
digitalWrite(trig,LOW);
sure=pulseIn(echo,HIGH);
mesafe=(sure/2) /28.5 ;
Serial.println(mesafe);
if(mesafe
Kod bu
Birde bu videodaki gibi led eklemek istiyorum
Mert Arduino Tutorial & Projects Çok teşekkürler
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
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.
Awesome 👌🏻
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!
digital pin 13 has a build in resistor
so why to put another one?
yey it worked, but how do i make it so that it'll have longer distance?
kenapa low high output input saya ga berubah warna yah
sir, how to increase and decrease distance range ??? please please please reply
hatt
lettuce
I've done all this but it doesn't work cause the fucking source code is not available
it is working only on time if i remove the obstacle then it is still alarming and blinking led
Well done sir can you pls Guide me on using pic16f877A for this project
I will sincerely be grateful for quick response
Could you please share the source code file again as the above attached link is expired.... please I need it very badly thanks :-)
If you find it give it to me plzz😊😊😊
My distance is only 0 and the signal does not turn off. Can you help me for figure it out
Why I can't use "serial.print/In" and "distance"
But.. this project is not working well at outside.. bcoz temperature factor that can change the speed of sound value (to measure the distance)..
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
can anybody paste the code here??
bu içeriğin raspberry pi için olanını da çekermisin acaba :)
Need block diagram.. circuit diagram immediately
Do you have the circuit diagram for this project? Urgently need it..thanks
me too want the circuit diagram can any one mail it please
(rchandrika723@gmail.com)
@@ravichandrika4824 no need to bother.. its been a year and still no reply from the creator
Is that works?
@@kaipeen2523 still no reply from the creator since 2018 😂
Hi .... Can explain to me about this project that use of what system ? Hopefully in full description
why this source code cannot be uploaded and copied ?
What happened when we disconnect with computer
it didnt work at alll its fakee
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?
Ultra sonic security system or ye same hai??
iyi günler acaba bunun kodunu göremiyorum bana kodu atarmısınız
bro i want the led to stop when something comes near to it.......plz someone help
how i can add vibration motor with this project > same a smart blind stick please any one help me to add vibration motor
can u make a vidio how to modify the distance
THNKYOUU ITS WORKS
Arduino Uno R3 Development Board with USB Cable can we use this
Hello!Can someone please help me by telling me the codes of 4 ultrasonic,4 LEDs,a buzzer with arduino uno.We will be really appreciate your help
It came in a kit, first thing that I acutally got to work with my UNO. Thanks for thie vid.
Thank you! This tutorial was very good and helped me a lot
How to increase distance I want 2 metres
I would like to know How much Safety factor ? How to calculate?
Thanks
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?
Thank u sir ❤❤its working
دروستم کرد💘
Nice video, by the way, i'm John Blas everyone.
Thank you for the great video and what is the name of the background music
Hey Bro, I Have 3 Pin Buzzer Sensor GND, I/O, VCC... So which connection should I do...?
It isn't working at all......I tried many times but isn't working
Can ve use another board uno small
Can I connect more than 1 LED? If i wish to disconnect the buzzer l, should I delete something in the code??
Where is the code??? Please help me.
can you send me de tinkercad?
I only have 2 GND pins and your video requires 3 (so far). What do I do?
one common ground can be used on the buzzer and LED
Use a wire to connect it to breadboard to make it short.
:D
I edited your script a bit so it goes beep stop beep stop within a set range thank you for the video
so! WHERES THE CODE,,ALL I SEE IS PRODUCTS TO BUY,,NO CODE,,
Only we have to do this code with computer only or we can use cellphone
tnx
hey could you please froward the code to me ? i'm unable to access it.
how to get the app for distance
Can iake it with Arduino nano with same code
Well done Professor
why the buzzer has no sound
Can we do this project without led and resistor ? Please reply sir
The code link does not work you should update if??
Thanks for your helping, I make it
does anyone have the rest of the code the website doesn't wanna work
The code was not opening
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.
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?
AMO TE
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..
Tell Uno model please ?
Sir, how will it be if you connect this project with GSM modem?
Can we make it without led
Nice tutorial,,
Luckily find it in instructable..
Thank you..
Keep it
Can we use capacitor and what is the purpose ?? Bro
Why would you add a capacitor???? That just holds energy and shoves it in bursts
Thank u very much it works
I CAN'T UNDERSTAND ANYTHING.
WHY IS THAT???
got the uno and this is a great tutorial. thanks.
good