0% found this document useful (0 votes)
192 views33 pages

LDR Plus GSM Based Security System - 2trfhg

The document outlines the development of a GSM-based security system that utilizes Light Dependent Resistors (LDR) for detecting changes in light intensity, which indicates potential security breaches. The system sends immediate SMS alerts to users via GSM technology, providing a cost-effective and efficient solution for real-time monitoring. It reviews existing literature on similar systems, highlights hardware components, and discusses the challenges and limitations of such security solutions.

Uploaded by

prince.globepay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
192 views33 pages

LDR Plus GSM Based Security System - 2trfhg

The document outlines the development of a GSM-based security system that utilizes Light Dependent Resistors (LDR) for detecting changes in light intensity, which indicates potential security breaches. The system sends immediate SMS alerts to users via GSM technology, providing a cost-effective and efficient solution for real-time monitoring. It reviews existing literature on similar systems, highlights hardware components, and discusses the challenges and limitations of such security solutions.

Uploaded by

prince.globepay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

1

2
3
Chapter 1

Introduction
In the modern world, the need for effective security systems has become more critical than ever.
With increasing concerns about burglary, unauthorized entry, and safety, there is a significant
demand for intelligent, automated security solutions that can offer realtime monitoring and
immediate alerts. Traditional security systems, such as CCTV cameras and motion detectors,
have their limitations, particularly when it comes to remote monitoring and real-time
communication.

The GSM-based Security System aims to address these limitations by leveraging GSM (Global
System for Mobile Communications) technology for instant alerts, combined with a Light
Dependent Resistor (LDR) sensor for detecting environmental changes, such as light intensity
shifts. The use of GSM ensures that users receive immediate notifications via SMS, which can
be critical in preventing further damage or intrusion.

LDR, a type of light sensor that changes its resistance based on light intensity, serves as the
primary detection method in this security system. The system is designed to detect significant
changes in light levels, indicating a potential security breach, such as someone entering a room
or tampering with a light source. The integration of an Arduino microcontroller allows for easy
interfacing of the sensor and GSM module, which are programmed to work seamlessly together
to trigger alerts when necessary.

This project aims to provide an affordable, simple, and effective security solution that can be
implemented in homes, small businesses, or areas requiring basic monitoring. By using widely
available and low-cost components like an Arduino, LDR, and GSM module, the system offers
a viable alternative to more expensive and complex security systems.

The main objectives of this project are:


1. To design a security system that detects light intensity changes as a sign of unauthorized
access or movement.
2. To utilize GSM technology for sending immediate alerts to the user's mobile phonewhen a
security event occurs.
3. To build a cost-effective, easily deployable, and low-maintenance security solution suitable
for a range of environments.

4
By the end of this project, the GSM-based security system using LDR will provide a practical
demonstration of how simple, accessible technology can be harnessed to enhance personal
security. The system's functionality, reliability, and potential for future upgrades will be
discussed in the subsequent chapters.

5
Chapter 2

Literature Review

In recent years, there has been significant research in the field of security systems, with a focus
on automation, real-time communication, and the use of sensors for detection. The application
of GSM technology combined with various sensor types for security and monitoring purposes
has been explored extensively. This section reviews existing research papers, articles, and
projects that are related to the integration of light sensing, GSMbased communication, and
security systems.
2.1 GSM-based Security System

Several studies have explored the use of GSM technology in security systems, particularly for
remote monitoring and alerting. GSM is widely chosen due to its simplicity, wide coverage, and
the ability to send messages across a vast network, making it ideal for realtime alerting in security
applications. In the work by M. Singh and A. K. Verma (2014), a GSM-based security system
was developed that used a PIR (Passive Infrared) sensor for motion detection. The system would
send an SMS to the owner when unauthorized movement was detected, providing an immediate
response. GSM-based systems like these are popular for home security, as they allow users to
monitor and receive alerts from anywhere.
A similar approach is presented by M. R. Shafiq et al. (2017), who developed a GSMbased
security system that uses various sensors such as gas sensors, motion detectors, and temperature
sensors. The research demonstrated how GSM could be used to send messages not only for
motion detection but also for environmental monitoring, alerting the user to potential fire, gas
leaks, or temperature changes.

2.2 Light Dependent Resistor (LDR) in Security Applications

The use of Light Dependent Resistors (LDR) for detection in security systems has also been well
documented. LDR sensors are typically used in applications where detecting changes in light
intensity is critical, such as in intrusion detection systems or automated lighting. The LDR's
resistance changes with the amount of light falling on it, making it an excellent sensor for
detecting changes in lighting conditions.
In their research, S. M. Ali and A. A. Khan (2015) developed a light-based security system using
an LDR sensor to detect changes in light intensity. When the light intensity decreased below a

6
set threshold, the system was triggered, indicating the possibility of unauthorized entry or
activity. This type of system can be used for basic security, especially in environments where
constant monitoring of light is necessary, such as in dark rooms, corridors, or restricted areas.
R. Gupta et al. (2018) also highlighted the use of LDR in their study on automated security
systems. Their system, which integrated LDR with a microcontroller, was able to send an alert
when the ambient light level fell below the preset threshold.

2.3 Integration of GSM with Light and Motion Sensors

One of the more recent developments in security systems is the combination of GSM technology
with various sensors, including motion detectors and light sensors like LDR. This hybrid
approach allows for more robust security systems that can respond to multiple types of threats
and changes in the environment.

In a paper by S. S. R. Anjaneyulu and B. V. S. S. Suresh (2016), a GSM-based alarm system


was developed that combined both motion and light detection. The system used an LDR to
detect changes in light intensity and a PIR sensor for motion detection. Upon detecting either a
light change or motion, the system would immediately send an SMS alert to the user, ensuring
rapid response and heightened security.

P. K. Singh et al. (2019) presented an integrated approach using a combination of GSM and
various environmental sensors, including LDRs, to monitor areas for unauthorized access. Their
system was designed to monitor light intensity changes in different parts of a building, and when
a significant shift was detected, an SMS alert was sent to the owner. This research demonstrated
how integrating multiple sensors into one GSM-based system can enhance security and provide
more comprehensive monitoring.

2.4 Challenges and Limitations

Despite the promising results, GSM-based security systems with light sensors and other
technologies have several challenges. One of the key limitations is the false positive rate, which
occurs when the system triggers an alarm due to minor, non-threatening changes, such as natural

7
light variations caused by clouds passing over the sun. To address this issue, many systems use
a threshold value that needs to be crossed before triggering an alert. However, calibrating the
threshold value correctly to minimize both false positives and negatives remains a challenge in
the design of LDR-based security systems.

In terms of GSM communication, one of the constraints is network reliability, especially in


remote or rural areas where mobile network coverage may be inconsistent. Research such as A.
P. Gupta et al. (2017) explores potential improvements in GSM communication reliability and
integration with other wireless technologies, such as Wi-Fi or Zigbee, for enhanced
performance.

2.5 Conclusion

The reviewed literature highlights the effectiveness of GSM-based security systems, especially
those that integrate light sensors like LDR. These systems provide a practical and cost-effective
solution for real-time monitoring and alerting. By detecting changes in light intensity, such
systems can signal unauthorized entry or disturbances, making them suitable for home and
business security applications. The use of GSM ensures immediate SMS alerts, which enhances
the system's ability to respond quickly.
Many studies have shown that combining light sensors with GSM modules results in reliable and
accessible security systems. The integration of other sensors, like motion detectors, further
improves the system’s capability to detect various threats. However, challenges such as false
alarms due to light fluctuations and network reliability issues in remote areas still remain. These
limitations suggest that ongoing improvements are needed to optimize system accuracy and
communication reliability.
In conclusion, GSM-based security systems with LDR and other sensors provide a simple yet
effective approach to security. They offer an affordable solution, and future research may focus
on reducing false alarms, improving sensor accuracy, and ensuring better GSM communication,
especially in areas with weak signal coverage.

8
Chapter 3

Hardware used:

The GSM-based security system relies on several hardware components that work together to
detect environmental changes and send alerts. These components include sensors, a
microcontroller, and communication modules, all of which enable the system to operate
efficiently. Below is a description of the primary hardware used in this project.

Components used in this mini project:-

1. Light Detecting Resistor(LDR)

2. GSM SIM800L Module

3. ArduinoUno

4. Buzzer

5. Power Supply

6. Connecting Wires

7. Sim Card

LDR (Light Detecting Resistor)

The Light Dependent Resistor (LDR) is an essential component in the GSM-based security system,
playing a pivotal role in detecting light intensity changes. An LDR is a type of resistor whose
resistance decreases as the amount of light falling on it increases. Conversely, as the light intensity
decreases, the resistance increases. This property allows the LDR to act as a sensor for detecting
variations in light conditions, which is crucial in identifying potential security breaches, such as
someone entering a room or moving objects that disturb the lighting.
In the context of this project, the LDR is used to monitor ambient light levels in a given area. When
the light intensity drops below a predefined threshold, which could be indicative of an intrusion or

9
sudden darkness (such as a door opening), the LDR's resistance increases. This change is detected
by the microcontroller (Arduino), which processes the data and triggers an alert. The system is
designed to notify the user via an SMS message, sent through the GSM module.
The LDR’s simplicity and low cost make it an ideal choice for this security application.
Additionally, LDRs are widely available and can be easily interfaced with microcontrollers like the
Arduino. The sensor's ability to detect light changes provides an effective and inexpensive method
for real-time environmental monitoring.

Specification:Light sensitivity: High sensitivity to changes in light intensity


Resistance range: Varies from a few hundred ohms in bright light to several megaohms in
darkness
Application: Used for light-based detection and intrusion detection in security systems
Cost: Low-cost and easy to integrate into basic security projects

GSM Module

The GSM module is a vital component of the GSM-based security system, as it enables the system
to send and receive SMS messages over a cellular network. The GSM module connects to the
microcontroller (Arduino) and uses a SIM card to access mobile networks, providing the
capability for real-time communication with the user. When the system detects an event, such as
a change in light intensity from the LDR, the GSM module sends an SMS alert to the user’s mobile
phone, informing them of the detected change.

10
The two most commonly used GSM modules in such projects are the SIM900 and SIM800
modules. Both are capable of sending SMS, making voice calls, and connecting to the internet
using GPRS (General Packet Radio Service). For this project, the SIM900 module is typically
used, as it is widely supported and offers a reliable, low-cost solution for SMSbased
communication.

Working Principle

The GSM module operates on the GSM network, which requires a SIM card to establish
communication with the mobile network. It communicates with the Arduino via a UART
(Universal Asynchronous Receiver Transmitter) interface. The Arduino sends AT commands (a
set of instructions used to control the GSM module) to the GSM module to trigger actions, such
as sending SMS alerts. The GSM module uses its onboard SIM card to send these messages to the
predefined phone number stored in the Arduino’s program.

Features:

• SMS Functionality: Sends and receives text messages (SMS) to and from a mobile phone.This is
the primary function in the security system, alerting the user whenever a security breach or event
is detected.

• Network Compatibility: The module supports GSM frequencies (typically 900/1800 MHz),making
it suitable for global use. A SIM card with a compatible network plan is required for the module to
function correctly.

11
• Low Power Consumption: The SIM900 module operates at a low voltage, typically 3.4V to
4.5V, which is well within the range of common microcontroller operating voltages.

• Communication Interface: The module connects with the Arduino using a serial communication
interface (TX, RX pins), making it easy to interface with the microcontroller.

Applications:
• SMS Alerts: The GSM module sends alerts to the user’s phone when the LDR detectssignificant
changes in light, signaling a potential security issue.

• Remote Communication: The GSM module allows for communication over long distanceswithout
needing a Wi-Fi or internet connection. It is particularly useful in areas with limited or no internet
access.

• Voice Calls (Optional): Although not essential for this project, the GSM module can also beused
to make voice calls, if additional features such as automated voice notifications are needed in the
future.

Specificatios:

• Operating Voltage: 3.4V to 4.5V

• Interface: UART (TX, RX) for communication with Arduino

• Frequency Band: 900/1800 MHz GSM bands

• Power Consumption: Typically 30–60 mA in idle mode, and up to 2A during transmission

• SMS Storage: Can store multiple incoming SMS messages for later retrieval

• SIM Card Slot: Standard SIM card slot for mobile network access

The GSM module is the communication backbone of the security system, enabling it to send realtime
alerts and provide remote monitoring capabilities. By incorporating this module, the project ensures
that users are promptly notified of security threats, regardless of their location.

Microcontroller Arduino Uno

12
The microcontroller is the brain of the GSM-based security system, coordinating the operation of the
various sensors and communication modules. In this project, the Arduino Uno is used as the central
processing unit. It controls the entire system by receiving input from the Light Dependent Resistor
(LDR), processing that input, and sending commands to the GSM module to send an SMS alert to
the user.

The Arduino Uno is an open-source, easy-to-use microcontroller that is widely popular in DIY
electronics projects. It is based on the ATmega328P microchip, which provides sufficient processing
power to handle basic tasks like reading sensor data and communicating with other modules.

Key Features and Functionality:

• Digital and Analog I/O Pins : The Arduino Uno provides 14 digital I/O pins (6 of which can be
used as Pulse Width Modulation, or PWM, outputs) and 6 analog input pins. These I/O pins allow
the microcontroller to interface with various sensors, modules, and external devices. For instance,

13
the LDR is connected to one of the analog input pins to measure light intensity, while the GSM
module connects through the digital I/O pins for communication.

• Processing Power: The Arduino Uno operates at a clock speed of 16 MHz, which is sufficient for
handling the logic involved in reading inputs from sensors, making decisions based on predefined
thresholds, and sending outputs to the GSM module. The ATmega328P microcontroller used in the
Arduino Uno has 32 KB of flash memory for storing the program and 2 KB of SRAM for runtime
variables.

• Power Supply : The Arduino Uno can be powered through a USB cable connected to a computer,
or via an external power supply. It operates at 5V, and it has an onboard voltage regulator that can
handle input voltages ranging from 7V to 12V. This flexibility in power supply makes it easy to
power the system either through a stable USB connection or a battery pack.

• Serial Communication : The Arduino Uno communicates with the GSM module using a serial
connection via the TX (Transmit) and RX (Receive) pins. The microcontroller sends AT commands
(a set of instructions used to control the GSM module) to the GSM module to send SMS alerts.
This serial communication also allows the system to receive data from the GSM module, such as
incoming messages, though this feature is not required for the basic SMS alert functionality in this
project.

• Programming and Customization : The Arduino Uno is programmed using the Arduino
Integrated Development Environment (IDE), which is user-friendly and allows for rapid
development. The Arduino programming language is based on C/C++, and it offers various
libraries for interfacing with sensors, modules, and peripherals. This ease of programming makes
the Arduino Uno an ideal choice for projects like this, where custom functionality can be quickly
implemented and modified.

• Expandable :The Arduino Uno is highly flexible and can be easily expanded with additional
shields and modules. If future expansions or upgrades to the security system are needed, such as
adding more sensors or features (e.g., a camera), the Arduino Uno has the necessary I/O capacity
and support for additional components.

14
Spepecifications :

• Microcontroller: ATmega328P

• Operating Voltage: 5V
• Digital I/O Pins: 14 (6 PWM outputs)
• Analog Input Pins: 6
• Clock Speed: 16 MHz
• Flash Memory: 32 KB
• SRAM: 2 KB
• EEPROM: 1 KB
• Power Supply: 7V to 12V (through the DC jack or VIN pin), or 5V (via USB)
• Communication: UART (TX/RX), I2C, SPI

Role of the Project:

In this project, the Arduino Uno acts as the central controller that interprets input from the LDR and
processes the data based on predefined conditions. When the LDR detects a drop in light intensity,
the Arduino Uno compares this value to a set threshold. If the threshold is crossed, it sends an AT
command to the GSM module to initiate the SMS alert. Additionally, the Arduino Uno manages any
optional devices, such as a relay or buzzer, that may be added to the system for further response
actions.

Overall, the Arduino Uno is a powerful yet simple microcontroller that provides the necessary control
and processing power to implement this GSM-based security system efficiently. Its widespread
popularity, ease of programming, and expandability make it an excellent choice for this type of
project.

3.4 Power Supply

The power supply is one of the most important aspects of any electronic system, ensuring that all
components receive the required voltage and current for proper operation. In the case of the LDR +
GSM-based security system, a reliable power supply is essential for ensuring the smooth functioning

15
of sensors, the GSM module, the microcontroller, and any additional peripherals like alarms or lights.
Here is a detailed explanation of the power supply considerations for this project:

Power Requirements of Components

Each component in the system has specific voltage and current requirements that must be met for
optimal performance:

• LDR (Light Dependent Resistors)

• Voltage Requirement: The LDR itself does not require direct power but is part of avoltage divider
circuit that provides a varying voltage depending on the light intensity.

• Current Consumption: The LDR draws negligible current, typically in the milliamps(mA) range.
The main power consumption comes from the microcontroller that reads the LDR’s output.

• Microcontroller (e.g. Arduino Uno)

• Voltage Requirement: The Arduino operates on 5V. It can be powered either via theUSB or an
external power supply (e.g., a 9V battery or adapter).

• Current Consumption: The typical current draw of the Arduino is around 50mA to200mA
depending on the number of peripherals and sensors connected.

• GSM Module (e.g. SIM800L/SIM900)

• Voltage Requirement: The GSM module typically operates at 3.7V to 5V (dependingon the
module). It’s important to note that the GSM module has a significant peak current requirement
when sending data or making calls.

• Current Consumption: The GSM module can consume up to 2A during transmission or when
making calls, though its idle consumption is much lower (around 50mA to 100mA).

Types of Power Supply

16
The power supply for this system can be divided into two main categories: direct power (ACto-DC
adapters) and portable power (batteries). Here's a breakdown of different power supply options:

1. USB Power Supply

• Usage: This is a convenient and simple power solution when prototyping, as it provides 5Vto power
the Arduino.

• Advantages:

• Easy to connect, often used in development or testing phases.

• The Arduino can be directly powered through the USB cable from a computer or a USB.

• Limitations:

• Not suitable for standalone use in remote areas or locations without a USB power source.

2. Battery Power Supply (Portable)

• Usage: For standalone systems that require portability (e.g., for remote monitoring), a battery can
be used. This includes options like 9V batteries, Li-ion, or Li-Po batteries.

• Advantages:

• Provides portability, making the system independent of external power sources.

• Li-ion/Li-Po batteries are rechargeable and provide higher capacity, making them a
moresustainable option for longer operation.

• Limitations

17
Battery life can be short, especially due to the high current draw of the GSM module.

Fig 1.5

3. AC-to-DC Adapter (For FixedInstallations)

• Usage: For systems that are installed in a fixed location (e.g., at home or office), an AC-to-DC
adapter can convert AC mains to 5V DC or 9V DC (depending on the system requirements).

• Advantages:

• Provides continuous, reliable power.

• No need to replace or recharge batteries.

• Limitations:

• Fixed installation means the system will need to be placed near an electrical

4. Regulated Power Supply

• Usage: The power supply should ideally be regulated to ensure that a consistent voltage isdelivered
to all components, especially the GSM module, which is sensitive to voltage

Voltage Regulation Options:

18
Linear Voltage Regulator (e.g., 7805): Converts higher voltages (e.g., 9V or 12V) to a stable5V
output to power the Arduino.

• Switching Regulator (e.g., Buck Converter): More efficient than linear regulators, as theyminimize
heat loss and are better for higher-current systems (especially with the GSM module).

• Advantages:

• Ensures stable voltage for sensitive components like the GSM module.

• Efficient regulation of power and minimized energy loss.

• Limitations:

• Requires additional components (e.g., capacitors, diodes) for proper functionality.

Power Supply Design

To ensure that all components of the system receive the correct power, the power supply design
needs to accommodate the following:

1. Power for the Arduino and Sensors (5V)

• The Arduino can be powered directly from the 5V supply (from an adapter or battery),
orthrough the Vin pin (if using a 9V adapter).

• An important consideration is the current draw from the sensors and any peripherals
connected to the Arduino. If the total current exceeds the Arduino’s power supply capability, an
external power source may be necessary.

2. Power for the GSM Module (3.7 V to 5V)

• The GSM module requires a higher current supply, especially during transmission. A stable5V or
4.2V power source is necessary to ensure that the module operates correctly without voltage drops.

19
Current Surge: The GSM module draws up to 2A when transmitting data or making calls,so
it is important to use a regulated 5V power supply with the ability to provide higher currents during
GSM operation.

3. Battery Management (if using batteries)

• If using Li-ion or Li-Po batteries, a battery management system (BMS) is essential to monitor the
battery’s charge and prevent overcharging, over-discharge, or overheating.

• The TP4056 module is commonly used for Li-ion battery charging and provides
overchargeprotection and charging status indicators.

Calculating Power Requirements

For the system to operate effectively, it is important to estimate the total current consumption. Here
is an approximate breakdown of the current usage:

• Arduino Uno: 50mA - 200mA (depending on connected components)

• GSM Module (SIM800): 50mA (idle) to 2A (active transmission)

• Relay Module: 5mA - 20mA (when activated)

• LDR Sensor: Negligible current consumption (few mA)

• Buzzer/LED: 10mA - 50mA (depending on configuration)

Estimated Total Current Consumption: During GSM transmission, the total current could peak at
2.2A or more (if using the GSM module at full load). To ensure reliable operation, a power supply
rated for at least 3A would be ideal, considering any additional components like a relay or sensors.

Power Supply Protection

To ensure the safety and longevity of the components, certain protection mechanisms should be
implemented:

20
Capacitors: Use decoupling capacitors near the power input to smooth out any voltagefluctuations,
especially for the GSM module.

• Diodes: Diodes can prevent reverse polarity or voltage spikes that might damage
sensitivecomponents.

• Fuses: A fuse can be added to the power supply to protect the system from overcurrentsituations.

Conclusion

A reliable and efficient power supply is crucial for the success of the LDR + GSM-based security
system. The power supply must meet the requirements of the Arduino, GSM module, and other
components. Whether using a USB adapter, battery, or AC-to-DC adapter, it’s essential to ensure
proper voltage regulation and to account for the current surges required by the GSM module. By
choosing the correct power supply and managing the power requirements of all components, the
system will operate effectively, providing reliable and uninterrupted service for security monitoring.

21
Chapter 4

Software Used

In the LDR + GSM-Based Security System, software is crucial for the operation and control of the
entire system. The software is written and deployed to the microcontroller (e.g., Arduino) to monitor
the LDR sensor, process the data, and control the GSM module to send alerts when an intrusion is
detected. Below is a detailed description of the software used in the mini project:

1 Arduino IDE (Integrated Development Environment):

Purpose

The software for this project is developed using the Arduino IDE. The Arduino IDE is a free,
opensource platform used to write, compile, and upload code to Arduino boards. It supports
programming languages such as C and C++ with an easy-to-use interface, making it ideal for
beginners and rapid prototyping. features of Arduino IDE:

• Code Editor: Provides syntax highlighting and auto-completion for writing Arduino programs.

• Compiler: Converts the written code into machine code that the microcontroller can understand.

• Uploader: Allows the compiled code to be uploaded to the microcontroller via the USBconnection.

• Serial Monitor: Used to monitor and debug outputs from the Arduino

2. Programming Language: C/C++

The code written for the Arduino is based on C/C++ programming languages. The Arduino
programming environment uses its own simple structure, but it is based on standard C/C++ syntax.
This makes the code easy to understand and modify for various needs.

3. Libraries Used:

22
Several libraries are used in the software to simplify the programming of different components in
the system. Some of the key libraries include:

GSM Library (if using a GSM shield or module)

• This library enables communication with GSM modules (e.g., SIM800/SIM900). It handlestasks
like sending and receiving SMS, making calls, and connecting to the GSM network.

Function Provided

• GSM.begin(): Initializes the GSM module and connects it to the mobile network.

• GSM.sendSMS(): Sends an SMS to a specified phone number.

• GSM.call(): Makes a call to a phone number.

• Delay library:
This is a standard library that provides the delay() function, which pauses the program for a specified
amount of time (in milliseconds). It is useful for adding time delays between events, such as sending
an SMS or waiting for the GSM module to respond.

Working of the Software:


The software for the LDR + GSM-Based Security System is structured to handle the following tasks:

• Initialize the system:

• The GSM module is initialized, and communication is established using the GSM.begin()function.

• The system is then ready to read data from the LDR sensor and process it.

• Read the LDR Sensor

• The LDR sensor is part of a voltage divider circuit, and the microcontroller continuouslymonitors
the sensor's output (usually through an analog pin).

23
• The Arduino reads the sensor value using the analogRead() function, which returns a valuebetween
0 and 1023, representing the voltage level at the sensor pin.

• Check for the Light Change (Intrusion detected):

A predefined threshold value is set for light intensity. If the light detected by the LDR islower or
higher than this threshold, it indicates an intrusion or an anomaly in the environment (e.g., a door
opening or an intruder entering).

• Trigger GSM module

• When the system detects a change in light (i.e., intrusion), it triggers the GSM module tosend an
alert.

• The code uses the GSM.sendSMS() function to send an SMS message to a predefined phone
number. The message might say something like, "Intruder Detected! Check the system."

• The system can also make a call to the predefined phone number using GSM.call() to alertthe user
of a potential security breach.

Optional control Relay (For External device):

• If a relay is used to control an external alarm or device, the software will activate the relayusing a
digital output pin when an intrusion is detected. This is done using the digitalWrite() function to
switch the relay on or off.

• Add Delays and Timeouts

• After sending the SMS or making a call, the system waits for a while (using delay()) toprevent
multiple alerts or calls in a short period of time.

• The system then resumes monitoring the LDR sensor for further changes in light.

• Serial Communication (for Debugging):

24
• The serial monitor is used to monitor the status of the system during the developmentphase. It
displays messages such as "System Initialized," "Intrusion Detected," or the current light intensity
value being read by the LDR.

Flow of the software:


• System Initialization:

Initialize the GSM module.

• Set up serial communication for debugging.

• Define the threshold for detecting light changes.

• Main Loop:

• Continuously read the light intensity from the LDR sensor.

• If the light intensity is below or above the set threshold (indicating an intrusion), trigger theGSM
module to send an SMS or make a call.

• Optionally activate an external alarm via the relay.

• Wait for a specified period to avoid sending multiple alerts.

• Repeat the Process:

• The system continuously monitors the environment for any changes in light, repeating theprocess
as long as it is powered on.

Summary :

In this LDR + GSM-Based Security System, the Arduino IDE is used for programming the
microcontroller, and the software is written in C/C++. The core functionality involves reading
light levels from the LDR, detecting changes in light intensity (indicating an intrusion), and using
the GSM module to send an SMS or make a call to alert the user. Libraries like GSM and
SoftwareSerial simplify communication with the GSM module, and functions like analogRead(),

25
sendSMS(), and delay() help implement the system's logic. The software continuously monitors
the sensor, sending alerts when an anomaly is detected and optionally activating a relay to trigger
external alarms.

Code :

/ Pin Definitions LA LORPin 20:


int buzzerPin 9: int threshold - 500: void setup() [

pinMode (buzzerPin, OUTPUT);

Serial.begin(9600):

LDR connected to analog pin 20

// Buzzer connected to digital pin 9

// Set a threshold for light intensity (you can adjust this value)

// Set buzzer pin as OUTPUT

// Start the serial monitor communication (for debugging) void

loop() L int lightLevel analogiead (LDRPin):

// Read the value from the LDR

Serial.println(lightlevel):

// Print the LDR value for debugging

// If the light level is below the threshold

(indicating a possible intrusion) if

(lightlevel < threshold) {

26
digitalWrite(buzzerPin, LOW); //

Activate the buzzer delay (3000):

// Wait for 5 seconds to avoid repeated alerts

digitalWrite(buzzerPin, HIGH):

// Turn off the buzzer

} delay(1000); // Wait 1 second before

checking

again }

Fig 1.6

27
Chapter 5

Methodology:

The methodology for the **LDR + GSM-Based Security System** can be broken down into key
steps:

1. **Requirement Analysis**: Identify system needs like light detection using the **LDRsensor**,
alerting via **GSM module**, and optional **relay** control for alarms.

2. **System Design**:
- **LDR Sensor**: Detects light changes indicating possible intrusion.
- **Arduino Microcontroller**: Processes the LDR data and communicates. - Relay Module:
Triggers an external alarm or device when activated.

3. Circuit Design: Design the necessary circuits using an LDR sensor Arduino, GSMmodule,
and relay. Connect these components appropriately for functionality.

4. PCB Design: Create a PCB layout for compact and efficient system assembly, ensuringproper
routing and minimal interference.

5. Software Development: Program the **Arduino** to monitor the LDR sensor, sendSMS
alerts using the **GSM module**, and trigger the **relay** when necessary.

6. Testing and Integration: Integrate all components, conduct tests for functionality (sensor,
GSM, relay), and ensure reliable operation
7. Outcome: The system successfully detects light changes (intrusions), sends SMS alerts,and
can trigger external alarms or devices via relay, providing a functional security solution.

28
29
Chapter 6

Mini Project : Glimpse & Result

Final Circuit

Fig 1.8

Results Discussion

The LDR + GSM-Based Security System functions effectively in detecting light changes and
alerting users via SMS.

30
• Functionality :

• The LDR sensor accurately detects light changes, such as when a door opens or an intruder enters.

• The relay module successfully triggers external devices like alarms when needed.

• Performance :

• Response Time: The system has a quick response time, activating the GSM module andrelay
almost instantly after detecting light changes.

• Reliability: The GSM module consistently sends SMS alerts without issues.

• Power Consumption: The system consumes moderate power, with potential for optimization,
especially for battery-operated setups.

• Testing Results:

• The relay reliably activates external devices like alarms when triggered.

Improvement Areas

• Enhancing sensor accuracy by adding additional sensors like PIR.

• Improving communication range with Wi-Fi or LoRa.

• Adding features like cameras for more comprehensive security.

Overall, the system provides an effective, simple, and reliable solution for basic security, with room
for further enhancements.

Chapter 7

31
Conclusion :

The LDR + GSM-Based Security System successfully achieves its goal of detecting light changes
and alerting the user in real-time. Using an LDR sensor for light detection, an Arduino
microcontroller for processing, and a GSM module for sending SMS alerts, the system efficiently
notifies the user of potential intrusions. The integration of a relay allows for the control of external
devices such as alarms or lights, enhancing the security system’s capabilities. This project
demonstrates the effectiveness of combining simple components to create a reliable and
costeffective security solution for homes or offices.

Future Scope:

The LDR + GSM-Based Security System has significant potential for enhancement and expansion:

• Multiple Sensor Integration: Adding additional sensors (e.g., motion detectors, PIR sensors)
can improve the system’s ability to detect a broader range of intrusions.

• Wireless Communication: Instead of relying on GSM for SMS alerts, integrating Wi-Fi
orBluetooth can allow the system to send notifications via mobile apps or through cloudbased
systems.

• Camera Integration: Adding a camera module (such as an IP camera or camera sensor)could


allow real-time video streaming, providing visual evidence along with the SMS alert.

• Data Logging and Analysis: The system could store data, such as timestamps and
sensorreadings, for later analysis or to monitor trends (e.g., frequent intrusion times).

• Mobile Application: Developing a dedicated mobile app could allow users to control
thesystem, receive push notifications, and view sensor data remotely.

• Power Efficiency: Optimizing the system to run on low power, potentially integratingsolar
panels or battery backups, would make the system more sustainable in remote locations.

By integrating these features, the system can be transformed into a more robust, scalable, and
sophisticated security solution.

32
References :
• Arduino Official Documentation - Arduino Project
Hub. Available at: https://www.arduino.cc/

• LDR Sensor - Understanding Light Dependent Resistors.


Available at:
https://www.electronics-tutorials.ws/

• Relay Module - Relay Module Tutorial for Arduino.


Available at: https://www.robotshop.com/

• Electronics for You - Electronics tutorials and project resources. Available at:
https://www.electronicsforu.com/

• All About Circuits - Electronics tutorials, circuit designs, and components. Available at:
https://www.allaboutcircuits.com/

• Circuit Digest - Electronics projects and tutorials. Available at:


https://www.circuitdigest.com/

• Hackaday - Electronics projects, hacking, and DIY tutorials. Available at:


https://hackaday.com/

• Electronics Hub - Electronics tutorials, circuits, and projects. Available at:


https://www.electronicshub.org/

33

You might also like