Intruder Detection Using Passive Infrared (PIR) Sensor and Arduino
Intruder Detection Using Passive Infrared (PIR) Sensor and Arduino
Interfacing an Arduino with a Passive Infrared (PIR) Sensor allows for the detection of human or animal movements within the sensor range. This project is straightforward and efficient, making it ideal for detecting potential intruders in the vicinity of your home. The sensor is commonly known as PIR, representing "Passive Infrared," "Pyroelectric," or "IR motion" sensor.
Components Required:
- Arduino Uno with USB 2.0 Cable
- PIR Sensor
- Jumper Wires
Arduino Uno with USB 2.0 Cable:
Arduino is a user-friendly, open-source electronics platform comprising both hardware and software components. Its design is geared towards enabling individuals involved in creating interactive projects.
PIR Sensor:
PIR stands for Passive Infrared sensor. This sensor is designed to detect the presence of human beings or animals. Two crucial components within the sensor contribute to its functionality. The first is the pyroelectric crystal, capable of detecting heat signatures emitted by living organisms, such as humans or animals. The second component is the Fresnel lenses, which serve to broaden the range covered by the sensor.
Specifications:
- Power Supply :+5V DC
- Quiescent Current : <50uA
- Ranging Distance: <120 ° within 7 meter
- Measuring Angle: 110 ° cone angle
- Board Dimension: 32mm x 24mm
Jumper Wires:
A jumper wire is an electrical wire equipped with connectors or pins at each end. It is commonly employed to interconnect components without the need for soldering, providing a convenient method for establishing electrical connections between different parts of a circuit.
Connection Diagram:
Connect your components according to the provided diagram and link the USB cable from Arduino to your computer.
Arduino Code:
int calibrationTime = 15;
int pirPin = 2; //the digital pin connected to the PIR sensor's output
int ledPin = 13; //Built-In led
void setup()
{
Serial.begin(9600);
pinMode(pirPin, INPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(pirPin, LOW);
//give the sensor some time to calibrate
Serial.print("calibrating sensor ");
for(int i = 0; i < calibrationTime; i++){
Serial.print(".");
delay(1000);
}
Serial.println(" done");
Serial.println("SENSOR ACTIVE");
delay(2000);
}
void loop()
{
if(digitalRead(pirPin) == HIGH)
{
digitalWrite(ledPin, HIGH); //the led visualizes the sensors output pin state
Serial.println("intruder detected! ");
delay(2000);
}
else if(digitalRead(pirPin) == LOW)
{
digitalWrite(ledPin, LOW); //the led visualizes the sensors output pin state
Serial.println("intruder not detected!"); //output
delay(2000);
}
else
{
Serial.println("Sensor Fault");
}
}
Upload:
Connect
Arduino board to computer using USB cable and wait for few seconds then it will
show you "Com port".
Check
your Com Port and Board Selection before upload Arduino code.
Check
output in Arduino serial monitor.
Additional Projects:
Subscribe to:
Post Comments
(
Atom
)
Internet of Things
What is Internet of Things?
What is IoT? The Internet of Things (IoT) is the network of physical objects/things are embedded with software, sensors, and hardw...
No comments :
Post a Comment