Arduino Ultrasonic Motion Sensor: Motion Sensor and LED project

  Переглядів 19,021

Waiduino

Waiduino

Рік тому

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.

КОМЕНТАРІ: 116
@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 7 місяців тому
Buen día, se puede agregar un buzzer ¿'
@Waiduino
@Waiduino 7 місяців тому
@@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 7 місяців тому
@@Waiduino Hola, si, seria interesante agregar un buzzer que se active con el código que creaste.
@Waiduino
@Waiduino 7 місяців тому
@@ericknova2989 Haré mi próximo video sobre cómo agregar un buzzer para este proyecto. Gracias por tu comentario.
@Waiduino
@Waiduino 6 місяців тому
@@ericknova2989 Se acaba de publicar un nuevo vídeo sobre el sensor y el buzzer. ¡Disfrutar! Gracias por tu comentario
@manjuyadav-ws4xd
@manjuyadav-ws4xd 4 місяці тому
Yo the channel owner is legend for replying to all comments most UKpostsrs dont do that
@Waiduino
@Waiduino 4 місяці тому
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 3 місяці тому
Hello just wanted to say thanks, I tried this in my class, it was my first time using ultrasonic and it worked💗
@Waiduino
@Waiduino 3 місяці тому
Yea of course! Thanks so much for your kind words.
@Bianchi77
@Bianchi77 Місяць тому
Creative video, thank you :)
@Waiduino
@Waiduino Місяць тому
Thank you!! Did you build the project?
@lyndalekirk6883
@lyndalekirk6883 Місяць тому
Very well explained thanks
@Waiduino
@Waiduino 20 днів тому
Thank you so much! Were you able to make the circuit?
@DannyYuson
@DannyYuson Місяць тому
endless thanks
@Waiduino
@Waiduino Місяць тому
No problem! Glad you enjoyed and learned something. Did you have to make it for a school project?
@arinaitwejoe19992
@arinaitwejoe19992 5 місяців тому
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 5 місяців тому
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?
@Sabbir-ln3bx
@Sabbir-ln3bx 20 днів тому
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 20 днів тому
oh wait nvm i think i got it.
@Waiduino
@Waiduino 20 днів тому
Sounds good thanks for commenting! Were you able to create the circuit?
@Sabbir-ln3bx
@Sabbir-ln3bx 20 днів тому
@@Waiduino it works thanks.
@GladiatorX-te6bx
@GladiatorX-te6bx 15 днів тому
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 13 днів тому
Sure which motors are you interested in? Like servo?
@mert5479
@mert5479 День тому
only one light blink you know why i pretty sure i put it together right
@Waiduino
@Waiduino День тому
You copied the code exactly, right? What pins is each individual LED connected to. Make sure they are securely in.
@Mg28mg
@Mg28mg 7 днів тому
Can we do this with uno and hc-sr04???
@Waiduino
@Waiduino 6 днів тому
Yep! If I am not mistaken, I used the hc-sr04 in my video as well as the uno. Thanks for your comment!
@missma.eugeniamartinezgonz560
@missma.eugeniamartinezgonz560 9 днів тому
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 6 днів тому
Hola! Gracias por tu comentario. ¿Quieres conectar el arduino a un teléfono?
@user-to6hm2wy8z
@user-to6hm2wy8z 14 днів тому
What is the resister number you used bro?
@Waiduino
@Waiduino 13 днів тому
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
@ili-sha
@ili-sha 3 місяці тому
how many ohms resistor did you use
@Waiduino
@Waiduino 3 місяці тому
Hi! It should be 330 ohms, I’m not entirely sure. The lower resistance, the brighter your LED is gonna be. Hope this helps!
@Sabbir-ln3bx
@Sabbir-ln3bx 20 днів тому
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 20 днів тому
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 20 днів тому
@@Waiduino ok
@Waiduino
@Waiduino 20 днів тому
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 20 днів тому
Does that work? Let me know
@Sabbir-ln3bx
@Sabbir-ln3bx 20 днів тому
@@Waiduino it doesn't
@mvsaikartheek633
@mvsaikartheek633 5 місяців тому
hello how to give connections for led positive and negative and resistor?
@Waiduino
@Waiduino 5 місяців тому
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 5 місяців тому
@@Waiduino oh thank you
@Waiduino
@Waiduino 5 місяців тому
@@mvsaikartheek633 Sure no problem! Let me know if you have any other questions.
@mvsaikartheek633
@mvsaikartheek633 5 місяців тому
@@Waiduino okay 👍
@DanielMTB663
@DanielMTB663 4 місяці тому
Yo I am new to arduino so could you tell me what app you use to put the code into the thing
@Waiduino
@Waiduino 4 місяці тому
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 4 місяці тому
@@Waiduino Thank you 😊
@Waiduino
@Waiduino 4 місяці тому
@@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 4 місяці тому
@@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 4 місяці тому
@@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!
@zeeshamt1695
@zeeshamt1695 4 дні тому
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?
@AKarts-ef4hq
@AKarts-ef4hq 5 місяців тому
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
@Curiousitypathofficial
@Curiousitypathofficial 6 місяців тому
the led is not lighting up how matter I try
@Waiduino
@Waiduino 6 місяців тому
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?
@zainraza7126
@zainraza7126 3 місяці тому
hey their whenever i connect to 5V my arduino shuts off plz help ASAP thanks
@Waiduino
@Waiduino 3 місяці тому
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 3 місяці тому
@@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 3 місяці тому
@@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?
@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!
@projekter.original
@projekter.original Місяць тому
Step1: Disconect Power from Arduino
@Waiduino
@Waiduino Місяць тому
Oh I forgot to add that to my video 😅😅. Did you make the project?
@user-ut6dr9pb7l
@user-ut6dr9pb7l Місяць тому
It doesn't let me send an email here I don't know why
@Waiduino
@Waiduino Місяць тому
No give me your email address so I can send you an email
@user-ut6dr9pb7l
@user-ut6dr9pb7l Місяць тому
@@Waiduino boqo lol boqo no space for email
@user-ut6dr9pb7l
@user-ut6dr9pb7l Місяць тому
@@Waiduino I couldn't send the whole email since it didn't let me and no space and no numbers
@user-ut6dr9pb7l
@user-ut6dr9pb7l Місяць тому
@@Waiduino Did you find it?
@naughtyboys2381
@naughtyboys2381 2 місяці тому
It's a distance sensor ig
@Waiduino
@Waiduino 2 місяці тому
Yea you could think about it like that. Did you get a a chance to make it?
@naughtyboys2381
@naughtyboys2381 2 місяці тому
@Waiduino yes long ago, btw . Motion sensing is different from distance sensing i think
@Waiduino
@Waiduino 2 місяці тому
@@naughtyboys2381 Thanks for pointing that out, your are correct. Thank you!
@fkj7761
@fkj7761 6 місяців тому
Hi
@Waiduino
@Waiduino 6 місяців тому
😂😂 Hi! Are you interested in Arduino
@user-ut6dr9pb7l
@user-ut6dr9pb7l Місяць тому
Awesome video bruh can you help pls? thanks!
@Waiduino
@Waiduino Місяць тому
I’m glad you enjoyed the video! I can help, what seems to be the issue?
@user-ut6dr9pb7l
@user-ut6dr9pb7l Місяць тому
@@Waiduino Heyy thank you! Do you have discord account?
@user-ut6dr9pb7l
@user-ut6dr9pb7l Місяць тому
@@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 Місяць тому
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 Місяць тому
@@Waiduino My group and I already have chosen things can you help us pls?
@fkj7761
@fkj7761 6 місяців тому
Hi 7:57
@Waiduino
@Waiduino 6 місяців тому
Hi!!! Did you enjoy the video?
@user-ut6dr9pb7l
@user-ut6dr9pb7l Місяць тому
boqo lol boqo no space for email
@Waiduino
@Waiduino Місяць тому
thanks! I’ll send an email when I get home
@ih8snow415
@ih8snow415 5 місяців тому
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 5 місяців тому
Thank you so much! I appreciate your input!! Do you use the Arduino often?
@ih8snow415
@ih8snow415 5 місяців тому
@@Waiduino yes sometimes
@Waiduino
@Waiduino 5 місяців тому
@@ih8snow415 Oh cool!! Are you new to Arduino and electronics?
@clobel55
@clobel55 Місяць тому
extremely confusing
@Waiduino
@Waiduino Місяць тому
Thanks for your comment what did you find particularly confusing?
@fkj7761
@fkj7761 6 місяців тому
Hi
@Waiduino
@Waiduino 6 місяців тому
Hi, how are you?
Sensors - which one to use
17:06
Electronoobs
Переглядів 1,3 млн
ВИРУСНЫЕ ВИДЕО / Мусорка 😂
00:34
Светлый Voiceover
Переглядів 8 млн
Помилка,  яку зробило військове керівництво 🙄
01:00
Радіо Байрактар
Переглядів 371 тис.
Top 10  Arduino Projects 2020 | Awesome Idea for winning Science Project
9:24
Arduino ultrasonic sensor led projects | Hc-sr04 Ultrasonic sensor
7:22
Mr ElectroUino
Переглядів 268 тис.
How to make an ultrasonic Radar
5:48
Hani's Experiments
Переглядів 264 тис.
Arduino To ESP32: How to Get Started!
9:26
Robonyx
Переглядів 140 тис.
EASY! Ultrasonic Sensor with Arduino
10:23
Fungineers
Переглядів 210 тис.
Arduino Ultrasonic Sensor & LED
2:16
Robotic Nation
Переглядів 19 тис.
ВИРУСНЫЕ ВИДЕО / Мусорка 😂
00:34
Светлый Voiceover
Переглядів 8 млн