Home - Security Report
Home - Security Report
Home - Security Report
The advancement of technology has paved the way for innovative approaches to home
security systems. This abstract delves into the development of a Laser-Based Home
Security System, incorporating various sensors and modules to enhance its functionality.
The system is designed to provide comprehensive security by integrating MQ2 gas
sensor, LDR sensor, GSM900A module, Arduino Nano microcontroller, 12V 2A adapter,
red and green LEDs, a 5V buzzer, and a 16x2 LCD display.
Objective:
The primary objective of this chapter is to present a detailed overview of the laser-
based home security system’s architecture, components, and functionality. The in-
corporation of multiple sensors aims to extend the system beyond traditional security
measures, adding capabilities such as gas detection, light sensitivity, and remote moni-
toring via GSM technology.
The proposed home security system comprises a laser emitter and receiver to estab-
lish a laser grid, forming the system’s core. The MQ2 gas sensor detects the presence of
hazardous gases, while the LDR sensor monitors ambient light conditions. The Arduino
Nano serves as the central processing unit, orchestrating the system’s response based
on inputs from the sensors. The GSM900A module enables remote communication,
allowing users to receive alerts and monitor the security system remotely.
Keywords: LER Sensor, 5V Buzzer, 12V 2A adapter, Sensor, Arduino Nano Mi-
crocontroller, GSM900A Module
Acknowledgement
i
Contents
1 Introduction 1
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Project Scope and Limitation . . . . . . . . . . . . . . . . . . . . . . . 3
1.4.1 Project Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4.2 Structure of the Thesis: . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Significance of the Study: . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Literature Survey 4
2.0.1 2.2 Laser-Based Home Security Systems: . . . . . . . . . . . . . 4
2.0.2 2.3 Sensor Integration in Home Security Systems: . . . . . . . . 4
2.0.3 2.4 IoT Applications in Home Security: . . . . . . . . . . . . . . 5
2.0.4 2.5 Challenges and Limitations: . . . . . . . . . . . . . . . . . . 5
2.0.5 2.6 Summary and Research Gap: . . . . . . . . . . . . . . . . . 5
3 Methodology : 6
3.1 Circuit Digram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.1.1 Hardware Requirement : . . . . . . . . . . . . . . . . . . . . . . 7
3.1.2 Where To Use MQ2 Gas Sensor . . . . . . . . . . . . . . . . . . 8
3.1.3 How To Use MQ2 Sensor To Detect Gas . . . . . . . . . . . . . 8
3.1.4 Arduino Nano Microcontroller . . . . . . . . . . . . . . . . . . . 8
3.1.5 What Does it Do? . . . . . . . . . . . . . . . . . . . . . . . . . 9
ii
3.1.6 What’s on the board? . . . . . . . . . . . . . . . . . . . . . . . 9
3.1.7 Power (USB / Barrel Jack) . . . . . . . . . . . . . . . . . . . . 10
3.1.8 Pins (5V, 3.3V, GND, Analog, Digital, PWM, AREF) . . . . . 10
3.1.9 Reset Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.10 Power LED Indicator . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.11 TX RX LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.12 Main IC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.13 Voltage Regulator . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1.14 LCD Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1.15 GSM Module : . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.16 GSM Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.17 SIM900A GSM Module Pinout Configuration . . . . . . . . . . 16
3.1.18 SIM900A GSM MODULE Features . . . . . . . . . . . . . . . . 16
3.1.19 Buzzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.1.20 Light Emitting Diode . . . . . . . . . . . . . . . . . . . . . . . . 19
3.1.21 Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.1.22 LDR Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4 SOFTWARE REQUIRMENT 27
4.1 SOFTWARE REQUIRMENT . . . . . . . . . . . . . . . . . . . . . . . 27
4.2 INTRODUCTION TO ARDUINO IDE . . . . . . . . . . . . . . . . . 27
4.3 The Semicolon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.4 THE DOUBLE BACKSLASH FOR SINGLE LINE COMMENTS . . . 29
4.5 THE CURLY BRACES . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.5.1 Function() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.5.2 Void Setup () . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.5.3 Void Loop () . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.5.4 Introduction Arduino Libraries . . . . . . . . . . . . . . . . . . 32
4.5.5 HOW TO INSTALL A LIBRARY . . . . . . . . . . . . . . . . 33
4.5.6 HOW TO CONNECT ARDUINO BOARD . . . . . . . . . . . 34
4.5.7 HOW TO UPLOAD A PROGRAM . . . . . . . . . . . . . . . . 35
iii
5 ADVANTAGES, DISADVANTAGES AND APPLICATIONS 36
5.1 ADVANTAGES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.1.1 DISADVANTAGES . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.1.2 APPLICATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . 37
7 REFERENCES 44
iv
List of Figures
v
List of Tables
vi
Chapter 1
Introduction
1.1 Overview
The increasing concerns regarding home security have spurred the development of so-
phisticated and multifaceted systems designed to safeguard residential spaces. Tradi-
tional security systems, while effective, often lack the versatility required to address
emerging threats and challenges. In response to this need, the integration of laser tech-
nology, coupled with advanced sensors and communication modules, has emerged as
a promising avenue for enhancing home security. This chapter introduces the concept
of a Laser-Based Home Security System, augmented with MQ2 gas sensor, LDR sen-
sor, GSM900A, Arduino Nano, and other key components, to provide a holistic and
adaptive approach to residential security.
1
Home Security System Using IOT
1.2 Motivation
The motivation behind the development of this laser-based home security system stems
from the desire to create a comprehensive solution that goes beyond conventional in-
truder detection. The integration of diverse sensors, such as the MQ2 gas sensor and
LDR sensor, adds layers of functionality to the system, addressing not only physical
intrusion but also potential hazards like gas leaks and adapting to varying light condi-
tions. The inclusion of the GSM900A module facilitates remote monitoring and instant
communication, allowing homeowners to stay connected with their security system from
anywhere in the world.
1.3 Objectives
The primary objectives of this research are: To design and implement a Laser-Based
Home Security System incorporating MQ2 gas sensor, LDR sensor, GSM900A, Arduino
Nano, and other relevant components. To enhance traditional security measures by
integrating gas detection capabilities, sensitivity to ambient light conditions, and remote
monitoring features. To evaluate the system’s effectiveness in providing real-time alerts,
adapting to environmental changes, and offering a comprehensive solution to residential
security challenges.
This study focuses on the development and implementation of a laser-based home se-
curity system, exploring the integration of various sensors and modules for enhanced
functionality. The scope encompasses the design and practical aspects of the system,
including hardware components, software programming, and the evaluation of its per-
formance under different scenarios.
The thesis is organized into several chapters, each addressing specific aspects of the
Laser-Based Home Security System. Chapter 2 provides an in-depth review of re-
lated literature, exploring existing technologies, methodologies, and their limitations.
Chapter 3 details the methodology employed in designing and implementing the sys-
tem, followed by Chapter 4, which presents the system architecture and components.
Chapter 5 discusses the experimental setup and results, evaluating the system’s perfor-
mance. Finally, Chapter 6 concludes the thesis, summarizing key findings, discussing
implications, and suggesting potential avenues for future research.
The literature review explores existing research, technologies, and methodologies re-
lated to laser-based home security systems and integrated sensor networks. This chap-
ter aims to provide a comprehensive understanding of the current state of the field,
identify gaps in existing knowledge, and lay the foundation for the development of an
innovative and adaptive home security solution.
Laser-based security systems have been widely employed for perimeter protection due
to their accuracy and reliability. Previous studies have investigated the use of laser grids
for intruder detection, examining various modulation techniques and signal processing
algorithms to enhance system performance. While these systems excel in detecting
physical intrusion, there is limited research on integrating additional sensors for a more
holistic approach to home security.
Traditional home security systems primarily rely on motion sensors and door/window
contacts. However, recent advancements in sensor technologies have expanded the scope
of possibilities. Studies have explored the integration of gas sensors, such as MQ2,
for detecting harmful gases like methane and propane. Additionally, light-dependent
resistor (LDR) sensors have been utilized to enhance systems with sensitivity to ambient
4
Home Security System Using IOT
light conditions. The literature suggests that combining these sensors can provide a
more comprehensive security solution.
The Internet of Things (IoT) has played a pivotal role in advancing home security sys-
tems. Research has focused on leveraging IoT for remote monitoring, real-time alerts,
and communication between devices. The integration of GSM modules in home security
systems allows for seamless connectivity and enables users to receive instant notifica-
tions on their mobile devices. Existing studies emphasize the importance of robust
communication networks in ensuring the reliability of IoT-based security solutions.
Despite the progress in the field, challenges and limitations persist. Previous research
has highlighted issues such as false alarms in laser-based systems due to environmental
factors like fog or dust. Additionally, the energy efficiency of the integrated sensors and
modules remains a concern. Understanding these challenges is crucial for developing a
system that is resilient in various conditions and minimizes false positives.
The literature review underscores the significance of laser-based home security systems
and the integration of advanced sensors for a comprehensive approach. While existing
studies have made strides in individual components, there is a noticeable research gap
in the development of a unified system that combines laser technology, gas detection,
light sensitivity, and remote monitoring capabilities. This research aims to bridge this
gap by presenting a holistic solution that addresses the limitations identified in the
literature.
6
Home Security System Using IOT
Liquefied Petroleum Gas (LPG) or the sensitive material of MQ-2 gas sensor is SnO2
considered as lower conductivity in the clean air. The conductivity of the sensor shown
in Figure 4 gets higher as long as gas concentration is elevated. The sensitivity of MQ-2
sensor is considered exceptionally higher to propane, LPG, hydrogen, methane, and the
other steams.
Moreover, the cost limitation of the proposed sensor is assigned to be appropriate
for numerous applications. The sensor realizes the flammable gas by an increase in the
temperature when excited by the heating components. As a working principle, when
gas leak is detected the conductivity of the sensor gets higher proportionally with gas
concentration raising.
TThe MQ-2 Gas sensor can detect or measure gasses like LPG, Alcohol, Propane,
Hydrogen, CO, and even methane. The module version of this sensor comes with a
Digital Pin which makes this sensor to operate even without a microcontroller and that
comes in handy when you are only trying to detect one particular gas. When it comes
to measuring the gas in ppm the analog pin has to be used, the analog pin also TTL
driven and works on 5V and hence can be used with most common microcontrollers. So
if you are looking for a sensor to detect or measure gasses like LPG, Alcohol, Propane,
Hydrogen, CO and even methane with or without a microcontroller, then this sensor
might be the right choice for you.
Using an MQ sensor to detect a gas is very easy. You can either use the digital pin or the
analog pin to accomplish this. Simply power the module with 5V and you should notice
the power LED on the module to glow and when no gas it detected the output LED
will remain turned off meaning the digital output pin will be 0V. Remember that these
sensors have to be kept on for pre-heating time (mentioned in features above) before
you can actually work with it. Now, introduce the sensor to the gas you want to detect
and you should see the output LED to go high along with the digital pin, if not use the
potentiometer until the output gets high. Now every time your sensor gets introduced
to this gas at this particular concentration the digital pin will go high (5V) else will
remain low (0V). You can also use the analog pin to achieve the same thing. Read the
analog values (0-5V) using a microcontroller, this value will be directly proportional to
the concentration of the gas to which the sensor detects. You can experiment with this
values and check how the sensor reacts to different concentration of gas and develop
your program accordingly.
button, or a Twitter message - and turn it into an output - activating a motor, turning
on an LED, publishing something online. We can tell your board what to do by sending
a set of instructions to the microcontroller on the board. To do so we use the Arduino
programming language (based on wiring), and the Arduino Software(IDE), based on
Processing.
The Arduino Uno can be powered via the USB connection or with an external
power supply. The power source is selected automatically. External (non-USB) power
can come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can
be connected by plugging a 2.1mm center-positive plug into the board’s power jack.
Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER
connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less
than 7V, however, the 5V pin may supply less than five volts and the board may be
unstable. If using more than 12V, the voltage regulator may overheat and damage the
board. The recommended range is 7 to 12 volts.
The Arduino hardware and software was designed for artists, designers, hobbyists,
hackers, newbie’s, and anyone interested in creating interactive objects or environments.
Arduino can interact with buttons, LEDs, motors, speakers, GPS units, cameras, the
internet, and even your smart-phone or your TV! This flexibility combined with the
fact that the Arduino software is free, the hardware boards are pretty cheap, and both
the software and hardware are easy to learn has led to a large community of users who
have contributed code and released instructions for a huge variety of Arduino-based
projects.
There are many varieties of Arduino boards (explained on the next page) that can be
used for different purposes. Some boards look a bit different from the one below, but
most Arduinos have the majority of these components in common
Every Arduino board needs a way to be connected to a power source. The Arduino
UNO can be powered from a USB cable coming from your computer or a wall power
supply (like this) that is terminated in a barrel jack. In the picture above the USB
connection is labeled (1) and the barrel jack is labelled. The USB connection is also
how you will load code onto your Arduino board.
The pins on your Arduino are the places where you connect wires to construct a circuit
(probably in conjuction with a breadboard and some wire. They usually have black
plastic headers that allow you to just plug a wire right into the board. The Arduino
”
has several different kinds of pins, each of which is labeled on the board and used for
different functions.
GND (3): Short for Ground. There are several GND pins on the Arduino, any of
”
which can be used to ground your circuit.
5V (4) 3.3V (5): As you might guess, the 5V pin supplies 5 volts of power, and
the 3.3V pin supplies 3.3 volts of power. Most of the simple components used with the
Arduino run happily off of 5 or 3.3 volts. Analog
(6): The area of pins under the Analog In label (A0 through A5 on the UNO) are
”
Analog In pins. These pins can read the signal from an analog sensor (like a temperature
sensor) and convert it into a digital value that we can read.
Digital (7): Across from the analog pins are the digital pins (0 through 13 on the
UNO). These pins can be used for both digital input (like telling if a button is pushed)
and digital output (like powering an LED).
PWM (8): You may have noticed the tilde ( ) next to some of the digital pins (3,
5, 6, 9, 10, and 11 on the UNO). These pins act as normal digital pins, but can also
be used for something called Pulse-Width Modulation (PWM). We have a tutorial on
PWM, but for now, think of these pins as being able to simulate analog output (like
fading an LED in and out).
AREF (9): Stands for Analog Reference. Most of the time you can leave this pin
alone. It is sometimes used to set an external reference voltage (between 0 and 5 Volts)
as the upper limit for the analog input pins.
Just like the original Nintendo, the Arduino has a reset button (10). Pushing it will
temporarily connect the reset pin to ground and restart any code that is loaded on the
Arduino. This can be very useful if your code doesnt repeat, but you want to test it
multiple times. Unlike the original Nintendo however, blowing on the Arduino doesnt
usually fix any problems.
Just beneath and to the right of the word “UNO” on your circuit board, theres a
tiny LED next to the word ON (11). This LED should light up whenever you plug
”
your Arduino into a power source. If this light doesnt turn on, theres a good chance
something is wrong. Time to re-check your circuit!
3.1.11 TX RX LEDs
TX is short for transmit, RX is short for receive. These markings appear quite a bit
in electronics to indicate the pins responsible for serial communication. In our case,
there are two places on the Arduino UNO where TX and RX appear – once by digital
pins 0 and 1, and a second time next to the TX and RX indicator LEDs (12). These
LEDs will give us some nice visual indications whenever our Arduino is receiving or
transmitting data (like when were loading a new program onto the board).
3.1.12 Main IC
The black thing with all the metal legs is an IC, or Integrated Circuit (13). Think of
it as the brains of our Arduino. The main IC on the Arduino is slightly different from
board type to board type, but is usually from the A Tmega line of ICs from the ATMEL
company. This can be important, as you may need to know the IC type (along with
your board type) before loading up a new program from the Arduino software. This
information can usually be found in writing on the top side of the IC. If you want to
know more about the difference between various ICs, reading the datasheets is often a
good idea.
The voltage regulator (14) is not actually something you can (or should) interact with
on the Arduino. But it is potentially useful to know that it is there and what its for.
The voltage regulator does exactly what it says – it controls the amount of voltage that
is let into the Arduino board. Think of it as a kind of gatekeeper; it will turn away an
extra voltage that might harm the circuit. Of course, it has its limits, so dont hook up
your Arduino to anything greater than 20 volts.
Without the liquid crystal between the polarizing filters, light passing through the first
filter would be blocked by the second (crossed) polarizer.
Before an electric field is applied, the orientation of the liquid-crystal molecules is
determined by the alignment at the surfaces of electrodes. In a twisted nematic (TN)
device, the surface alignment directions at the two electrodes are perpendicular to each
other, and so the molecules arrange themselves in a helical structure, or twist. This
induces the rotation of the polarization of the incident light, and the device appears
gray.
If the applied voltage is large enough, the liquid crystal molecules in the center of
the layer are almost completely untwisted and the polarization of the incident light is
not rotated as it passes through the liquid crystal layer.
This light will then be mainly polarized perpendicular to the second filter, and thus
be blocked and the pixel will appear black. By controlling the voltage applied across
the liquid crystal layer in each pixel, light can be allowed to pass through in varying
amounts thus constituting different levels of gray.
As most of present-day LCDs used in television sets, monitors and smart phones have
high-resolution matrix arrays of pixels to display arbitrary images using backlighting
with a dark background when no image is displayed, different arrangements are used.
For this purpose, TN LCDs are operated between parallel polarizers, whereas IPS
LCDs feature crossed polarizers. In many applications IPS LCDs have replaced TN
LCDs, in particular in smart phones such as iPhones.
Both the liquid crystal material and the alignment layer material contain ionic com-
pounds. If an electric field of one particular polarity is applied for a long period of time,
this ionic material is attracted to the surfaces and degrades the device performance.
This is avoided either by applying an alternating current or by reversing the polarity
of the electric field as the device is addressed (the response of the liquid crystal layer is
identical, regardless of the polarity of the applied field)
This is a basic 16 character by 2 line display.16×2 LCD module is a very common
type of LCD module that is used in 8051 based embedded projects. It consists of 16
rows and 2 columns of 5×7 or 5×8 LCD dot matrices. The module were are talking
about here is type number JHD162A which is a very popular one . It is available in
a 16 pin package with back light, contrast adjustment function and each dot matrix
has 5×8 dot resolution. The pin numbers, their name and corresponding functions are
shown in the table below.
SIM900A GSM Module is the smallest and cheapest module for GPRS/GSM com-
munication. It is common with Arduino and microcontroller in most of embedded
application. The module offers GPRS/GSM technology for communication with the
uses of a mobile sim.
It uses a 900 and 1800MHz frequency band and allows users to receive/send mobile
calls and SMS. The keypad and display interface allows the developers to make the
customize application with it.
Furthermore, it also has modes, command mode and data mode. In every country
the GPRS/GSM and different protocols/frequencies to operate. Command mode helps
the developers to change the default setting according to their requirements.
SIM900A is a 68 terminal device as shown in pin diagram. We will describe the function
of each pin below.
3.1.19 Buzzer
LEDs are versatile semiconductor with a number of attributes which make them
perfect for most applications. Their features include:
• Long Life: LEDs can last over 100,000 hours (10+ years) if used at rated current
• No annoying flicker as we experience with fluorescent lamps.
• LEDs are impervious to heat, cold, shock and vibration.
• LEDs do not contain breakable glass.
• Solid-State, high shock and vibration resistant
• Extremely fast turn on/off times
• Low power consumption puts less load on the electrical systems increasing battery
life.
• CAUTIONS:
LEDs produce a focused light source and extra care should be used for your eyes ,though
intensity is not very high. While testing the LEDs a resitance
ripple variations small enough to leave the powered device unaffected. Size and weight
of the device was largely determined by the transformer, which in turn was determined
by the power output and mains frequency. Ratings over a few watts made the devices
too large and heavy to be physically supported by a wall outlet.
The output voltage of these adapters varied with load; for equipment requiring
a more stable voltage, linear voltage regulator circuitry was added. Losses in the
transformer and the linear regulator were considerable; efficiency was relatively low,
and significant power dissipated as heat even when not driving a load.
Early in the twenty-first century, switched-mode power supplies (SMPSs) became
almost ubiquitous for this purpose. Mains voltage is rectified to a high direct voltage
driving a switching circuit, which contains a transformer operating at a high frequency
and outputs direct current at the desired voltage. The high-frequency ripple is more
easily filtered out than mains-frequency. The high frequency allows the transformer
to be small, which reduces its losses; and the switching regulator can be much more
efficient than a linear regulator. The result is a much more efficient, smaller, and
lighter device. Safety is ensured, as in the older linear circuit, because a transformer
still provides galvanic isolation.
A linear circuit must be designed for a specific, narrow range of input voltages (e.g.,
220–240 VAC) and must use a transformer appropriate for the frequency (usually 50
or 60 Hz), but a switched-mode supply can work efficiently over a very wide range
of voltages and frequencies; a single 100–240 VAC unit will handle almost any mains
supply in the world.
However, unless very carefully designed and using suitable components, switching
adapters are more likely to fail than the older type, due in part to complex circuitry
and the use of semiconductors.
Unless designed well, these adapters may be easily damaged by overloads, even tran-
sient ones, which can come from lightning, brief mains overvoltage (sometimes caused
by an incandescent light on the same power circuit failing), component degradation,
etc.
A very common mode of failure is due to the use of electrolytic capacitors whose
equivalent series resistance (ESR) increases with age; switching regulators are very
sensitive to high ESR (the older linear circuit also used electrolytic capacitors, but the
effect of degradation is much less dramatic). Well-designed circuits pay attention to
the ESR, ripple current rating, pulse operation, and temperature rating of capacitors.
Many inexpensive switched-mode AC adapters do not implement adequate filtering
and/or shielding for electromagnetic interference that they generate. The nature of
these high speed, high-energy switching designs is such that when these preventative
measures are not implemented, relatively high energy harmonics can be generated,
and radiated, well into the radio portion of the spectrum. The amount of RF energy
typically decreases with frequency; so, for instance, interference in the medium wave
(US AM) broadcast band in the one megahertz region may be strong, while interference
with the FM broadcast band around 100 megahertz may be considerably less. Distance
is a factor; the closer the interference is to a radio receiver, the more intense it will be.
Even WiFi reception in the gigahertz range can be degraded if the receiving antennae
are very close to a radiating AC adapter.
A determination of if interference is coming from a specific AC adaptor can be made
simply by unplugging the suspect adapter while observing the amount of interference
received in the problem radio band. In a modern household or business environment,
there may be multiple AC adapters in use; in such a case, unplug them all, then plug
them back in one by one until the culprit or culprits is found.
Specifications
• Operating Voltage: 3.3V to 5V DC
• Operating Current: 15ma
• Output Digital - 0V to 5V, Adjustable trigger level from preset
• Output Analog - 0V to 5V based on light falling on the LDR
• LEDs indicating output and power
• PCB Size: 3.2cm x 1.4cm
• LM393 based design
Board Schematic
• VCC = 3.3V to 5V DC
• GND = Ground
• DO = Digital Output
• AO = Analog Output
How to use
• Photosensitive resistor module most sensitive to environmental light intensity is gen-
erally used to detect the ambient brightness and light intensity.
• Module light conditions or light intensity reach the set threshold, DO port output
high, when the external ambient light intensity exceeds a set threshold, the module D0
output low;
• Digital output D0 directly connected to the MCU, and detect high or low TTL,
thereby detecting ambient light intensity changes;
• Digital output module DO can directly drive the relay module, which can be composed
of a photoelectric switch;
27
Home Security System Using IOT
The code you write is “human readable”, that is, it will make sense to you (some-
times), and will be organized for a human to follow. Part of the job of the IDE is
to take the human readable code and translate it into machine-readable code to be
executed by the Arduino. This process is called compiling.The process of compiling is
seamless to the user. All you have to do is press a button. If you have errors in your
computer code, the compiler will display an error message at the bottom of the IDE
and highlight the line of code that seems to be the issue. The error message is meant
to help you identify what you might have done wrong – sometimes the message is very
explicit, like saying, “Hey – you forget a semicolon”, sometimes the error message is
vague.Why be concerned with a semicolon you ask? A semicolon is part of the Arduino
language syntax, the rules that govern how the code is written. It is like grammar in
writing. Say for example we didn’t use periods when we wrote – everyone would have
a heck of a time trying to figure out when sentences started and ended. Or if we didn’t
employ the comma, how would we convey a dramatic pause to the reader? And let me
tell you, if you ever had an English teacher with an overactive red pen, the compiler is
ten times worse. In fact – your programs WILL NOT compile without perfect syntax.
This might drive you crazy at first because it is very natural to forget syntax. As you
gain experience programming you will learn to be assiduous about coding grammar.
like in them. If you have a lot you need to explain, you can use a multi-line comment,
shown below. . . //This is an example Comments are like the footnotes of code, except
far more prevalent and not at the bottom of the page.
4.5.1 Function()
Functions are pieces of code that are used so often that they are encapsulated in certain
keywords so that you can use them more easily. For example, a function could be the
following set of instructions. . . This set of simple instructions could be encapsulated in
a function that we call WashDog. Every time we want to carry out all those instructions
we just type WashDog and voila – all the instructions are carried out.In Arduino, there
are certain functions that are used so often they have been built into the IDE. When you
type them, the name of the function will appear orange. The function pinMode(), for
example, is a common function used to designate the mode of an Arduino pin. What’s
the deal with the parentheses following the function pinMode? Many functions require
arguments to work. An argument is information the function uses when it runs.For our
WashDog function, the arguments might be dog name and soap type, or temperature
and size of a bucket. pinMode(13,OUTPUT); The argument 13 refers to pin 13, and
OUTPUT is the mode in which you want the pin to operate. When you enter these
arguments the terminology is called passing. You pass the necessary information to the
functions. Not all functions require arguments, but opening and closing parentheses
will stay regardless though empty. Notice that the word OUTPUT is blue. There are
certain keywords in Arduino that are used frequently and the color blue helps identify
them. The IDE turns them blue automatically. Now we won’t get into it here, but you
can easily make your own functions in Arduino, and you can even get the IDE to color
them for you. We will, however, talk about the two functions used in nearly EVERY
Arduino program.
The function, setup(), as the name implies, is used to set up the Arduino board. The
Arduino executes all the code that is contained between the curly braces of setup() only
once. Typical things that happen in setup() are setting the modes of pins, startingYou
might be wondering what void means before the function setup(). Void means that the
function does not return information.Some functions do return values – our DogWash
function might return the number of buckets it required to clean the dog. The function
analogRead() returns an integer value between 0-1023. If this seems a bit odd now,
don’t worry as we will cover every common Arduino function in depth as we continue
the course. Let us review a couple things you should know about setup(). . . 1. setup()
only runs once. 2. setup() needs to be the first function in your Arduino sketch. 3.
setup() must have opening and closing curly braces.
You have to love the Arduino developers because the function names are so telling.
As the name implies, all the code between the curly braces in loop() is repeated over
and over again – in a loop. The loop() function is where the body of your program
will reside.As with setup(), the function loop() does not return any values, therefore
the word void precedes it. Does it seem odd to you that the code runs in one big
loop? This apparent lack of variation is an illusion. Most of your code will have specific
conditions laying in wait which will trigger new actions. If you have a temperature
sensor connected to your Arduino for example, then when the temperature gets to a
predefined threshold you might have a fan kick on. The looping code is constantly
checking the temperature waiting to trigger the fan. So even though the code loops
over and over, not every piece of the code will be executed every iteration of the loop.
Libraries are a collection of code that makes it easy for you to connect to a sensor,
display, module, etc. For example, the built-in LiquidCrystal library makes it easy to
talk to character LCD displays. There are hundreds of additional libraries available on
the Internet for download. The built-in libraries and some of these additional libraries
are listed in the reference. To use the additional libraries, you will need to install them.
Arduino libraries are managed in three different places: inside the IDE installation
folder, inside the core folder and in the libraries folder inside your sketchbook. The
way libraries are chosen during compilation is designed to allow the update of libraries
present in the distribution. This means that placing a library in the “libraries” folder
in your sketchbook overrides the other libraries versions.
The same happens for the libraries present in additional cores installations. It is also
important to note that the version of the library you put in your sketchbook may be
lower than the one in the distribution or core folders, nevertheless it will be the one used
during compilation. When you select a specific core for your board, the libraries present
in the core’s folder are used instead of the same libraries present in the IDE distribution
folder. Last, but not least important is the way the Arduino Software (IDE) upgrades
itself: all the files in Programs/Arduino (or the folder where you installed the IDE) are
deleted and a new folder is created with fresh content.This is why we recommend that
you only install libraries to the sketchbook folder so they are not deleted during the
Arduino IDE update process.
To install a new library into your Arduino IDE you can use the Library Manager
(available from IDE version 1.6.2). Open the IDE and click to the ”Sketch” menu and
then Include Library ¿ Manage Libraries. Then the Library Manager will open and
you will find a list of libraries that are already installed or ready for installation. In
this example we will install the Bridge library. Scroll the list to find it, click on it, then
select the version of the library you want to install. Sometimes only one version of the
library is available. If the version selection menu does not appear, don’t worry: it is
normal
Finally click on install and wait for the IDE to install the new library. Downloading
may take time depending on your connection speed. Once it has finished, an Installed
tag should appear next to the Bridge library. You can close the library manager.You
can now find the new library available in the Sketch ¿ Include Library menu. If you
want to add your own library to Library Manager, follow these instructions.
If you’re using a serial board, power the board with an external power supply (6 to
25 volts DC, with the core of the connector positive). Connect the board to a serial
port on your computer.On the USB boards, the power source is selected by the jumper
between the USB and power plugs. To power the board from the USB port (good for
controlling low power devices like LEDs), place the jumper on the two pins closest to
the USB plug. To power the board from an external power supply (needed for motors
and other high current devices), place the jumper on the two pins closest to the power
plug. Either way, connect the board to a USB port on your computer. On Windows,
the Add New Hardware wizard will open; tell it you want to specify the location to
search for drivers and point to the folder containing the USB drivers you unzipped in
the previous step. The power LED should go on.
The content of circuits and Arduino sketches can vary greatly. Before you get started,
there is one simple process for uploading a sketch to an Arduino board that you can
refer back to. Follow these steps to upload your sketch: 1. Connect your Arduino using
the USB cable. The square end of the USB cable connects to your Arduino and the
flat end connects to a USB port on your computer. 2. Choose Tools→Board→Arduino
Uno to find your board in the Arduino menu. You can also find all boards through this
menu, such as the Arduino MEGA 2560 and Arduino Leonardo. 3. Choose the correct
serial port for your board. You find a list of all the available serial ports by choosing
Tools→Serial Port→ comX or /dev/tty.usbmodemXXXXX. X marks a sequentially or
randomly assigned number. In Windows, if you have just connected your Arduino,
the COM port will normally be the highest number, such as com 3 or com 15. Many
devices can be listed on the COM port list, and if you plug in multiple Arduinos, each
one will be assigned a new number. On Mac OS X, the /dev/tty.usbmodem number
will be randomly assigned and can vary in length, such as /dev/tty.usbmodem1421 or
/dev/tty.usbmodem262471. Unless you have another Arduino connected, it should be
the only one visible. 4. Click the Upload button. This is the button that points to the
right in the Arduino environment. You can also use the keyboard shortcut Ctrl+U for
Windows or Cmd+U for Mac OS X.
5.1 ADVANTAGES
1. Comprehensive Security:
• The integration of laser technology, gas sensors, and light-sensitive detectors provides
a comprehensive security solution, addressing physical intrusions, gas leaks, and adapt-
ing to varying light conditions.
2. Early Detection of Hazards:
• The inclusion of the MQ2 gas sensor allows for the early detection of hazardous gases,
providing an added layer of safety by alerting residents to potential threats before they
escalate.
3. Adaptability to Environmental Changes:
• The system’s ability to adapt to changes in ambient light conditions ensures reliable
performance in different weather and lighting scenarios, reducing the likelihood of false
alarms.
4. Remote Monitoring and Alerts:
• The GSM900A module enables remote monitoring, allowing users to receive real-time
alerts and notifications on their mobile devices, enhancing situational awareness and
36
Home Security System Using IOT
response times.
5. Integration of Multiple Sensors:
• The system’s integration of multiple sensors enhances its versatility, making it suitable
for a range of applications beyond traditional home security, including environmental
monitoring and safety.
5.1.1 DISADVANTAGES
1. False Alarms:
• Environmental factors such as fog, dust, or sudden changes in light conditions may
trigger false alarms in the laser-based detection system. Mitigating these false positives
remains a challenge.
2. Energy Consumption:
• The simultaneous operation of multiple sensors and communication modules may lead
to increased energy consumption, requiring careful consideration of power management
to ensure prolonged system operation.
5.1.2 APPLICATIONS
1. Residential Security:
• The primary application is in residential security, where the system provides robust
protection against intruders and potential hazards within the home environment.
2. Commercial and Industrial Security:
• The system can be adapted for use in commercial and industrial settings to enhance
security measures and monitor for gas leaks or unauthorized access.
3. Environmental Monitoring:
• The integrated gas sensor can be employed for environmental monitoring in areas
prone to pollution or industrial emissions, contributing to air quality assessment.
4. Safety in Laboratories or Workspaces:
• The system can be utilized in laboratories or workspaces where early detection of gas
leaks is critical for ensuring the safety of personnel and preventing accidents.
5. Remote Property Monitoring:
• Suitable for monitoring vacation homes or properties in remote locations, the system
provides peace of mind by offering real-time alerts and status updates to property
owners.
6.0.1 Results:
The implementation and testing of the Laser-Based Home Security System with Inte-
grated Sensors have yielded promising results, showcasing the system’s effectiveness in
providing comprehensive security.
The key outcomes include:
1. Intruder Detection:
• The laser-based detection system demonstrated reliable performance in detecting
physical intrusions, effectively activating security measures such as the red LED and
buzzer.
2. Gas Detection:
• The MQ2 gas sensor successfully detected the presence of hazardous gases, triggering
appropriate responses, including the activation of the green LED and the initiation of
alert messages via the GSM module.
3. Light Sensitivity:
• The integration of the LDR sensor enhanced the system’s adaptability to varying
light conditions, minimizing false alarms and ensuring reliable operation in different
environmental settings.
4. Remote Monitoring:
39
Home Security System Using IOT
• The GSM900A module facilitated seamless remote monitoring, allowing users to re-
ceive real-time alerts on their mobile devices, ensuring timely responses to security
breaches and gas detection events.
6.0.2 Conclusion:
The Laser-Based Home Security System with Integrated Sensors has proven to be a
robust and versatile solution for residential security. The comprehensive approach,
combining laser technology with gas detection, light sensitivity, and remote monitoring,
addresses the limitations of traditional security systems. The system’s adaptability to
environmental changes and early detection capabilities enhance its reliability, making
it a valuable asset for homeowners seeking advanced security measures. The successful
integration of multiple sensors and communication modules underscores the potential
of this system to provide not only security but also safety features, especially with
its capability to detect hazardous gases. The real-time alerts and remote monitoring
capabilities contribute to a proactive security stance, allowing users to respond promptly
to security events.
This integration can also facilitate interoperability with other smart home devices. 4.
Advanced Gas Sensing Technologies:
• Research into more advanced gas sensing technologies can improve the precision and
specificity of gas detection, expanding the range of detectable gases and reducing the
likelihood of false positives.
5. Scalability for Larger Properties:
• Designing the system to be scalable for larger properties, such as commercial or indus-
trial spaces, will be crucial for broadening its applicability. This may involve exploring
methods to extend the coverage of the laser grid and optimizing sensor placement.
6. Integration with Emergency Services:
• Exploring possibilities for direct integration with emergency services can enhance
the system’s capabilities in emergency situations, enabling faster response times and
coordination with local authorities.
[2] V. Ramya and B. Palaniappan, “Embedded system for Hazardous gas detection
and Alerting,” in Proc. of International Journal of Distributed and parallel system
(IJDPS), vol. 3, no. 3, May 2012.
[3] L. Solis, Y. Li and L. B. Kishs, “Fluctuation-Enhanced Multiple-gas sensing by
Commercial Taguchi Sensor,”IEEE Sensor Journal, vol. 5, no. 6, Dec 2005.
[4] H. G. Rodney Tan, C. H. Lee and V. H. Mok, “Automatic Power Meter Reading
System Meter Reading Using GSM Network,” in Proc. of the 8 Th International Con-
ference.
[6] A Jain, D. Kumar and J. Kedia, “Design and development of GSM based energy
Meter, “International Journal of Computer Application, vol. 47, no. 12, June 2012.
44
Home Security System Using IOT
[7] S. Shinde, S. B. Patil and A. J. Patil, “Development of movable gas tanker leak-
age detection using wireless sensor network based on embedded system,” International
Journal of Engineering Research and Application(IJTERA), vol. 2, pp. 1180-1183,
Nov.-Dec. 2012.
[8] Geronimo, ”Gas leak, not bomb, caused Two Seren blast,” GMA Network, 7 June
2013. http://www.gmanetwork.com/news/story/311810/news/metromanila/gasNot-bomb-
caused-two-serendra-blast-mar-roxas.