0:00
Welcome back tech enthusiasts
0:01
In today's video, we'll be exploring how to use a passive infrared sensor
0:05
or PIR sensor with Arduino to detect motion. Whether you're building a security system or an automated lighting system
0:12
this project is a great starting point. Let's get started. A PIR sensor detects motion by measuring changes in infrared radiation
0:24
in its environment, when a warm body like a human or an animal passes in front of the sensor, it triggers a signal
0:30
Today, we'll use this signal to light up an LED and send a message
0:34
to the serial monitor. Here's what you'll need for this project. Arduino board, PIR sensor, LED, 220 ohm resistor for the LED
0:43
breadboard and jumper wires. First, let's set up our circuit. Connect the VCC pin of the PIR sensor to the 5V pin on the Arduino
0:51
the GND pin to the GND on the Arduino, and the out pin to digital pin
0:55
two on the Arduino for the LED. Connect its anode longer leg to digital pin eight and its cathode
1:01
shorter leg to a 220 ohm resistor. Then connect the other end of the resistor to the GND pin on the Arduino
1:07
Give me a moment here while I assemble the circuit. I'm going to put the LED in the middle of the board
1:27
I'm going to connect the LED to the pin on the Arduino. Connect the other end of the resistor to the GND pin on the Arduino
1:33
Connect the other end of the resistor to the GND pin on the Arduino. Connect the other end of the resistor to the GND pin on the Arduino
1:39
Connect the other end of the resistor to the GND pin on the Arduino. Connect the other end of the resistor to the GND pin on the Arduino
1:45
Connect the other end of the resistor to the GND pin on the Arduino. Connect the other end of the resistor to the GND pin on the Arduino
1:51
Connect the other end of the resistor to the GND pin on the Arduino. Connect the other end of the resistor to the GND pin on the Arduino
1:57
Connect the other end of the resistor to the GND pin on the Arduino. Connect the other end of the resistor to the GND pin on the Arduino
2:03
Connect the other end of the resistor to the GND pin on the Arduino. Connect the other end of the resistor to the GND pin on the Arduino
2:09
Connect the other end of the resistor to the GND pin on the Arduino. Connect the other end of the resistor to the GND pin on the Arduino
2:15
Connect the other end of the resistor to the GND pin on the Arduino. Connect the other end of the resistor to the GND pin on the Arduino
2:21
Once detected, the sensor's output pin goes high and we turn on the LED and print
2:25
MOTION DETECTED to the serial monitor. The delay of one second prevents repeated detections
2:31
If no motion is detected, the LED remains off. Upload the code to your Arduino board
2:41
Once the upload is complete, open the serial monitor to see the motion detection messages
2:47
Wave your hand in front of the sensor. You should see the LED light up and the message MOTION DETECTED appear on the serial monitor
2:54
If you don't see this, double check your wiring and code. Great job! You've just learned how to use a PIR sensor with Arduino to detect motion
3:09
This foundational project can be expanded into more complex systems like security alarms or automated lighting
3:15
If you enjoyed this video, please like, subscribe, and hit the bell icon for more exciting tech projects
3:20
Thanks for watching and happy tinkering