0% found this document useful (0 votes)
10 views

Report for Pir Motion Sensor With Arduino Code

Uploaded by

Kabir Rastogi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Report for Pir Motion Sensor With Arduino Code

Uploaded by

Kabir Rastogi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

REPORT

Arjun Rastogi – 2362314


Hitesh Umesh – 2362613
Dev Rakesh Parsana- 2362808

Project Title:
Implementation of PIR Motion Sensor with Arduino

Objective:
The primary objective of this project is to create a motion
detection system using a Passive Infrared (PIR) sensor
interfaced with an Arduino microcontroller. The system should
be able to detect motion within its range and trigger appropriate
actions, such as turning on lights, activating an alarm, or
sending notifications.

Abstract:

Components used in this project:


1. Arduino Uno (or any compatible microcontroller)
2. PIR Motion
3. Jumper Wires
4. LED (optional, for demonstration purposes)

Schematics:
Assemble the parts with the help of a schematics:

Project Overview: Passive Infrared (PIR) sensors detect


motion by measuring changes in infrared radiation levels
emitted by surrounding objects. When a warm body moves
within the sensor's field of view, it triggers a signal.

Implementation Steps:

1. Hardware Setup:
• Connect the VCC pin of the PIR sensor to 5V on the
Arduino.
• Connect the GND pin of the PIR sensor to GND on the
Arduino.
• Connect the OUT pin of the PIR sensor to a digital pin
(e.g., Pin 2) on the Arduino.
2. Arduino Sketch:
• Initialize the digital pin connected to the OUT pin of the
PIR sensor as an input.
• Set up the Arduino to monitor the state of the PIR sensor's
output.
• When motion is detected (i.e., the output of the PIR sensor
goes HIGH), trigger an action (e.g., turning on an LED).
• Optionally, add a delay to prevent repeated triggering for a
specified period.
3. Testing and Calibration:
• Upload the Arduino sketch to the microcontroller.
• Place the PIR sensor in the desired location with an
appropriate field of view.
• Adjust the sensitivity and timing settings of the PIR sensor
if necessary.
• Test the system by moving within the sensor's detection
range and observe the response.
4. Integration and Expansion:
• Integrate the motion detection system with other devices
or systems as needed.
• Implement additional functionalities, such as sending
notifications to a smartphone or recording data when motion is
detected.
• Consider adding features like a delay timer to control the
duration of the triggered action.

PIR Motion Sensor with the help of Arduino Code:

Arduino code for PIR Motion Sensor:


/*
Arduino with PIR motion sensor
For complete project details, visit:
http://RandomNerdTutorials.com/pirsensor
Modified by Rui Santos based on PIR sensor by Limor Fried
*/
int led = 13; // the pin that the LED is attached to
int sensor = 2; // the pin that the sensor is attached to
int state = LOW; // by default, no motion detected
int val = 0; // variable to store the sensor status
(value)

void setup() {
pinMode(led, OUTPUT); // initalize LED as an output
pinMode(sensor, INPUT); // initialize sensor as an input
Serial.begin(9600); // initialize serial
}

void loop(){
val = digitalRead(sensor); // read sensor value
if (val == HIGH) { // check if the sensor is HIGH
digitalWrite(led, HIGH); // turn LED ON
delay(100); // delay 100 milliseconds

if (state == LOW) {
Serial.println("Motion detected!");
state = HIGH; // update variable state to HIGH
}
}
else {
digitalWrite(led, LOW); // turn LED OFF
delay(200); // delay 200 milliseconds

if (state == HIGH){
Serial.println("Motion stopped!");
state = LOW; // update variable state to LOW
}
}

References:

Conclusion:
In conclusion, this project successfully demonstrates the
implementation of a motion detection system using a PIR
sensor and Arduino microcontroller. By following the outlined
steps, users can create a versatile and customizable motion
sensing solution suitable for various applications, including
home security, automation, and environmental monitoring.
Further enhancements and integrations can be made based on
specific project requirements and desired functionalities.

You might also like