Project showcase
Home Security Automation Using 1Sheeld

Home Security Automation Using 1Sheeld

Our project can be easily done in different places and it's away simple thankfully to 1Sheeld.

  • 3,985 views
  • 0 comments
  • 6 respects

Components and supplies

About this project

This is a home automation and security system using 1Sheeld. The project works as the following:

When the user reaches his home door a pir sensor will sense him so an LED will be turned on and then he has to say a specific password to can access his home. If the password is right, the entrance LED and the music player will be turned on. If the password is wrong, a buzzer will be turned on and the camera will capture a photo of him and tweet it on twitter. For the kitchen there are a water and a gas sensor if they passed a certain threshold, then for sure there is a problem so the 1Sheeld will send you a message on your mobile phone telling you that and if the problem is in the gas ratio the fan will be turned on to push that gas outside your home.

N.B:  You should also download 1Sheeld app on you smartphone 

https://play.google.com/store/apps/details?id=com.integreight.onesheeld&hl=en

And more about 1Sheeld : 

Code

Home Automation and security system using 1SheeldC/C++
/*

this  is a Home security project using Arduino UNO board and the ammazing 1sheild

@author		Ahmed ismail , hussien mohamed
@email		mido-ahlawy-92@hotmail.com ,hussien.G750@gmail.com
@ide		Arduino IDE

when the user reaches his home door a pir sesnor will sense him so a led will be turned on
and then he has to say a specific password to can access his home
if the password is right the enterance led and the music player will be turned on
and if the password is wrong a buzzer will be turned on and the camera will capture
a photo of him and tweeted it on twitter

and for the kitchen their are a water and a gas sesnor if they passed a certain threshold
then for sure there is a problem so the 1 sheild will send you a message on your mobile phone
telling you that and if the problem is in the gas ratio the fan will be turned on
to push that gas outside your home

*/


/* Include 1Sheeld library. */
#include <OneSheeld.h>

#define CUSTOM_SETTINGS
#define INCLUDE_VOICE_RECOGNIZER_SHIELD
#define INCLUDE_LCD_SHIELD
#define INCLUDE_MUSIC_PLAYER_SHIELD
#define INCLUDE_TERMINAL_SHIELD
#define INCLUDE_CAMERA_SHIELD
#define INCLUDE_TWITTER_SHIELD
#define INCLUDE_SMS_SHIELD


#define pir    A0
#define gas    A1
#define water  A2
#define led1   11
#define led2   12
#define led3   10
#define lamp   13
#define fan    5
#define buzzer 9


/* Define some variables. */
int pirv = 0;
int gasv = 0;
int waterv = 0;
boolean isMessageSent = false;

/* Voice command set by the user. */
const char openCommand[] = "open";


void setup() {
  /* Start communication. */
  OneSheeld.begin();
  /* Error Commands handiling. */
  VoiceRecognition.setOnError(error);

  VoiceRecognition.start();


  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(lamp, OUTPUT);
  pinMode(fan, OUTPUT);
}

void loop() {

  LCD.begin();
  pirv =   digitalRead(pir);
  gasv =   digitalRead(gas);
  waterv = analogRead(water);

  if (pirv == 1) {
    digitalWrite(led2, HIGH);
    LCD.print("say password");
    delay(5000);

    if (VoiceRecognition.isNewCommandReceived()) {
      /* Compare the open command. */
      if (!strcmp(openCommand, VoiceRecognition.getLastCommand())) {
        digitalWrite(led2, LOW);
        digitalWrite(led1, HIGH);
        LCD.print("welcome home ");
        MusicPlayer.play();
        delay(5000);
        digitalWrite(led1, LOW);
      }

      else {
        digitalWrite(buzzer, HIGH);
        Camera.setFlash(ON);
        /* Take the picture. */
        Camera.rearCapture();
        /* Wait for 10 seconds. */
        OneSheeld.delay(10000);
        /* Post the picture on Twitter. */
        Twitter.tweetLastPicture("unauthinticated person");
      }
    }
  }

  if (waterv > 300 || gasv > 200) {

    if (!isMessageSent)
    {
      /* Send the SMS. */
      SMS.send("01094537336", "kitchen ALERT");
      /* Set the flag. */
      isMessageSent = true;
    }
    while (gasv > 200) {
      digitalWrite(fan, HIGH);
    }
  }
}

/* Error checking function. */
void error(byte errorData)
{
  /* Switch on error and print it on the terminal. */
  switch (errorData)
  {
    case NETWORK_TIMEOUT_ERROR: Terminal.println("Network timeout"); break;
    case NETWORK_ERROR: Terminal.println("Network Error"); break;
    case AUDIO_ERROR: Terminal.println("Audio error"); break;
    case SERVER_ERROR: Terminal.println("No Server"); break;
    case SPEECH_TIMEOUT_ERROR: Terminal.println("Speech timeout"); break;
    case NO_MATCH_ERROR: Terminal.println("No match"); break;
    case RECOGNIZER_BUSY_ERROR: Terminal.println("Busy"); break;
  }
}

Comments

Similar projects you might like

Smart Home Automation And Security System Using 1Sheeld

Project tutorial by Team SADEE

  • 5,509 views
  • 3 comments
  • 25 respects

Security System With 1Sheeld

Project showcase by nada abdelnaby mady

  • 1,384 views
  • 0 comments
  • 2 respects

Home Automation using Arduino and 1Sheeld

Project tutorial by Ramy ElMallah

  • 3,968 views
  • 2 comments
  • 12 respects

SMS based Home Automation system using 1SHEELD

Project tutorial by Tanishq Jaiswal

  • 27,240 views
  • 11 comments
  • 63 respects

My Motion Activated Security Cam project

Project tutorial by Christiaan Neil Burger

  • 9,230 views
  • 9 comments
  • 12 respects

Universal Remote Control using Arduino, 1Sheeld and Android

Project tutorial by Ashraf Nabil

  • 8,814 views
  • 5 comments
  • 14 respects
Add projectSign up / Login