How to make burglar alarm using motion sensor

Arduino

How to make burglar Alarm:

We will use RIP motion sensor with Arduino Uno board. RIP sensor is a 3 pin module which can trigger on motion detection. Arduino will detect the alarm and will drive the alarm system to integrate with central alarm system or security system.

RIP Module

RIP-Motion-Sensor

 

Connectivity Diagram:

You can connect the module with Arduino with 2 pin Alarm and GND, VCC will be 5V external power supply with common ground

Motion-Sensor-Connectivity

 

Sensor Position:

You can install the sensor in top of the roof or corner from where full room is visible.

Motion-Sensor-Position

 

Program:

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int AlarmPin = 6;
const int powermotionsensor = 9;
//Motion Sensor from top view
// 1.2.3
//GND.ALARM.VCC

void setup() {
// put your setup code here, to run once:

Serial.begin(9600);
pinMode(AlarmPin, INPUT);
pinMode(powermotionsensor, OUTPUT);
lcd.begin(16, 2);
lcd.print(” Motion Sensor”);
lcd.display();
digitalWrite(powermotionsensor, HIGH);
}

void loop() {

boolean alarm;
alarm = digitalRead(AlarmPin);
Serial.print(alarm);
Serial.print(” Motion Sensing “);
Serial.println();

if(alarm==true){
itsAlarm();
}else{
itsNotAlarm();
}
delay(1000);
}
void itsAlarm(){
Serial.println(“Motion Detected”);
lcd.noDisplay();
lcd.setCursor(0, 0);
lcd.print(“Motion Detected”);
lcd.display();
}
void itsNotAlarm(){
Serial.println(“Nothing “);
lcd.noDisplay();
lcd.setCursor(0, 0);
lcd.print(“Nothing “);
lcd.display();
}

Connect a Buzzer:

Motion-with-Alarm

Program:

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int AlarmPin = 6;
const int powermotionsensor = 9;
const int SirenPin = 7;
const int powersiren = 8;
const int groundsiren = 10;
//Motion Sensor from top view
// 1.2.3
//GND.ALARM.VCC

void setup() {
// put your setup code here, to run once:

Serial.begin(9600);
pinMode(AlarmPin, INPUT);
pinMode(powermotionsensor, OUTPUT);
pinMode(SirenPin, OUTPUT);
pinMode(powersiren, OUTPUT);
pinMode(groundsiren, OUTPUT);
lcd.begin(16, 2);
lcd.print(” Motion Sensor”);
lcd.display();
digitalWrite(powermotionsensor, HIGH);
digitalWrite(powersiren, HIGH);
digitalWrite(groundsiren, LOW);
digitalWrite(SirenPin, LOW);
}

void loop() {

boolean alarm;
alarm = digitalRead(AlarmPin);
Serial.print(alarm);
Serial.print(” Motion Sensing “);
Serial.println();

if(alarm==true){
itsAlarm();
}else{
itsNotAlarm();
}
delay(1000);

}
void itsAlarm(){
Serial.println(“Motion Detected”);
lcd.noDisplay();
lcd.setCursor(0, 0);
lcd.print(“Motion Detected”);
lcd.display();
digitalWrite(SirenPin, HIGH);
}
void itsNotAlarm(){
Serial.println(“Nothing “);
lcd.noDisplay();
lcd.setCursor(0, 0);
lcd.print(“Nothing “);
lcd.display();
digitalWrite(SirenPin, LOW);
}

 

For LCD connectivity please follow the below link

How to add LCD with Arduino Uno Board

Run it and enjoy, below is the video tutorial for this project which can help you more

One thought on “How to make burglar alarm using motion sensor

Comments are closed.