• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Contact | Calculators-online
You are here: Home / Security and Alarm / SMS Based Laser Security Circuit

SMS Based Laser Security Circuit

Last Updated on September 11, 2019 by Swagatam 36 Comments

In this post, I will show how 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.

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.

How it Works

SMS Based Laser Security Circuit

NOTE: Please replace the transistor base resistor 330 ohm with a 10 K resistor, because 330 ohm value is too low and is incorrect.

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 senses 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:

block2Bdiagram

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.

LDR Setup

beam 2

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 Code:

//--------------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.

You'll also like:

  • 1.  Anti Spy RF Detector Circuit – Wireless Bug Detector
  • 2.  Earth Leakage Indicator Circuit for Detecting Current Leakages in Ground Wires
  • 3.  Footsteps Detector Circuit
  • 4.  Office Call Bell Network Circuit with LED Monitor
  • 5.  Make this Simple Refrigerator Door Open Alarm Circuit
  • 6.  433 MHz Remote Infrared Wireless Alarm

About Swagatam

I am an electronics engineer with over 15 years of hands-on experience. I am passionate about inventing, designing electronic circuits and PCBs, and helping hobbyists bring their projects to life. That is why I founded homemade-circuits.com, a website where I share innovative circuit ideas and tutorials. Have a circuit related question? Leave a comment.... I guarantee a reply!

Previous Post: « 10 LED Tachometer Circuit Diagram
Next Post: Intruder Position Indicator Security Circuit »

Reader Interactions

Comments

  1. Joshua says

    June 24, 2021 at 3:02 pm

    Do you have a wiring diagram

    Reply
  2. vhafuwi says

    June 17, 2018 at 11:22 pm

    Hello Mr Swagatam

    I have gone through this post , noted that modification on Aduino Code falls under premium projects ,

    I require a quote on some code modification for the above project post for my specific solution , I may have to send to it through to your email

    regards

    Reply
    • Swagatam says

      June 18, 2018 at 4:07 pm

      Hi Vhafuwi, sorry Arduino coding not being my area of expertise would be difficult to address, and approaching the actual author may be also difficult at the moment for me. Kindly bear with me!

      Reply
  3. Gycon says

    May 22, 2018 at 12:51 pm

    Hi
    Pls am done with the project and tested it, everything is working but am not receiving SMS from the GSM. So pls help me out whether there is a problem with the coding.

    Reply
    • Swagatam says

      May 22, 2018 at 5:14 pm

      Mr. GR will reply you soon.

      Reply
      • Vaidehee says

        April 7, 2021 at 7:25 pm

        Hello, i tried this project, i have GSM, SIM 900A.. the problem is
        1) i can’t connect the relay on breadboard?
        2) also if i use USB to power up Arduino where should I place the connection for LDR?
        3) IS there any video available for thos project as a result?
        4) what changes do i have to make in the program?

        Reply
        • Swagatam says

          April 8, 2021 at 12:18 pm

          Hello, all the connections are already given in the diagram, the LDR connection is also shown…
          there’s no video for this…

          Reply
    • GR says

      May 22, 2018 at 7:23 pm

      Hi Gycon,
      Open the Serial monitor and try triggering the circuit. You must see “Message is sent” on serial monitor, if yes the circuit is triggered and Arduino is communicating with GSM. If no SMS to your mobile phone, check you connection to GSM module, still no results. Check your GSM module is properly working or not.

      Regards

      Reply
  4. gycon says

    May 21, 2018 at 6:48 pm

    hi
    pls which part of the circuit is the relay output terminals connects to

    Reply
    • Swagatam says

      May 21, 2018 at 8:39 pm

      The relay coil connects with the transistor. For more on relay connections you can refer to the following post:
      https://www.homemade-circuits.com/community/electronic-circuit-forum/how-a-relay-works-in-circuits-how-to-connect-it/

      Reply
  5. Gycon says

    May 7, 2018 at 1:35 pm

    Hi
    Pls am done with the wiring of the diagram and uploaded the program to it but am not having any feedback. Pls kindly help me out.

    Reply
    • GR says

      May 7, 2018 at 2:28 pm

      Hi Gycon,

      I didn’t get you….. can you elaborate what feedback do you mean.

      Regards

      Reply
    • Gycon says

      May 7, 2018 at 3:20 pm

      Am talking of the SMS and the LED which suppose to light up as the output results.

      Reply
  6. Gycon says

    May 5, 2018 at 5:08 pm

    Hi
    Pls on the GSM which pins is meant for the external power

    Reply
    • GR says

      May 5, 2018 at 6:48 pm

      Hi Gycon,

      The external power to your GSM module is the DC jack generally. The external “pin” on your GSM module may be differ from mine, so search your model on google or just take closer look on the board it will be named as “Vcc” or “12V” something similar.

      Regards

      Reply
  7. Rakesh says

    February 3, 2018 at 11:08 pm

    Hlo sir..
    I want such kind an project in which an megnatic switch turns on the one specific pin of arduino to make a call from gsm module to a mobile number…
    Plz explain me the complete circuit and the parts list….this project is very important for me…
    Not an notifying msg is required…
    Just an call by turning on the read switch….
    [email protected]
    Thank u.

    Reply
    • Swagatam says

      February 4, 2018 at 10:08 am

      Hello Rakesh,

      presently all Arduino related projects are premium projects, so you may have to pay for the customization, or have to buy the entire kit from us.

      Reply
      • Rakesh says

        February 4, 2018 at 4:52 pm

        Okkk sir…
        How much i hav to pay for this article ????

        Reply
        • Swagatam says

          February 4, 2018 at 5:44 pm

          I’ll forward this question to Mr. GR, he will reply you regarding the price soon…

          Reply
    • GR says

      February 4, 2018 at 7:39 pm

      Hi Rakesh,

      From you comments what we can understand is:

      You want to get a call from the GSM module to a mobile number, if the magnetic switch (reed switch) is triggered.

      Shall we confirm your requirement? and proceed?

      Regards

      Reply
      • Rakesh says

        February 4, 2018 at 9:30 pm

        Yes sir i want to manage a call by triggering (on/off)the read switch ….
        And the call must be repeated until the call is being not answered….

        Reply
        • GR says

          February 4, 2018 at 10:46 pm

          Hi Rakesh,

          Let’s make the technical aspects of your project clear once again,

          When the reed switch is triggered you will receive a call to your phone and the call ring to your phone lasts 40 to 50 seconds, it is your wish to cut the call or not. But anyways the call gets disconnected (by the mobile network) after 50 seconds automatically and you will get missed call notification.

          The pricing for the project:
          For Each word explanation is 1 rupee. (Around 500 words of explanation is expected, but can vary)
          For Each line of program code is 10 rupee. (Around 100 to 150 lines of code is expected, but can vary)

          Regards

          Reply
  8. siamfj says

    January 23, 2018 at 5:36 pm

    Hello sir Some problem gsm.println(“AT+CMGS=”+91XXXXXXXXXX”r”); // Replace x with mobile number
    delay(1000); please solved.And e-mail me code for project.

    Reply
    • Swagatam says

      January 23, 2018 at 9:06 pm

      Hello siamfj, I’ll forward this question to Mr. GR, he will solve the issue for you soon…

      Reply
      • GR says

        January 24, 2018 at 1:28 am

        Hi siamfj,

        The corrected code will be placed soon.

        Regards

        Reply
        • Swagatam says

          January 24, 2018 at 6:54 am

          Thank you GR,

          I have made the necessary corrections, I hope the system will work correctly now.

          Reply
  9. malek says

    December 28, 2017 at 1:32 am

    i am AUTOMATION & ROBOTICS ENGINEER
    GSM Module how it cost ?

    kind regards

    Malek

    Reply
    • Swagatam says

      December 28, 2017 at 10:06 am

      You can search online for the rates, you can find it easily

      Reply
  10. OFFOR KELVIN PIUS says

    December 17, 2017 at 4:37 pm

    Hi,SWAG. i am really grateful to you for making your circuits open to all God will bless you abundantly.
    Pls kindly assist me in this project, i want to build a security system whereby the system will send sms or message to numbers and location using gprs.
    Thank hoping to hearing from you soonest from Kelvin

    Reply
    • Swagatam says

      December 17, 2017 at 6:00 pm

      Thanks Offor, I am glad you liked the circuits. The Arduino circuits are not designed by me, they are designed by Mr.GR, so I’ll inquire with him and get back to you soon with the reply. By the way why GPRS is required here? Please enlighten me about this….

      Reply
  11. Jigar Mistry says

    October 21, 2017 at 7:34 am

    gsm.println(“AT+CMGS=\”+91XXXXXXXXXX\”+91XXXXXXXXXX\r”); // Replace x with mobile number
    above example is possible ?can we add two or more number!!!?

    Reply
  12. Rina Gracia says

    March 21, 2017 at 11:31 am

    Hi! I would like to make this project together with my classmates for our subject Spectra. Do you have a list for the components used in this? Thank you very much!

    Reply
    • Swagatam says

      March 21, 2017 at 12:23 pm

      Hi, I am glad you have selected this project!
      All the parts shown in the diagram are standard parts, you just have to copy them as given in the diagram and show it to the shopkeeper…the shopkeeper will understand and provide them to you appropriately.
      Please click the diagram to get an enlarged view of it….

      Reply
  13. Jade Villanueva says

    December 7, 2016 at 11:30 am

    Thank you

    Reply
  14. Jade Villanueva says

    December 7, 2016 at 11:29 am

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

    Reply
    • GR says

      December 8, 2016 at 6:06 am

      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

      Reply

Need Help? Please Leave a Comment! We value your input—Kindly keep it relevant to the above topic! Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Subscribe to New Circuit Ideas

Categories

  • Arduino Projects (87)
  • Audio and Amplifier Projects (132)
  • Automation Projects (17)
  • Automobile Electronics (101)
  • Battery Charger Circuits (82)
  • Datasheets and Components (103)
  • Electronics Theory (143)
  • Free Energy (37)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (19)
  • Health related Projects (25)
  • Home Electrical Circuits (12)
  • Indicator Circuits (14)
  • Inverter Circuits (87)
  • Lamps and Lights (142)
  • Meters and Testers (69)
  • Mini Projects (46)
  • Motor Controller (64)
  • Oscillator Circuits (27)
  • Pets and Pests (15)
  • Power Supply Circuits (108)
  • Remote Control Circuits (50)
  • Security and Alarm (64)
  • Sensors and Detectors (101)
  • Solar Controller Circuits (59)
  • Temperature Controllers (42)
  • Timer and Delay Relay (49)
  • Transmitter Circuits (29)
  • Voltage Control and Protection (37)
  • Water Controller (36)

Calculators

  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator
  • Filter Capacitor Calculator
  • Buck Converter Calculator
  • Boost Converter Calculator
  • Solar Panel, Inverter, Battery Calculator
  • Wire Current Calculator
  • SMPS Transformer Calculator
  • IC SG3525, SG3524 Calculator
  • Inverter LC Filter Calculator

People Also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |

Recent Comments

  • Swagatam on Best Electronic Circuit Projects
  • TOMMY on Best Electronic Circuit Projects
  • Swagatam on Inverter Circuit with Feedback Control
  • Jerry Adeosun on Inverter Circuit with Feedback Control
  • Swagatam on Contact

Company

  • Privacy Policy
  • Cookie Policy
  • About Me
  • Contact
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Quora
  • Stack Exchange
  • Linkedin
  • © 2025 · Swagatam Innovations