Experiment 3: Motion Detection System
Objective: Detect motion using a PIR sensor and trigger an LED and a buzzer for notification.
Components:
• PIR (Passive InfraRed) Sensor
• Arduino UNO R3 DIP
• Breadboard
• Jumper Wire All type
• LED any color
• Buzzer 5V
• 220Ω or 1KΩ resistor
Steps to Perform the Experiment:
A. Set Up the Hardware
1. Connect the PIR Sensor:
- VCC: Connect to the Positive power rail on the breadboard.
- GND: Connect to the GND power rail on the breadboard.
- OUT: Connect to DP 2 on the Arduino.
2. Connect the LED:
- Anode (longer leg): Connect to DP 7 on the Arduino through a resistor.
- Cathode (shorter leg): Connect to GND power rail on the breadboard.
3. Connect the Buzzer:
- Positive (+): Connect to DP 8 on the Arduino.
- Negative (-): Connect to GND power rail on the breadboard.
4. Set Up the Breadboard:
- Connect the 5V on Arduino to Positive power rail on the breadboard.
- Connect the GND on Arduino to breadboard's GND power rail to complete the circuit.
B. Upload the Code to the Arduino
1. Open the Arduino IDE on your computer.
2. Connect your Arduino UNO to your computer using the USB cable.
3. Write the code into the Arduino IDE.
4. Select the correct board and port in the Arduino IDE (Tools > Board > Arduino UNO, Tools > Port > your
port).
5. Click the "Upload" button to upload the code to the Arduino.
C. Testing the Setup
1. After uploading the code, the Arduino should start running the program.
2. When there is no motion in front of the PIR sensor, the LED should remain off and the buzzer should be
silent.
3. When the PIR sensor detects motion, the LED should light up and the buzzer should sound.
4. The Serial Monitor in the Arduino IDE will display "Motion detected!" when motion is detected and "No
motion" when there is none.
Robo%cs & A.I. – Class IX | SMC Prayagraj