Nov 17, 2016

SMS Based Laser Security Circuit using Arduino

In this post, we are going to construct a laser security circuit which can send SMS alert to owner of the property or anyone else and activate loud alarm to deter the crook, which can be interfaced via relay.

 
By: Girish Radhakrishnan

We always fear about crooks especially when we leave our property alone, this where security systems come in handy. Loud alarm may be enough to grab everyone’s attention nearby area and deter the thief.

SMS alert warns the user to take necessary action just after the crook broke in to your property.
 
The security systems should be implemented at week points of your house/office, such as doors and windows, sometimes multiple numbers of security systems are required for maximum protection against thief at different points of your home or office.

The circuit:



   
The circuit consists of Arduino, which sense intrusion and take decisions. GSM modem receives command for sending SMS to user and few other passive components to detect intrusion.

The Arduino scans the laser beam for interruption in light 500 times a second. The LDR sense the presence laser light and gives signal to Arduino.

The 10K and LDR forms voltage divider, the analogue signal is taken from a point between these two components.

When the incident light intensity reduces to certain degree or light completely cut-off the arduino recognize as intrusion.

The 10K resistor which is connected to “activate button” acts as pull down resistor to prevent the arduino pin from activating randomly.

The transistor activates the relay in case of an intrusion and the diode protects the rest of the circuit from high voltage spike while switching the relay on and off.

You can connect a siren or lights or whatever you wish to connect to relay.

To activate the security system, we have to press the activate button, the LED indicator confirms that the button is pressed.

 The system gets activated only after 2 minutes; this will give time to lock you property and leave the place.

When you return home, to deactivate the system press the reset button. Solder a push-to-on button from reset button terminal of arduino, so that the reset button to deactivate the system is easily accessible from outside the setup. 

Once the circuit detected intrusion, the relay will be activated for 2 minutes and it turns off and it will be ready to detect next intrusion.

The GSM modem need external power supply as arduino can’t provide enough current to the module. Please insert a valid SIM card with a working SMS plan.

That’s all about this SMS based laser security circuit; now let’s see how to implement the setup in correct way.


How to implement the setup:




Place the laser source and arduino circuit in such a way that the laser light falls exactly on LDR. You can also try mirrors reflecting the laser beam to cover a large area.

If you own pets and to prevent accidental or false alarm, elevate the whole setup to hip level of an adult. You pets will go under the laser beams preventing false triggering.

The LDR is susceptible to errors/false alarm when ambient light falls on it. To avoid these kinds of errors, we need to enclose the LDR with opaque hollow cylinder with one end open and other end closed made up of plastic or any other material.  

 
Make sure the front portion of the tube is covered as well and only tiny hole with few millimeters in diameter for entering laser beam.

When the laser beam falls on the LDR the value read by the arduino is low but when light interruption is detected the value will go to peak at the same instant, which you can witness the same from serial monitor.

Once the light intensity goes below the pre-determined threshold, arduino trigger the relay and send SMS alert to the user.

Program:

//--------------Program developed by R.Girish---------------//
#include <SoftwareSerial.h>
SoftwareSerial gsm(9,8);
int LDR = A0;
int OP = 7;
int start = 6;
int LED = 5;
int th = 300;
int x;
unsigned long A = 1000L;
unsigned long B = A * 60;
unsigned long C = B * 2;
void setup()
{
  Serial.begin(9600);
  gsm.begin(9600);
  pinMode(LDR,INPUT);
  pinMode(OP,OUTPUT);
  pinMode(start,INPUT);
  pinMode(LED,OUTPUT);
}
void loop()
{
if(digitalRead(start)==1)
{
digitalWrite(LED,HIGH);
delay(C);
A:
x = analogRead(A0);
Serial.println(x);
if(x<=th)
{
  delay(2);
  goto A;
}
if(x>=th)
{
digitalWrite(OP,HIGH);
Serial.println("Sending SMS......\n");
gsm.println("AT+CMGF=1");   
delay(1000); 
gsm.println("AT+CMGS=\"+91XXXXXXXXXX\"\r"); // Replace x with mobile number
delay(1000);
gsm.println("Security Warning: Intruder detected."); // The SMS text you want to send
delay(100);
gsm.println((char)26); // ASCII code of CTRL+Z
delay(1000);
Serial.println("Message is sent\n");
delay(C);
digitalWrite(OP,LOW);
goto A;
}
}
}
//--------------Program developed by R.Girish---------------//

Please replace the “XXXXXXXXXX” with your phone number to receive SMS.

Hi Friends, Welcome to my site, a place where you will discover a massive collection of electronic circuit ideas, mostly requested by the dedicated readers and exclusively designed by me for their customized application needs. I have posted more than 1100 circuit designs in this site, if you have a personalized circuit requirement you may feel free to request it through the comment box, if it seems feasible to me then surely you may find it published here with your credentials attached in the post, thanks and please keep reading

3 comments:

  1. What is "ASCII code of CTRL+Z" ? Can i change the activation time??

    ReplyDelete
    Replies
    1. Hi Jade,

      It is termination character for sending SMS, after sending SMS we have to terminate the process.

      On which part you want to change activation time? Can you elaborate please.

      Regards

      Delete