Skip to main content

Security Alarm using Arduino and PIR sensor

 Security Alarm using Arduino and PIR Sensor


Project Overview :

To create a security alarm system that detects unauthorized access or intrusion and alerts the user through audible and/or visual alarms.


Components :

1. Arduino board (such as Arduino Uno)

2. PIR motion sensor module

3. Buzzer or piezo speaker

4. LED (optional for visual indication)

5. Breadboard 

6. Jumper wires


Hardware Setup :
  • Connect the PIR motion sensor module to the Arduino. The sensor typically has three pins: VCC, GND, and SIGNAL. Connect VCC to 5V, GND to GND, and SIGNAL to a digital input pin (e.g., pin 2) on the Arduino.

  • Connect the buzzer or piezo speaker to the Arduino. Connect one terminal of the buzzer to a digital output pin (e.g., pin 3) on the Arduino and the other terminal to GND.

  • Optionally, connect an LED to a digital output pin (e.g., pin 4) on the Arduino for visual indication.

Software Setup : 

Arduino Code :

#define PIR_PIN 2 // Digital pin connected to PIR sensor
#define BUZZER_PIN 3 // Digital pin connected to buzzer
#define LED_PIN 4 // Digital pin connected to LED (optional)
void setup() {
  pinMode(PIR_PIN, INPUT);
  pinMode(BUZZER_PIN, OUTPUT);
  pinMode(LED_PIN, OUTPUT);
  
  Serial.begin(9600);
  Serial.println("Security Alarm System - Ready");
}
void loop() {
  int motionDetected = digitalRead(PIR_PIN);
  
  if (motionDetected == HIGH) {
    digitalWrite(BUZZER_PIN, HIGH); // Activate the buzzer
    digitalWrite(LED_PIN, HIGH); // Turn on the LED (optional)
    Serial.println("Intruder Detected - Alarm Activated!");
    delay(5000); // Alarm duration (adjust as needed)
    digitalWrite(BUZZER_PIN, LOW); // Deactivate the buzzer
    digitalWrite(LED_PIN, LOW); // Turn off the LED (optional)
  }
}


Code File : Click Here


Project Outcome:

The completed security alarm system provides effective protection against unauthorized access or intrusion, alerting users to potential security threats through audible and/or visual alarms. With its customizable features and robust functionality, the system enhances the security and peace of mind of users in various environments.


Follow For More :


Comments

Popular posts from this blog

Automatic Door Opening System Using Arduino and PIR Sensor

Project Overview:   The project aims to create an automatic door opening system using an Arduino microcontroller , a PIR (Passive Infrared) sensor, and a servo motor. The system detects motion using the PIR sensor and automatically opens the door by activating the servo motor. After a specified delay, the door closes automatically.   Materials: - Arduino Uno board - PIR sensor - Servo motor - Jumper wires - Breadboard - USB cable for Arduino - Computer for programming and testing   Software Requirements: - Arduino IDE (Integrated Development Environment)   Hardware Setup: 1. Connect the PIR sensor to the Arduino as follows:    - Signal pin of the sensor to digital pin 2 of the Arduino    - VCC pin of the sensor to 5V pin of the Arduino    - GND pin of the sensor to GND pin of the Arduino 2. Connect the servo motor to the Arduino as follows:    - Signal wire of the servo motor to digital pin 3 of the Arduino...

Exploring the Fascinating World of Robotics

  In the realm where science fiction meets reality, there exists a field that continually pushes the boundaries of human imagination and technological innovation: robotics. From the fictional realms of Isaac Asimov's visionary tales to the real-world applications in manufacturing, healthcare, space exploration, and beyond, robotics has captured the fascination of both dreamers and engineers alike. Unveiling the Marvels of Robotics At its core, robotics is the interdisciplinary field that merges mechanical engineering, electrical engineering, computer science, and artificial intelligence to create machines—robots—that can perform tasks autonomously or semi-autonomously. These machines range from the size of nanobots, manipulating matter at the molecular level, to towering humanoid robots mimicking human movements with remarkable precision. Applications in Everyday Life The impact of robotics extends far beyond the confines of research laboratories. In manufacturing, robots have revo...