Você está na página 1de 100

Iqra University IU

Islamabad Campus

INDUSTRIAL AUTOMATION SYSTEM


USING GSM AND WEB BASED

By

Aamir Shahzad
051-14-21503/BEEE/F14

Muhammad Bilal
051-14-21418/BEEE/F14

Supervised by

Mr. Muntazir Hussain

Designation, Iqra University, Islamabad Campus

Thesis Submitted as partial fulfillment of requirement for the Degree of


Belcher of engineering electronic engineering (BEEE)

Department of Engineering in Electronics Engineering


Iqra University Islamabad Campus
ABSTRACT
Now a day there is a lot of burglary happening across the city, the reason behind that is police can’t
make out the exact location of burglary for example if burglary is happening inside any area in the
city, police will get information after the incident had happened, and then they can’t find out the
way the thieves had went. Now so many alarm system and security systems are emerging in our
markets using high-tech techniques, but in our design we are implementing a home automation
and security systems using GSM, GSM is one of the latest mobile technology using smart
MODEM which can easily interfaced to embedded microcontrollers. Now everything is going to
be automated using this technology, using this technology we can access the devices remotely.
Using GSM now we can identify the people, vehicles etc. in anywhere of the world. In this project
there will be sensors inside the home, if anybody comes forcibly to home the sensors output will
give information to the system that somebody had come, then it will send the SMS to the owners
mobile or make a call to police.

ii
ACKNOWLEDGEMENTS

This BE proposition in Electronics Engineering has been directed at Department of Electronic


Engineering, and Technology, IQRA University, as a major aspect of the degree program. We
might want to express gratitude toward Engr. Mr. Muntazir Hussain for giving us a chance to
take a shot at this task, under his watch and direction all through the undertaking. We might
likewise want to express gratitude toward Engr. Kashif ur rehman for his assistance, endeavors
and devoted help all through the venture.

Facilitate we are especially appreciative to all-powerful Allah and thankful to our folks, siblings
and sisters who constantly upheld and supported us amid our undertaking and concentrates at
(IUIC).

Aamir Shahzad

Muhammad Bilal

iii
DECLARATION
I hereby declare that this research, neither as whole nor as part has been copied out from any
source. It is further declaring that I have prepared this report entirely on the basis of my personal
efforts made under the sincere guidance of teachers especially my supervisor Dr. Jamil Ahmed. If
any part of this thesis is proved to be copied out from any source or found to be reproduction of
some other, I will stand by the consequences. No potion of the work presented has been submitted
in support of any application for any other degree or qualification of this or any other university
or institute of learning.

Aamir Shahzad
051-14-21503/BEEE/F14

Muhammad Bilal
051-14-21418/BEEE/F14

iv
THESIS APPROVAL SHEET
It is certifying that Muhammad Bilal and Aamir Shahzad Department of Electronic Engineering
& Technology, Student ID (51-07-21418) and (51-07-21503) of IQRA University Islamabad, has
submitted the final Thesis report on “INDUSTRIAL AUTOMATION SYSTEM USING GSM
AND WEB BASED”. We have read the report and it fulfills the partial of Bachelor of Engineering
Electronic Engineering degree.

INTERNAL EXAMINER:

Name:
Designation: Assistant Professor
Organization: Iqra University Islamabad Campus

Signature: _____________________

EXTERNAL EXAMINER:

Name:
Designation:
Organization:
Signature: _____________________

SUPERVISOR:

Name: Muntazir Hussain


Designation: Assistant Professor
Organization: Iqra University Islamabad Campus

Signature: ____________________

v
Contents
ABSTRACT...................................................................................................................................................... ii
ACKNOWLEDGEMENTS ................................................................................................................................ iii
DECLARATION .............................................................................................................................................. iv
THESIS APPROVAL SHEET .............................................................................................................................. v
List of Figures ................................................................................................................................................ x
List of Tables ............................................................................................................................................... xii
Chapter 1 Introduction ................................................................................................................................. 1
1.1. Introduction ....................................................................................................................................... 2
1.2. Existing System................................................................................................................................... 3
1.3. Proposed System................................................................................................................................ 3
1.4. Design of the project.......................................................................................................................... 4
1.5 Advantages.......................................................................................................................................... 4
1.6 Applications......................................................................................................................................... 4
1.7 Future work ......................................................................................................................................... 5
Chapter 2 Component of project .................................................................................................................. 2
2.1 GSM ..................................................................................................................................................... 6
2.1.1 Introduction ................................................................................................................................. 6
2.1.2 History of GSM ............................................................................................................................. 6
2.1.4 Radio Interface of GSM ................................................................................................................ 7
2.1.5 GSM repeat gatherings ................................................................................................................ 8
2.1.6 GSM-900 ...................................................................................................................................... 8
2.1.7 Network structure and Architectural elements ........................................................................... 9
2.1.8 The Base Station Subsystems of G.S.M. ..................................................................................... 10
2.1.9 Accessing G.S.M. deal with ........................................................................................................ 10
2.1.10.1 General Packet Radio Service (GPRS).................................................................................... 11
2.1.10.2 Short Message Service (SMS)................................................................................................ 12
2.1.11 Phone Identification (SIM cards).............................................................................................. 12
2.1.12 GSM cell phone Advantages & Disadvantages ........................................................................ 13
2.1.12.1 Advantages............................................................................................................................ 13
2.1.12.2 GSM remote obstacles .......................................................................................................... 13
2.2 Wi-Fi Module ESP8266 Srt ................................................................................................................ 13

vi
2.2.1 Wi-Fi module esp8266 Srt circuit diagram ................................................................................. 14
2.2.2 Wi-Fi module ESP8266 pin configuration .................................................................................. 15
2.2.3 Wi-Fi module esp8266 pin configuration diagram .................................................................... 15
2.3 Gas sensor MQ 2 ............................................................................................................................... 16
2.3.1 Mq2 gas sensor pin configuration.............................................................................................. 16
2.4 Flame sensor: .................................................................................................................................... 17
2.4.1 Features ..................................................................................................................................... 17
2.4.2 Flame sensor circuit diagram ..................................................................................................... 18
2.5 Smoke sensor .................................................................................................................................... 18
2.5.1 Smoke sensor stick design circuit .............................................................................................. 18
2.6 Temperature sensor LM35................................................................................................................ 19
2.7 DC Fan ............................................................................................................................................... 19
2.8 Alternate Current Motor(Engine) ..................................................................................................... 20
2.9 Bulb AC .............................................................................................................................................. 20
2.10 Arduino ........................................................................................................................................... 20
2.10.1 Why Arduino? .......................................................................................................................... 21
2.10.2 Sorts of Arduino ....................................................................................................................... 21
2.10.3 Arduino DUE............................................................................................................................. 22
2.10.4 Introduction. ............................................................................................................................ 22
2.10.5 Physical components of Arduino due. ..................................................................................... 22
2.10.6 Memory.................................................................................................................................... 23
2.10.6 System ...................................................................................................................................... 23
2.10.7 Startup ..................................................................................................................................... 23
2.10.9 FEATURES OF ARDUINO DUE ................................................................................................... 24
2.10.10 Arduino DUE Pin functions..................................................................................................... 24
2.11 indicator light .................................................................................................................................. 25
2.11.1 Diagram of Indicator ................................................................................................................ 25
2.11.2 LCD 16 x 2 ................................................................................................................................. 26
2.11.3 16×2 LCD stick design............................................................................................................... 26
2.11.4 Interfacing 16×2 LCD to Arduino .............................................................................................. 27
2.12 Buzzer .............................................................................................................................................. 28
2.12.1 Buzzer specifications ................................................................................................................ 29

vii
2.12.2 Buzzer diagram......................................................................................................................... 29
2.13 Relay ................................................................................................................................................ 30
2.13.1 Basic design and operation ...................................................................................................... 30
2.13.2 Relay Module Used in Project .................................................................................................. 31
2.14 Transformer .................................................................................................................................... 31
2.14.1 Transformer circuit Diagram .................................................................................................... 32
2.15 Bridged Rectifier ............................................................................................................................. 32
2.16 Regulator IC LM7812....................................................................................................................... 33
2.16.1 Features ................................................................................................................................... 33
2.16.2 Package includes ...................................................................................................................... 34
2.16.3 Pin configuration ...................................................................................................................... 34
2.17 Regulator IC LM7805....................................................................................................................... 34
2.17.1 Pin configuration ...................................................................................................................... 35
2.18 DC to DC converter ......................................................................................................................... 35
2.19 Triac................................................................................................................................................. 35
2.20 pc817 opt coupler ........................................................................................................................... 36
2.20.1 Pc817 opt coupler circuit diagram ........................................................................................... 37
Chapter 3 THE INDUSTRIAL AUTOMATION AND IoT..................................................................................... 6
3.1 Increase Quality and Flexibility in Your Manufacturing Process....................................................... 39
3.2 Advantages of Industrial Automation ............................................................................................... 39
3.2.1 High productivity ........................................................................................................................ 39
3.2.2 High Quality................................................................................................................................ 40
3.2.3 High flexibility............................................................................................................................. 40
3.2.4 High Information Accuracy ........................................................................................................ 40
3.2.5 High safety ................................................................................................................................. 40
3.2.6 High Initial cost........................................................................................................................... 40
3.3 Conclusion ......................................................................................................................................... 40
3.4 Internet of Things (IoT) ..................................................................................................................... 41
3.4.1 Internet ...................................................................................................................................... 41
3.4.2 Internet of things (IoT) ............................................................................................................... 41
3.4.3 Internet of things (IoT) works .................................................................................................... 42
3.5 Internet of things (IoT) system.......................................................................................................... 43

viii
3.6 Benefits of Internet of things (IoT).................................................................................................... 43
3.7 Internet of things (IoT) application ................................................................................................... 44
3.8 The future of Internet of things (IoT) ................................................................................................ 44
Chapter 4 Simulation .................................................................................................................................... 6
4.1 220 volts AC to 15 volts DC supply proteus simulation .................................................................... 46
4.2 GSM module simulation.................................................................................................................... 47
4.3 GAS sensor simulation ...................................................................................................................... 48
4.4 Simulation of Gas sensor with Arduino............................................................................................. 48
4.5 simulation of Temperature sensor. .................................................................................................. 49
4.6 Arduino DUE simulation .................................................................................................................... 50
4.7 Simulation of flame sensor ............................................................................................................... 50
4.8 Simulation of Smoke sensor interfacing with LCD through Arduino ................................................ 51
4.9 GSM module and Arduino Simulation .............................................................................................. 51
Chapter 5 Hardware implementation ......................................................................................................... 46
5.1 block diagram of industry automation ............................................................................................. 57
5.2 Circuit diagram of Project ................................................................................................................. 58
Chapter 6 Conclusion and Future Work........................................................................................................ 6
6.1 Conclusion ......................................................................................................................................... 60
6.2 Advantages........................................................................................................................................ 60
6.3 Applications....................................................................................................................................... 60
6.4 Future work ....................................................................................................................................... 60
6.5 New technology directions ............................................................................................................... 60
Appendix ................................................................................................................................................. 62
Project Code ............................................................................................................................................ 62
References .............................................................................................................................................. 86
Plagiarism report..................................................................................................................................... 87

ix
List of Figures
Figure 1.1 Design of the project.................................................................................................................... 4
Figure 2.1 Network structure and Architectural elements ........................................................................... 9
Figure 2.2 A typical GSM Base Station ........................................................................................................ 10
Figure 2.3 Wi-Fi module Esp8266 ............................................................................................................... 14
Figure 2.4 Wi-Fi module Esp8266 pin configuration diagram .................................................................... 15
Figure 2.5 Mq2 gas sensors......................................................................................................................... 16
Figure 2.6 Mq2 gas sensor with Arduino .................................................................................................... 17
Figure 2.7 Flame sensor circuit diagram ..................................................................................................... 18
Figure 2.8 Smoke sensor stick design circuit.............................................................................................. 18
Figure 2.9 Temperature sensor LM35 ........................................................................................................ 19
Figure 2.10 DC Fan ..................................................................................................................................... 19
Figure 2.11 AC Motor .................................................................................................................................. 20
Figure 2.12 Bulb AC .................................................................................................................................... 20
Figure 2.13 Arduino DUE ............................................................................................................................ 22
Figure 2.14 Arduino DUE Pin functions ...................................................................................................... 24
Figure 2.15 Diagram of Indicator ............................................................................................................... 25
Figure 2.16 Interfacing 16×2 LCD to Arduino .............................................................................................. 28
Figure 2.17 Buzzer ...................................................................................................................................... 29
Figure 2.18 Relay ........................................................................................................................................ 30
Figure 2.19 Relay module........................................................................................................................... 31
Figure 2.20 Transformer circuit diagram ................................................................................................... 32
Figure 2.21 Bridged Rectifier...................................................................................................................... 33
Figure 2.22 IC LM7812 ............................................................................................................................... 33
Figure 2.23 LM781 pin ............................................................................................................................... 34
Figure 2.24 LM7805 IC ............................................................................................................................... 34
Figure 2.25 LM7805 pin .............................................................................................................................. 35
Figure 2.26 DC to DC converter.................................................................................................................. 35
Figure 2.27 Triac circuit ............................................................................................................................... 36
Figure 2.28 Triac ......................................................................................................................................... 36
Figure 2.29 Pc817 opt coupler circuit diagram .......................................................................................... 37
Figure 3.1 IoT.............................................................................................................................................. 42
Figure 3.2 IoT System ................................................................................................................................. 43
Figure 3.3 IoT Applications ......................................................................................................................... 44
Figure 4.1 220 volts AC to 15 volts DC supply proteus simulation ............................................................ 46
Figure 4.2 GSM module simulation............................................................................................................ 47
Figure 4.3 GSM module simulation............................................................................................................. 47
Figure 4.4 GAS sensor simulation ............................................................................................................... 48
Figure 4.5 Simulation of Gas sensor with Arduino...................................................................................... 48

x
Figure 4.6 Simulation of Temperature sensor ........................................................................................... 49
Figure 4.7 Arduino DUE simulation ............................................................................................................. 50
Figure 4.8 Simulation of flame sensor ........................................................................................................ 50
Figure 4.9 Simulation of Smoke sensor interfacing with LCD through Arduino ......................................... 51
Figure 4.10 GSM module and Arduino Simulation ..................................................................................... 51
Figure 4.11 Firebase ................................................................................................................................... 52
Figure 4.12 Firebase Application mobile display ........................................................................................ 53
Figure 4.13 Showing different stats in Firebase Application ..................................................................... 54
Figure 4.14 Motor at high speed in Firebase Application. ......................................................................... 55
Figure 5.1 Block diagram of Industrial automation ................................................................................... 57
Figure 5.2 Project Circuit diagram .............................................................................................................. 58

xi
List of Tables
Table 2-1 Wi-Fi module esp8266 pin configuration.................................................................................... 15

xii
Chapter 1 Introduction
1.1. Introduction
There are many problems now a day which includes congestion of traffic. Imagine having the
ability to control all the electrical devices of your industry from in every practical sense wherever
you are on the planet! For example, say one cool winter day, you are stuck in surge hour gridlock
on the motorway in the wake of a dull day at work. By crushing two or three keystrokes on your
PDA, you authorize an extensive scale which turns on the motor in the business, prepares your
advanced device, and switches on your electrical mechanical equipment through on the web. In
the present events the GSM flexible terminal has ended up being something that are persistently
with us. Much equivalent to our wallet/handbag, keys or watch, the GSM adaptable terminal outfits
us with a correspondence channel that enables us to talk with the world. The requirement for a
man to be reachable or to call anyone at whatever point is incredibly captivating. Using the
possibility of action space, we as a general rule expand the movement space of the human with the
adaptable terminal, enabling the endorser of speak with another supporter and thusly exchange
information, issue or get bearings. This Project is used to control our advanced hold electrical
devices from wherever through the cell phone and WEB. The circuit includes an Arduino DUE
Microcontroller. The Arduino DUE microcontroller controls all the system. In this endeavour we
control mean four contraptions. It switches on/off the contrasting devices according to the
customer require. The circuit has an inbuilt phone ring or (SMS) sensor circuit and the system will
accept control by means of phone control if it was not taken physically. Press the relating numbers
to execute on/the devices. The purpose of the endeavour is to look at a fiscally sharp course of
action that will give controlling of mechanical machines is online through the web. The proposes
a structure that empowers customer to be control the business devices unavoidably and moreover
give security on acknowledgment of interference by methods for SMS using GSM development.
The motivation is to urge the customers to mechanize their industry having all-inclusive access.
The structure gives openness due to headway of an insignificant exertion system. The business
machines control structure with a moderate cost was accepted to be manufactured that should be
convenient offering access to the mechanical assemblies and allowing industry security. The
business robotization is today needs to make usage of the latest inventive parts open. In this
endeavour, we present the structure and use of an industry computerization system where
correspondence advancements GSM (Global System for Mobile Communication) through WEB.

2
This procedure is successfully merged in a lone remote industry computerization structure. This
structure offers an aggregate, negligible exertion, astounding and simple to utilize technique for
consistent watching and control of an industry. It has 2 self-ruling hand-off switches with
ordinarily open and routinely closed switch contacts, these can be changed to switch on for a pre-
chosen time length at whatever point the GSM-AUTO is called. The exchange switches can
moreover be quickly or forever turned on or off by sending the GSM-AUTO a request.

1.2. Existing System


In the current framework we use to check each electrical mechanical hardware and every one of
the gadgets previously leaving the home, and some of the time we use to overlook the gadgets in
running condition and leave that in same condition in the wake of originating from the workplace
we will see that gadget in a similar running condition, at that point we will turn off the gadget to
the experimental mode.

1.3. Proposed System


In the proposed framework the GSM is utilized to get the message and transmit the message to the
microcontroller. As we have two gadgets utilized GSM and other is microcontroller. The remote
client sends an instant message to the including order to the collector. GSM beneficiary, gets
message sent from the client mobile phone, GSM collector translates the sent message and sends
the order to the microcontroller. Microcontroller issues direction to the apparatuses and the gadget
associated will switch ON/OFF. The utilization and control unit will build up correspondence by
means of GSM through WEB.

3
1.4. Design of the project

Figure 1.1 Design of the project

1.5 Advantages
 Possibility to control & monitor at longer distance
 Faster manufacturing and less expensive hard work price.
 Can carry out the assignment beyond the human capability.

1.6 Applications
Home applications: Small appliances like TV, fans, fridge can be monitored and controlled through
artificial Intelligence platforms.
Offices: Monitoring and controlling the machines and instruments using the IoT technique.
Hospitals and labs: Doctor can examine the current status of the patient using his android phone
by placing the sensors on patient’s body using the artificial intelligence and IoT

4
1.7 Future work
The automated industries do NOT extrapolate to littler and less expensive PLCs, DCSs, and
supervisory control and information securing frameworks; those capacities will just be inserted in
equipment and programming. Rather, future development will originate from absolutely new
bearings. New innovation headings

5
Chapter 2 Component of project
2.1 GSM
2.1.1 Introduction

The Global System for Mobile Communications (GSM) is best outstanding standard for
telephones on planet. GSM benefits are utilized by more than 2,000 million individuals
transversely over in excess of 212 nations and territories. [1][2] The unavoidability of the
GSM standard makes by and large twisting incredibly normal between telephone
administrators, empowering endorsers of utilization their telephones in different areas of the
world. GSM varies essentially from their trailblazers in which hailing & talk channels are of
Digital calls quality, which recommended that this is viewed as 2nd time (2.G) remote
structure. Such reality in like way recommended that information correspondence was united
with the framework by third Generation Partnership Project, (3GPP). From the perspective of
the customers, the key great position of GSM structures is full mechanized speech quality as
well as ease options in contrast to making calls, for example, content informing. The favorable
position for system administrators has been the capacity to send gear from various sellers in
light of the fact that the open standard permits simple between operability. Like other cell
measures GSM permits organize administrators to offer wandering administrations which
mean supporters can utilize their telephones everywhere throughout the world. As the GSM
standard kept on creating, it held in reverse similarity with the first GSM telephones.

2.1.2 History of GSM

Europeans quickly grasped the bothers of each European state tackling their adaptable
structure. It keeps mobile use from one nation to another nation within Europe. Issue was
viewed when Europeans was traveling in large amount from nation to nation with in Europe.
Amending the condition, the Conference of European Posts and Telegraphs (CEPT) amassed
an examination add up to with purposes of curious about the cell phone framework in Europe.
This get-together was called Group Special Mobile (GSM). For the going with ten years the
GSM pack illustrated measures, explored headway and sorted out an approach to manage
execute a dish European cell phone coordinate. In 1989 work done by the GSM collect was
exchanged to the European Telecommunication Standards Institute (ETSI). The name GSM
was transposed to name the sort of affiliation envisioned. The curtailed edge GSM had been

6
changed from Group Special Mobile to Global Systems Mobile Telecommunications the first
GSM organize was moved in 1991 by Radiolinja in Finland. Just consistently and by then 36

GSM makes in overabundance out of 22 nations. Two or three different nations were on the
ascending to get a handle on this new telephone make and offer in what was changing into a
general standard. In the meantime, GSM in like way wound up being completely utilized in
the other countries Australia. And in the Europe built up a complex modernized phone
structure, the America was in the meantime working basically on the old, fundamental AMPS
system TDMA. Around the total of October 2001, Cingular was the first to report their change
to the 3G GSM engineer. This included exchanging in excess of 22 million clients from
TD.MA to G.S.M. 2006 Cingular ceased new telephone incitation on the TDMA make and
started just moving GSM advantage. By a wide margin the greater part of the world outside
to the United States utilizes GSM headway. Regardless, tackle diverse frequencies then the
United States GSM telephones. There are five basic GSM frequencies that have wound up
being standard around the world. They meld G.S.M.-900, G.S.M.-18,00, G.S.M-850, G.S.M.-
19,00 and G.S.M.-400. In our undertaking we can utilized the G.S.M. 900.

2.1.3 Core technology of GSM

 2G technologies

 2.5G technologies

 3G technologies

 4G technologies

2.1.4 Radio Interface of GSM

G.S.M. is a mobile form, which proposes in which mobile phones interface with it by methods
of pursuing down mobiles in the induce area. G.S.M. structures work in the 4 specific
recurrent extents. Many G.S.M. structures work 900 MHz or 18,00 MHz social affairs. Two
or three nations in the USA (counting the USA and Canada) utilize the 851 MHz and 19,00
MHz bundles of light in the way that the 9,00 and 1,800 MHz rehash group were by then
distribute.

7
2.1.5 GSM repeat gatherings

There are eight repeat bunches described in 3.G.P.P. TS 05.05:

I. Standards G.S.M. 900 Band P G.S.M.

II. G.S.M. 450 Bands

III. G.S.M. 480 Bands

IV. G.S.M. 850 Bands

V. increased G.S.M. 900 Bands, E G.S.M. (joins Standards G.S.M. 900 bands)

VI. Railways G.S.M. 900 Bands, R G.S.M. (joins Standard and Extended G.S.M. 900
bands)

VII. D.C.S. 1,800 Bands

VIII. P.C.S. 1,900 Bands

2.1.6 GSM-900

GSM-900 is utilized in various part of the world, Europe, Arab countries, and (Africa) and
the lot of south Asia and north Asia. G.S.M.-900 utilizations 890-- 915 MHz to send data from
the Mobil Stations to the Base Transceivers Stations (uplinks,) and 935 -- 960 MHz fr the
others course (downlinks), giving (124) RF channel’s (channels number (1 to 124)) dispersed
at 2,00 kHz. Duplex’s separating of 45 MHz is utilized in several nations the G.S.M.-900
bands has been reached out to covers a more noteworthy rehash grow. This expanded G.S.M.
E—G.S.M. utilizes rehash run 880 - 915 MHz (uplink) and 925 - 960 MHz (downlink),
including 50 channels (channel numbers 975 to 1023 and 0) to the first GSM-900 band. The
G.S.M. decisions besides outline 'railroads GSM', G.S.M. R, which, utilizes rehash widen 876
- 915 MHz (uplinks) also 921…960 MHz (downlinks). Channels starting 955 and ending
1023. G.S.M.-R gives extra channel as well as centered associations for, used by railroad staff.
Those assortments were intertwined into G.S.M.-900. confirmation.

8
2.1.7 Network structure and Architectural elements

The GSM versatile correspondence advantage depends upon a development of reaching radio
cells which give finish thought of the association zone and permit the endorser undertaking
wherever inside it. Preceding this phone thought, radiophones were constrained to simply the
transmitter layering the entire association zone. Cell correspondence shifts from the
radiophone advantage in light of the path that rather than one enormous transmitter, different
insignificant ones are utilized to cover a similar territory. The basic issue is to deal with the
condition where a man utilizing the telephone in one cells move out of degree in that cells. In
the radiophone advantage there was no approach and the call was lost, that is the, reason the
association district was so expansive. In cell correspondence, giving the pass on over to the
going with cell manages the issue. This strategy is completely tweaked and requires no
extraordinary intervention by the client, yet it is an astounding explicit limit requiring
enormous preparing capacity to accomplish a fast response. The realistic structure of a G.S.M.
framework can b widely detached in to the Mobile Stations, the Base Stations Subsystems,
and Networks Subsystems. Every subsystems is incorporated utilitarian segments that offer
through the particular interfaces utilizing chose customs. The endorser passes on the versatile
station; the base stations subsystems control the radio relationship with the Mobile Station.
The structure subsystem, which is the fundamental piece of which is Mobile Associations
Switching Canter, plays out the exchanging of calls between the adaptable and other settled
or advantageous system clients, and what's increasingly the heads of versatile associations,
for example, check.

Figure 2.1 Network structure and Architectural elements

9
2.1.8 The Base Station Subsystems of G.S.M.

The Base Station Subsystems is part of GSM deal with which is in charge of overseeing
activity and motioning between a cellphone and the Networks Switching Subsystem. The
B.S.S. completes the process of transcoding of talk channel’s, part of, radio channel’s to cell
phones, paging qualities association of transmission and gathering over the air interface
different unmistakable assignments identified with the radio system.

Figure 2.2 A typical GSM Base Station

2.1.9 Accessing G.S.M. deal with

In order to get to G.S.M. affiliations, a customer need 3 thing

•A enrollment with wireless executive. This is everything considered Pay when You move
approach, where most GSM affiliations considered paid for the front of calendar, or Pay 4
weeks’ elective where bills are issue constantly for lines rent based, great part of the time
paid for multi month early, and for affiliations used in the before month.

•A remote which is GSM brilliant and works at hazy repeat from the executive. Most phone
affiliations move phones from aloof producers.

•A S.I.M Card which is issued by head once the venture is permitted. The cards come pre, -
changed with supporter's phones "character" and will be use to stores lone information’s like
contacts proportions of friend and families

After supporters join, information regarding supporter’s cell identities also those affiliations
they are permitted for this are secured within "SIM record" in Home Location Register

10
(H.L.R). HLR is data base kept up through "home" phones relationship in order to
considerable measure of their endorsers. They are used for response will in general like,
"Where on the PDA make is the contraption related with this phone number?" & "What
affiliations is this endorser paying for?" By stacking SIM card inside phone & this will filled
on, they shell find the nearby remote shaft, in like way known as Base Transceiver
Station(BTS). In case this post would attractively come to thought in space. Static mobiles
are perpetually communicating with an identical bit of the phone manage, at any rate mobile
phones can "visit" any bit of the framework, paying little identity to whether transversely
over town or in another country by strategies for an outside provider in the midst of a system
known as paging whenever GSM plan have desire to discover PDA. Each SIM card having
riddle scratch, known as Ki, that is used for showing their character to cell manage (for avoid
burglary in relationship) by contacting first time, the structure do that through coordinating
Authentication Center of “home" cell alliance, that in like manner had replica of question
key. (Regardless of how confirmation will delivered other than sending a key
obviously2.1.10. Some features of GSM

2.1.10.1 General Packet Radio Service (GPRS)

A bundle exchanged alliance cuts information into clear pieces, known as gatherings, which
may touch base at their target by techniques for various courses, at various occasions, out of
accumulation, or (ideally precisely now and again) not under any condition. A generally
engaging convention, similar to TCP, may be utilized to guarantee the essential information
stream is reassembled at the goal (by setting bunches all together and retransmit missing’s
one if primary). The General Packet Radio Service (GPRS) is a bundle exchanged information
transmissions custom which was joined into the G.S.M. standards in 1998. It is in reverse
incredible frameworks that utilization pre—1,997 forms of the standards. G.P.R.S. does this
by sending gatherings to the territory cell phone shaft (B.T.S.) those channels which are not
used for circuit-exchanged audio calls and information affiliations. Distinctive G.P.R.S.
clients can share a solitary unused direct in light of the manner in which that every one of
them utilizes it just for unplanned short effects. The upside of bundle exchanged affiliations
is that trade speed is just utilized only on presence of information for sending. Communication
of this type are therefore consistently charged in kb rather than perseveringly, and is regularly
a more moderate option for application that just needs to sends and get information

11
sporadically, such as informing. GPRS is normally portrayed as a 2.5G improvement; see the
standard articles for more data.

2.1.10.2 Short Message Service (SMS)

The G.S.M. models at 1st depicted the structures of a short message, and give a procedure for
transmitting’s message among telephones and short, message, service, Centers by techniques
for the Short Message Service (SMS). SMS messages might be passed on among telephones
and SMSCs by any of the circuit-exchanged or partition frameworks portrayed above or,
significantly more typically, by M.A.P. custom through the S.S.7. hailing station utilized for
call setup. S.M.S.C. can be thoughts of as focal planning center concentrations for Short
Messages. Different advantageous association officials utilize their S.M.S.C.s as segments to
outside structures, including’s the internet advancing toward S.M.S. news sources, and one
another (reliably utilizing the recognized SMPP standard). The S.M.S. standard is moreover
utilized outside of the G.S.M. structure; see the standard articles for subtleties.

2.1.11 Phone Identification (SIM cards)

CDMA: On a CDMA (Code-Division Multiple Access) telephone, your record data is


modified into your PDA. On the off chance that you need to change your telephone, you need
to contact your bearer and have them reinvent your new telephone. You will likewise need to
reappear your contact rundown and schedule data into your new telephone. In the event that
you have a considerable measure of contacts, your bearer may have the capacity to enable you
to play out this errand.

GSM: On a GSM telephone your record data alongside your contact list and other individual
information are put away on a SIM card (Subscriber Identity Module) which is a little chip
you can openly remove from your telephone. When you get another cell phone, you can
essentially embed your SIM card into it and it will work with your current record data and
contact list. On the off chance that you travel to another nation, it may even be conceivable to
buy a paid ahead of time SIM card which you can use to abstain from meandering charges.
GSM is a reasonable champ here. The SIM card innovation offers numerous points of interest.

12
2.1.12 GSM cell phone Advantages & Disadvantages

2.1.12.1 Advantages

GSM telephones offer unrivalled sound quality. Foundation sounds, unsettling effects, and
static are immensely diminished and crossed-line discoursed are likewise nearly refrained
from in gsm mobile phones. GSM telephone sound quality is more similar to that of a settled
phone. The critical perfect position of GSM mobiles are International Roaming limit,
uncommon sound quality, negligible more moderate handsets and capacity to oversee high
volumes of clients. Rather than direct telephones, your trades utilizing a gsm wireless inside
the pushed structure are protected and secure. With regular battery life and pushed
improvement, you get twice as much talk time from every battery charge, separated and direct
telephones. Besides the pushed association enables more calls to be overseen at any one time,
in this way reducing stop up in regions of thick masses and high use. GSM PDAs offer
wandering office, which surmises, you can utilize your PDA, and same versatile number in
different nations around the globe who work through GSM structure or you can basically
utilize your SIM card into another GSM remote.

2.1.12.2 GSM remote obstacles

Approved improvement is concentrated among a couple of industry people, making obstacles


to region for new challengers and restricting rivalry among telephone creators. GSM has a
settled most remarkable cell site degree of 35 km, which is compelled by explicit goals. The
GSM framework is the most all things considered utilized advantageous convey trades
structure being used on the planet today. The letters GSM at first addressed the words Group
Special Mobile, yet as it wound up being clear this standard was to be utilized worldwide the
centrality of GSM was changed to Global System for Mobile Communications.

2.2 Wi-Fi Module ESP8266 Srt


The esp8266 Wi-Fi module a free S.O.C. with formed T.C.P/I. P conventions stacks that’s gives
any Micro Controller access to your Wi-Fi deal with. “The E.S.P.8266” can do either promising
an application or offloading all Wi-Fi dealing with points of confinement from another application
processor. E.S.P.8266 has a satisfactorily dazzling into-pile up arranging & limit which engages
and it intertwined along sensor with insignificant upgrade early also immaterial amidst run time.

13
Their irregular condition is on chip joining thinks about irrelevant outer gear, including the front-
end module, is intended to incorporate unimportant PCB zone. The ESP8266 bolsters APSD for
VoIP applications and Bluetooth concurrence interfaces, it contains a self-adjusted RF engaging it
to work under every single working condition, and requires no outside RF parts. There is a decently
boundless wellspring of data accessible for the ESP8266, all of which has been given by dazing
framework bolster. In the Documents parcel underneath you will discover different points of
interest for helps for utilizing the E.S.P.8266, as well as guideline of very competent technique for
converting such modules to Internet of Things blueprint.

2.2.1 Wi-Fi module esp8266 Srt circuit diagram

Figure 2.3 Wi-Fi module Esp8266

14
2.2.2 Wi-Fi module ESP8266 pin configuration

Table 2-1 Wi-Fi module Esp8266 pin configuration

2.2.3 Wi-Fi module esp8266 pin configuration diagram

Figure 2.4 Wi-Fi module Esp8266 pin configuration diagram

15
2.3 Gas sensor MQ 2
The MQ--2 Gas sensors can see or measure gasses like L.P.G., Alcohol, Propane, Hydrogen, CO
and even methane. The module sort of this sensor continues} running with a” Digital Pin which
makes this sensor to work even there is no microcontrollers that breezes up being critical when
you are fundamentally end evoking to review one unequivocal gas. Concerning investigating the
gas in ppm the quick stick must be utilized, the urgent stick moreover TTL driven and handles 5V
and starting now and into the not all that inaccessible can be utilized with most fundamental
microcontrollers. So in case you are pursuing down a sensor to see 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”.

2.3.1 Mq2 gas sensor pin configuration

This breakout board is proposed to work with any of the MQ-course of action gas sensors,
enhancing the interface from 6 to 3 pins—ground, +5V VCC, and a straightforward voltage
yield. Interface VCC to 5 V, GND to ground, and OUT to an easy to-mechanized converter
(ADC). The board has two sets through-opening pins for the required affectability picking
resistor RL transversely over GND and OUT. The restriction of RL should be resolved using
the datasheet for your particular Gas sensors.

Figure 2.5 Mq2 gas sensors

16
Figure 2.6 Mq2 gas sensor with Arduino

2.4 Flame sensor:


Fire Sensor. Can be used to recognize fire source or others light wellsprings of the wavelengths in
the extent of 760.nm –1,100 nm. It relies upon the YG1006 sensor which is a quick and high fragile
NPN silicon phototransistor. In view of its dull epoxy, the sensor is sensitive to infrared radiation.
In putting out flames robot preoccupation, the sensor accepts a basic occupation, it will in general
be used as a robot eyes to find the fire source.

2.4.1 Features

 Groves Interface
 High Photo Sensitivities.
 High response time.
 Simple to utilize
 flexible

17
2.4.2 Flame sensor circuit diagram

Figure 2.7 Flame sensor circuit diagram

2.5 Smoke sensor


Smoke discoverer is a Sensors to distinguishes smokes as basic indications of fire. It gives a banner
to fire ready systems in an immense building, or conveys an equipped for being heard and visual
banner generally in a room or a house smoke locators are regularly housed in a little, rounds shape
plastics, and put at the housetop there are threats of fire or fire. dangers.

2.5.1 Smoke sensor stick design circuit

1. Info VCC
2. D0 stick
3. A0 stick
4. Ground

Figure 2.8 Smoke sensor stick design circuit

18
2.6 Temperature sensor LM35
The L.M.35 “is one sort of ordinarily utilized temperature sensor that can be utilized to quantify
temperature with an electrical o/p in regard to the temperature (in °C). It can gauge temperature
significantly more exactly separate and a thermistor. This sensor makes an exceptional yield
voltage than thermocouples and may not require that the yield voltage is moved forward. The
LM35 has a yield voltage that is contrasting with the Celsius temperature. The scale factor is
.01V/°C. The LM35 does not require any outside switch and keeps up a precision of +/ - 0.4°C at
room temperature and +/ - 0.8°Cover a degree of 0°C to +100°C.One more essential average for
this sensor is that it draws only 60 tinier scale amps from its supply and gains a low self-warming
most distant” point. The LM35 temperature sensor accessible in a broad assortment of packs like
T0-46 metal can transistor-like bundle, TO-92 plastic transistor-like bundle, 8-lead surface mount
SO-8 little configuration bundle.

Figure 2.9 Temperature sensor LM35

2.7 DC Fan
A DC engine is an engine that changes electrical vitality into mechanical vitality by attracting
direct flow. DC engines actuate a revolution development in the machine by electromagnetism.
DC engines have inductors (electromagnet) inside them that make an attractive field that guides
the turn of the engine.

Figure 2.10 DC Fan

19
2.8 Alternate Current Motor(Engine)
The engine that changes over the exchanging current into mechanical power by utilizing an
electromagnetic determination consider is called an AC engine. This engine is driven by an
exchanging current. The stator and the rotor are the two most central parts of the AC engines.
The stator is the stationary piece of the engine, and the rotor is the turning some section of the
engine. The AC engine might be single stage or three stage. The AC engine is commonly asked
for into two sorts. They are the synchronous engine and the choice engine

Figure 2.11 AC Motor

2.9 Bulb AC

Figure 2.12 Bulb AC

2.10 Arduino
Arduino is open source contraptions compose depend on simple to use rigging and programming
Arduino includes physical programmable sheet called microcontroller and programming or an
arranged movement running on a PC which is utilized to make and stack a PC code on a physical
card. Arduino does not require fascinating equipment to reload the new code on the card one can

20
basically utilize a USB interface. The Arduino IDE utilizes improved modification of C++. Which
is an immediate programming.

2.10.1 Why Arduino?

The Arduino creating PC programs is positively not hard to-use for understudies, yet
adequately versatile for forefront customers. It continues running on Mac, Windows, and
Linux. Educators and understudies use it to make unimportant exertion astute instruments, to
show science and material science benchmarks, or regardless programming and set forth a
concentrated exertion sufficiency. Facilitators and artists make regular models, entertainers
and specialists use it for foundations and to inquire about specific avenues with respect to new
melodic instruments. Makers, clearly, use it to manufacture a wide bit of the endeavors
showed up at the Maker Faire, for example. Arduino is a key instrument to learn new things.
Anyone - kids, authorities, talented workers, programming engineers - can start tinkering just
adhering to the plain much planned standards of a pack, or sharing contemplations online with
various people from the Arduino social demand.

o Less costly
o Simple programming
o Cross organize
o Open source and extensible programming
o Open source and extensible rigging

2.10.2 Sorts of Arduino

o Arduino UNO
o Lily cushion Arduino
o Red Board
o Arduino Mega
o Arduino DUE
o Arduino Leonardo

21
2.10.3 Arduino DUE

Figure 2.13 Arduino DUE

2.10.4 Introduction.

It is Arduino that is dependent on 32 bit A.R.M center. Sensible for wide range assignments
and it separate from other Arduino units as it keeps running at 3.3Volt, which is most
unbelievable voltages.

2.10.5 Physical components of Arduino due.

It reliant on Atmel SAM3X8E ARM Cortex-M3 microcontroller is a man from a social event
of Flash microcontrollers subject to the world class 32--bit A.R.M. Cortex- -M3 RISC
processor. It works at a most phenomenal speed of 84 MHz and up to 512 Kbytes of Flash
memory and up to 100 Kbytes of SRAM. Also, its features as search for after.

 A.R.M. Cortex—M.3 amendment 2.0 running at up to 84, MHz

 (M.P.U) Memory Protection Unit

 24--bit Sys, Tick Counter

 Nested Vector Interrupt Controller

22
2.10.6 Memory

 256 to 512 Kb presented flash. 128-piece wide-access-memory, breathing life into expert,
twofold bank.

 Thirty-two 32 to Hundred 100 KB inserted SRAM with twofold banks.

 16 KB R.O.M. with inserted boot loader designs (U.A.R.T., U.S.B.) and I.A.P. designs.

 Static Memory Controller (SMC): SRAM, NOR, NAND strengthen. NFC with 4 Kbyte
RAM support and ECC.

2.10.6 System

Presented voltage controller for single supply development Power-On-Reset (POR), Brown-
out Detector (BOD) and Watchdog for safe reset Quartz or let go resonator oscillators: 3 to
20 MHz standard and discretionary low power 32.768 kHz for RTC or contraption clock
High exactness 8/12 MHz creating plant trimmed interior RC oscillator with 4 MHz default
rehash for quick gadget.

2.10.7 Startup

Moderate Clock Internal RC oscillator as relentless check for contraption check in low-control
mode One PLL for gadget clock and one submitted PLL for USB 2.0 High Speed Mini
Host/Device Temperature Sensor Up to 17 outskirts DMA (PDC) channels and 6-coordinate
focal DMA despite committed DMA for High-Speed USB Mini Host/Device and Ethernet
MAC.2.10.8 Low-control Modes

Rest, Wait and Backup modes, down to 2.5 μA in Backup mode with RTC, RTT, and GPBR

23
2.10.9 FEATURES OF ARDUINO DUE

2.10.10 Arduino DUE Pin functions

Figure 2.14 Arduino DUE Pin functions

24
2.11 indicator light
Marker are phenomenal for endeavors since they give visual beguilement. Marker use a
phenomenal material which releases light when current travels through it. Rather than lights,
Indicator never destroy with the exception of if their present limit is passed. A current of 0.02
Amps (20 mA) to 0.04 Amps (40 mA) is a tolerable range for Indicator. They have a positive
leg and a negative leg just like common diodes. To find the positive side of an Indicator, scan
for a line in the metal inside the Indicator. It may be difficult to see the line. This line is closest
to the positive side of the Indicator. Another technique for finding the positive side is to find a
dimension spot on the edge of the Indicator. This dimension spot is on the negative side. Exactly
when current is traveling through an Indicator the voltage on the positive leg is about 1.4 volts
higher than the voltage on the negative side. Remember that there is no insurance from limit the
current so a resistor must be used in game plan with the Indicator to keep away from destroying
it. It has high splendor board driven markers light in various tints like red, green, yellow, blue
and white. Distinctive volt keeps running in drove pointers lights. Long life working. Various
Volt is available 24v, 110v, 220v.

2.11.1 Diagram of Indicator

Figure 2.15 Diagram of Indicator

25
2.11.2 LCD 16 x 2

LCD (liquid valuable stone introduction) is the advancement used for grandstands in diary
and other more diminutive PCs. Like light-transmitting diode (LED) and gas-plasma
progresses, LCDs allow grandstands to be much slimmer than cathode shaft tube (CRT)
advancement. LCDs use extensively less power than LED and gas-demonstrate appears since
they wear down the standard of blocking light instead of emanating it. A LCD is made with
either an uninvolved system or a working system indicate framework. The dynamic lattice
LCD is generally called a thin film transistor (TFT) appear. The confined structure LCD has
a grid of conductors with pixels arranged at each assembly in the system. A current is sent
across more than two conductors on the cross section to control the light for any pixel. A
working lattice has a transistor arranged at each pixel crossing point, requiring less current to
control the luminance of a pixel. Thus, the current in a working system show can be turned
on and off more frequently, upgrading the screen fortify time (your mouse will appear to move
even more effortlessly over the screen, for example). Some withdrew grid LCD's have twofold
looking at, inferring that they check the system twice with

Current in a comparable time that it took for one scope in the principal development. In any
case, dynamic cross section is up 'til now a common advancement.

2.11.3 16×2 LCD stick design

1. Ground (0V) Ground


2. Supply voltage; 5V (4.7V – 5.3V) Vcc
3. Contrast alteration; the most ideal route is to utilize a variable resistor, for example, a
potentiometer. The yield of the potentiometer is associated with this stick. Turn the
potentiometer handle forward and in reverse to modify the LCD contrast.
Vo/VEE
4. Selects direction enrol when low, and information enlist when high RS (Register
Select)
5. Low to keep in touch with the enlist; High to peruse from the register Read/compose
6. Sends information to information pins when a high to low heartbeat is given; Extra
voltage push is required to execute the guidance and EN(enable) flag is utilized for
this reason. Ordinarily, we make it en=0 and when we need to execute the guidance

26
we make it high en=1 for a few milliseconds. After this we again make it ground that
is, en=0. Enable
7. 8-piece information pins DB0
8. DB1
9. DB2
10. DB3
11. DB4
12. DB5
13. DB6
14. DB7
15. Backlight VCC (5V) Led+
16. Backlight Ground (0V) Led-

2.11.4 Interfacing 16×2 LCD to Arduino

RS stick of the LCD module is connected with motorized stick 12 of the Arduino. R/W stick
of the LCD is grounded. Empower stick of the LCD module is connected with robotized stick
11 of the Arduino. In this undertaking, the LCD module and Arduino are interfaced in the 4-
bit mode. This proposes just four of the modernized information lines (DB4 to DB7) of the
LCD are utilized. This strategy is to an extraordinary degree major, requires less affiliations
and you can about use the most outrageous limit of the LCD module. Impelled lines DB4,
DB5, DB6 and DB7 are interfaced to computerized pins 5, 4, 3 and 2 of the Arduino. The
10K potentiometer is utilized for changing the division of the presentation. 560-ohm resistor
R1 limits the current through the landscape light LED. The Arduino can be filled through the
outside power jack gave on the board. +5V required in some phenomenal parts of the circuit
can be drawn from the 5V source on the Arduino board. The Arduino can be in like way
controlled from the PC through the USB port. The full program for interfacing LCD to
Arduino is shown as seeks after.

27
Figure 2.16 Interfacing 16×2 LCD to Arduino

2.12 Buzzer
This signal is a functioning ringer, which essentially implies that it will buzz at a predefined
recurrence (2300 ±300 Hz) all alone notwithstanding when you simply apply unfaltering DC
control. On the off chance that you are searching for a bell can create fluctuated tones from a
wavering info flag, at that point investigate our aloof ringer. A few people like to get dynamic bells
since they can utilize them with consistent DC control yet additionally have the capacity to create
some assortment of tones by applying a wavering sign. Some view them as more adaptable than
their cousin, the inactive ringer, which is the sort that requires a wavering sign to make any tone.
It is conceivable, and regularly done, to in any case make diverse tones through a functioning
ringer when you apply a swaying sign to the bell, however the range of conceivable distinctive
tones is extremely restricted and not as fresh or clean of sound as can be created with an aloof
ringer. One preferred standpoint to a functioning signal is that you can in any case create a sound
from the ringer associated with a microcontroller, for example, an Arduino, by simply driving a
standard high yield on the associated stick. The advantages of this are you don't have to utilize
handling power, equipment clocks, or extra code to create sound.

28
2.12.1 Buzzer specifications

Rated Voltage 5V

Operating Voltage 4~8 V

Max Rated Current ≤32 mA

Min. Sound Output at 10cm 85 dB

Resonant Frequency 2300 ±300 Hz

Operating Temperature -20°C to 45°C

Dimensions (Excluding Pins)

Height 9.16 mm (0.36")

Diameter 11.78 mm (0.46")

Weight 1.6 g (0.057 oz.)

2.12.2 Buzzer diagram

Figure 2.17 Buzzer

29
2.13 Relay
An exchange is an electrically worked switch. Numerous exchanges use an electromagnet to
mechanically fill in as witch, anyway other working guidelines are also used, for instance, and
solid state exchanges. Exchange used where it is vital to control a circuit by a low-control
movement (with complete electrical detachment among control and controlled circuits), or where
a couple of circuits must be controlled by one banner. A sort of exchange that can manage the high
power required to explicitly control an electric motor or diverse weights is known as a contactor.
Solid state exchanges control circuits with no moving parts, rather using a semiconductor device
to perform trading. Exchanges with adjusted working characteristics and every so often various
working twists are used to shield electrical circuits from over-weight or faults; in present day
electric power systems these limits are performed by mechanized instruments still called "cautious
exchanges".

Figure 2.18 Relay

2.13.1 Basic design and operation

A fundamental electromagnetic hand-off includes a circle of wire collapsed over a fragile iron
focus, an iron weight which gives a low reluctance approach to alluring movement, a versatile
iron armature, and somewhere around one game plans of contacts (there are two in the
exchange imagined). The armature is turned to the weight and mechanically associated with
no less than one courses of action of moving contacts. It is held set up by a spring so when the
exchange is de-engaged there is an air opening in the appealing circuit. In this condition, one

30
of the two plans of contacts in the exchange imagined is closed, and the other set is open.
Diverse exchanges may have progressively or less game plans of contacts depending upon
their ability. The move in the picture furthermore has a wire interfacing the armature to the
weight. This ensures congruity of the circuit between the moving contacts on the armature,
and the circuit track on the printed circuit board (PCB) by methods for the weight, which is
fixed to the PCB. Right when an electric stream is experienced the circle it delivers an
appealing field that orders the armature, and the resulting advancement of the versatile
contact(s) either speaks to the critical point in time (dependent upon improvement) a
relationship with a settled contact. If the course of action of contacts was closed when the
hand-off was de-animated, by then the advancement opens the contacts and breaks the
affiliation, and the different way contacts were open. Right when the current to the circle is
killed, the armature is returned by a power, around half as strong as the alluring force, to its
easygoing position. Ordinarily this power is given by a spring, anyway gravity is furthermore
used normally in present day motor starters. Most exchanges are created to work quickly. In
a low-voltage application this lessens commotion; in a high voltage or current application it
diminishes.

2.13.2 Relay Module Used in Project

Figure 2.19 Relay module

2.14 Transformer
Transformer is a static gadget that changes over electric power starting with one voltage level then
onto the next voltage level at same recurrence yet with various voltage levels. In the transformer,
increasing the current level will decrease in voltage level and vice versa

31
Transformer have two types:

1. Step-Up Transformers

2. Step-Down Transformers

In our project we can used the step-down transformer in 220v to 15v AC voltage.

2.14.1 Transformer circuit Diagram

Figure 2.20 Transformer circuit diagram

2.15 Bridged Rectifier


A diode connect is a gadget that changes Alternating Current (AC) to Direct Current (DC). The
contrast between these two sorts are that, AC is beat power exchanging polarities 50-60 times each
second. (On the off chance that you take a gander at electronic gadgets it says that it keeps running
on 50 Hertz AC) Switching polarities= - to + and + to - multiple times in a second. DC is a ceaseless
current turning out. Model batteries. The polarities don't change in DC. The issue with AC is that
you can't accuse batteries of it.

32
Figure 2.21 Bridged Rectifier

2.16 Regulator IC LM7812


The LM78XX arrangement of three terminal positive controllers are accessible in the TO-220
bundle and with several settled yield voltages, making them pleasing in an expansive grouping of
vocations. Each sort utilizes inside current constraining, warm closed down and safe working space
security, making it basically indestructible. In the event that alluring warmth sinking is given, they
can disregard on 1A yield current. In spite of the fact that sorted out basically as settled voltage
controllers, these gadgets can be utilized with outer bits to get portable voltages.

Figure 2.22 IC LM7812

2.16.1 Features

 PDIP-16 package

 Output Current is 1A

 Output Voltage is 12V

33
 Thermal Overload Protection

 Short Circuit Protection

 Output Transistor Safe Operating Area Protection

2.16.2 Package includes

 1 x LM7812 12V Regulator IC

2.16.3 Pin configuration

Figure 2.23 LM781 pin

2.17 Regulator IC LM7805


These IC’s LM78XX are same electronic IC’s for different voltage. In this IC LM7805 IC output
is the 5v dc.

Figure 2.24 LM7805 IC

34
2.17.1 Pin configuration

Figure 2.25 LM7805 pin

2.18 DC to DC converter
A DC-to-DC converter is an electronic circuit or electromechanical contraption that changes over
a wellspring of direct current (DC) beginning with one voltage level then onto the following. It is
a kind of electric power converter. Power levels go from low (little batteries) to (high-voltage
control transmission).

Figure 2.26 DC to DC converter

2.19 Triac
The TRIAC is a three terminal semiconductor contraption for controlling current. It is suitably an
enhancement of the SCR or thyristor, yet not in any way like the thyristor which is simply prepared
to lead one way, the TRIAC is a bidirectional device. The TRIAC is a section that is suitably
established on the thyristor. It gives AC changing to electrical systems. Like the thyristor, the
TRIACs are used in various electrical trading applications. They find explicit use for circuits in
light dimmers, etc., where they engage the two sections of the AC cycle to be used. This makes
them more profitable with respect to the utilization of the power available. While it is possible to
use two thyristor continuous, this isn't by and large adroit for negligible exertion and decently low

35
power applications. It is possible to see the assignment of a TRIAC in regards to two thyristor put
back to back.

Figure 2.27 Triac circuit

One of the disadvantages of the TRIAC is that it doesn't switch symmetrically. It will
frequently have a counterbalanced, exchanging at various entryway voltages for every 50% of
the cycle. This makes extra sounds which isn't useful for EMC execution and furthermore gives
a lopsidedness in the framework In request to enhance the exchanging of the present waveform
and guarantee it is more symmetrical is to utilize a gadget outside to the TRIAC to time the
activating heartbeat. A DIAC put in arrangement with the entryway is the typical strategy for
accomplishing this.

Figure 2.28 Triac

2.20 pc817 opt coupler


This application note depends on Renessa pick couplers. The plan is to address a few inquiries that
end clients have had, for example, how to work with CTR, how to drive an IRED, and
understanding the development of a pick coupler. This application note will allude to other

36
application. notes presently posted on the CEL site. A standard select coupler gives flag exchange
between a secluded info and yield through an infrared Emitting Diode (IRED) and a silicon
phototransistor. The IRED sends a light emission vitality to an optical beneficiary inside a solitary
bundle with a light directing medium between the producer and identifier. This instrument gives
finish electrical disengagement of electronic circuits from contribution to yield while transmitting
data from one side to the next, and starting with one voltage potential then onto the next.

2.20.1 Pc817 opt coupler circuit diagram

Figure 2.29 Pc817 opt coupler circuit diagram

37
Chapter 3 THE INDUSTRIAL
AUTOMATION AND IoT
Current computerization is the use of control systems, for instance, PCs or robots, and information
progresses for dealing with different techniques and mechanical assemblies in an industry to
override a man. It is the second step past robotization in the degree of industrialization.

3.1 Increase Quality and Flexibility in Your Manufacturing Process


Prior the clarification behind mechanization was to manufacture profitability (since robotized
structures can work 24 hours of the day), and to reduce the cost related with human administrators
(i.e. compensation and focal points). In any case, today, the purpose of assembly of
computerization has moved to developing quality and adaptability in a gathering framework. In
the vehicle business, the establishment of barrels into the motor used to be performed physically
with a botch rate of 1-1.5%. After a short time, this errand is performed utilizing robotized gear
with a goof rate of 0.00001%.

3.2 Advantages of Industrial Automation


Lower working cost: Industrial robotization disposes of social assurance costs and paid leave and
occasions related with a human chief. Further, current robotization does not require other worker
focal points, for example, rewards, annuity consolidation, and so forth. Most importantly, paying
little respect to how it is associated with a high beginning cost it spares the month to month wages
of the laborers which prompts basic cost theory resources for the affiliation. The upkeep cost
related with hardware utilized for mechanical robotization is less in light of the manner in which
that it doesn't from time to time come up short. On the off chance that it bombs, just PC and support
engineers are required to settle it.

3.2.1 High productivity

Be that as it may, different affiliations use various creation specialists for an up to three
advancements to run the plant for the craziest number of hours, the plant still should be shut
for help and occasions. Present day computerization satisfies the reason for the relationship
by engaging the relationship to run a social affair plant for 24 hours in multi day 7 days in a
week and 365 days a year. This prompts a basic update in the efficiency of the affiliation.

39
3.2.2 High Quality

Robotization mitigates the mistake related with an individual. Further, in contrast to


individuals, robots don't include any weakness, which results in items with uniform quality
produced at various occasions.

3.2.3 High flexibility

Including another assignment in the sequential construction system requires preparing with
a human administrator, in any case, robots can be customized to do any undertaking. This
makes the assembling procedure more adaptable.

3.2.4 High Information Accuracy

Including robotized information gathering, can enable you to gather key creation data,
enhance information precision, and lessen your information accumulation costs. This
furnishes you with the certainties to settle on the correct choices with regards to diminishing
waste and enhancing your procedures.

3.2.5 High safety

Modern computerization can make the generation line alright for the representatives by
conveying robots to deal with unsafe conditions. Disservices of Industrial Automation

3.2.6 High Initial cost

The underlying venture related with the creation the change from a human generation line to
a programmed creation line is high. Additionally, significant expenses are engaged with
preparing workers to deal with this new refined hardware.

3.3 Conclusion
Industrial automation (Mechanical mechanization) has as of late discovered increasingly
acknowledgment from different businesses as a result of its gigantic advantages, for example,
expanded profitability, quality and security at low expenses.

40
3.4 Internet of Things (IoT)
In this section we will discuss about the internet of think (IOT), IoT works, Benefits of IoT, The
future of IoT and Application of IoT

3.4.1 Internet

The Internet, now and again called basically "the Net," is a general game plan of PC
frameworks - an arrangement of frameworks in which customers at any one PC can, in case
they have assent, get information from some other PC (and a portion of the time talk clearly
to customers at various PCs). The Internet is directly comprehensively used as an accessibility
device for informative, business, and individual applications. The Internet is a stimulating
portal that makes it possible for customers to get to for all intents and purposes an unending
supply of information.

3.4.2 Internet of things (IoT)

IOT or web of things is an advancement that deals with bringing control of physical devices
over the web. Here we propose viable industry motorization structure that empowers customer
to beneficially control industry mechanical assemblies/machines over the web. For appearing
of this structure we use 3 stacks as present day contraptions or machines and a motor to show
as a mechanical motor. Our structure uses an Avr family microcontroller for dealing with all
customer headings. A Wi-Fi modem is used to interface with the web and get customer
headings. On sending bearings through the web they are first gotten by our Wi-Fi modem. The
modem interprets information and passes it to the microcontroller for further planning. The
microcontroller then switches stacks and works the motors as indicated by beneficiary's
bearings. Moreover, it demonstrates the system state on a LCD appear. Thusly we motorize
entire industry using on the web GUI for basic industry computerization.

41
Figure 3.1 IoT

3.4.3 Internet of things (IoT) works

An IoT natural network contains web-enabled adroit devices that usage introduced processors,
sensors and correspondence gear to assemble, send and follow up on data they secure from
their environment. IoT contraptions share the sensor data they assemble by interfacing with
an IoT entry or other edge device where data is either sent to the cloud to be inspected or
examined locally. Once in a while, these devices talk with other related contraptions and
follow up on the information they get from one another. The contraptions do most by far of
the work without human intercession, regardless of the way that people can collaborate with
the devices - for instance, to set them up, give them headings or access the data. The
accessibility, frameworks organization and correspondence traditions used with these web-
enabled contraptions, all things considered, depend upon the unequivocal IoT applications
passed on.

42
3.5 Internet of things (IoT) system

Figure 3.2 IoT System

3.6 Benefits of Internet of things (IoT)


The snare of things offers different focal points to affiliations, enabling them to:

• Monitor their general business frames.

• Improve the customer experience.

• Save time and money.

• Enhance labourer effectiveness.

• Integrate and change designs of activity.

• Make better business decisions. and,

• Generate more salary.

43
3.7 Internet of things (IoT) application

Figure 3.3 IoT Applications

3.8 The future of Internet of things (IoT)


There is no absence of IoT publicize estimations. For example:

 Bain and Company expects yearly IoT salary of gear and programming to outperform
$450 billion by 2020.
 McKinsey and Company measures IoT will have a $11.1 trillion impact by 2025.
 IHS Market confides in the amount of related IoT devices will increase 12% consistently
to accomplish 125 billion of each 2030.
 Gartner assesses that 20.8 billion related things will be utilized by 2020, with total spend
on IoT contraptions and organizations to reach $3.7 trillion of each 2018.

44
Chapter 4 Simulation
Simulation is a very powerful tool to understand how the device will work after implementing in
real. Before start any project, it is a good practice to simulate it and virtually verify that works.
Proteus is a simulation base software.

In this chapter we show simulation of different parts or different circuit’s simulation of our project
that is GSM module simulation, WIFI module simulation, Arduino Due simulation, sensors
simulation i.e. fire sensor, smoke sensor, gas sensor, temperature sensor, LCD simulation, Arduino
plus GSM module simulation.

4.1 220 volts AC to 15 volts DC supply proteus simulation

Figure 4.1 220 volts AC to 15 volts DC supply proteus simulation

The figure 4.1 shows the simulation of Ac to Dc power supply in which we are converting an
Alternate current of 220 volts to Direct current of 15 volts
4.2 GSM module simulation

Figure 4.2 GSM module simulation

Figure 4.3 GSM module simulation

In this Figure 6.1A is the simple simulation of the GSM is shown and checking the response of
the GSM. And in the second figure which is figure 6.1b is shows some simple basic commends
which are been supported by the proteus these commands are used for sending and receiving
messages.

47
4.3 GAS sensor simulation

Figure 4.4 GAS sensor simulation

In this we use a GAS sensor which is MQ5 blue led at the output, giving VCC to the Sensor input
and we also have a test pin. The LED is connected with the output terminal and also being ground.

If we start the program and make the test pin 1 then the LED will glow because the voltage cross
across the LED and when we make test pin 0 then the LED will become off.

4.4 Simulation of Gas sensor with Arduino

Figure 4.5 Simulation of Gas sensor with Arduino

48
In this simulation we use a GAS sensor which is MQ5 with Arduino, making interfacing between
Arduino and Gas sensor, blue LED, at the output and giving VCC to the Sensor and we also have
a test pin. The LED is connected with the output terminal and also being ground.

If we start the program and make the test pin 1or high, then the LED will glow because the voltage
cross across the LED and when we make test pin 0 or low then the LED will become off.

4.5 simulation of Temperature sensor.

Figure 4.6 Simulation of Temperature sensor

We take a temperature sensor LM 35 and also DC volt meter for measuring the voltage as the
voltage is increasing the heat is increasing on the site as the heat is been sensed by the temperature
sensor it shows the output. The temperature sensor updates the readings according’s to the decrease
and increase in voltages and Room temperature.

49
4.6 Arduino DUE simulation

Figure 4.7 Arduino DUE simulation

This figure shows the simulation of Arduino. We are going to simulate Arduino in Proteus. We
will test Arduino Blink program with Proteus. If the LED blinks it means that the simulation is
perfect.

4.7 Simulation of flame sensor

Figure 4.8 Simulation of flame sensor

50
4.8 Simulation of Smoke sensor interfacing with LCD through Arduino

Figure 4.9 Simulation of Smoke sensor interfacing with LCD through Arduino

4.9 GSM module and Arduino Simulation

Figure 4.10 GSM module and Arduino Simulation

This simulation shows the GSM interfacing with Arduino we did this simulation for texting and
messaging purposes.

51
4.10 Firebase

Figure 4.11 Firebase

The firebase is the free mobile and Web application development platform which provides
users to develop high quality apps, this is free application offered by the Google to their users.
The Firebase Real Time Database is a cloud hosted NoSQL database which lets you store and
sync between your users in realtime.

The Realtime Database is really just one big JSON object that the developers can manage in
realtime. Its database gives your app the current as well as updates on that data by using just
one API. The user can access data from any device by feature of realtime synchronization.

To use this application one must have to sign in to the application through his Gmail account
through internet after that one can be able to excess and work on it.Fire base has the features
of cloud messaging’s which is called Google cloud messaging it provide cross platform
solution for messages and notification for android and WEB.

52
4.11 Firebase Application mobile display

Figure 4.12 Firebase Application mobile display

The above figure no 4.12 shows the mobile display of our project in which we see the three
outputs which is fan light and bulb also the speed of motor which is shown on the yellow line
in this figure we have all the outputs appliances is FF it is shown in the below green blocks
which shows the ON/ OFF status of the outputs appliances or electronics devices (Fan, Light).
In this figure the speed of motor is low which is shown by the yellow line

53
4.12 Firebase Application mobile display

Figure 4.13 Showing different stats in Firebase Application

The speed of the motor in this figure shows it is on normal speed that is nor it is very high nor it is
moving with very low speed so this time the motor is at constant speed, but all the others Electrical
devices (Fan, Bulb) is OFF.

54
4.13 Firebase Application mobile display

Figure 4.14 Motor at high speed in Firebase Application.

In this figure the speed of the motor is at high speed and moving with full rpm while the other
outputs are off.

55
Chapter 5 Hardware implementation
In this section you will study the hardware implementation.

5.1 block diagram of industry automation

Figure 5.1 Block diagram of Industrial automation

This is the block diagram of our project which the main controller is Arduino. The Arduino is
interfacing to the all components of the project. The main power supply is consisting of two DC
voltage 5v and 12v. 5v used for the Arduino and the 12v used for the DC fan. The switching device
of the project is relays which is used for both DC and AC. The output has consisted of DC fan,
AC motor, and AC light. The DC fan is 12v, AC motor and light is 220v.the four sensor used in
the project tempter sensor, gas sensor, smoke sensor and flam sensor. And all the input and output
automation is display through the 16x2 LCD. And control the help of internet by using the WI-FI
and GSM module.

57
5.2 Circuit diagram of Project

Figure 5.2 Project Circuit diagram

The above is the Circuit diagram of our project which the main controller is Arduino. The Arduino
is interfacing to the all components of the project. The main power supply is consisting of two DC
voltage 5v and 12v. 5v used for the Arduino and the 12v used for the DC fan. The switching device
of the project is relays which is used for both DC and AC. The output consists of DC fan, AC
motor, and AC light. The DC fan is 12v, AC motor and light is 220v.the four sensor used in the
project which is (tempter sensor, gas sensor, smoke sensor and flam sensor). And all the input and
output automation is display through the 16x2 LCD. And control the help of internet by using the
WI-FI and GSM module

58
Chapter 6 Conclusion and Future Work
These are some conclusions of project “Web Base industrial automation using Arduino DUE”
advantages and applications and some Future work as well.

6.1 Conclusion
Prior we used to screen the things by utilizing RFID framework where it was utilized for short
length Communication. To decrease the manual overhead, the thing which we are presenting is
internet of things based industrial automation system which can conquer the RFID shorter length
issue. Utilizing IOT at industrial level we can screen and control the mechanical hardware all the
more effectively.

6.2 Advantages
 Possibility to control & monitor at longer distance
 Faster manufacturing and less expensive hard work price.
 Can carry out the assignment beyond the human capability.

6.3 Applications
Home applications: Small appliances like TV, fans, fridge can be monitored and controlled by
artificial Intelligence Industries
Offices: Monitoring and controlling the machines and instruments using the IoT technique.
Hospitals and labs: Doctor can examine the current status of the patient using his android phone
by placing the sensors on patient’s body using the artificial intelligence and IoT

6.4 Future work


The automated industries do NOT extrapolate to littler and less expensive PLCs, DCSs, and
supervisory control and information securing frameworks; those capacities will just be inserted in
equipment and programming. Rather, future development will originate from absolutely new
bearings. New innovation headings.

6.5 New technology directions


Industrial automation can and will create hazardous development with innovation identified with
new affectation focuses: nanotechnology and Nano scale get together frameworks; MEMS and
nanotech sensors (modest, low-control, ease sensors) which can quantify everything and anything;
and the inescapable Internet, machine to machine (M2M) organizing. Continuous frameworks will

60
offer approach to complex versatile frameworks and multi-preparing. The future has a place with
nanotech, remote everything, and complex versatile frameworks. Major new programming
applications will be in remote sensors and disseminated distributed systems – minor working
frameworks in remote sensor hubs, and the product that enables hubs to speak with one another as
a bigger complex versatile framework. That is the rush of things to come.

61
Appendix
Project Code:
#include <FirebaseArduino.h>

#include <ESP8266WiFi.h>

#define FIREBASE_HOST "industrial-df178.firebaseio.com" ////https://industrial-df178.firebaseio.com/

#define FIREBASE_AUTH "uzPqLzjSWTsGITlTrgPfSOuGzb6g1btnbUdVZ6du" //links

#define WIFI_SSID "nlink" // Change the name of your WIFI

#define WIFI_PASSWORD "12345678" // Change the password of your WIFI

//#define WIFI_SSID "D-Link" // Change the name of your WIFI

//#define WIFI_PASSWORD "islamabad" // Change the password of your WIFI

String inputString = ""; // a string to hold incoming data

boolean stringComplete = false; // whether the string is complete

void setup() {

Serial.begin(9600);

inputString.reserve(200);

pinMode(2,INPUT);

pinMode(5,INPUT);

pinMode(4,INPUT);

pinMode(13,INPUT);

pinMode(15,INPUT);

delay(1000);

WiFi.begin (WIFI_SSID, WIFI_PASSWORD);

while (WiFi.status() != WL_CONNECTED) {

delay(500);

Serial.print(".");

62
}

// dht.begin();

Serial.println ("");

Serial.println ("WiFi OK!");

// Firebase.begin(FIREBASE_HOST);

Firebase.begin(FIREBASE_HOST,FIREBASE_AUTH);

Firebase.setInt("S1",1);

Firebase.setInt("S2",1);

Firebase.setInt("S3",1); //Here the varialbe"S1","S2","S3" and "S4" needs to be the one which is used
in our Firebase and MIT App Inventor

Firebase.setInt("Num",0);

Firebase.setInt("Temp",0);

Firebase.setInt("Fire",0);

Firebase.setInt("Smoke",0);

Firebase.setInt("Gass",0);

int val1;

int val2;

int val3;

int nn=0;

void firebasereconnect()

Serial.println("Trying to reconnect");

Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);

void loop() {

63
if (Firebase.failed())

Serial.print("ZZZ:");

Serial.println(Firebase.error());

firebasereconnect();

return;

val1=Firebase.getString("S1").toInt();

val2=Firebase.getString("S2").toInt();

val3=Firebase.getString("S3").toInt();

int speed_=Firebase.getString("SP").toInt();

if(val1==1)

Serial.write('a');

}else

Serial.write('s');

if(val2==1)

Serial.write('d');

}else

Serial.write('f');

64
if(val3==1)

Serial.write('g');

}else

Serial.write('h');

// Serial.println(val1); //FAN a s

// Serial.println(val2); //Light d f

//Serial.println(val3); //motor g h

//Serial.print("Speed ");

Serial.println(speed_);

delay(100);

Firebase.setInt("Num", nn);

Firebase.setInt("Fire",digitalRead(5));

Firebase.setInt("Smoke",digitalRead(4));

Firebase.setInt("Gass",digitalRead(13));

Firebase.setInt("Temp",digitalRead(15));

nn++;

delay(3000);

void serialEvent() {

while (Serial.available()) {

// get the new byte:

65
char inChar = (char)Serial.read();

if(inChar=='$')

inputString="";

inputString += inChar;

if (inChar == '*') {

stringComplete = true;

//#include <SoftwareSerial.h>

#include <TimerOne.h>

#include <LiquidCrystal.h>//we included library for lcd

LiquidCrystal lcd(33, 31, 29, 27, 25, 23);//this is for lcd pin attachments with arduino this way we tell our
arduino software that lcd pins are these pins on arduino

////

// Include the libraries we need

#include <OneWire.h>

#include <DallasTemperature.h>

// Data wire is plugged into port 2 on the Arduino

#define ONE_WIRE_BUS A6

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas
temperature ICs)

OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.

66
DallasTemperature sensors(&oneWire);

/////////////////////

int self=49;

int lod=51;

boolean manual=1;

float power_limit=130;

boolean gen_on=0;

boolean gen_off=0;

unsigned int v=220;

int over_load_cut=4;

float system_power=0;

#define DEBUG true

//

float fuel_l1=10;/////////////

float water_l1=5;////////////////

float gen_volt=0;

float load_current=0;

///

boolean brsf=0;

boolean frsf=0;

boolean blsf=0;

boolean flsf=0;

boolean ds=1;

float temperature_globle=20;

float smoke_globle=80.4;

67
float globle_bv=13.2;

float globle_gv=223;

float globle_wl=43;

float globle_ol=43.2;

///

float bvoltage=0;

float voltage=0;

float water_level=0;

float fuel_level=0;

int y=0;

int change_over=3;

boolean update_f=0;

int light1=43;

int light2=39;

int light3=41;

int fan=51;

int light=47;

int motor=49;

//////////////

float globle_temp=0;

float globle_bpercent=0;

String battery_percent_string="";

String temp_string="";

boolean inv_f=0;

68
float temp=0;

float smoke=0;

float fire=0;

float gass=0;

int te=8;

int fe=9;

int se=10;

int ge=11;

int buzzer=43;

boolean now_go=0;

long cycle_c=0;

int motor_ss=5;

boolean tv=0;

void setup()

Serial.begin(250000);

Serial1.begin(9600); // your esp's baud rate might be different

Serial2.begin(9600);

pinMode(8,OUTPUT);pinMode(9,OUTPUT);

pinMode(10,OUTPUT);pinMode(11,OUTPUT);

///

pinMode(43,OUTPUT);

pinMode(7,OUTPUT);

pinMode(fan,OUTPUT);//trig2

pinMode(light,OUTPUT);//trig2

69
pinMode(motor,OUTPUT);//trig2

digitalWrite(buzzer,0);

digitalWrite(fan,1);

digitalWrite(light,1);

digitalWrite(motor,1);

delay(2000);

lcd.begin(16, 2);

lcd.print(" DC Nano ");

lcd.setCursor(0,1);

lcd.print("System");

delay(2000);

pinMode(13,OUTPUT);

inv_f=1;

keep_a();//AT\r this is simple AT command to test the modem

eco_off();//ATE0\r// giving eco off command to modem asking the modem to stop giving eco.

//Serial2.print("AT+CLIP=1");Serial2.write('\r');delay(1000);

Serial2.print("AT+CMGF=1");Serial2.write('\r');

long tyu=millis();

while(millis()-tyu<1000)

serialEvent2();

// making modem enter in to the text mode.

delet_msg();// deleting all msges which are stored in the modem

sms_forwarding();

70
sensors.begin();

//////////

pinMode(3, OUTPUT);

Timer1.initialize(10000); // set a timer of length 100000 microseconds (or 0.1 sec - or 10Hz => the led
will blink 5 times, 5 cycles of on-and-off, per second)

Timer1.attachInterrupt( timerIsr ); // attach the service routine here

attachInterrupt(digitalPinToInterrupt(2), blink, RISING);

boolean u=0;

boolean fault=0;

int fault_counter=0;

boolean gass_f=0;

boolean fire_f=0;

boolean smoke_f=0;

boolean app_cmd=0;

void loop()

get_sensor();

temp=get_temp();

if(temp<28)

if(app_cmd)

digitalWrite(fan,1);

71
if(temp>=30)

digitalWrite(fan,0);

lcd.clear();

lcd.print(temp,1);lcd.print("*C ");

lcd.print("( ");

fault=0;

if(smoke<500)

lcd.print("1 ");

fault=1;

digitalWrite(se,1);

smoke_f=1;

}else

smoke_f=0;

lcd.print("0 ");digitalWrite(se,0);

if(fire<500)

fault=1;

fire_f=1;

lcd.print("1 ");digitalWrite(fe,1);

}else

72
{

fire_f=0;

lcd.print("0 ");digitalWrite(fe,0);

if(gass<500)

fault=1;

gass_f=1;

lcd.print("1 ");digitalWrite(ge,1);

}else

gass_f=0;

lcd.print("0 ");digitalWrite(ge,0);

if(temp>50)

fault=1;

digitalWrite(te,1);

}else

digitalWrite(te,0);

lcd.print(")");

Serial1.print("$,");

Serial1.print(temp,1);Serial1.write(',');

73
Serial1.print(smoke_f);Serial1.write(',');

Serial1.print(fire_f);Serial1.write(',');

Serial1.print(gass_f);

Serial1.println(",*");

Serial.print(temp,1);Serial.print(" *C ");

Serial.print(smoke);Serial.print(" ");

Serial.print(fire);Serial.print(" ");

Serial.print(gass);Serial.println("");

if(fault)

if(++fault_counter>5)

send_sms_Theft();// //////////////////////////////////////////////////

fault_counter=0;

digitalWrite(buzzer,1);

}else

digitalWrite(buzzer,0);

long t=millis();

while(millis()-t<500)// it was 1000

serialEvent();

serialEvent1();

74
}

//

unsigned int over_load_counter=0;

/////

boolean show_f=0;

void serialEvent() {

while (Serial.available()) {

// get the new byte:

char inChar = (char)Serial.read();

if (inChar == 'a') {

digitalWrite(fan,0); //Serial.println("Fan on");

if (inChar == 's') {

digitalWrite(fan,1);//Serial.println("Fan off");

if (inChar == 'd') {

digitalWrite(light,0); //Serial.println("Light on");

if (inChar == 'f') {

digitalWrite(light,1);//Serial.println("Light off");

if (inChar == 'g') {

digitalWrite(motor,0); //Serial.println("Motor on");

75
if (inChar == 'h') {

digitalWrite(motor,1);//Serial.println("Motor off");

if (inChar == 'q') {

if(motor_ss<9)

motor_ss++;

//show_f=1;

if (inChar == 'w') {

if(motor_ss>3)

motor_ss--;

//show_f=1;

if(inChar>='0'&&inChar<='7')

int nnvv=inChar-'0';

nnvv=7-nnvv;

nnvv=nnvv+3;

motor_ss=nnvv;

76
}

////

void serialEvent1() {

while (Serial1.available()) {

// get the new byte:

char inChar = (char)Serial1.read();

Serial.write(inChar);

if (inChar == 'a') {

app_cmd=0;

digitalWrite(fan,0); //Serial.println("Fan on");

if(inChar == 's') {

app_cmd=0;

if(temp<30)

digitalWrite(fan,1);//Serial.println("Fan off");

if (inChar == 'd') {

digitalWrite(light,0); //Serial.println("Light on");

if (inChar == 'f') {

digitalWrite(light,1);//Serial.println("Light off");

if (inChar == 'g') {

77
digitalWrite(motor,0); //Serial.println("Motor on");

if (inChar == 'h') {

digitalWrite(motor,1);//Serial.println("Motor off");

if (inChar == 'q') {

if(motor_ss<9)

motor_ss++;

//show_f=1;

if (inChar == 'w') {

if(motor_ss>3)

motor_ss--;

//show_f=1;

if(inChar>='0'&&inChar<='7')

int nnvv=inChar-'0';

nnvv=7-nnvv;

nnvv=nnvv+3;

motor_ss=nnvv;

78
}

boolean inverter_cycle=0;

///

///

void get_sensor()//A0 smoke A1 A2 A3

int u=0;

temp=0;

smoke=0;

fire=0;

gass=0;

for(u=0;u<5;u++)

temp+=analogRead(A0);

smoke+=analogRead(A1);

fire+=analogRead(A2);

gass+=analogRead(A3);

temp=temp/5;

smoke=smoke/5;

fire=fire/5;

gass=gass/5;

temp=(float)temp/204.8;

79
temp=(float)temp/0.01;

////

void send_sms_Theft()

Serial2.print("AT");Serial2.write(13);

check_response();

Serial2.print("AT+CMGS=");Serial2.write('"');

Serial2.print("03455060707");

Serial2.write('"');Serial2.write(13);

check_response();

if(temp>50)

Serial2.println("Over Heat ");

if(smoke<500)

Serial2.println("Smoke");

if(fire<500)

Serial2.println("Fire");

if(gass<500)

80
Serial2.println("Gass leakage");

Serial2.write(26);

long tttt=millis();

while(millis()-tttt<4000)

check_response();

/////////

String inputString="";

void keep_a()

Serial.println("Keep Alive ");

Serial2.write('A');delay(100);Serial2.write('T');delay(100);Serial2.write('\r');

int u=0;

do{

serialEvent2();

delay(10);

u++;

}while(u<100);

//delay(1000);//AT\r --> OK

Serial2.write('A');delay(100);Serial2.write('T');delay(100);Serial2.write('\r');//delay(1000);//ATE0

u=0;

do{

81
serialEvent2();

delay(10);

u++;

}while(u<100);

void eco_off()

{int u=0;

Serial.println("Eco Off ");


Serial2.write('A');delay(100);Serial2.write('T');delay(100);Serial2.write('E');delay(100);Serial2.write('0');d
elay(100);Serial2.write('\r');

do{

serialEvent2();

delay(10);

u++;

}while(u<100);

//

void check_response()

String sms="";

inputString="";

int uuuui=0;

do

serialEvent2();

delay(1);

82
uuuui++;

}while(uuuui<1000);

//

void sms_forwarding()

Serial.println("Sms Forwarding");

Serial2.println("AT+CNMI=1,2,0,0,0");

check_response();

///

void delet_msg()

Serial.println("Delete SMS ");

Serial2.write('A');delay(100);Serial2.write('T');delay(100);Serial2.write('+');delay(100);Serial2.write('C');d
elay(100);Serial2.write('M');delay(100);Serial2.write('G');delay(100);Serial2.write('D');delay(100);Serial2.
write('=');delay(100);Serial2.write('1');delay(100);Serial2.write(',');delay(100);Serial2.write('4');Serial2.wr
ite('\r');

int u=0;

do{

serialEvent2();

delay(10);

u++;

}while(u<400);

////

83
void serialEvent2() {

while (Serial2.available()) {

char inChar = (char)Serial2.read();

Serial.write(inChar);

///////////////////////

void blink() {

if(++cycle_c>500)

now_go=1;

Timer1.initialize(motor_ss*1000);/////03335713689

/// --------------------------

/// Custom ISR Timer Routine

/// --------------------------

void timerIsr()

digitalWrite(3,1);delayMicroseconds(200);

digitalWrite(3,0);

Timer1.initialize(100000);

////////////////////

float get_temp()

84
{

float ntt=0;

//Serial.print("Requesting temperatures...");

sensors.requestTemperatures(); // Send the command to get temperatures

//Serial.println("DONE");

// After we got the temperatures, we can print them here.

// We use the function ByIndex, and as an example get the temperature from the first sensor only.

//Serial.print("Temperature for the device 1 (index 0) is: ");

ntt=sensors.getTempCByIndex(0);

Serial.println(ntt);

return(ntt);

85
References
[1]. http://www.8052.com/book

[2]. http://www.vishay.com/docs/82030/82030.pdf

[3]. http://www.wcl.ee.upatras.gr/ai/papers/potamit is14.pdf

[4]. http://www.academypublisher.com/jnw/vol03/no02/jnw03025863.pdf

[5]. http://www.newi.ac.uk/groutv/papers/p5.pdf

[6]. http://www.8051projects.info

[7]. http://www.datasheet4u.com

[8]. http://www.seminarprojects.com

[9]. http:// www.ieeexplore.ieee.org

86
Plagiarism report

87

Você também pode gostar