Vous êtes sur la page 1sur 28

HOME AUTOMATION SYSTEM USING GSM

A Mini Project-II Report

Submitted in Partial Fulfillment of the Requirements


For the Degree of

BACHELOR OF TECHNOLOGY

IN

ELECTRONICS & COMMUNICATION ENGINEERING


By
Happy Agarwal & Akash Kedia
13bec033 & 14bec010

Under the Guidance of


Prof. Rachna Sharma

Department of Electronics & Communication Engineering


Institute of Technology, Nirma University
Ahmedabad-382481
May 2017
CERTIFICATE

This is to certify that the Mini Project-II Report entitled “HOME AUTOMATION
SYSTEM USING GSM” submitted by Happy Agarwal (13BEC033) & Akash Kedia
(14BEC010) as the partial fulfillment of the requirements for the award of the degree of
Bachelor of Technology in Electronics & Communication Engineering, Institute of
Technology, Nirma University is the record of work carried out by him/her under my
supervision and guidance. The work submitted in our opinion has reached a level
required for being accepted for the examination.

Date: 04/05/2017

Prof. Rachna Sharma


Project Guide

Prof. (Dr.) D. K. Kothari


HOD (EC)
ACKNOWLEDGEMENT

I would like to extend my thanks to Institute of Technology, Nirma University for giving us this
opportunity for undergoing this project work, which helped in our development in various aspects.
I would like to thank respected Prof. RACHNA SHARMA for giving me such a wonderful opportunity
to expand my knowledge for my own branch and giving me guidelines to present a Mini project
report. It helped me a lot to realize of what we study for. Secondly, I would like to thank my
parents who patiently helped me as i went through my work and helped to modify and eliminate
some of the irrelevant or un-necessary stuffs. Thirdly, I would like to thank my friends who helped
me to make my work more organized and well-stacked till the end. Next, I would thank Microsoft
for developing such a wonderful tool like MS Word. It helped my work a lot to remain error-free.
Last but clearly not the least, I would thank The Almighty for giving me strength to complete
report on time. I have tried to cover all the aspects in the project and minimize the errors.
ABSTRACT

Security has been a major issue where crime is increasing and everybody wants to take proper measures
to prevent intrusion. In addition there was a need to automate home so that user can take advantage of
the technological advancement in such a way that a person going out of home can keep an eye anytime.
Considering the advancement in technology we have designed an automatic security system which can
be used both for household as well as for office purpose. As nowadays everything can be controlled by
mobile so we have designed a system which can easily be operated by our handset. In today’s age of
digital technology and intelligent systems, home automation has become one of the fastest developing
application-based technologies in the world. The idea of comfortable living in home has since changed
for the past decade as digital, vision and wireless technologies are integrated into it.
Index

Chapter Title Page No.


No.
Acknowledgement i
Abstract ii
Index iii
List of Figures iv
List of Tables vi
1 Introduction
1.1 Introduction 1
1.2 Objective of project 1
1.3 Problem statement 1
1.4 Code Used 2
1.5 Scope Of Project 3

2 Literature Review

Existing Home Security 5

3 Peripherals Used

3.1 Microcontroller board used: Arduino 6


ATMEGA 2560

3.2 GSM module 8

3.3 Reed Switch 9

3.4 Ultra sonic 9


4 Working
4.1 Home Security System 18

4.2 Office Security System 20

4.3 Home Automation System 21

Conclusions 23

References 24

Annexure 25
LIST OF FIGURES

Fig. No. TITLE PAGE NO

1.1) QR Code 10

3.1) Arduino ATMEGA 2560 diagram 13

3.2) Diagram of GSM module circuit 14

3.3) Reed switch diagram 15

3.4) Ultra Sonic Sensor 16

4.1) House schematic 17

4.2) Level I Security 18

4.3) Level II Security 18

4.4) Level III Security 19

4.5) QR Code Scanning 19

4.6) SMS Sending 20

4.7) Employee Details 20

4.8) Home Automation System 21


LIST OF TABLES

Table 3.1.1 Features of Arduino ATMEGA2560 15


4.1.1 List of Commands 21
CHAPTER 1
Introduction
1.1 INTRODUCTION
For home security automation we have made a system in which there will be 3 level of security.
A thief can enter a house by either cutting the grill of windows or through main door. So in level
1 security we have used a simple technique of winding the electric wires around the grill and
then connecting the wires to a circuit so that if the thief cuts the grill the wire would also be cut
and the connection would break so a message will be sent to the owner that level 1 security is
breached. In level 2 we have used a reed switch at the main door so that if the thief forcefully
opens the door or by cutting the lock the connection of the reed switch will be cut and a message
will be sent to the owner that level 2 security is breached. If after opening the gate the thief still
continues to enter the house then we have used a motion sensor which will detect that there is a
movement and then a message will be sent to the owner that level 3 security is breached.

1.2 OBJECTIVE
Basic Idea of our project is to provide GSM Based security even if the owner is away from the
restricted areas. For this we adopted wireless mode of transmission using GSM. Beside this there
are many methods of wireless communication but we selected GSM in our project because as
compared to other techniques, this is an efficient and cheap solution also, we are much familiar
with GSM technology and it is easily available.

1.3 PROBLEM STATEMENT


Technology has advanced so much in the last decade or two that it has made life more efficient
and comfortable. The comfort of being able to take control of devices from one particular
location has become imperative as it saves a lot of time and effort. Therefore there arises a need
to do so in a systematic manner which we have tried to implement with our system. The system
we have proposed is an extended approach to automating a control system. With the
advancement and breakthroughs in technology over the years, the lives of people have become
more complicated and thus they have become busier than before. With the adoption of our
system, we can gain control over certain things that required constant attention. The application
of our system comes in handy when people get to know about the remote intrusions in their
house or if there is some mishap when they are not at their place.
1.4 SCOPE OF WORK

GSM Technology
The radio spectrum can be shared by different users accessing similar frequency band without
causing any kind of obstruction. The techniques used for this are TDMA (Time division multiple
access), FDMA (Frequency division multiple access) and CDMA (Code division multiple
access).GSM is the combination of both Time and Frequency-Division Multiple Access
(TDMA/FDMA). FDMA part involves the partition by frequency of (maximum) 25 MHz
bandwidth into 124 carrier frequencies spaced 200 kHz apart. Each of the carrier frequencies is
then alienated in time, using a TDMA plan. The fundamental unit of time in this TDMA system
is called a burst period and it lasts 15/26 ms (or approx. 0.577 ms). Eight burst periods are
grouped into TDMA frame (120/26 ms, or approx. 4.615 ms), which forms essential unit for the
definition of logical channels. One physical channel is one burst period per TDMA frame. Thus
GSM allows eight concurrent calls on same radio frequency. GSM (Global System for Mobile
Communications) is a form of multiplexing, which divides the accessible bandwidth between
different channels.GSM operates on four special frequencies worldwide [1].

QR codes

QR codes are two dimensional quick response codes that are now gaining notability and
popularity in the United States. They are easy to use and versatile. The code itself stores huge
amounts of information that is easily scanned and stored onto a mobile device. Many businesses
are now adopting this code as a means of marketing and as another way to attract customers to
the internet for more information. QR codes have both advantages and disadvantages and both
benefits and drawbacks of the code should be understood before using the QR code as a
marketing technique.

1.1 QR Code
Advantages:

The main advantage of a QR code is its versatility. QR codes can be used for anything and
everything. They are also beneficial for both customers and businesses. For example, a business
saves money and advertising costs by distributing a QR code to their website or URL. A
customer can scan this QR code and this allows them to store the information for future
reference. What’s also greater about QR codes is that they bridge different forms of marketing
streams together. For example ecommerce and mobile commerce are both used for QR codes.
QR codes acts as the link and it also exposes customers to other forms of advertising the
business or service of the QR code has done. This maximizes exposure and can potentially
generate revenue

Advantage of Speech Processing


One of the most notable advantages of speech recognition technology includes the dictation
ability it provides. With the help of the technology users can easily control devices and create
documents by speaking. Speech recognition can allow documents to be created faster because
the software generally produces words as fast as they are spoken, which is generally much faster
than a person can type. Dictation solutions are not only used by individuals but also by
organizations which require heavy transcription tasks such as healthcare and legal.

Advantages of Python

Python has clean object-oriented design, provides enhanced process control capabilities, and
possesses strong integration and text processing capabilities and its own unit testing framework,
all of which contribute to the increase in its speed and productivity. Python is considered a
viable option for building complex multi-protocol network applications. Python provides a large
standard library which includes areas like internet protocols, string operations, web services
tools and operating system interfaces. Many high use programming tasks have already been
scripted into the standard library which reduces length of code to be written significantly.
CHAPTER 2 – LITERATURE REVIEW

Existing Home Security

In most of the cases we use a watchman at our home, a dog or a camera to keep a record so these are the
most commonly used system nowadays to protect our houses but a major drawback in these systems are
the cost and camera can be only used to see how a robbery was made, it cannot give an instant alert to
the owner and stop the robbery. Home security involves the security hardware in place on a property,
and personal security practices. The hardware would be the doors, locks, alarm systems, lighting,
motion detectors, security camera systems, etc. that are installed on a property. Personal security
practices would be ensuring doors are locked, alarms activated, windows closed, extra keys not hidden
outside and many other routine tasks which act to prevent a burglary. According to an FBI report, 58.3
percent of burglaries involved forcible entry. A typical burglary lasts for about 8 to 12 minutes and, on
average, a burglar will break into a home within 60 seconds. Home security can be strengthened by
adding a first line of defense like a thorny shrub or bush to give the burglar a hard time. A motion
activated bright light can play a psychological role in deterring a burglar also acting as a second line of
defense along with outdoor security cameras. In order to protect the entry points, we need to have
window and door sensors. Once a burglar gets past the second line of defense, motion detectors kick in.
A motion detector can raise an alarm or send a security footage to the homeowner if it's linked to a
camera system. Storing valuables like passports, jewelry, important documents, etc. might also be
considered a home security precaution. Common security methods include never hiding extra keys
outside, never turning off all the lights, applying small CCTV stickers on doors, and keeping good tabs
with neighbors.
CHAPTER 3-PERIPHERALS USED

3.1 Arduino ATMEGA 2560


The Mega 2560 is a microcontroller board based on the ATmega2560. It has 54 digital input/output pins
(of which 15 can be used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports), a 16
MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button. It contains
everything needed to support the microcontroller; simply connect it to a computer with a USB cable or
power it with a AC-to-DC adapter or battery to get started. The Mega 2560 board is compatible with
most shields designed for the Uno and the former boards Duemilanove or Diecimila[2].

3.1 ARDUINO ATMEGA 2560 DIAGRAM


MICROCONTROLLER ATmega2560

Operating Voltage 5V

Input Voltage 7-12 V

Digital I/O Pins 54 ( 14 Provide PWM Output)

Analog Input Pins 16

DC Current per I/O Pin 40 ma

Flash Memory 256KB


(Boot Loader takes 8KB by boot loader)
SSRAM 8KB

EEPROM 4KB

Clock Speed 16MHz

Table 3.1.1 Features of Arduino ATMEGA 2560

3.2 GSM MODULE

3.2 Diagram of GSM module circuit


Features of GSM Module
 Improved spectrum efficiency.
 International roaming.
 Compatibility with integrated services digital network (ISDN)
 Support for new services.
 SIM phonebook management.
 Fixed dialing number (FDN)
 Real time clock with alarm management.
 High-quality speech.

3.3 Reed Switch

Fig 3.3 Reed switch diagram

Working of Reed Switch

The reed switch (sometimes also known as Herkon) is an electrical switch operated by an applied
magnetic field. It was invented at Bell Telephone Laboratories in 1936 by W. B. Ellwood. It consists of
a pair of contacts on ferromagnetic metal reeds in a hermetically sealed glass envelope [3].
3.4 Ultra Sonic

Fig 3.4 Ultra Sonic

Features of Ultra Sonic Sensor


The following list shows typical characteristics enabled by the detection system.
1) Transparent object detectable
Since ultrasonic waves can reflect off a glass or liquid surface and return to the sensor head,
even transparent targets can be detected.
2) Resistant to mist and dirt
Detection is not affected by accumulation of dust or dirt.
3) Complex shaped objects detectable
Presence detection is stable even for targets such as mesh trays or springs.

Working of Ultra Sonic Sensor


The sonic waves emitted by the transducer are reflected by an object and received back in the
transducer. After having emitted the sound waves, the ultrasonic sensor will switch to receive mode.
The time elapsed between emitting and receiving is proportional to the distance of the object from the
sensor.
CHAPTER 4- WORKING

4.1 Home Security System

4.1 House schematic

We have used 3 level of security in our system


Level I: A burglar can enter a house either from main door or from windows. So we have put wires
around the grills of the windows and a reed switch on the main door. If the burglar tries to cut the grill
of windows the wire will also be cut and the connection will be lost so alarm will ring and a message
will be sent to the owner that level 1 security is breached. Same goes with the reed switch if the burglar
tries to open the door forcefully the reed switch connection with the magnet will break and same
message will be sent.
4.2 Level I Security

Level II: If the burglar continues to enter the house we have kept an ultrasonic sensor in the passage
which will detect the presence and so it will transfer the signal to the GSM module and a message will
be again sent to the owner that level 2 security is been breached.

4.3 Level II Security


Level 3: Now in level 3, if the burglar still continues to enter the house we have kept a motion sensor
in the Living room which will detect any movement so again the message will be sent to the owner that
level 3 security is breached.

4.4 Level III Security

4.2 Non-Burglar Security System


This system can be used outside an office/home/schools. A screen will be there near the gate which will
have a screen which will have some fixed QR codes and will be continuously changing the QR codes at
a particular interval. If an employee wants to enter the office or wants to mark his presence he will have
to scan the code from his/her mobile, if the employee is valid the complete details of employee will be
displayed on the screen and the door will open. If some other person which doesn’t belong to that office
try to scan the code, a message will be displayed that ‘Authentication failed’, and the doors will remain
closed.

4.5 QR Code Scanning


4.6 SMS Sending

4.7 Employee Details

4.3 Home Automation System


In this system a person will have to give a secret command so that system will start, we have stored the
command to start the system as ‘clap clap’. After it receives this signal the system will start working
and detect a person’s voice, if I give command ‘turn on light 1’ that particular light will start glowing,
similarly if I give command ‘turn on fan 2’, that particular fan will start. We have also given command
of ‘it’s too bright’ which will turn off the light, and command ‘it’s too dark’ which will turn on both
lights.
4.8 Home Automation System

Turn ON Fan 1 Turn OFF Light 1


Turn ON Fan 2 Turn OFF Light 2
Turn ON Light 1 Its too dark
Turn ON Light 2 Its too bright
Turn OFF Fan 1 Its too hot
Turn OFF Fan 2 Its too cold
4.1.1 List of Commands
CONCLUSION

The project we have undertaken has helped us gain a better perspective on various aspects
related to our course of study as well as practical knowledge of electronic equipment and
communication. We became familiar with software analysis, designing, implementation,
testing and maintenance concerned with our project. The extensive capabilities of this
system are what make it so interesting. From the convenience of a simple cell phone, a user
is able to control and monitor virtually any electrical devices. This makes it possible for
users to rest assured that their belongings are secure and that the television and other
electrical appliances was not left running when they left the house to just list a few of the
many uses of this system. The end product will have a simplistic design making it easy for
users to interact with. This will be essential because of the wide range of technical
knowledge that homeowners have.
References

1)https://www.ukessays.com/essays/information-technology/advantages-and-disadvantages-of-gsm-
information-technology-essay.php
2) https://www.arduino.cc/en/Main/arduinoBoardMega2560
3)https://www.google.co.in/search?q=working+of+reed+switch&rlz=1C1CHBD_enIN714IN714&o
q=working+of+reed+switch&aqs=chrome..69i57.8757j0j9&sourceid=chrome&ie=UTF-8
4)dreamstime.com
5)cutcaster.com
6) centraltimeclock.com
Annexure

Code for Home Security System:


#include <GSM.h>

GSM gsmAccess;
GSM_SMS sms;
char remoteNum[20] = "+919016888444";
int encode[3] = {0,0,0};
void setup()
{
pinMode(12, INPUT);
pinMode(11, OUTPUT);

pinMode(14, INPUT);

pinMode(13, OUTPUT);

pinMode(16, INPUT);
delay(30000);

Serial.begin(9600);
while (!Serial)
{
;
}
}

void loop()
{

pinMode(13, OUTPUT);
digitalWrite(13, LOW);
delayMicroseconds(2);
digitalWrite(13, HIGH);
delayMicroseconds(5);
digitalWrite(13, LOW);
pinMode(13, INPUT);
int duration = pulseIn(13, HIGH);
int distance = duration / 29 / 2;
if((digitalRead(12)!= LOW)||(digitalRead(14)!= HIGH))
{
encode[0]=1;
}

else if(distance <= 1000)


{
encode[1]=1;
}

else if((digitalRead(12)== HIGH))


{
encode[2]=1;
}

else
{
delay(1000);
}

sms.beginSMS(remoteNum);

if(encode[2]==1)
{
sms.print("Security Level 3 Breached");
sms.endSMS();
}
else
{
if(encode[1]==1)
{
sms.print("Security Level 2 Breached");
sms.endSMS();
}
else
{
if(encode[0]==1)
{
sms.print("Security Level 1 Breached");
sms.endSMS();
}
}
}
}

Code for Non-Burglar Security System:

#include <GSM.h>
#include <string.h>

GSM gsmAccess;
GSM_SMS sms;

// Array to hold the number a SMS is retreived from


char senderNumber[20];

void setup() {
// initialize serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
}

void loop() {
char c;
char message_income[16];
int i;

if (sms.available()) {

i=0;
while (c = sms.read())
{
message_income[i]=c;
++i;
}

if((strcmp(message_income,"14BEC010")==0)||(strcmp(message_income,"MP6")==0)||(strcmp(message_income,"GUIDER
S")==0))
{
sms.remoteNumber(senderNumber, 20);

for(i=3; senderNumber[i]!='\0'; ++i)


{
senderNumber[i-3]=senderNumber[i];
}

Serial.println(senderNumber);

sms.flush();
}
}

delay(1000);

Code for Home Automation System:

#include <GSM.h>
#define PINNUMBER ""

GSM gsmAccess;
GSM_SMS sms;

void setup()
{
Serial.begin(9600);
pinMode(13,OUTPUT);
pinMode(12,OUTPUT);
pinMode(6,OUTPUT);
boolean notConnected = true;

while (notConnected)
{
if (gsmAccess.begin(PINNUMBER) == GSM_READY)
{
notConnected = false;
}

else
{
Serial.println("Not connected");
delay(1000);
}
Serial.println("GSM initialized");
}
}

void loop()
{
char remoteNum[20]= "8758582771";
Serial.println(remoteNum);

// sms text
//Serial.print("Now, enter SMS content: ");
char txtMsg[4][200];
char str[200];
int i = 1;
char result[5];
while(1)
{
if(Serial.available())
{
result[i-1]=Serial.read();
//Serial.print(result[i-1]);
if((result[i-1]=='1')&&(i==1))
strcpy(txtMsg[0]," F1 ON ");
else if((result[i-1]=='0')&&(i==1))
strcpy(txtMsg[0]," F1 OFF ");
else if((result[i-1]=='1')&&(i==2))
{
strcpy(txtMsg[1]," F2 ON ");
digitalWrite(13,HIGH);
}
else if((result[i-1]=='0')&&(i==2))
strcpy(txtMsg[1]," F2 OFF ");
else if((result[i-1]=='1')&&(i==3))
{
strcpy(txtMsg[2]," T1 ON ");
digitalWrite(12,HIGH);
}
else if((result[i-1]=='0')&&(i==3))
strcpy(txtMsg[2]," T1 OFF ");
else if((result[i-1]=='1')&&(i==4))
{
strcpy(txtMsg[3]," T2 ON ");
digitalWrite(6,HIGH);
}
else if((result[i-1]=='0')&&(i==4))
strcpy(txtMsg[3]," T2 OFF ");
i++;
if(i>4)
break;
}
}
strcat(txtMsg[0],txtMsg[1]);
strcat(txtMsg[0],txtMsg[2]);
strcat(txtMsg[0],txtMsg[3]);
sms.beginSMS(remoteNum);
sms.print(txtMsg[0]);
sms.endSMS();
Serial.println("\nCOMPLETE!\n");
}

Vous aimerez peut-être aussi