How to make Home Security System Using Arduino?

0
1062
smart home security system

Home security is always been a concern of the era. Peoples are spending thousands of rupees to make their homes secure. You don’t need to spend those rupees on home security because In this article I will show you how you can make a cost-effective Home security system. This system will help you to monitor water leakage, gas leakage, and smoke and fire.

Working and Explanation:

The smart home security system will detect the abnormal conditions in the home and give an alert message on the LCD and the buzzer will turn on.

Components used:

  • Arduino UNO
  • 20*4 LCD
  • LPG Gas sensor
  • Fire Sensor
  • Water Leakage sensor
  • 10K potentiometer
  • 9V battery
  • Connecting Wires

Smart home security system project consists of fire and smoke detection, gas leakage system, and water leakage system.  We have used a fire sensor, water sensor, gas sensor, and the LCD to display data. These sensors are connected to the Arduino. Arduino will receive data from these sensor and make decision. For example any of the sensor detect any abnormal codition at a time or one by one they send the data to the microcontroller Arduino UNO. Based on the data receive Arduino will display the alert message and turn the buzzer on.

Circuit Diagram (Arduino Based smart Security System):

The figures below are the circuit diagrams of Arduino based security system for home.

a. Software Implementation and results:

we have implemented the circuit on Proteus software and observed different scenarios

home security system using Arduino

Case 1 ( Gas Leakage)

Gas Leakage

Case 2 ( Water Leakage)

water leakage

Case 3 (Fire)

Fire

Case 4 (Water and Gas)

Water and Gas

Case 5 (Water and Fire)

Water and Fire

Case 6 (Gas and Fire)

Gas and Fire

Case 7 (Gas , Water and Fire)

smart home security system
Gas Water and Fire

b. Hardware

The figure below is the circuit Diagram of security system for home using Arduino and sensors.

home security using arduino
smart home security system

Coding: (Smart Home Security)

#include<LiquidCrystal.h>

LiquidCrystal lcd(2,3,4,5,6,7);

int buzzer=9;
int fire=8;
int gas=A1;
int water=A0;

void setup() {
Serial.begin(9600);
lcd.begin(16,2);
pinMode(buzzer,OUTPUT);
pinMode(fire,INPUT);
pinMode(gas,INPUT);
pinMode(water,INPUT);
}

void loop() {
// put your main code here, to run repeatedly:
int gasData=analogRead(gas);
int waterData=analogRead(water);
int fireData=digitalRead(fire);
Serial.print(“Gas Data:”);
Serial.println(gasData);
Serial.print(“Water Data:”);
Serial.println(waterData);
Serial.print(“Fire Data:”);
Serial.println(fireData);

if((gasData<=750)&&(waterData<=300)&&(fireData==0))
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“You Are Safe”);

}

else if((gasData>750)&&(waterData>300)&&(fireData==1))
{
tone(buzzer,500);
delay(200);
noTone(buzzer);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“ALERT!”);
delay (100);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“GAS & WATER LEAKAGE”);
lcd.setCursor(0,1);
lcd.println(“FIRE DETECTED”);

}

else if((gasData>750)&&(waterData>300)&&(fireData==0))
{
tone(buzzer,1000);
delay(200);
noTone(buzzer);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“ALERT”);
delay (100);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“WATER LEAKAGE”);
lcd.setCursor(0,1);
lcd.print(“GAS LEAKAGE”);
}

else if((gasData<=750)&&(waterData>300)&&(fireData==1))
{
tone(buzzer,1500);
delay(200);
noTone(buzzer);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“ALERT!”);
delay (100);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“WATER LEAKAGE”);
lcd.setCursor(0,1);
lcd.print(“FIRE”);
}

else if((gasData>750)&&(waterData<=300)&&(fireData==1)) { tone(buzzer,100); delay(200); noTone(buzzer); lcd.clear(); lcd.setCursor(0,0); lcd.print(“ALERT!”); delay (100); lcd.clear(); lcd.setCursor(0,0); lcd.print(“FIRE”); lcd.setCursor(0,1); lcd.print(“GAS LEAKAGE”); } else if((gasData>750)&&(waterData<=300)&&(fireData==0))
{
tone(buzzer,2000);
delay(200);
noTone(buzzer);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“ALERT!”);
delay (100);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“GAS LEAKAGE”);;
}

else if((gasData<=750)&&(waterData>300)&&(fireData==0))
{
tone(buzzer,2500);
delay(200);
noTone(buzzer);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“ALERT!”);
delay (100);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“WATER LEAKAGE”);
}

else if((gasData<=750)&&(waterData<=300)&&(fireData==1))
{
tone(buzzer,3500);
delay(200);
noTone(buzzer);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“ALERT!”);
delay (100);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“FIRE DeETECTED”);
}

}

we have used seven cases in coding to detect abnormal conditions and make our home secure. In short, this smart home security system is simple and cost-effective that it can easily be built at home.

Leave a Reply