Arduino Projects

Home Security System Using Ultrasonic Sensor With GSM

GSM Based Home Security System Using Ultrasonic Sensors


In this article, we will make a project based on the security system and we will guide you in building a security alarm system using an Arduino Uno. This project is used in various fields like home security, office security and another system.DIY project generated an alarm system that can detect any movement and send notifications to a particular mobile number via SMS.

Components Needed




Link to Buy


Arduino Uno



Ultrasonic Sensor



GSM sim800l Module






LM2596 Step Converter






Zero PCB



9v power supply


Arduino Uno

The Arduino Uno is a big-size microcontroller board based on the ATmega328P IC. It is part of the Arduino family of development boards with the popular Arduino environment. However, the uno is big in size and is a total of 14 digital pins available and a total of 6 analog pins available and also supports UART, SPI and I2C  Communication.


ATmega328P microcontroller

  • The clock speed of 16 MHz.
  • The flash is the memory of 32KB for storing the program code
  • The SRAM for 2KB of data storage
  • The EEPROM of 1KB for non-volatile storage.
  • The digital and analog input/output pins can be used to interface with sensors, actuators, and other electronic components. It totals 14 digital I/O pins & 8 analog input pins.

The supports

  • 9v Dc Power Supply.
  • UART (Universal Asynchronous Receiver&Transmitter).
  • SPI (Serial Peripheral Interface).
  • I2C (Inter-Integrated Circuit).
  • These all are interfaces with other devices such as sensors, displays, and wireless modules.

Ultrasonic Sensor

  • The ultrasonic sensor is a device that uses sound waves of high frequency to measure distances.
  • the work of transmitter and a receiver that work together to emit and receive ultrasonic waves.


  • Transmitter generated the high-frequency sound waves, typically in the range of 40 kHz to 200 kHz.
  • Receiver received the sound waves and travels through the air until they encounter an object. When the sound waves hit the object, they get reflected back towards the sensor. a receiver detects the reflected sound waves and converts them into electrical signals.
  • Formula to calculate the Distance = Speed of Sound × Time / 2.

GSM sim800l Module

The SIM800L GSM module is a small device that communicates over the Global System for cellular network Communications. The module connects to a Mobile cellular network and transmits data, make voice calls, and sends text messages.


  • The module has a backside SIM card slot available, which can accept a SIM card 2G or 3G SIM card.
  • The works in a frequency range of 850MHz to 1900MHz. It also works with AT commands.
  • The GSM Module requires a power supply of around 3.7 to 4.2 volts.

Circuit Diagram

  • Connect the VCC and GND pins of the ultrasonic sensor to the 5V and GND pins of the Arduino Nano, respectively.
  • Connect the Trig and Echo pins of the ultrasonic sensor to any two digital pins of the Arduino Nano (6 and 7).
  • Connect the positive terminal of the buzzer to a digital pin of the Arduino Nano (13) and the negative terminal to GND.
  • Connect the TX and RX pins of the SIM800L module to the 2 and 3 pins of the Arduino Nano, respectively. Use voltage dividers or level shifters to convert the 5V Arduino logic to the 3.3V required by the SIM800L module.

circuit diagram 17

Source Code

  • Program the Arduino Nano using the Arduino IDE or any compatible programming environment.
  • Initialize the necessary libraries and define pins for the ultrasonic sensor, buzzer, and GSM module.
  • Implement the required functions for ultrasonic distance measurement, alarm triggering, and CALL sending.
  • Set up the GSM module to establish communication with the mobile network and enable CALL functionality.


Project Demo

  • The ultrasonic sensor detects movement and measures the distance to the object.

Screenshot 2023 06 15 at 12.35.48 AM

  • If the distance falls below a specified threshold, indicating unauthorized movement, the system triggers the buzzer to produce an audible alarm.
  • Simultaneously, the GSM SIM800L module sends a CALL notification to the user’s mobile device, providing details of the security breach.

Screenshot 2023 06 15 at 12.36.07 AM



The Security Alarm System project demonstrates the successful integration of an ultrasonic sensor, GSM SIM800L module, buzzer, and Arduino Nano to develop a reliable security alarm system. This project offers an affordable and customizable solution for various security applications. By combining hardware components and software programming, the system detects unauthorized movement, triggers an audible alarm, and sends SMS notifications to the user, ensuring enhanced security and peace of mind.

Arduino Based Projects


Hi, Prateek Here I’m interested in Electronics That's why I Make Soo Many Projects, I’m currently Pursuing M Tech.. if you Relay Like To My Blog Plz Comment Below...Thanks To All Electronics Lover...❤️

Leave a Reply

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

Back to top button

Adblock Detected

Please consider supporting us by disabling your ad blocker