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...

Automatic Light ON/OFF System

Motion detection Light ON/OFF system (Automatic Light) Project Overview : The project aims to create an automatic light control system using an Arduino micro-controller, a PIR (Passive Infrared) sensor, and a relay module. The system detects motion using the PIR sensor and automatically turns on/off a light source connected through the relay. After a specified period of inactivity, the light is turned off to conserve energy. Materials: 1. Arduino UNO 2. PIR Sensor 3. Relay Module 4. LED Bulb or Any AC Bulb 5. Jumper Wires 6. Bread Board Software Requirements: Arduino IDE (Integrated Development Environment) Hardware Setup: 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 Connect the relay module to the Arduino: Connect the signal pin of the relay module to a digital pin (e.g., pin 3) of the Arduino. Connect the VCC pin of the relay mod...