Wednesday 30 March 2016

A simple GSM security using laser diode with alarm and camera system


Circuit
 
SIM900 Arduino Compatible GSM modem
A camera system it shall capture the a image of the intruder and save it to its own memory-card
The SMS will be sent to the owner if the alarm has triggere

Codes
-----------------------------------------------------------------------------------------------------
int inputpin = 13;
int indicators = 12;

void setup()
{
  delay(2000); //Delay to start Serial
Serial.begin(9600);
pinMode(inputpin, INPUT);
 pinMode(indicators, OUTPUT);
delay(5000); //Delay to activate Network from a GSM
}

void loop() {
int inputpin = digitalRead(13);
if (inputpin==HIGH)
{
  digitalWrite(indicators, HIGH);
  SendMessage();
  } 
else
  {
    digitalWrite(indicators, LOW);
  }
}

void SendMessage()
{
  Serial.println("AT");
 delay(1000);
Serial.println("AT+CMGF=1");
delay(1000);
Serial.println("AT+CMGS=\"0788636145\"\r");
delay(1000);
Serial.println("EMERGENCY, INTRUDER!!");
delay(100);
Serial.println((char)26);// ASCII code of CTRL+Z
}
---------------------------------------------------------------------------------------------------------

No comments:

Post a Comment