Project tutorial
Smart Home Safety Systems

Smart Home Safety Systems © CC BY-NC-SA

A Home System To Moniter Fire, Smoke/Gas Leak, Laser Theft Trip and Building Collaspe.

  • 150 views
  • 0 comments
  • 1 respect

Components and supplies

Necessary tools and machines

Hy gluegun
Hot glue gun (generic)
09507 01
Soldering iron (generic)

About this project

SMART HOME SAFETY SYSTEM

This is a prototype consisting fire alarm, gas and smoke alarm,building collapse alarm and the anti-theft laser trip alarm combined in oneunit along with the systems to communicate with the authorities during emergenciesto provide all the available safety systems to a house.

The absence of efficient fire alarm systems to detect firefailed to warn the people and the authorities caused certain incidents like thepriya hall fire, the gariahat fire. These incidents made us to make certainefficient fire alarm system and a gas detecting system.

The absence of an anti-theft system caused problems of theftin the Tollygaunge area. We took these incidents to make the laser tripwiresystem.

The Majherhat Bridge collapsed due to the absence of a system,which monitored the capacity of the beams and other parts of a building or a bridgeknown as the building collapse monitor. This incident inspired us to make abuilding collapse monitor.

Although these systems are available abroad but they have tobe bought separately. We have combined them in one unit so that people can buy4 systems while spending money for one interface not for separate interface.

All four systems are connected parallely. The fire alarmsystem is based on an Infrared Radiation detection, the gas, smoke alarm basedon a smoke and gas sensor, the building collapse monitor is based on two flexsensor, and the tip wire system is based on photo resistor or LDR and a 5mWlaser, which is deviated by a 45-degree glass prism. The fire alarm, gas andsmoke sensor, the building collapse monitor all works on same principle, thereading reaches maximum amount after which the alarm triggers. The trip wireworks on another principle, when the laser is falling of the LDR the alarm doesnot trigger and there is no danger, as soon as the laser is stopped the alarmtriggers. All the four systems are connected using the Domino Effect. There isa communicating system used to inform the authorities like the police , whenany one of the alarm triggers .There is a connected emergency light and alarmsystem again with the help of the Domino Effect which warns all the people is ahouse or a building when any one of the alarm triggers.

A Domino Effect or chainreaction is the cumulative effect produced when one event setsoff a chain of similar events. The term is best known as a mechanical effectand is used as an analogy to a falling row of dominoes.It typically refers to a linked sequence of events where the time betweensuccessive events is relatively small. It can be used literally (an observedseries of actual collisions) or metaphorically (causal linkages within systemssuch as global finance or politics). The term Domino Effect is usedboth to imply that an event is inevitable or highly likely (as it has alreadystarted to happen), and conversely to imply that an event is impossible orhighly unlikely (the one domino left standing).

BY: Students Of MP Birla Foundation Higher Secondary School, Kolkata, India

Bikramaditiya Munshi

Kazi Abdul Baset

Parts

Building

Circuits

Code

Smoke/Gas SensorArduino
int redLed = 12;
int buzzer = 10;
int smokeA0 = A5;
// Your threshold value
int sensorThres = 290;

void setup() {
  pinMode(redLed, OUTPUT);
  pinMode(buzzer, OUTPUT);
  pinMode(smokeA0, INPUT);
  Serial.begin(9600);
}

void loop() {
  int analogSensor = analogRead(smokeA0);

  Serial.print("Pin A0: ");
  Serial.println(analogSensor);
  // Checks if it has reached the threshold value
  if (analogSensor > sensorThres)
  {
    digitalWrite(redLed, HIGH);
    tone(buzzer, 100, 200);
  }
  else
  {
    digitalWrite(redLed, LOW);
    noTone(buzzer);
  }
  delay(150);
}
Flex SensorArduino
//Constants:
const int ledPin = 3;   //pin 3 has PWM funtion
const int flexPin = A0; //pin A0 to read analog input
int Buzzer = 13; // Use buzzer for alert 
//Variables:
int value; //save analog value

void setup(){
  pinMode(Buzzer, OUTPUT);
  pinMode(ledPin, OUTPUT);  //Set pin 3 as 'output'
  Serial.begin(9600);       //Begin serial communication
}

void loop(){
  value = analogRead(flexPin);         //Read and save analog value from potentiometer
  value = map(value, 700, 900, 0, 255);//Map value 0-1023 to 0-255 (PWM)
    Serial.println(value);               //Print value
  if(value<=-600 && value>=-790){
  analogWrite(ledPin, LOW);
  digitalWrite(Buzzer, LOW);  
  }//Send PWM value to led
  else{
     digitalWrite(Buzzer, HIGH);
    analogWrite(ledPin, HIGH);  
  }
  delay(100);                          //Small delay
  
}
DisplayArduino
#include <Wire.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>

// OLED display TWI address
#define OLED_ADDR   0x3C

Adafruit_SSD1306 display(-1);

#if (SSD1306_LCDHEIGHT != 32)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif

//const won't change
const int ledPin = 13;   //the number of the LED pin
const int ldrPin = A0;  //the number of the LDR pin
 
void setup() {
  // initialize and clear display
  display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR);
  display.clearDisplay();
  display.display();

  // display a pixel in each corner of the screen
  display.drawPixel(0, 0, WHITE);
  display.drawPixel(127, 0, WHITE);
  display.drawPixel(0, 31, WHITE);
  display.drawPixel(127, 31, WHITE);

  // display a line of text
  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0,1);


  // update display with all of the above graphics
  display.display();
   Serial.begin(9600);
  pinMode(ledPin, OUTPUT);  //initialize the LED pin as an output
  pinMode(ldrPin, INPUT);   //initialize the LDR pin as an input
}

void loop() {
  // put your main code here, to run repeatedly:
int ldrStatus = analogRead(ldrPin);   //read the status of the LDR value
 
  //check if the LDR status is <= 300
  //if it is, the LED is HIGH
  Serial.println(ldrStatus);
   if (ldrStatus >=500) {
   display.print("ALARM!");
   display.print("CALLTHE POLICE");
    digitalWrite(ledPin, HIGH);               //turn LED on
    Serial.println("ALARM");


  // update display with all of the above graphics
  display.display();
   }
  else {
 
    digitalWrite(ledPin, LOW);          //turn LED off
    Serial.println("---------------");
    
  }
}
IR SensorArduino
int Buzzer = 13;  // Use Buzzer for Alert 
int FlamePin = 2; // This is for input pin
int Flame = HIGH; // HIGH when FLAME Exposed
int led = 11;     // Use LED for Alert
void setup() { 
 pinMode(led, OUTPUT);
 pinMode(Buzzer, OUTPUT);
 pinMode(FlamePin, INPUT);
 Serial.begin(9600);
}
 
void loop() {
 Flame = digitalRead(FlamePin);
 if (Flame== LOW)
 {
 Serial.println("HIGH FLAME");
 digitalWrite(Buzzer, HIGH);
 digitalWrite(led, HIGH);
 delay(10);
 }
 else
 {
 Serial.println("No flame");
 digitalWrite(Buzzer, LOW);
 digitalWrite(led, LOW);
 }
}
Trip WireArduino
// Variables
int mode = 1;
int ambiant;
int trip = 1000; // The light value I get when using my laser
int minLight = 900;
int makeBeep = 1; //0 for no beep, 1 for beep!
int atAverage;
long millisCount;

// Output Pins
int laserPin = 2;
int ledPin = 13;
int buzzerPin = 3;
String  modeNames[3] = {"SETTINGS","ARMED","TRIP"};

// Input Pins
int modePin = 4; 
int tripPin = A0;
int ambiantPin = A1;


void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(laserPin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);
  pinMode(modePin, INPUT);
  Serial.begin(9600);
}


void loop() {

  switch (mode) {
    case 0: //calibration mode
      digitalWrite(laserPin,HIGH);
      
      ambiant = analogRead(ambiantPin);
      trip = analogRead(tripPin);
      atAverage = ambiant + ((trip - ambiant)/2);
      stats();
      
      if (trip  >= minLight) {
        digitalWrite(ledPin,HIGH);
      } else {
        digitalWrite(ledPin,LOW);
      }

    break;

    case 1: // Armed mode
      digitalWrite(laserPin,HIGH);
      digitalWrite(ledPin,LOW);
      ambiant = analogRead(ambiantPin);
      atAverage = ambiant + ((trip - ambiant)/2);
      if (analogRead(tripPin) < atAverage) {
        mode = 2;
      }
      if ((millis() - millisCount) >= 3000) {
        millisCount = millis();
        stats();
      }
    break;
    
    case 2: //Trip Mode
      if ((millis() - millisCount) >= 1000) {
        millisCount = millis();
        stats();
        beep(3);
        mode = 1;
      }
    break;
    }

    
  delay(0.5);                       // wait for a bit
}

//It Beeps
void beep(int qty) {
  int count;
  if (makeBeep == 1) {
    for (count = 1;count<=qty;count++) {
      digitalWrite(buzzerPin, HIGH);
      delay(50);
      digitalWrite(buzzerPin, LOW);
      delay(50);
    }
  }
}

//Writes stats to the Serial Port
void stats() {
  Serial.print("A:");
  Serial.print(ambiant);
  Serial.print(" T:");
  Serial.print(trip);
  Serial.print(" AT:");
  Serial.print(atAverage);
  Serial.print(" MODE:");
  Serial.print(modeNames[mode]);
  Serial.println("");
}

Schematics

Wiring
Oledledtrigger bb png l8omcchmfp
smokegasbuzzerled_bb_jpeg_Mld8LWPQVy.jpg
Smokegasbuzzerled bb jpeg mld8lwpqvy
tripwire_bb_jpeg_LaKFat7HGc.jpg
Tripwire bb jpeg lakfat7hgc
flame_sensor_bb_jpeg1_EuDlp70CsF.jpg
Flame sensor bb jpeg1 eudlp70csf
flexledbuzzer_bb_jpeg_hqtPcCUYiD.jpg
Flexledbuzzer bb jpeg hqtpccuyid

Comments

Similar projects you might like

Safe Home Smart Home: Safety Device For Every Family Member

Project tutorial by Patel Darshil

  • 4,602 views
  • 0 comments
  • 11 respects

Smart Battery Charger Multiplexer with Smart Display

Project tutorial by leonzak

  • 2,643 views
  • 5 comments
  • 14 respects

Smart Fire and Flammable Gas Safety Valve

Project in progress by Ashwini kumar sinha

  • 690 views
  • 0 comments
  • 2 respects

Home Safety Bot

Project showcase by Team HomeSafety

  • 2,751 views
  • 3 comments
  • 17 respects

Smart Garden

Project showcase by patel Dipen

  • 31,723 views
  • 17 comments
  • 75 respects

Octopod: Smart IoT Home/Industry Automation Project

Project tutorial by Saksham Bhutani

  • 10,084 views
  • 9 comments
  • 37 respects
Add projectSign up / Login