Académique Documents
Professionnel Documents
Culture Documents
ON
UNDERTAKING
DEVICES
CONTROL
SYSTEM
USING
GSM
Richa Shukla
Rituraj
Shriya
Mehrotra
Shobhit
Chaturvedi
Vishal Kant
Rai
(PROJECT CO-ORDIN.)
(HOD, EN-DEPT.)
MR.
(PROJECT GUIDE)
LECTURER EN-DEPT
B.B.D.N.I.T.M.
LECTURER EN-DEPT
ACKNOWLEDGEMENT
We would like to give our cordial thanks to our project guide Mr. VINAMRA
GOVIL Senior lecturer EN DEPARTMENT, B.B.D. N. I.T.M,Lucknow,for his
regular encouragement,invaluable advice and support without with this project
would never have been completed so smoothly.It is because his regular guidance
and effort,that the whole process has become a success.
We would also like to thanks Mr. MOHD. SHIBLEE, HOD& MR.RAFEEQ
AHMAD, project coordinator, Electrical & Electronics Engineering Department,
B.B.D.N.I.T.M, Lucknow and other faculty members of the department, for their
regular encouragement and support. Without their support ,completion of this
B.Tech.course would not have been possible. They were the driving force and also
the force of inspiration to us.
We would like to thanks our friends Pragati Chaturvedi,Abhinandan
Choudhary,Arun Kumar & special thanx to one of our team member Richa for
their help in completing our project.
Last but not the least We would like to thanks our parents for their indomitable
patients,sacrifice and support without which the successful completion of this work
would have been a distant dream.
ABSTRACT
The rapidly advancing mobile communication technology and
the decrease incosts make it possible to incorporate mobile
technology into home .The project report on SMS BASED DEVICE
CONTROL IN HOMES gives an elaborate view and understanding of the
project design and functioning.
The report is divided into parts for explaining the step by step development of the
project. The first part introduces the idea behind the project and the underlying
information of the technologies used. Next chapter is dedicated for information on
the equipments used and how they were accommodated in the project circuitry.
The working of the project with the programming code are explained after that.
Lastly, the merits, de-merits and future prospects of the project are given.
CONTENTS
ACKNOWLEDGEMENT .............................................4
ABSTRACT5
LIST OF FIGURE...8
Chapter 1 INTRODUCTION..9
1.1 INTRODUCTION...10
1 .2 MOTIVATION...11
1.3 PROBLEM STATEMENT..11
Chapter 2 EQUIPMENT & PCB DESGINING12
2.1 EQUIPMENTS.13
2.2.2.3 ETCHING31
2.2.2.4 DRILLING..31
2.2.2.5 SOLDERING..32
2.2.2.6 MASKING..32
2.2.3 PCB LAYOUT32
Chapter 3 COMPONENT LIST..34
3.1 COMPONENT LIST..35
Chapter 4 WORKING OPERATION & PROGRAMMING CODE..36
4.1 WORKING....37
4.2 CIRCUIT DIAGRAM ...39
4.3 PROGRAMMING CODE.40
Chapter 5 ADVANTAGES & DISADVANTAGES47
5.1 ADVANTAGES48
5.2 DISADVANTAGES..48
Chapter 6 APPLICATIONS49
6.1 APPLICATIONS...50
REFERENCES...51
LIST OF FIGURES
Figure 1 Gsm Modem.15
Figure 2 Pin configuration of Atmega18
Figure3 LCD.. 21
Figure4 Different types of relay.24
Figure 5 (a) pin connection of uln 2803
26
Figure 5 (b) plastic package...26
Figure 6 PCB Layout of soldering side28
Figure 7 PCB Layout of Component side...28
Figure 8 PCB Designing process..29
Figure 9 PCB cleaning processs ..31
Figure 10 Block Diagram39
Figure 11 Circuit Diagram..............................................................................40
CHAPTER 1
INTRODUCTION
INTRODUCTION
1.1 Introduction
10
11
1.2 Motivation
As an engineering student a project is required as part of the final year work. The
project chosen is the activation of HomeAutomation via mobile technology. This
was selected because of
appliances which we believe is the next important step to realize the Home
Automation. 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.
12
CHAPTER 2
EQUIPMENT & PCB
DESGINING
2.1 EQUIPMENTS:
The different major equipments used in system are enlisted below:
a) GSM modem
b) Microcontroller (ATEMEGA 168)
c) LCD
13
d) Relay
e) ULN2803
14
DCS
1800
and
1900MHz.
With
tiny
configuration
of
40mmx33mmx2.9mm, SIM 300 can meet almost all the space requirements in
your applications, such as smart phone, PDA phone and other mobile devices. The
physical interface to the mobile application is a 60 pin board t board connector,
which provides all hardware interfaces between the module and customers boards
except the RF antenna interfaces.You can turn on the module by driving the
PWRKEY to a low level voltage for period time. The automatic power on circuit
illustrate as following figure. The PWRKEY pin is the NO.34 pin of the module
interface. The value of the capacitor C155 is recommended as
15
16
Pin Descriptions
1. VCC
Digital supply voltage.
2 GND
Ground.
3 Port B (PB7:0) XTAL1/XTAL2/TOSC1/TOSC2
Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for
each bit). The Port B output buffers have symmetrical drive characteristics with
both high sink and source capability. As inputs, Port B pins that are externally
pulled low will source current if the pull-up resistors are activated. The Port B pins
are tri-stated when a reset condition becomes active, even if the clock is not
running
17
ATmega 8
18
4. Port C (PC5:0)
Port C is a 7-bit bi-directional I/O port with internal pull-up resistors (selected for
each bit). The PC5..0 output buffers have symmetrical drive characteristics with
both high sink and source capability. As inputs, Port C pins that are externally
pulled low will source current if the pull-up resistors are activated. The Port C pins
are tri-stated when a reset condition becomes active, even if the clock is not
running.
5. PC6/RESET
If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the
electrical characteristics of PC6 differ from those of the other pins of Port C.
If the RSTDISBL Fuse is unprogrammed, PC6 is used as a Reset input. A
low level on this pin for longer than the minimum pulse length will generate a
Reset.
6. Port D (PD7:0)
Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for
each bit). The Port D output buffers have symmetrical drive characteristics with
both high sink and source capability. As inputs, Port D pins that are externally
pulled low will source current if the pull-up resistors are activated. The Port D pins
are tri-stated when a reset condition becomes active, even if the clock is not
running.
19
7. AVCC
AVCC is the supply voltage pin for the A/D Converter, PC3:0, and ADC7:6. It
should be externally connected to VCC, even if the ADC is not used. If the ADC is
used, it should be connected to VCC through a low-pass filter.
8. AREF
AREF is the analog reference pin for the A/D Converter.
9.ADC7:6
In the TQFP and QFN/MLF package, ADC7:6 serve as analog inputs to the A/D
converter. These pins are powered from the analog supply and serve as 10-bit
ADC channels.
20
A liquid crystal display (LCD) is a flat panel display, electronic visual display,
or video display that uses the light modulat. LCDs do not emit light directly.LCDs
are used in a wide range of applications ,including computer monitors, television,
instrument panels, aircraft cockpit displays, signage, etc. They are common in
consumer devices such as video players, gaming
Fig 3.LCD
2.1.3.1 Features :
21
2.1.4 Relays:
Relays are electromechanical devices, which are used as a switch. Current flowing
through the coil of the relay creates a magnetic field which attracts a lever and
changes the switch contacts. The main advantages of using relay as a switch is that,
they provide electrical isolation between inputs with the help of magnetic coupling
and also we can handle a large power using a relay.
There are different types of relays are available and they can be categorized in
various ways. For example relays can be SPST, SPDT, DPST, DPDT etc. SPDT
stands for Single Pole
A relay will switch one or more poles, each of whose contacts can be thrown by
energizing the coil in one of three ways:
"early-make" or NOEM, which means that the contacts will close before the
button or switch is fully engaged.
SPST Single Pole Single Throw. These have two terminals which can be
connected or disconnected. Including two for the coil, such a relay has four
terminals in total. It is ambiguous whether the pole is normally open or
normally closed. The terminology "SPNO" and "SPNC" is sometimes used to
resolve the ambiguity.
23
DPST Double Pole Single Throw. These have two pairs of terminals.
Equivalent to two SPST switches or relays actuated by a single coil. Including
two for the coil, such a relay has six terminals in total. The poles may be Form
A or Form B (or one of each).
DPDT Double Pole Double Throw. These have two rows of change-over
terminals. Equivalent to two SPDT switches or relays actuated by a single coil.
Such a relay has eight terminals, including the coil.
24
Rating
Symbol
Value
Unit
Output Voltage
VO
50
Input Voltage
VI
30
IC
500
mA
IB
25
Ma
25
(B)
(A)
26
PCBs are inexpensive, and can be highly reliable. They require much more layout
effort and higher initial cost than either wire-wrapped or point-to-point constructed
circuits, but are much cheaper and faster for high-volume production. Much of the
electronics industry's PCB design, assembly, and quality control needs are set by
standards.
27
28
2.2.2PCB-DESIGNING
PCB Designing includes the following steps:-
PROCESSING
CLEANSING
PRINTING
ETCHING
DRILLING
29
SOLDERING
MASKING
2.2.2.1PROCESSING
The layout of a PCB has to incorporate all the information on the board before one
can go on to the artwork preparation. This means that a concept that clearly defines
all the details of the circuit and partly also of the final equipment, is a prerequisite
before the actual layout can start. The detail circuit diagram is very important for
the layout designer and he must also be familiar with the design concept and with
the philosophy behind the equipment. The General Considerations are-
30
c-) Board types:-There are two side of a PCB board Component side &
Solder side. Depending on these board are classified as
2.2.2.2CLEANING
The cleaning of the copper surface prior to resist application is an essential step for
any type of PCB process using etches or plating resist.After scrubbing with the
abrasive, a water rinse will remove most of the remaining slurry.
31
Scrubbing
Water Rinse
Tap Water
Wet Brushing
Tap Water
Acid dip
Hydrochloric Acid-HCl
Final Rinse
De-ionized Water
Drying
2.2.2.3 ETCHING
It is of utmost importance to choose a suitable Etchant Systems. There are many
factors to be considered: Etching speed
Copper solving capacity
Etchant price
Pollution character
We have uses FeCl3 (Conc. 120 g/litre 0.1 M) for etching.
32
2.2.2.4 DRILLING
The importance of hole drilling into PCBs has further gone with electronic
component miniaturization and its need for smaller holes diameters (diameters less
than half the board thickness) and higher package density.
The following hole diameter tolerances have been generally accepted wherever no
other specifications are mentioned.
Hole Diameter
+ / - 0.05 mm
Hole Diameter
(D) > 3 mm
+ / 0.1 mm
2.2.2.5 SOLDERING
Flux should be removed after Soldering. It is done through washing by 0.51 %
HCl followed by Neutralization in dilute alkali to remove corrosive flux.Noncorrosive is removed by Iso-Propanal.
2.2.2.6 MASKING
It is done for the protection of conductor track from Oxidation.
33
A PCB layout is required to place components on the PCB so that the component
area can be minimized and the components can be placed in an efficient manner.
The components can be placed in two ways, either manually or by software. The
manual procedure is quiet cumbersome and is very inefficient. The other method is
by the use of computer software. This method is advantageous as it saves time and
valuable copper area. There are various softwares available for this purpose like Express PCB
Pad2pad
Protel PCB
PCB design e.t.c.
Many of them are loaded with auto routing and auto placement facility. The
software that we have used here is EXPRESS PCB. This software has a good
interface, easy editing options and a wide range of components.
Express P.C.B.
Express PCB is a very easy to use Windows application for laying out
printed circuit boards. There are two parts to Express PCB, Express SCH for
34
drawing schematics and Express PCB for designing circuit boards. We downloaded
the software from the website www.expresspcb.com.
There are lots of functions available in the software. This software is free of
cost and it is very easy to use. The different layers of the PCB can be viewed by
just a click of a button on the interface. And we easily get its print on paper which
is utilized for further processing. We can design single sided PCB as well as
Double Sided PCB with this Software.
CHAPTER 3
35
COMPONENT LIST
MODEL
SIM 300
ATMEGA 168
ULN 2803
JIH JIK
HD44780U
LM 7805
IN 4007
1Kohm
36
QUANTITY
1
1
1
4
1
6
1
1
2
6
Resistance
Crystal oscillator(10
MHz)
Ceramic capacitor
Ceramic capacitor
Connector
Connecting wires
Relay
10Kohm
1
1
104/AEC
33/AEC
1
2
9
JQC-3FC
CHAPTER 4
WORKING OPERATION &
PROGRAMMING CODE
37
the sms is used as the password. As the password is matched, then the sms arrival
is assumed to be valid by the microcontroller otherwise, it ignores the sms.Working
of sms based device control system using GSM MODEM is very simple.It can
be simply understood by its block diagram &circuit diagram.
40
41
//String mob_no="";
String sms="";
const char sms_end='*';
int stage=0;
char ch;
int i=-1;
void setup()
{
lcd.begin(16, 2);
// lcd.print("GSM BASED SYSTEM");
indicate(1000);
gsm.begin(2400);// keep the speed of the modem slow to handle the data easily
gsm.print("at\n\r"); // ATTENTION
delay(100);
gsm.print("ate0\n\r"); // ECHO OFF
delay(100);
gsm.print("at+cmgf=1\n\r");// SMS FORMAT TEXT
delay(100);
gsm.print("at+cnmi=2,1,0,1,0\n\r"); // indicates the arrival of new message
delay(1000);
gsm.flush(); // CLEAR THE INITIAL DATA OF MODEM
delay(1000);
gsm.print("at+cmgd=1\n\r"); // CLEAR THE LOCATION 1
pinMode(11,OUTPUT);
digitalWrite(11,LOW);
pinMode(14,OUTPUT);
42
pinMode(15,OUTPUT);
pinMode(17,OUTPUT);
pinMode(16,OUTPUT);
lcd.clear();
lcd.print("DEVICE CONTROL");
}
void loop()
{
while(stage==0) // hold here unless otherwise any sms arrives
{ if(gsm.available())
{ ch=char(gsm.read());
str+=ch;
i=str.indexOf("+CMTI: ");
if(i>=0) // only when sms gets arrived
{ //Serial.println("SMS ARRIVED");
lcd.clear();
lcd.print("SMS ARRIVED");
str="";
gsm.print("at+cmgr=1\n\r");// comman to read the sms
stage=1;// now we shall read the sms
i=-1
indicate(100);
lcd.clear();
}
}
43
}
while(stage==1)
{
if(gsm.available())
{ ch=gsm.read();
// Serial.print(ch);
lcd.print(ch);
str+=ch;
if(ch==sms_end)// termination character found
{stage=2;
indicate(100);
}
}
}
while(stage==2)
{
for(i=((str.indexOf('#')+1));(i<str.indexOf('*'));i++) // sms starts with # and ends with *
{ sms+=str.charAt(i);
}
indicate(1000);
lcd.clear();
lcd.print("GSM BASED SYSTEM");
lcd.setCursor(0,1);
lcd.print(sms);
44
indicate(200);
for(int n=0;n<=3;n++)
{
int pin=14+n;
int data=sms[n]-'0';
digitalWrite(pin,data);
}
//******************************
str="";// clear the string
gsm.print("at+cmgd=1\n\r");//clear the locatin 1
}// stage 2
while(stage==3)
{
if(gsm.available())
{ ch=gsm.read();
// Serial.print(ch);
str+=ch;
if((str.indexOf("OK")>0))
{ str="";
status_string="OK";
// mob_no="";
sms="";
stage=4;
i=-1;
45
indicate(100);
delay(2000);
send_sms();
delay(1000);
}
}
}// stage 3
while(stage==4) //
{
if(gsm.available())
{
ch=gsm.read();
Serial.print(ch);
str+=ch;
if((str.indexOf("OK")>0))
{ str="";
stage=0;
lcd.clear();
lcd.print("DEVICE CONTROL");
}
}
}
}//main loop
void indicate(int i)
{
46
digitalWrite(led_pin, HIGH);
digitalWrite(buzz_pin, HIGH);
delay(i);
digitalWrite(led_pin, LOW);
digitalWrite(buzz_pin, LOW);
}
void send_sms()
{
gsm.print("AT\n\r");
gsm.print("AT+CMGS=");
gsm.print(char(34));
gsm.print("+9197932022 58");
gsm.print(char(34));
gsm.print("\n\r");
delay(100);
gsm.print("OK");
gsm.print(char(26)); // ascii code for ctrl^z
// sent_sms="OK"; //
47
CHAPTER 5
ADVANTAGES &
DISADVANTAGES
48
5.1ADVANTAGES:
1.
2.
3.
4.
5.
49
5.2DISADVANTAGES:
1. The system is network dependent. Hence, network congestion can reduce the
00 reliability of the system.
2. User can make mistake while typing the message format.
CHAPTER 6
APPLICATIONS
50
6.1 APPLICATIONS
The previous chapter deal with stated merits and de-merits of the project, the
project can be put for use in following fields1. Home automation, which was the seed for developing the idea of project.
2. Remote device control. a) This will help to eliminate need of human
personnel attending the device till it has to be switched off/on. Based on
experience of approximate time to switch on/off ,he/she can control the
device, saving time.
b) It will also help to control device while attending to other work.
c) User can control device in case of forgetting to do so while leaving for
some other place.
3. Energy conservation
4. Irrigation systems
51
REFERNCES:
1. Paper of M.J Vanderwerff on activation of home automation system via
2.
3.
4.
5.
6.
mobile technology
Wikipedia-GSM technology
Data sheet of ATMEGA 168
www.motorola.com-interfacing device information
Dr. Aditya Trivedi-Prof. IIIT Gwalior
Labsguru workshop programming details
52