Тёмный

Arduino Ultrasonic Motion Sensor: Motion Sensor and LED project 

Waiduino
Подписаться 559
Просмотров 29 тыс.
50% 1

I wanted to make a continuation to the first video, implementing the addition of a motion sensor. We combined LED lights with a motion sensor to make a cool distance detector. Make sure you like and subscribe so that you don't miss the next video where we might implement the buzzer or remote.

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

 

24 ноя 2022

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 152   
@Waiduino
@Waiduino Год назад
const int echo=13; const int trig=12; int LED1=2; int LED2=3; int LED3=4; int LED4=5; int duration=0; int distance=0; void setup() { pinMode(trig,OUTPUT); pinMode(echo,INPUT); pinMode(LED1,OUTPUT); pinMode(LED2,OUTPUT); pinMode(LED3,OUTPUT); pinMode(LED4,OUTPUT); Serial.begin(9600); } void loop() { digitalWrite(trig,HIGH); delay(1000); digitalWrite(trig,LOW); digitalWrite(LED1,LOW); digitalWrite(LED2,LOW); digitalWrite(LED3,LOW); digitalWrite(LED4,LOW); duration=pulseIn(echo,HIGH); distance= (duration/2)/28.5; if (distance=10 && distance 20&& distance
@ericknova2989
@ericknova2989 9 месяцев назад
Buen día, se puede agregar un buzzer ¿'
@Waiduino
@Waiduino 9 месяцев назад
@@ericknova2989 Hola, no hablo muy bien español. Sí, puedes agregar un buzzer. Puedo hacer un vídeo sobre eso si estás interesado.
@ericknova2989
@ericknova2989 9 месяцев назад
@@Waiduino Hola, si, seria interesante agregar un buzzer que se active con el código que creaste.
@Waiduino
@Waiduino 9 месяцев назад
@@ericknova2989 Haré mi próximo video sobre cómo agregar un buzzer para este proyecto. Gracias por tu comentario.
@Waiduino
@Waiduino 9 месяцев назад
@@ericknova2989 Se acaba de publicar un nuevo vídeo sobre el sensor y el buzzer. ¡Disfrutar! Gracias por tu comentario
@manjuyadav-ws4xd
@manjuyadav-ws4xd 7 месяцев назад
Yo the channel owner is legend for replying to all comments most RU-vidrs dont do that
@Waiduino
@Waiduino 7 месяцев назад
Haha thanks so much! I try to reply to every comment since I’m thankful you guys watch my videos and because I mainly wanted to help other people create and learn about circuits. I always try to reply to comments so thanks for noticing!!
@layanshali8015
@layanshali8015 5 месяцев назад
Hello just wanted to say thanks, I tried this in my class, it was my first time using ultrasonic and it worked💗
@Waiduino
@Waiduino 5 месяцев назад
Yea of course! Thanks so much for your kind words.
@lyndalekirk6883
@lyndalekirk6883 3 месяца назад
Very well explained thanks
@Waiduino
@Waiduino 3 месяца назад
Thank you so much! Were you able to make the circuit?
@Bianchi77
@Bianchi77 3 месяца назад
Creative video, thank you :)
@Waiduino
@Waiduino 3 месяца назад
Thank you!! Did you build the project?
@arinaitwejoe19992
@arinaitwejoe19992 7 месяцев назад
Hello thanks very much , so i have an inquire how can i use an infrared sensor as a level sensor and also with like 2 indicator LED lights ???
@Waiduino
@Waiduino 7 месяцев назад
Thank you so much for your comment! It is possible to use the infrared sensor as a level sensor however it would require much more instructions than I can show here. Would you like me to create a video to show how to create this project?
@DannyYuson
@DannyYuson 3 месяца назад
endless thanks
@Waiduino
@Waiduino 3 месяца назад
No problem! Glad you enjoyed and learned something. Did you have to make it for a school project?
@GladiatorX-te6bx
@GladiatorX-te6bx 2 месяца назад
Yo. Can you tell me how to switch off two motors if the distance is less than 20 for example, and otherwise keep it on? Thanks
@Waiduino
@Waiduino 2 месяца назад
Sure which motors are you interested in? Like servo?
@ZaidQuihuis
@ZaidQuihuis 2 месяца назад
i love you man
@Waiduino
@Waiduino 2 месяца назад
LMAOO thanks for the support! Were you able to built it without any problems?
@Sabbir-ln3bx
@Sabbir-ln3bx 3 месяца назад
What was the resistance of the resistor you used? And how did you wire the leds, and the wires next to the led?
@Sabbir-ln3bx
@Sabbir-ln3bx 3 месяца назад
oh wait nvm i think i got it.
@Waiduino
@Waiduino 3 месяца назад
Sounds good thanks for commenting! Were you able to create the circuit?
@Sabbir-ln3bx
@Sabbir-ln3bx 3 месяца назад
@@Waiduino it works thanks.
@turtleburglary1141
@turtleburglary1141 Месяц назад
Waiduino: *audio shift* Me: *tears ears off by accident*
@Waiduino
@Waiduino Месяц назад
🤣🤣 underrated comment 😆😆 Did you build the circuit successfully?
@turtleburglary1141
@turtleburglary1141 Месяц назад
@@Waiduino I think so 🥹🥹.. nooo
@paulcarsco6029
@paulcarsco6029 26 дней назад
I tried using the code but it didn't work because I need a value for the pulseln variable?
@Waiduino
@Waiduino 26 дней назад
for this project, i don’t think pulseIn is a variable, it should be a library. That’s why it has the parameters (the things inside the brackets if u look at the code). Did you copy directly from the comment?
@Mg28mg
@Mg28mg 2 месяца назад
Can we do this with uno and hc-sr04???
@Waiduino
@Waiduino 2 месяца назад
Yep! If I am not mistaken, I used the hc-sr04 in my video as well as the uno. Thanks for your comment!
@vipulsingh1155
@vipulsingh1155 Месяц назад
what is the value of resistor for led
@Waiduino
@Waiduino Месяц назад
I believe it is 500 or 1k but whatever value you use is fine. The lower the value, the brighter the LED.
@teerthkhiya7318
@teerthkhiya7318 2 месяца назад
Hello Thank you very much for this video I was hoping if you could please mention the name of the all components for this experiment
@Waiduino
@Waiduino 2 месяца назад
Sure I found these all in the Arduino uno kit. It uses ultrasonic sensor, 3 LED, and an arduino uno. Let me know of you need it more specific.
@mvsaikartheek633
@mvsaikartheek633 7 месяцев назад
hello how to give connections for led positive and negative and resistor?
@Waiduino
@Waiduino 7 месяцев назад
You can find that all in the circuit diagram. The GND should connect to the railing which is connected to a resistor which connects to the negative side of the LED and the positive side connects to a pin on the Arduino designated in your code. You can find a walkthrough in my first ever video. Hope this helped!
@mvsaikartheek633
@mvsaikartheek633 7 месяцев назад
@@Waiduino oh thank you
@Waiduino
@Waiduino 7 месяцев назад
@@mvsaikartheek633 Sure no problem! Let me know if you have any other questions.
@mvsaikartheek633
@mvsaikartheek633 7 месяцев назад
@@Waiduino okay 👍
@ili-sha
@ili-sha 6 месяцев назад
how many ohms resistor did you use
@Waiduino
@Waiduino 6 месяцев назад
Hi! It should be 330 ohms, I’m not entirely sure. The lower resistance, the brighter your LED is gonna be. Hope this helps!
@zainraza7126
@zainraza7126 6 месяцев назад
hey their whenever i connect to 5V my arduino shuts off plz help ASAP thanks
@Waiduino
@Waiduino 6 месяцев назад
Hi! I’ve had this issue in the past. Pay attention to where the 5v railing is and you might find the cause of the issue. Did you make sure all connections are correct?
@zainraza7126
@zainraza7126 6 месяцев назад
@@Waiduino im not sure if my breadboard is properly or if the video is inverted u are saying to plug in the Sensor closest to the negative side right? Sorry i have a project on this and im stressed
@Waiduino
@Waiduino 6 месяцев назад
@@zainraza7126 If you are referring to the sensor, the white wire is plugged to the rightmost pin on the sensor (the sensor circles should be pointed to the right). Is that what you are referring to?
@Sabbir-ln3bx
@Sabbir-ln3bx 3 месяца назад
How do you do it with all the leds on and when you put your hands closer to the leds they turn off one by one?
@Waiduino
@Waiduino 3 месяца назад
Hi so basically you would need to modify the code. I will do that for you right now if you would like. You just have to set the status to each LEF as on and then every second it detects a hand, it will turn off an LED by turning it off. Let me comment the code now
@Sabbir-ln3bx
@Sabbir-ln3bx 3 месяца назад
@@Waiduino ok
@Waiduino
@Waiduino 3 месяца назад
const int echo=13; const int trig=12; int LED1=2; int LED2=3; int LED3=4; int LED4=5; int duration=0; int distance=0; void setup() { pinMode(trig,OUTPUT); pinMode(echo,INPUT); pinMode(LED1,OUTPUT); pinMode(LED2,OUTPUT); pinMode(LED3,OUTPUT); pinMode(LED4,OUTPUT); Serial.begin(9600); } void loop() { digitalWrite(trig,HIGH); delay(1000); digitalWrite(trig,LOW); digitalWrite(LED1,HIGH); digitalWrite(LED2,HIGH); digitalWrite(LED3,HIGH); digitalWrite(LED4,HIGH); duration=pulseIn(echo,HIGH); distance= (duration/2)/28.5; if (distance=10 && distance 20&& distance
@Waiduino
@Waiduino 3 месяца назад
Does that work? Let me know
@Sabbir-ln3bx
@Sabbir-ln3bx 3 месяца назад
@@Waiduino it doesn't
@user-to6hm2wy8z
@user-to6hm2wy8z 2 месяца назад
What is the resister number you used bro?
@Waiduino
@Waiduino 2 месяца назад
I believed I used like 500 or 1k but feel free to use whatever you want. Lower resistance means brighter color so I normally like LEDS to shine more
@missma.eugeniamartinezgonz560
@missma.eugeniamartinezgonz560 2 месяца назад
Como puede tu código mandar la información a un celular, supongamos un lugar separado, como cuando separas tu lugar, prende el foco rojo y manda la información a una pantalla.
@Waiduino
@Waiduino 2 месяца назад
Hola! Gracias por tu comentario. ¿Quieres conectar el arduino a un teléfono?
@Curiousitypathofficial
@Curiousitypathofficial 8 месяцев назад
the led is not lighting up how matter I try
@Waiduino
@Waiduino 8 месяцев назад
Hmm i can assist you personally. Have you used a resistor and followed the diagram exactly? What pin did you attach it to on the Arduino?
@zeeshamt1695
@zeeshamt1695 2 месяца назад
Can u tell me the number of the risistor and the wites
@Waiduino
@Waiduino 2 месяца назад
I used a 1k ohm resistor. The higher resistance, the less bright your LED will be. What is your question about the wires?
@jesussaquin6266
@jesussaquin6266 Месяц назад
at 6:12 idk if my wiring is right but my LED is not lighting up
@Waiduino
@Waiduino Месяц назад
Did you notice that one pin of the LED is longer than the other? Did you follow that part?
@jesussaquin6266
@jesussaquin6266 Месяц назад
@@Waiduino heal all good friend thank you :)
@Waiduino
@Waiduino Месяц назад
@@jesussaquin6266 Did my advice work? Glad everything works!!
@DanielMTB663
@DanielMTB663 6 месяцев назад
Yo I am new to arduino so could you tell me what app you use to put the code into the thing
@Waiduino
@Waiduino 6 месяцев назад
Yea for sure. I talked about this in my very first video but the compiler or IDE is something you have to download. Here is the link: www.arduino.cc/en/software Let me know if you have any other questions!!
@DanielMTB663
@DanielMTB663 6 месяцев назад
@@Waiduino Thank you 😊
@Waiduino
@Waiduino 6 месяцев назад
@@DanielMTB663 Yea of course! If you’re interested in other projects I would greatly appreciate it if you could check out some of my other videos since i’m really trying to grow my channel. Have you built any other projects?
@DanielMTB663
@DanielMTB663 6 месяцев назад
@@Waiduino no this is my first project as I am trying to make an RC plane. I have subscribed to see more projects. (I am using the radar to ad to the plane)
@Waiduino
@Waiduino 6 месяцев назад
@@DanielMTB663 Ohhhh that seems super interesting! Glad to see your working with the Arduino. Thank you for your support and if there’s any project ideas or assistance you need with the Arduino feel free to ask any questions!
@LZ1SSA
@LZ1SSA 12 дней назад
Червен кабел за маса, защо? Сигурен начин да прецакаме нещо е работата под напрежение.
@Mertv123
@Mertv123 2 месяца назад
only one light blink you know why i pretty sure i put it together right
@Waiduino
@Waiduino 2 месяца назад
You copied the code exactly, right? What pins is each individual LED connected to. Make sure they are securely in.
@Mertv123
@Mertv123 2 месяца назад
​@Waiduino yes I copied the code, but I think it is the wire, since it is kinda hard to follow since you don't show yourself connect the led but I will try again
@Waiduino
@Waiduino 2 месяца назад
@@Mertv123 Thank you for your feedback, I will try my best to improve that for my future videos. With the LED, do you know which wires to connect it to? Remember that the shorter part of the LED should touch the resistor and the other to the wire connecting to the pin on the Arduino.
@Mertv123
@Mertv123 2 месяца назад
@@Waiduino it works now thanks you so much
@Waiduino
@Waiduino 2 месяца назад
@@Mertv123 No problem!! I’m so happy that you were able to make it. Is it for a school project?
@user-ut6dr9pb7l
@user-ut6dr9pb7l 4 месяца назад
It doesn't let me send an email here I don't know why
@Waiduino
@Waiduino 4 месяца назад
No give me your email address so I can send you an email
@user-ut6dr9pb7l
@user-ut6dr9pb7l 4 месяца назад
@@Waiduino boqo lol boqo no space for email
@user-ut6dr9pb7l
@user-ut6dr9pb7l 4 месяца назад
@@Waiduino I couldn't send the whole email since it didn't let me and no space and no numbers
@user-ut6dr9pb7l
@user-ut6dr9pb7l 4 месяца назад
@@Waiduino Did you find it?
@user-xg3nn4jm3z
@user-xg3nn4jm3z 2 месяца назад
hello, can i ask for the diagram? tysm
@Waiduino
@Waiduino 2 месяца назад
Sure do you have an email or form of communication I can send the diagram to? Is it too confusing to follow with the physical components?
@user-xg3nn4jm3z
@user-xg3nn4jm3z 2 месяца назад
@@Waiduino I'm sorry, I am a 2nd year college taking electronics and this is one of my arduino projects. I am sorry if I am a slow learner, earlier I tried this and it works! Tysm for the vid.
@Waiduino
@Waiduino 2 месяца назад
@@user-xg3nn4jm3z Of course, no problem! I just want to know how I can improve my content for the future so that’s why I was wondering if it was too confusing. Next time I will be sure to add the diagram so that it is easier to follow along. Thank you for your comment and I hope you enjoyed the video! Are you interested in continuing to make projects with the Arduino?
@user-xg3nn4jm3z
@user-xg3nn4jm3z 2 месяца назад
@@Waiduino yes I am continuing for school projects. But discovering an arduino is too early for me. Maybe in the future if I am confident enough on this one. Tysm
@Waiduino
@Waiduino 2 месяца назад
@@user-xg3nn4jm3z Are you sure you don’t want to continue Arduino? I felt the same way when I started and that’s the reason I started this channel, to help others. There are wiring diagrams and in depth explanations on my other videos. Have you seen them?
@douglaskiptum
@douglaskiptum Год назад
are you open to innovation project. ?
@Waiduino
@Waiduino Год назад
Yea definitely! I have been working on a few but they take really long to finish them.
@Waiduino
@Waiduino Год назад
Also don’t forget to check out my other videos with cool projects and different Arduino modules!
@naughtyboys2381
@naughtyboys2381 4 месяца назад
It's a distance sensor ig
@Waiduino
@Waiduino 4 месяца назад
Yea you could think about it like that. Did you get a a chance to make it?
@naughtyboys2381
@naughtyboys2381 4 месяца назад
@Waiduino yes long ago, btw . Motion sensing is different from distance sensing i think
@Waiduino
@Waiduino 4 месяца назад
@@naughtyboys2381 Thanks for pointing that out, your are correct. Thank you!
@AKarts-ef4hq
@AKarts-ef4hq 7 месяцев назад
const int echo=13; const int trig=12; int LED1=2; int LED2=3; int duration=0; int distance=0; void setup() { pinMode(trig,OUTPUT); pinMode(echo,INPUT); pinMode(LED1,OUTPUT); pinMode(LED2,OUTPUT); Serial.begin(9600); } void loop() { digitalWrite(trig,HIGH); delay(1000); digitalWrite(trig,LOW); digitalWrite(LED1,LOW); digitalWrite(LED2,LOW); duration=pulseIn(echo,HIGH); distance= (duration/2)/28.5; if (distance=10 && distance 20&& distance
@fkj7761
@fkj7761 9 месяцев назад
Hi
@Waiduino
@Waiduino 9 месяцев назад
😂😂 Hi! Are you interested in Arduino
@projekter.original
@projekter.original 4 месяца назад
Step1: Disconect Power from Arduino
@Waiduino
@Waiduino 4 месяца назад
Oh I forgot to add that to my video 😅😅. Did you make the project?
@user-ut6dr9pb7l
@user-ut6dr9pb7l 4 месяца назад
Awesome video bruh can you help pls? thanks!
@Waiduino
@Waiduino 4 месяца назад
I’m glad you enjoyed the video! I can help, what seems to be the issue?
@user-ut6dr9pb7l
@user-ut6dr9pb7l 4 месяца назад
@@Waiduino Heyy thank you! Do you have discord account?
@user-ut6dr9pb7l
@user-ut6dr9pb7l 4 месяца назад
@@Waiduino Were not allowed to use arduino uno or any similar though so it's kinda a bit hard to choose but I think it's a small project since were not going to use arduino uno or any similar etc We have this type of list and I don't know which to choose for beginners raspberry pi Thanks! User Interface Basic Basic Kit (at least 2 from LEDs, Button Switches, Buzzer) Basic Bluetooth API (e.g. Blue Dot API) Basic Speech Recognition Basic Speech Output Basic e-mail Alerts Basic RFID input Basic Push Notifications to mobile using API like Instapush or Twilio Advanced Flask Server (or WebIoT) providing Web interface Advanced GUI created using TkInter or Pygame or guizero or similar Advanced Machine Learning Advanced GPIO connected Character Pad Advanced GPIO connected Joystick Advanced 74HC595 & Bar Graph LED Advanced 74HC595 & 4-digit 7-Segment Display Advanced 74HC595 & LED Matrix 8x8 or bigger Advanced Output to an IoT broker such as Thingsboard Advanced 2x16 I2C based LCD Advanced Fingerprint scanner Sensors and Actuators Basic Pi-Camera or USB Webcam for taking photos Basic PIR Infrared Motion Sensor Basic Soil Moisture Sensor Basic Rain Fall sensor Basic Relays connected to equipment such as water-pump/lights/ locks/ valves Basic CPU/Case/Graphic card temperature sensor Basic Photoresistor & LED or RGB LED with ADC module Advanced Infrared Digital Obstacle Avoidance Sensor Advanced Potentiometer & ADC module with LEDs or RGB LED Advanced Attitude Sensor MPU6050 Advanced Hygrothermograph DHT11 sensor / Barometric Pressure Sensor Advanced Wind Direction & Speed sensors Advanced Ultrasonic Distance Sensors Advanced Motor with ADC control or PWM Advanced Servo Motor/s Advanced Pi-Camera or USB Webcam with Open-CV computer vision
@user-ut6dr9pb7l
@user-ut6dr9pb7l 4 месяца назад
List at least 5 functionalities in total from Table 1 below (Minimum 2 of which must be advanced) for use in your project. Elements from both sections of the table (User Interface and Sensors and Actuators) must be included. Use of the same component is only allowed once, if the two components are complementary to each other and are going to be programmed separately. We need to choose atleast 5 things
@user-ut6dr9pb7l
@user-ut6dr9pb7l 4 месяца назад
@@Waiduino My group and I already have chosen things can you help us pls?
@kabirrobloxPakistan
@kabirrobloxPakistan 2 дня назад
a total timewast
@Waiduino
@Waiduino 2 дня назад
@@kabirrobloxPakistan hi I am so sorry you feel that way. Is there anything I can help with? I know it can be difficult to follow since this was one of my earlier videos but if you have any questions I can surely help!
@fkj7761
@fkj7761 9 месяцев назад
Hi 7:57
@Waiduino
@Waiduino 9 месяцев назад
Hi!!! Did you enjoy the video?
@user-ut6dr9pb7l
@user-ut6dr9pb7l 4 месяца назад
boqo lol boqo no space for email
@Waiduino
@Waiduino 4 месяца назад
thanks! I’ll send an email when I get home
@clobel55
@clobel55 3 месяца назад
extremely confusing
@Waiduino
@Waiduino 3 месяца назад
Thanks for your comment what did you find particularly confusing?
@ih8snow415
@ih8snow415 8 месяцев назад
use this code if ur buzzer sound like radioactive sound "#define trigPin 9 // Broche de déclenchement du capteur à ultrasons #define echoPin 10 // Broche d'écho du capteur à ultrasons #define ledPin 13 // Broche de la LED #define buzzerPin 11 // Broche du buzzer void setup() { pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(ledPin, OUTPUT); pinMode(buzzerPin, OUTPUT); Serial.begin(9600); } void loop() { long duration, distance; // Envoi d'une impulsion de déclenchement au capteur à ultrasons digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); // Lecture de la durée de l'impulsion d'écho duration = pulseIn(echoPin, HIGH); // Calcul de la distance en centimètres distance = (duration / 2) / 29.1; // Affichage de la distance dans le moniteur série Serial.print("Distance : "); Serial.print(distance); Serial.println(" cm"); // Vérification de la distance et activation de la LED et du buzzer if (distance < 20) { digitalWrite(ledPin, HIGH); // Allume la LED tone(buzzerPin, 1000); // Active le buzzer à 1 kHz } else { digitalWrite(ledPin, LOW); // Éteint la LED noTone(buzzerPin); // Désactive le buzzer } delay(100); // Attente pour éviter les fausses détections } "
@Waiduino
@Waiduino 8 месяцев назад
Thank you so much! I appreciate your input!! Do you use the Arduino often?
@ih8snow415
@ih8snow415 8 месяцев назад
@@Waiduino yes sometimes
@Waiduino
@Waiduino 8 месяцев назад
@@ih8snow415 Oh cool!! Are you new to Arduino and electronics?
@fkj7761
@fkj7761 9 месяцев назад
Hi
@Waiduino
@Waiduino 9 месяцев назад
Hi, how are you?
Далее
NCT DOJAEJUNG 엔시티 도재정 'Perfume' MV
3:07
ЧТО Я ПОСТРОИЛ 11? | CLEX #shorts
1:00
Просмотров 588 тыс.
Effective Ways To Detect People With Common Sensors
7:43
Sensors - which one to use
17:06
Просмотров 1,3 млн
EASY! Ultrasonic Sensor with Arduino
10:23
Просмотров 216 тыс.
arduino ultrasonic sensor projects | led project
4:11
How to make an ultrasonic Radar
5:48
Просмотров 283 тыс.
NCT DOJAEJUNG 엔시티 도재정 'Perfume' MV
3:07