Smart Home Automation using Labview
-
Upload
rabiya-syed -
Category
Documents
-
view
52 -
download
1
description
Transcript of Smart Home Automation using Labview
Thesis
Sma
s submitted
art Hom
to the facu
D
D
Pakistan In
N
me Auto
B
H
K
lty of Engin
Degree of B
epartment o
nstitute of E
Nilore, Isla
omation
By
Bilal Shahee
Hamza Kha
Kamil Abba
neering in p
S Electrical
of Electrical
Engineering
mabad 4565
June, 2014
n using
en
an
as
partial fulfill
l Engineerin
l Engineerin
and Applie
50, Pakistan
4
LabVI
lment of req
ng
ng,
ed Sciences,
n
IEW
quirements
,
for the
iii
Department of Electrical Engineering
Pakistan Institute of Engineering and Applied Sciences (PIEAS)
Nilore, Islamabad 45650, Pakistan
Declaration of Originality
We hereby declare that the work contained in this thesis and the intellectual content of this
thesis are the product of our own research. This thesis has not been previously published in
any form nor does it contain any verbatim of the published resources which could be treated
as infringement of the international copyright law. We also declare that we do understand the
terms copyright and plagiarism, and that in case of any copyright violation or plagiarism
found in this work, we will be held fully responsible of the consequences of any such
violation.
Signature:………….
Name: Bilal Shaheen
Signature:…………..
Name: Hamza Khan
Signature:………….
Name: Kamil Abbas
Date: June, 2014
Place: PIEAS
iv
Certificate of Approval
This is to certify that the work contained in this thesis entitled
“Smart Home Automation using LabVIEW”
was carried out by
Bilal Shaheen, Hamza Khan and Kamil Abbas
under my supervision and that in my opinion, it is fully adequate, in scope and quality,
for the degree of BS Electrical Engineering from Pakistan Institute of Engineering and
Applied Sciences (PIEAS).
Approved By:
Signature: ……………………...
Supervisor: Dr. Haroon ur Rashid
Verified By:
Signature: ……………………………..
Head, Department of Electrical Engineering
Stamp:
v
Dedication
To our grandparents, parents and siblings
vi
Acknowledgements Foremost, we would like to thank Almighty Allah, the most merciful and beneficent for
giving us the strength and courage to accomplish the task assigned to us. We would like to
express our sincere gratitude to our supervisor Dr. Haroon ur Rashid for the continuous
support of our Bachelors study and FYP.
Besides our advisor, we would like to thank the rest of my thesis committee: Dr. Ghulam
Mustafa and Dr. Arif Gilgiti for their encouragement, insightful comments and questions.
We thank our fellow-mates in PIEAS for the stimulating discussions, for the sleepless nights
we were working together before deadlines, and for all the fun we have had in the last two
years.
Last but not the least, we would like to thank our families for supporting us spiritually
throughout our academic life.
Declara
Certific
Dedicat
Acknow
Table o
Table o
Table o
Abstrac
1 Int
1.1
1.2
1.3
1.4
2 Lit
2.1
2.2
2.3
2.3
2.3
2.3
2.3
2.4
2.4
2.4
2.4
ation of Orig
cate of Appr
tion ............
wledgement
of Contents .
of Tables ....
of Figures ...
ct ................
troduction ..
Overview
Bird’s Ey
Objective
Report lay
terature Rev
Automati
History ...
Types of
Build3.1
Powe3.2
Indus3.3
Hom3.4
Types of
Centr4.1
Semi4.2
Distr4.3
ginality ......
roval ..........
..................
ts ................
..................
..................
..................
..................
..................
w .................
ye View ......
es ................
yout ...........
view...........
on ..............
..................
Automation
ding Autom
er Automati
strial Autom
me Automati
Automation
ralized Syst
i Distributed
ributed Syst
T
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
n .................
mation .........
ion .............
mation ........
ion ..............
n Systems ..
tems ...........
d/Centralize
tems ...........
Table of Co
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
ed Systems
...................
ontents
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
..................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
vii
......... iii
.......... iv
........... v
.......... vi
......... vii
........... x
.......... xi
....... xiii
........... 1
........... 1
........... 1
........... 2
........... 3
........... 4
........... 4
........... 4
........... 5
........... 5
........... 5
........... 5
........... 6
........... 6
........... 6
........... 7
........... 8
2.5
2.5
2.5
2.5
2.6
2.6
2.7
2.7
3 Me
3.1
3.2
3.2
3.2
3.2
3.3
4 Ha
4.1
4.2
4.3
5 So
5.1
5.2
5.3
5.4
5.5
5.6
Data Acq
Senso5.1
Data 5.2
Ardu5.3
Communi
Type6.1
LabVIEW
Using7.1
ethodology
Selection
Modes of
XBee2.1
XBee2.2
Addr2.3
Relay Sys
ardware Imp
Connectin
Software
Relay Cir
oftware Imp
External L
Internal L
Fire Alarm
Burglar A
Temperat
Graphical
quisition Sys
ors .............
Acquisition
uino UNO ...
ication .......
es of Comm
W ................
g DAQs wi
..................
of DAQ ca
f Communic
e ................
e ZigBee co
ressing of X
stem ...........
plementatio
ng the XBee
to Configur
rcuit ...........
lementation
Lighting sy
Lighting sys
m System ..
Alarm .........
ture Control
l User Interf
stems .........
...................
n Cards ......
...................
...................
munication ...
...................
ith LabVIEW
...................
ard ..............
cation .........
...................
oncepts .......
XBee ...........
...................
on ...............
e to Arduin
re XBee .....
...................
n .................
stem ..........
stem............
...................
...................
l System ....
face ...........
...................
...................
...................
...................
...................
...................
...................
W ...............
...................
...................
...................
...................
...................
...................
...................
...................
o ................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
...................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
..................
viii
........... 9
......... 10
......... 12
......... 15
......... 16
......... 16
......... 19
......... 20
......... 21
......... 21
......... 22
......... 22
......... 25
......... 26
......... 29
......... 30
......... 30
......... 31
......... 33
......... 35
......... 35
......... 37
......... 39
......... 40
......... 41
......... 42
ix
5.7 Data Logging ............................................................................................................. 44
5.8 Control across the Globe ........................................................................................... 45
6 Conclusion ....................................................................................................................... 46
6.1 Recommendations and Future Work ......................................................................... 46
7 References ........................................................................................................................ 48
x
Table of Tables
Table 2-1- Comparison of Automation Control Systems ............................................................... 9
Table 2-2- Sensor Types ............................................................................................................... 10
Table 3-1- Comparison of NI DAQ with Arduino UNO .............................................................. 21
Table 3-2- Product Comparison (Series 1 vs. Series 2) ................................................................ 22
Table 3-3 - Pin out of XBee Series 2 ............................................................................................ 24
Table 3-4- API format for Remote AT Command Request .......................................................... 27
xi
Table of Figures
Figure 1-1- Overview of the automation system ............................................................................ 2
Figure 2-1 - Typical Centralized Systems ...................................................................................... 6
Figure 2-2 - Semi Distributed/Centralized Systems ....................................................................... 7
Figure 2-3 - Mesh Network of Distributed Systems ....................................................................... 8
Figure 2-4 - DAQ Systems ........................................................................................................... 10
Figure 2-5 - Temperature Sensor LM 35 ...................................................................................... 11
Figure 2-6 - Passive IR Sensor ...................................................................................................... 11
Figure 2-7 - Smoke Detector ......................................................................................................... 12
Figure 2-8- Typical block diagram of a DAQ card ....................................................................... 13
Figure 2-9- NI USB 1208FS DAQ card ....................................................................................... 14
Figure 2-10- Arduino UNO .......................................................................................................... 15
Figure 2-11- NI LabVIEW ............................................................................................................ 19
Figure 2-12- Processing acquired signal in LabVIEW ................................................................. 20
Figure 3-1- A typical ZigBee network .......................................................................................... 26
Figure 3-2 - Single Pole Double Throw ........................................................................................ 29
Figure 4-1- Proteus layout of XBee PCB ..................................................................................... 30
Figure 4-2- XBee Breakout Board ................................................................................................ 31
Figure 4-3- Programming XBee with X-CTU software ............................................................... 32
Figure 4-4- Relay Circuitry to switch load ................................................................................... 33
Figure 4-5- PCB layout of relay circuit ........................................................................................ 33
Figure 4-6 - Relay Module ............................................................................................................ 34
Figure 5-1- Block Diagram of LabVIEW controlled applications ............................................... 35
Figure 5-2- Front panel of external lighting system ..................................................................... 36
Figure 5-3- Back panel of external lighting system ...................................................................... 37
Figure 5-4- Front panel of internal lighting system ...................................................................... 38
Figure 5-5- Back panel of internal lighting system ...................................................................... 38
Figure 5-6- Front panel of fire alarm system ................................................................................ 39
Figure 5-7- Back panel of fire alarm system ................................................................................ 39
Figure 5-8- Front panel of burglar alarm system .......................................................................... 40
Figure 5-9- Back panel of burglar alarm system .......................................................................... 40
Figure 5-10- Front panel of temperature control system .............................................................. 41
xii
Figure 5-11- Back panel of temperature control system ............................................................... 42
Figure 5-12- Final GUI: Monitoring & Control ........................................................................... 43
Figure 5-13- Final GUI: Settings Panel ........................................................................................ 43
Figure 5-14- Data logging in excel ............................................................................................... 44
Figure 5-15- Final GUI: Accessing Front Panel through internet browser .................................. 45
xiii
Abstract
In smart homes, information technology is used to control electrical equipment and to
converse with the surroundings. The technology is new and is still in the development phase.
Smart home automation system is capable of replicating the domestic activities performed on
daily basis such as light automation, security of the house, watering system and HVAC (heat,
ventilation and air conditioning). The backbone of the home automation system is LabVIEW
which provides the complete control in the form of GUI to the end-user. This home
automation system is made up of different subsystems, capable of controlling lights around
the house, fire and burglar alarm to warn the user and automating different daily routines. By
using an internet connection the system can be monitored from all over the world. The
prototype of the system has been developed with hardware which is easily available in
Pakistan. The hardware implementation and communication of a control system for house
automation using LabVIEW is discussed here. The prototype of the system not only monitors
the power used in the house but also helps in conserving the energy by allowing the user to
take full control of the system.
1
1 Introduction
1.1 Overview
Home automation within the recent years has seen much awaited progress. Although the
technology is present for quite some time but the recent advancements in the field of signal
acquisition and computer manipulations has really helped the process automation industry. Home
automation is actually a branch of automation. Automation systems use different kinds of
instruments to sense a change or anomaly in the behavior of a plant and then take the necessary
action against the detected change.
Home automation systems can detect and identify a change and then adjust the light intensity,
room temperature or control opening or closing of drapes based on the logic set by the user.
These type of features make the home automation ‘smart’, because it is making decisions on its
own. A user can set manually the number of changes to detect and then take the required action
according to the detected change. All these type of features of a home automation system can
make the life easier of elderly or those who are physically challenged.
1.2 Bird’s Eye View
The main controller of the home automation system is LabVIEW. The input data from different
type of sensors is acquired by Arduino UNO and manipulated in LabVIEW. These connect
directly with Arduino UNO which feeds the data to LabVIEW. Different programs are made in
LabVIEW which after processing the signal take the necessary action by generating a signal at
the output. This signal is wirelessly transmitted with the help of an XBee. Another XBee is
connected at the load end acting as a router. It receives the signal and triggers the relay circuit to
change the state of the load. The overview of the automation system is shown in figure 1-1.
2
Figure 1-1- Overview of the automation system
The user gets a graphical interface to interact with different energy loads around the house. This
gives complete control over the appliances and the user can turn them on or off or can even
schedule time to dim the lights when needed.
1.3 Objectives
The objectives of our project are mentioned below:
Lighting control system to control household electric lights.
Designing and implementation of heating, ventilation and air conditioning control
system.
Graphical User Interface (GUI) in LabVIEW for the end user.
Control and integration of security systems having the potential of sending emails to
warn user.
Power monitoring and data logging so that user can easily understand power utilization
going around the house.
3
Monitoring and control of house through internet or android smart phones.
1.4 Report layout
The entire project is composed of six chapters, each covering a section of the work as
summarized below:
Chapter one gives a brief introduction to home automation.
Chapter two covers literature review on automation, different types of data acquisition
systems, different communication protocols and standards and software over which home
automation can be implemented.
Chapter three highlights the decisions that led to the selection of a particular component
and also, brief details on both hardware components and communication services used.
Chapter four discusses the hardware design and implementation with practical details of
the project design, construction and testing.
Chapter five includes the software implementation of the control system. The front panels
and back panels designed in LabVIEW have been discussed.
The last chapters concludes the project by summarizing the results, observations and
hurdles faced during the project. It also includes short comings and recommendations.
4
2 Literature Review
2.1 Automation
Automation includes the use of different control systems to run different equipment by using
computer technology. Automation reduces the requirement of human supervision. This not only
helps to increase the efficiency of the overall plant but also ensures consistent results.
We now live in the age of modern machines and intelligent systems. The need of having
automated systems is more than ever before. The fast paced economy trend demands faster
production rates which requires a more sophisticated and complex control of systems to achieve
the ever increasing demand of product supplies. In this situation, engineers analyze the problem
and try to overcome the hurdles with mathematical and programming tools.
Though the use of automation is increasing day by day, but there are still some domains where
automation cannot help us at all. The intelligent control systems cannot distinguish between
taste, smell or handwriting. Also these systems fail when it comes to strategic planning or
designing a federal law framework.
2.2 History
Automation existed around 1898 when Nikola Tesla patented the idea for a remote controlled
boat. This was the birth of remote administration which proved to be a precursor for automation.
In 1910, when mass production was popularized, a new kind of system was implemented by
Ford Inc. The systems used electric motors with a chain and the rig was commonly known as
sequential motion production. The idea of home automation originated during the World’s Fairs
in late 1930s. Although the production and availability of electricity was scarce, the enthusiasts
and hobbyists kept on working the idea of home automation. In 1960s an engineer named Jim
Sutherland made an automation system but this was not commercialized due to the unavailability
of the basic framework. The term smart house was first used in 1984 by American Association of
House builders. The creation of microcontroller caused sudden reduce in the cost of electrical
control of products. In 1990s the concept of home automation gained prominence. The use of
computer and robotics rose to control equipment for the feasibility of user. Although the concept
became p
still not
home ros
analyses
Although
devices.
first wire
many ho
domain d
2
There are
Building
network
mechanic
distribute
Power sy
power pl
voltage o
or superv
perform
automati
Industria
industrie
to use au
popular but
affordable b
se to 1.5 m
shows. [1]
h the start o
But since th
eless home a
me automat
day by day.
2.3 Type
e mainly fou
2.3.1
automation
of a buildi
cal systems
ed control sy
2.3.2
ystem autom
lants by usin
or current wa
visor uses th
fault detect
on system is
2.3.3
al automation
s now a day
utomation eq
as there wa
by common
million in US
of the autom
he advent of
automation s
ion systems
s of Auto
ur types of au
Building1
n essentially
ing. This co
inside a b
ystems for ea
Power A2
mation, comm
ng instrumen
aveforms. Th
he data for m
tion and co
s Supervisory
Industri3
n use differe
s heavily rel
quipment to m
s not any sim
man. ABI r
S and this fi
mation system
f wireless tec
system to be
have entere
omation
utomation di
g Automa
y means co
ould include
building. M
asier access
Automati
monly known
ntation devic
his acquired
making futur
orrection wi
y Control an
ial Autom
ent kinds of
ly on compu
monitor and
mplified pro
research tells
igure will ri
m used cabl
chnology, th
e introduced
ed the marke
iscussed belo
ation
ontrolling th
e surveillan
Most of the
in case of ap
ion
n as power a
ces and cont
d data is then
re decisions.
ithout huma
nd Data Acqu
mation
control to c
uters and info
d control diff
otocol to imp
s that in 20
ise to 8 mil
les to comm
he whole sce
in the mark
et and we ar
ow:
he different
nce systems,
building a
ppliance failu
automation e
trol systems
n sent to the
The power
an interferen
uisition or S
arry out auto
ormation tec
ferent parts o
mplement suc
12 the numb
llion till 201
municate wit
enario has ch
ket was the X
re witnessing
devices pr
, power sys
automation
ure.
employ tech
. Data is acq
database wh
system auto
nce. The m
SCADA syst
omation pro
chnology, it b
of the plant.
ch systems it
ber of autom
17 as the cu
th controller
hanged a lot
X-10. Since
g progress in
resent inside
stems, and
systems use
hniques to co
quired in for
here the eng
omation can
most used p
tem.
ocesses. Sinc
becomes obv
Most of the
5
t was
mated
urrent
r and
t. The
then,
n this
e the
other
e the
ontrol
rm of
gineer
even
power
ce the
vious
e time
HMI (Hu
Industria
managem
Home au
appliance
to the sig
outdoor l
provide t
and many
commod
over inte
around th
2
Automat
evolved w
schemes.
three maj
uman Mach
al automatio
ment.
2.3.4
utomation as
es. It can inc
gnal receive
light on and
the user con
y other num
ity in our co
ernet and thu
he world.[2]
2.4 Type
ion systems
with the cha
. Based on t
jor categorie
2.4.1
hine Interfac
on is used
Home A4
discussed in
clude intellig
ed from the
off at a spe
nvenience an
merous featur
ountry. The
us enabling
s of Auto
have been p
anging techn
the level of
es:
Centrali1
ce) is used
for process
Automatio
n the previou
gent event tri
environmen
ecific time. T
nd offer a mo
res, it can h
present hom
the user to
omation S
present for m
nologies. The
f complexity
lized Syst
Figure 2-1 - Ty
to monitor
s control, e
on
us paragraph
iggering, wh
nt or the ort
The basic pu
ore comforta
help you sav
me automatio
monitor an
Systems
more than a
ese systems
y, automation
tems
ypical Centralize
and contro
energy mana
hs is the auto
here the syst
rthodox sche
urpose of ho
able and sec
ve energy, w
on systems
nd control h
hundred ye
have chang
n systems a
ed Systems
ol the activi
agement an
omation app
tem takes an
eduled tasks
ome automat
cure life. In
which is beco
can provide
his/her house
ears now and
ed from a si
are further c
ity of a pro
nd environm
lied to house
n action acco
s e.g. turnin
tion systems
addition to
oming a pre
e the user co
e from anyw
d have const
imple to com
characterized
6
ocess.
mental
ehold
ording
ng the
s is to
these
ecious
ontrol
where
tantly
mplex
d into
These sy
from onl
logic but
because n
Controlle
These sy
figure 2-
attached
contain a
is a little
is very a
controlle
ystems are th
ly one rack
t they requir
now these in
er or PLC is
2.4.2
ystems are p
-2. This syst
to it throug
a processor,
bit more co
accommodat
r to change t
he oldest of a
or control p
re a lot of h
nputs and ou
based on the
Semi Di2
Figu
partially dist
tem also con
gh a field b
and can be
mplex than
ing and sav
the logic to d
automation s
panel. The s
hardware and
utputs would
e same conc
istributed
ure 2-2 - Semi D
tributed and
nsists of a m
bus. The per
programmed
the old centr
es a good d
desired settin
systems. All
systems are
d space as th
d require sep
cept. Block d
d/Central
Distributed/Centr
d partially ce
main control
ripherals con
d separately
ral systems b
deal of hardw
ngs.
l the devices
usually less
the number o
parate data
diagram is sh
lized Sys
ralized Systems
entralized co
ller which c
nnected with
from the ce
but provide
ware, the us
s are control
s complex w
of inputs an
cables. Prog
hown in figu
tems
ontrol syste
controls diff
th the centra
entral contro
more flexibi
ser must rep
lled or moni
when it com
nd outputs g
grammable L
ure 2-1.
ems, as show
ferent periph
al controller
oller. This sy
ility. Though
program the
7
itored
mes to
go up,
Logic
wn in
herals
r also
ystem
h this
main
These ar
type of s
shown in
or radio
independ
controllin
paramete
commun
As the w
taken dow
more tha
the novic
2.4.3
e the new s
systems cont
n figure 2-3.
frequencie
dent of other
ng the light
ers of the roo
icates with a
whole system
wn for main
an the rest of
ce user to c
Distribu3
ystems and
tain multiple
The commu
s. Each roo
r subsystems
s, temperatu
om, the cont
all the contro
Figu
m works in a
ntenance or if
f the system
ustomize th
uted Syst
are generall
e subsystem
unication be
om of the
s present insi
ure etc. on i
troller of the
ollers of all t
ure 2-3 - Mesh N
a mesh like n
f it malfunct
ms available
he settings to
tems
ly more exp
ms, each link
etween the s
house or b
ide the whol
its own. Wh
subsystem
the subsystem
Network of Distr
network, it i
tions. The le
in the past.
o suit his/he
pensive than
ked together
subsystems c
building can
le building.
hile this sub
is controlled
ms present in
ributed Systems
is not affecte
evel of flexib
A highly us
er needs. Th
n the rest of
to form a m
can be achie
n have its
This subsys
bsystem con
d by another
nside a build
ed if one of
bility in this
ser friendly
hough it is v
the types. T
mesh networ
eved using c
own subsy
tem is capab
ntrols the de
r controller w
ding.
f the subsyste
type of syst
interface en
very flexible
8
These
rk, as
cables
ystem,
ble of
efined
which
em is
tem is
nables
e, the
9
system is also very complex and requires experience and knowledge to execute and maintain the
system.
Table 2-1- Comparison of Automation Control Systems
Categories Pros Cons
Centralized Simple
Less software required
Extensive cabling required
Large space required
Semi-Centralized/Decentralized Easy to update software etc.
Easily upgradeable hardware
Complex
Lacking redundancy
Decentralized
Easy to maintain and upgrade
Highly customizable
No extensive cabling required
Highly complex
Expensive
2.5 Data Acquisition Systems
Data acquisition system can be deconstructed into three main building blocks, as shown in figure
2-4. Sensing element, Data Acquisition (DAQ) card and a PC. The physical phenomena are
converted into electrical signal by the sensing instrument. After the signal is converted into an
electrical signal, it is fed into the DAQ card. The DAQ card amplifies the signal, removes noise,
and quantize it. After that, the converted signal is fed into the computer, where the acquired data
can be manipulated according to one’s need. [3]
The phy
measured
given bel
Sensor
Thermoco
Photo Sen
Micropho
Strain Ga
Potentiom
They are
centigrad
ysical quant
d by differen
low.
ouple, Therm
nsor
one
age, Piezoele
meter
2.5.1
e temperature
de. It works
tities can b
nt type of se
mistor
ectric Transd
Sensors1
2.5.1.1 T
e sensors wi
in a range
Figure 2
be temperatu
ensors availa
Table 2
ducer
s
Temperatur
ith voltage li
of -55 to 15
2-4 - DAQ Syste
ure, light et
able in the m
2-2- Sensor Type
Pheno
Tempe
Light
Sound
Force a
Positio
e sensors
inearly prop
50 degree c
ems
tc. These p
market. Some
es
menon
erature
and Pressure
on and Displ
portional to d
centigrade. D
physical phe
e of the com
e
acement
degree
Due to
enomena ca
mmon sensor
10
an be
rs are
11
trimming and calibration at wafer level low cost is ensured. The current it draws is just 60uA.
Pin layout of LM35 is shown in figure 2-5.
2.5.1.2 Passive infrared sensor (PIR)
All the devices above absolute zero temperature emit radiation
which cannot be detected by human eye but electronic devices can
be used for such purposes. Radiations enter through the front face
of sensor and at the core sensor is made from pyro electric material
which produce energy when exposed to radiations. PIR motion
based sensors are used to detect the motion of people, animal and
objects. They are used in automatic lightning and burglar alarms.
The sensor will detect the change in infrared radiation and if the change is higher than the set
value will cause device to trigger on.
We are using HC-SR501 PIR motion sensor shown in figure 2-6. Some of its specifications are
listed below
Voltage 5V- 20V
65mA allowable current
TTL output 3.3V-0V
Delay time (0.3sec-10min) can be adjusted.
Locking time 0.2 sec
Sensing range within 7m with angle less than 120 degrees
Working temperature -15 to +70 degree centigrade
2.5.1.3 Burglar alarm
There are many types of burglar alarms but the most common sensor we can use is PIR (passive
infrared) sensor. PIR sensors can be placed in the house to detect change if someone enters your
house.
Figure 2-5 - TemperatureSensor LM 35
Figure 2-6 - Passive IR Sensor
It is a de
work on
Two mai
It is ligh
focus its
straight t
path of l
figure 2-7
These se
ionization
Data Acq
the digita
Acquisiti
into elect
(DAQ) c
then exp
data. Eve
every DA
comprise
or microp
Data Ac
(input/ou
computer
evice that de
the principle
in types of sm
Optical
ht sensor in
light in a fo
through in fr
ight and ligh
7.
Ionization
ensors uses
n in air. Wh
2.5.2
quisition car
al world. It
ion cards ar
trical signals
cards with m
loit the disp
en though th
AQ card is al
ed of an amp
processor.
cquisition D
utput) ports,
r in a num
2.5.1.4 S
tects smoke
e of photoele
moke detecto
which there
rm of beam.
ront of the d
ht reaches s
s radio isot
enever there
Data Ac2
rds, shown in
digitizes th
e used to pr
s by sensing
more resoluti
playing and
he technology
lmost the sam
plifier and an
Devices are
, sampling
mber of diff
Smoke detec
which resul
ectric and io
ors;
e is light so
. In the absen
etector and i
sensor and tr
topes like
e is smoke di
cquisition
n figure 2-8,
e incoming
rocess the p
g instrument.
ion and inpu
processing c
y advances h
me. Every D
nalog to digi
available
rate, resolu
ferent ways.
ctor
lts in the eve
nization.
ource like bu
nce of smok
if smoke is p
rigger the al
americium-
ifference is d
n Cards
, act as a bri
data so that
physical quan
. As newer t
ut/output po
capabilities
has brought
DAQ contain
ital converte
in differen
ution and co
. Most of t
ent of fire sta
ulb and a le
ke the light p
present it cu
larm as show
-241 to pro
detected cau
idge between
t the compu
ntities after
technology h
orts are avai
of a PC to
in new tech
ns a signal co
er, input/outp
nt types, m
ost. DAQ d
the DAQ d
arting. Many
ens to
passes
uts the
wn in
oduce
using alarm t
n the real ph
uter can inte
they have b
has arrived,
ilable in the
further anal
hniques, the b
onditioning c
put ports and
mainly chara
devices are
devices are
Figure
y smoke dete
to trigger.
hysical world
erpret them.
been transfo
Data Acquis
market. We
lyze the acq
basic structu
circuitry wh
d microcontr
acterized by
interfaced
PCI (Perip
e 2-7 - Smoke De
12
ectors
d and
Data
ormed
sition
e can
quired
ure of
hich is
roller
y IO
with
pheral
etector
13
Component Interconnect) and some are designed for mounting in board slots on a computer
motherboard.
Figure 2-8- Typical block diagram of a DAQ card
Data Acquisition device interfaces with computer and exploits the processing power and display
capabilities of the PC. Usually a software package like NI LABVIEW, NI Measurement Studio,
Microsoft Visual C/C++, Visual Basic etc. is used to communicate and manipulate the acquired
data. Thus it offers powerful, flexible and economical measurement solution.
National Instruments (NI) is the leading DAQ card manufacturer in the world. Their devices are
usually very high grade and reliable. All their devices are compatible with a multitude of
software including LabVIEW. The NI DAQ cards are easy to setup and configure. [3]
2.5.2.1 NI-USB 1208FS
It is a USB 2.0 powered device that can be connected to a PC with analog and digital I/O. The
card features eight analog input channels. Each channel is 11-bit resolution input. Two output
ports with 12-bit resolution are available. When it comes to digital, 16 I/O channels can be
selected as input or output in two 8-bit ports. The maximum sampling rate that the card can
achieve is 50 kSamples/sec. The card comes with MCC DAQ software.
14
Figure 2-9- NI USB 1208FS DAQ card
The NI-USB 1208FS, shown in figure 2-9, features two mode of inputs. The user can either set
Differential Input mode or the Single-Ended Input mode. The number of input channel decreases
two four when we use the differential mode.
Differential Mode
The signal input will have two channels with respect to ground. A signal HI and a signal LO pins
are used for one input. By doing this we are actually reducing common mode rejection noise,
which is helpful when there is electromagnetic interference or radio frequency interference. The
differential mode will have half number of inputs when compared to single-ended mode. If there
are ‘n’ number of signals, the differential mode will require ‘2n’ wires or channel.
Single-Ended Mode
The signal input will have only one HI pin and a common LO pin. All the inputs have one
common LO pin while they have separate HI input. For example, if A/D board has 8 single-
ended inputs, there will be 8 HI pins while there will be only one LO pin common to all HI pins.
Single-ended mode is the most common and easiest way to transmit signals over the channel.
The single-ended mode is cheaper in a sense that it requires only ‘n+1’ wires or channels. The
widely used RS-232 system is an example of single-ended mode. [4]
Arduino
multitude
ATmega
board can
the packa
Although
DAQ car
The Ard
through s
used to tr
card, but
2.5.3
UNO is a
e of project
328 chip. T
n be program
age.
h the UNO c
rds. The max
duino UNO
serial port by
ransmit the d
t it is inexpe
Arduino3
USB 2.0 an
ts. The Ard
The board s
mmed throug
can be used
ximum samp
has an AD
y using its 0
data. Althou
ensive and is
o UNO
nd 3.0 com
duino UNO
supports 14
gh the USB
as DAQ ca
pling rate tha
Figure 2
DC with 10
0 (RX) and 1
ugh the numb
s easily avai
mpatible devi
is mainly s
digital I/O
port with th
ard, but its s
at the UNO c
2-10- Arduino UN
0-bit resoluti
(TX) pins.
ber of analo
ilable. The o
ice shown i
sold as micr
pins. It also
he Arduino ID
sampling rat
can achieve
UNO
ion. The A
RX pin is us
g channels i
only downsi
in figure 2-
rocontroller
o have 6 an
DE software
te is much lo
is about 5kS
Arduino UNO
sed to receiv
is less than t
ide is the slo
10. It is us
board base
nalog inputs
e that comes
ower than th
Samples/sec.
O communi
ve and TX p
that of a NI
ow sampling
15
ed in
ed on
. The
s with
he NI
.
icates
pins is
DAQ
g rate
(30 Sam
interfacin
2
Commun
load. We
technolog
The two
Wireless
briefly di
It is a co
and dem
between
our home
can be co
A carrier
wiring o
frequency
and the e
line and
permanen
Advanta
N
A
Disadvan
mples/sec) an
ng will be di
2.6 Comm
nication is th
e are using w
gy are used t
2.6.1
types of co
technology
iscussed.
ommunicatio
modulates it
other comm
es is used fo
ontrolled and
r in the rang
f the house
y and it is n
each receiver
decoded at
ntly wire the
ages:
No new wirin
Anything plu
ntages:
nd the diffi
iscussed in th
municati
he process o
wireless com
to transfer o
Types o1
ommunicatio
was chosen
2.6.1.1 P
on technique
at the recei
munications i
or sending in
d monitored.
e of 20 to 2
. The reason
not legal to o
rs used have
t the receiv
em.
ng was neede
gged inside
iculty in int
he coming c
ion
of transferrin
mmunication
ur signals fr
of Commu
on are powe
n but the rea
Power-line C
in which a
iver’s end to
is that it doe
nformation.
.
00 kHz com
n to use thi
operate in th
e an address
ver. So we
ed.
socket could
terfacing th
hapters. [5]
ng data from
in which de
rom LabVIE
unication
er-line comm
asons to dro
Communica
person mod
o read what
es not requir
This means
mmonly know
is band is to
e range of th
and can be c
can use dev
d be controll
he Arduino
m the data ac
evices know
EW to load.
n
munication a
op power-lin
ation:
dulates the d
t informatio
re any new
s all the devi
wn as narrow
o avoid inte
hose frequen
controlled by
vices plugg
led.
UNO with
cquisition ca
wn as XBee,
and wireless
ne Commun
ata and send
on was send
wiring as th
ices connect
w band is m
erference wi
ncies. The c
y signals tran
ged inside p
LabVIEW.
ard to the de
based on Zi
s communica
nication wou
ds it over the
d. The differ
he wiring us
ted to power
modulated int
ith radio ch
arrier is digi
nsmitted ove
power socke
16
The
esired
igBee
ation.
uld be
e line
rence
sed in
r line
to the
annel
itized
er the
ets or
17
The safe transfer of information to the end device is quite low.
The data received at the user end might be highly distorted.
There is no fix standard when it comes to power-line communication. International
market is not taking any interest in devising a standard to distribute data in homes
through power-line communication.
The use of power-lines wires inside homes is high, in fact everything that runs on
electricity is connected to power-line and as a result there is a lot of electrical noise which
comes in the path of transferring the data.
2.6.1.2 Popular Power-line Protocols in Home Automation
Some of the popular Power-line protocols used in home automation are briefly described in the
next subsections.
X-10:
It is one of the first few protocols which used power-line communication to connect devices. It
didn’t receive any major upgrades and considered as an old technology. [6]
Insteon:
Insteon connects the devices together through power-line, radio frequencies or both. All Insteon
devices can receive, transmit and repeat messages without the need of a controller.
Universal Power-line Bus (UPB):
Like X-10 it uses existing home wires to communicate between devices but when comparing
reliability, functionality and cost it is far better.
The technique looked quite attractive at start but due to bad wiring in homes especially in our
country this technique could not be relied upon. [7]
Wireless Communication:
18
It is a communication technique in which data is transmitted over the air without the help of
electrical conductors. The radio waves are made to travel and the distance they travel varies from
device to device as the power requirements increases as the distance increases.
Advantages:
Wireless networks have the ability to get interfaced with the wiring system present in our
homes.
The system is flexible and can be easily shifted to another place when needed.
The running cost of wireless devices is quite low as not much energy is required to make
them work.
They can be installed in places which are not easily accessible and also in harsh
environmental conditions.
Disadvantages:
Radio frequencies are expected to get interference from nearby devices which also emits
radio frequencies.
These networks are not that reliable and secure.
The initial cost of installing and buying is too high to attract interested people.
The radio signals get distorted while passing through walls, ceilings and floors. The main
information initially sent might get lost.
Popular Wireless protocols in Home Automation
Some of the popular wireless protocols used in home automation are briefly described in the next
subsections.
Z-Wave:
It is a wireless protocol which uses 908.42 MHz band of radio frequency. It utilizes a mesh type
network in which signal is passed along the network till it reaches the final destination. [8]
19
Wi-Fi:
It is already a famous technology and many manufactures are developing their products which
are compatible with Wi-Fi devices. Many devices in home uses Wi-Fi and interference with
smart devices that are needed to be controlled and monitored is likely to happen. The device
equipped with Wi-Fi technology consumes a lot of power and application like controlling lights
is not feasible with it.
ZigBee:
ZigBee technology is based upon IEEE 802.15.4 radio specification and usually operates in 2.4
GHz frequency. The main objective was to develop low cost and low power consuming packet
based radio protocol. It uses mesh networking to communicate between devices and is highly
reliable. [8, 9]
It was decided to use ZigBee due to its numerous advantages, not over power-line but also over
other wireless protocols.
2.7 LabVIEW
LABVIEW is widely used in many industrial applications. Custom applications that interact with
real time problems can be designed in LabVIEW. LabVIEW has been used as the brain in this
project and acts as the control for the entire smart home automation system. LABVIEW provides
a wide variety of tool in a single interface, confirming that simple task such as drawing wires
ensures compatibility. LABVIEW is an application designing software and itself contains a lot of
components as shown in figure 2-11.
Figure 2-11- NI LabVIEW
LabVIEW
machine
language
be run in
serial app
written b
provides
is connec
the physi
internet m
LabVIEW
In most c
be manip
There are
FFT of th
be displa
figure 2-
W analyzes t
code avoids
es. LabVIEW
n parallel pro
plication. La
by the user i
the ease of c
cted with the
ical realizati
making it ea
2.7.1
W can comm
cases, a DAQ
pulated at use
e different ty
he acquired
ayed in graph
12.
the block di
s the disadv
W can also b
oviding effic
abVIEW pro
in C but the
combining a
e other by m
ion of the s
sy for the us
Using D1
municate wit
Q card is us
er’s will.
ypes of anal
signal, time
hs, tables an
Figur
agram and c
antages rela
reak down t
cient results
ovides optio
e graphical p
a number of
means of wire
ystem. Furth
ser to control
DAQs with
th the outer w
ed to obtain
lysis availab
e and frequen
nd with a GU
re 2-12- Process
compiles it t
ated with per
the applicati
and better c
n for both g
programming
modules alre
es. The who
hermore Lab
l his applica
h LabVIE
world using
n the data fro
le in LabVIE
ncy analysis
UI for the end
ing acquired sig
to create a p
rformance th
ion into man
control as co
graphical pro
g is conside
eady provide
ole sketch als
bVIEW prov
ation sitting i
EW
g different ki
om the real w
EW. One ca
s and much
d user. The i
gnal in LabVIEW
proficient ma
hat are asso
nifold thread
ompared to
ogramming
ered more fe
ed by the so
so gives a g
vides remot
in any part o
inds of hardw
world. The d
an perform c
more. The a
information
W
achine code.
ciated with
ds which can
a single thre
and a code
easible becau
ftware. One
eneral idea a
te access thr
of the world.
ware periph
data obtaine
curve fitting,
acquired dat
flow is show
20
. This
other
n then
eaded
to be
use it
node
about
rough
herals.
d can
, take
ta can
wn in
21
3 Methodology
3.1 Selection of DAQ card
As discussed in the previous chapter that we had two options to select from the available DAQs
in the market. We went ahead to purchase the Arduino UNO because of the following reasons.
We wanted a system that has at least 5 analog inputs and more than 5 outputs.
We needed a system that was real time and had a good sampling rate (more than
10Samples/sec).
Should be cheap and reliable.
Table 3-1- Comparison of NI DAQ with Arduino UNO
NI USB-1208FS
Arduino UNO(ATmega328 )
Analog Inputs
8 6
Digital Inputs 16 bit I/O connection
port 14 I/O’s
Sampling Rate 50k Samples/Second Variable but usually low (30 Samples/Sec) Can achieve rate of 8000 samples/second
Resolution 12 bit per input 10 bit
Counters 1 (32 bit) -
Operating Conditions
5 volts 5 volts
EEPROM 1KB 1KB
Conversion Time 10µs 110µs
Price $300 $30
Arduino
DAQ ca
interface
3
The com
XBees ar
possesses
XBee as
There are
type and
Series 1
The chip
The stand
Series 2
The chip
standardi
low powe
The both
differenc
Indoo
Outdo
UNO was
rd. Althoug
with NI Lab
3.2 Mode
3.2.1
mmon misco
re digital rad
s a cellphon
the cellphon
e many type
series 2 type
XBee
p used is man
dard followe
XBee
p used is m
ized mesh ne
er scenarios
h types of
ce between th
Characte
r/Urban ran
oor RF line-
purchased b
gh our decis
bVIEW softw
es of Com
XBee 1
nception is
dios that may
ne with Wi-F
nes and ZigB
3.2.1.1 T
es of XBees
e. A brief co
nufactured b
ed is just 802
manufacture
etworking ca
.
Xbees are
hem is that i
Table
eristics
nge
-of-sight ran
because it w
sion favored
ware. The pr
mmunica
that people
y or may no
Fi and it ca
Bee as the W
Types of XB
available in
omparison be
by Freescale
2.15.4 firmw
ed by Emb
an be implem
further divi
n Pro versio
3-2- Product Co
up to 1
nge up to 3
was a well-r
d the purcha
roblems will
ation
e think that
ot be using Z
an be used t
Wi-Fi.
ee
n the market.
etween the tw
e to offer hig
ware which is
er Network
mented. The
ided in XBe
ons power tra
omparison (Seri
XBee Serie
100 ft. (30m)
300 ft. (100m
rounded sub
ase of UNO
l be discusse
XBee and
ZigBee exper
to download
. We selecte
wo is made
gh quality po
s faster than
ks in which
e ZigBee me
ees and Xb
ansmission c
ies 1 vs. Series 2)
s 1
) u
m) u
bstitute for t
O, but it pr
ed in the com
ZigBee are
rtise like eve
d and transfe
ed two of the
in the next f
oint to point
ZigBee.
h different
esh network
bees-Pro ver
capacity is h
2)
XBee
up to 133 ft.
up to 400 ft.
the expensiv
roved difficu
ming chapter
identical th
eryone nowa
er data. Thin
e XBees, ser
few lines
t communica
type of Zi
is unsurpass
rsions. The
higher. [10]
Series 2
(40m)
(120m)
22
ve NI
ult to
rs.
hings.
adays
nk of
ries 1
ation.
igBee
sed in
only
23
Transmit Power Output 1 mW (0dbm) 2 mW (+3dbm)
RF Data Rate 250 Kbps 250 Kbps
Supply Voltage 2.8 - 3.4 V 2.8 - 3.6 V
Transmit Current (typical) 45 mA (@ 3.3 V) 40 mA (@ 3.3 V)
Idle/Receive Current (typical) 50 mA (@ 3.3 V) 40 mA (@ 3.3 V)
Power-down Current 10 uA 1 uA
Frequency ISM 2.4 GHz ISM 2.4 GHz
Dimensions 0.0960" x 1.087" 0.0960" x 1.087"
Operating Temperature -40 to 85 C -40 to 85 C
Antenna Options PCB, Integrated Whip,
U.FL, RPSMA
PCB, Integrated Whip,
U.FL, RPSMA
Network Topologies Point to point, Star, Mesh
(with DigiMesh firmware)
Point to point, Star, Mesh
Number of Channels 16 Direct Sequence
Channels
16 Direct Sequence
Channels
Filtration Options PAN ID, Channel &
Source/Destination
PAN ID, Channel &
Source/Destination
The XBee Series 2 is equipped with ZigBee technology and it was decided to buy XBee Series 2.
The discussions made in later sections will be related with XBee Series 2 and the name XBee
will be used for Series 2 chip. [11]
3.2.1.2 Important features of Series 2
Routing
It shows how one radio transmits data to series of other radios to its destination point.
Ad-hoc Network Creation
The entire network of radios can be created wirelessly without any help from an individual.
24
Self-healing mesh
It automatically figures out if one or more radios were missing and repair any broken link.
Working of XBee
The XBee module connects to a host device through a logic level asynchronous port. Using its
serial port XBee can connect to any logic and voltage compatible UART.
3.2.1.3 Serial Interface Protocols
Transparent Operation
When operating in this mode all serial data received through Data in pin simply line up for radio
frequency transmission. The data send out through Data out pin after radio frequency data is
received.
Application Programming Interface (API) Operation
In API mode all data entering and leaving is contained in frames which describes the action of
the XBee modules. The frame allows the UART devices connected to communicate with the
network capabilities of the modules.
Table 3-3 - Pin out of XBee Series 2
Pin No. Name Direction Default State Description
1 Vcc - - Power Supply
2 Dout Output Output UART Data Out
3 Din/Config Input Input UART Data In
4 DIO12 Both Disabled Digital I/O 12
5 Reset Both Open-Collector with
Pull-up Module Reset
6 RSSI
PWM/DIO10 Both Output
RX Signal Strength Indicator
/Digital IO
7 DIO11 Both Input Digital I/O 11
8 [reserved] - Disabled Do not Connect
9
10
11
12
13
14
15
16
17
18
19
20
XBee can
figure 3-
When set
one coor
DIO8
GND
DIO4
CTS/DI
ON/Sle
VREF
DIO5
RTS/DI
AD3/DI
AD2/DI
AD1/DI
AD0/DI
3.2.2
n be configu
1.
t in this mod
dinator and
8 B
D
4 B
IO7 B
eep Ou
F In
5 B
IO6 B
IO3 B
IO2 B
IO1 B
IO0 B
XBee Zi2
ured as three
3.2.2.1 C
de the modul
to start the n
Both
-
Both
Both
utput
nput
Both
Both
Both
Both
Both
Both
igBee co
e device typ
Coordinator
le is in charg
network a ch
Input
-
Disabled
Output
Output
-
Output
Input
Disabled
Disabled
Disabled
Disabled
ncepts
pes Coordina
r
ge of setting
hannel and P
di
M
Fo
mo
Di
A
A
A
ator, Router
up the netw
PAN ID is as
Dig
G
Dig
Clear to sen
gital IO 7. C
o
odule Status
or compatibil
odules, conne
Sampli
Dig
Request to s
gital IO 6. R
Analog Inpu
Analog Inpu
Analog Inpu
Analog Inp
and End de
work. In each
ssigned. It a
gital IO 8
Ground
gital IO 4
nd Flow Cont
CTS, if enabl
output.
s Indicator o
IO 9
lity with oth
ect this pin i
ing is desired
gital IO 5
send flow co
RTS, if enabl
input
ut 3 or Digita
ut 2 or Digita
ut 1 or Digita
put 0, Digital
evice as show
h network th
llows router
25
trol or
led is an
r Digital
her XBee
if Analog
d
ontrol,
led, is an
al IO 3
al IO 2
al IO 1
l IO 0
wn in
here is
rs and
end devi
cannot sl
It’s like a
and send
informati
They sav
are not n
To transf
receiving
is fixed.
network
ices to join
leep during o
a node and i
d informatio
ion to other
ve power as
eeded. They
3.2.3
fer informat
g the informa
Then there i
this address
the network
operation.
3.2.2.2 R
is able to joi
on but it c
devices so th
3.2.2.3 E
they do not
y can be mult
Address3
tion between
ation. Each X
is dynamic s
is unique.
k. It requires
Router
in a ZigBee
can also ro
hat informat
End device
t transmit kn
tiple in num
Figure 3-1- A
sing of X
n radios one
XBee modu
hort 16 bit a
s continuous
network. A
ute the inf
tion can trav
nowledge to
mber and are a
A typical ZigBee
XBee
e should kn
le is assigne
address assig
s power as
After joining
formation m
vel to longer
other modu
able to send
network
now the dest
ed with a dif
gned by coor
it is like the
it is not onl
meaning tha
distances.
ules and can
d and receive
tination add
fferent 64 bit
rdinator to o
e main CPU
ly able to re
at it can co
sleep when
e information
dress of the
t address and
other radios.
26
U and
eceive
onvey
n they
n.
radio
d this
For a
27
3.2.3.1 PAN address
The ZigBee network is like a city in which the name of the city is in numbers which is also 16
bit. The available PAN addresses are 65,536 and it is quite a large number even if your project is
dealing with a huge quantity of networks.
3.2.3.2 Channels
The channel is like tuning the radio to get a desired frequency. To transmit information the
channel meaning the frequency of all radio should be same otherwise there won’t be any
communication between radios.
For the message to travel the channel and the PAN ID’s of the radio should be same. In addition
to this, the sending module should know the address of the receiving module. Destination serial
address should be set to zero if the data is to be send to coordinator only.
3.2.3.3 API Frame Types
In a frame type arrangements there are sub-arrangements which tell about different types of data
that can be send or received from XBee. Now we after looking at first four bytes we can
conclude about frame type, starting of a frame and how long that frame is going to be.
There are many API frame type designed for XBee but only Remote AT Command Request will
be discussed here as it fulfilled the need of the project.
3.2.3.4 Remote AT Command Request
This mode is used to send commands to the receiving XBee from the coordinator wirelessly. The
coordinator should be in API mode and Router in AT mode. One application of this mode is to
toggle output of receiving XBee from High to Low. It means that we are able to utilize relay
circuitry to switch our load end devices over the air.
Table 3-4- API format for Remote AT Command Request
Byte Example Description
0 0x7E Start byte - Indicate beginning of data time
1 0x00 Length – Number of bytes
28
2 0x10
3 0x17 Frame type – 0x17 means this is a AT command request
4 0x52 Frame ID – Command sequence number
5 0x00
64-bit Destination Address (Serial Number)
MSB is byte 5, LSB is byte 12
0x0000000000000000 = Coordinator
0x000000000000FFFF = Broadcast
6 0x13
7 0xA2
8 0x00
9 0x40
10 0x77
11 0x9C
12 0x49
13 0xFF Destination Network Address
(Set to 0xFFFE to send a broadcast) 14 0xFE
15 0x02 Remote command options (set to 0x02 to apply changes immediately)
16 0x44(D) AT Command Name (Two ASCII characters)
17 0x02(02)
18 0x04 Command Parameter
19 0xF5 Checksum
Byte 0 indicates the start of the byte which is 7E and byte 1 and 2 informs about start of byte
which is 0 and length of frame which is 16 bytes long respectively. All the numbers written here
are in hexadecimal as XBee is programmed to recognize numbers in hexadecimal. Byte 3 gives
information about frame type and 17 is an AT command request. Byte 4 is Frame ID which
acknowledges whether the other side has received the information or not. The next 8 bytes are to
29
write the serial address of the destination radio. It can be set 000000000000FFFF to set it as
broadcast meaning it will connect to nearest available XBee. The next two bytes are recipient’s
network address and setting it too FFFE will make it a broadcast. The next byte is about remote
command options and setting it to 02 will allow the XBee to make changes immediately. The
byte 16 and 17 are going to be the commands send to the remote XBee. The byte 18 contains any
parameters to be set. The last 19th byte is checksum which is needed to be accurate otherwise
XBee won’t perform any function it was assigned to do. It is the sum of bytes after the byte
length. [12]
3.3 Relay System
We used relays to control the state of load. The signal generated by XBee (router) cannot provide
enough power to control a load, so we used relay systems to control the state of load. The control
signal generated by LabVIEW is transmitted wirelessly to another XBee connected with a relay
system. When the relay system receives a signal from XBee it triggers the state of load
depending upon the nature of the received control signal.
Relays available in the market are of different types; single pole-double throw, double pole triple
throw etc. Since our project required the switching of five loads between on and off states so we
used single pole-double throw relays. This type of relay only switch the load between two states
on and off. These relays are readily available in the market and are reliable. The internals of a
single pole-double throw is shown in figure 3-2.
Figure 3-2 - Single Pole Double Throw
4 Ha
4
XBee pi
compatib
TX (data
XBee. Th
ardwa
4.1 Conn
ns are too
ble with XBe
a out) pin of
he layout of
re Imp
necting th
small to en
ee were rath
f XBee Coo
PCB is show
plemen
he XBee t
nter inside a
her expensiv
ordinator and
wn in figure
Figure 4-1- Pro
ntation
to Ardui
any breadbo
ve. The RX (
d the TX pi
4-1. The fin
oteus layout of X
no
oard so PCB
(data in) pin
n Arduino i
nal PCB is sh
XBee PCB
B were mad
n of Arduino
is connected
hown in figu
de as the b
o is attached
d with RX p
ure 4-2.
30
oards
d with
pin of
31
Figure 4-2- XBee Breakout Board
4.2 Software to Configure XBee
X-CTU is the software needed to configure the XBee. It’s free software and can be downloaded
from Digi official website. As discussed earlier the coordinator in this project was needed to be
programmed as API and router as AT mode. There are boards available with USB interface
which provide direct connections to your computer system, again they were adding extra cost so
another method was adopted. The reset pin of Arduino was connected to ground bypassing the
chip making Arduino a simple board. The RX pin of Arduino was connected to RX pin of XBee
and TX pin of Arduino was connected to TX pin of XBee. The caution was taken as the output of
Arduino pins is 5V and XBee can only survive 3.6V, hence voltage regulators of 3.3V were used
to prevent any damage to XBee. Then X-CTU was used to configure the coordinator in API
mode and no other settings were disturbed. The router was set in AT mode and channel
verification was enabled to check whether coordinator and router are communicating over the
same channel. No other settings were changed as the I/O pin settings were made over the air.
Main configuration Page of X-CTU is shown in figure 4-3.
32
Figure 4-3- Programming XBee with X-CTU software
4
To conne
software
figure 4-4
4.3 Relay
ect the load
and consist
4 below sho
12
J
X
y Circuit
d with router
ted of relays
ws the layou
R1
12R
J3
XBee output
r XBee a re
s, diodes, N
ut in Proteus
Figure 4-4- Rela
Figure 4-5- PC
D1DIODE
Q1TIP122
1 2
J26 V DC supply
elay circuit w
NPN transisto
s.
ay Circuitry to s
CB layout of rela
was needed
ors, DC sup
switch load
ay circuit
RG
. It was des
pply, resisto
RL1G5CLE-14-DC5
12
J4
LOAD
12
J
2
signed in Pr
ors and load
J1
220V AC
33
roteus
. The
34
Figure 4-6 - Relay Module
The figure 4-5 shows the PCB tracks made in Proteus. The Figure 4-6 above shows the final relay PCB.
35
5 Software Implementation The smart home control system has been divided into five parts or subsystems as shown in figure
5-1. Each subsystem can be taken out from the network without affecting other subsystems
functionality. All these subsystems can be accessed over the internet and desired variation can be
achieved. The first subsystem is the external lighting system. It controls all the external lighting
around the house. The second subsystem is the internal lighting system which basically controls
the ceiling lighting. The third subsystem is the fire alarm system. It detects the presence of fire
and warns the user in pre-programmed way. The fourth subsystem is the security unit of the
house. It is basically a burglar alarm system. The fifth subsystem is the temperature control of
the system and can be adjusted according to user’s desire.
Figure 5-1- Block Diagram of LabVIEW controlled applications
5.1 External Lighting system
The external lighting control system developed in LabVIEW uses a light dependent resistor
(LDR) to sense the light. The system automatically turns on or off the lights depending upon the
readings taken by sensor. On pressing the automatic switch the system automates the light
control. A potential divider is set up at the sensors end and a voltage change occurs at the sensors
end with the change in intensity of light because LDR’s resistance increases with a decrease in
LABVIEW
EXTERNAL LIGHTING
INTERNAL LIGHTING
FIRE ALARM SYSTEM
BURGLAR ALARM SYSTEM
TEMPERATURE CONTROL
36
light and it decreases as light intensity increases. Thus as potential drop across LDR varies goes
below than 3.5v the system turns on the light and when it goes above the particular threshold
then the lights are turned off. The graphical interface shows a LED which shows the current
status of lights that whether they are turned on or off. Moreover the user is also provided with a
manual switch to change the status of lights at his or her own will. The system also shows a
waveform chart continuously detecting the change in potential drop across the LDR. Moreover a
stop switch is present to turn off the system in case of a malfunctioning as shown in figure 5-2.
Figure 5-2- Front panel of external lighting system
In the back panel the programming for this system is done. Initially the settings for the
communication port are done. The Baud rate is kept at 9600. Then after initializing the
communication port LabVIEW takes input from Arduino UNO card and upon receiving this
input compares it with a threshold i.e. if the input is less than 0.3v then a Boolean true occurs but
if input is greater than 0.3v then a Boolean false occurs. On receiving a Boolean true serial write
is performed. A string is serially written into Arduino and then Arduino acts accordingly. On
receiving a Boolean false another string is written which tells Arduino to turn off the system for
the particular time being. After this the session is closed. The back panel of external lighting
system is shown in the figure 5-3.
37
Figure 5-3- Back panel of external lighting system
5.2 Internal Lighting system
The internal lighting system uses PIR sensor to detect motion and switch on or off the lights in
the room. PIR motion sensor generates a pulse of 3.3v whenever motion is detected. On
detection of this pulse the system turns on the lights. Moreover the user is provided with a
scheduler to control the time of the day for which the lights should be automatically controlled.
Apart from this time the user can manually change the state of lights with the switch provided in
the graphical interface. A light indicator is also present which indicates the current state of lights
so that the user will be aware that whether the lights are on or off in the particular room. A
waveform chart continuously plots the data being received from the PIR sensor. An emergency
stop switch is provided to turn off the system in case of a problem as shown in figure 5-4.
38
Figure 5-4- Front panel of internal lighting system
In the back panel firstly the communication port is initialized. LabVIEW then receives the
analog input and then uses a greater than or equal to block to compare the input with a threshold
of 3.3v. If input is greater than or equals to 3.3v a Boolean true occurs. When Boolean true is
present the output is turned on for a particular time being (as selected by the user) regardless of
the input state during that time instance. After that time instance the input is sampled again.
Upon receiving a Boolean false again a string is written which tells Arduino to turn off the
system for the particular time being. The whole system is placed in a while loop so that the
whole system keeps repeating unless the emergency stop is pressed. The back panel is shown in
the figure 5-5.
Figure 5-5- Back panel of internal lighting system
39
5.3 Fire Alarm System
The fire alarm system consists of a smoke detector. The smoke detector will send a signal on
detection of smoke and then LabVIEW will turn on the alarm to indicate that there is an
emergency. Moreover this system will send an email or SMS to the user warning him about the
situation. Furthermore solenoid valves will be installed in the house and they will turn on to help
extinguish the fire. A LED is present on the interface which will start blinking in case of
emergency alarming the user visually as shown in figure 5-6.
Figure 5-6- Front panel of fire alarm system
In the back panel input is received by LabVIEW and then the input is compared through a
greater than or equal to block with a value of 2v. The serial write is placed in a case structure. In
case of a Boolean true the system maintains this true state for a particular time instant. During
this time instant the alarm will stay on. LabVIEW will send a particular string to Arduino in case
of a true and a different string in case of a false. Upon receiving this string Arduino will send
corresponding signal to transceivers. The back panel is shown in the figure 5-7.
Figure 5-7- Back panel of fire alarm system
40
5.4 Burglar Alarm
This system uses a PIR sensor which will detect motion in case of a forced entry in the house. In
detection of entry the sensor will send a pulse of 3.3v. The burglar alarm system in LabVIEW
will detect this pulse and turn on the alarm to make the owner aware of the condition. A LED
will also start blinking on the main screen indicating the presence of a burglar in the house. This
system can also be capable of sending a short message to the user warning him of the condition.
An emergency shutdown switch is present to turn off the system in case of a system failure
which is shown in figure 5-8.
Figure 5-8- Front panel of burglar alarm system
The back panel for the burglar alarm system is similar to that of the fire alarm system. Upon
receiving the input from the sensor it will be compared with a particular threshold and then upon
receiving a Boolean true serial data will be send to Arduino. Then Arduino will perform the
corresponding function accordingly. The back panel is shown in the figure 5-9.
Figure 5-9- Back panel of burglar alarm system
41
5.5 Temperature Control System
LM35 is used as a temperature sensor in the temperature control system. As temperature changes
LM35 produces a change in the voltage level which is then used by the LabVIEW to decide
whether temperature is increasing or decreasing. Then by comparing the voltage output of sensor
to a particular threshold LabVIEW decides whether to turn on the heaters or the air-conditioners.
The front panel consists of a thermometer indicating the temperature changes occurring. There
are two LEDS one indicating the state of heaters and the other indicating the state of air-
conditioners. A shutdown switch is also present to turn off the system in case of a system failure
as shown in figure 5-10.
Figure 5-10- Front panel of temperature control system
In the back panel after initialization of communication port input is received. This input is then
furthermore compared with a particular threshold as recommended by the used i.e. whether air
conditioners should be working at 35oC or 40oC and then after comparing, Boolean true or false
is created. Upon receiving a true LabVIEW writes a particular string serially to Arduino telling
the card to perform a particular function. On receiving a false LabVIEW writes a different string
which tells Arduino to turn off the particular output. The back panel is shown in figure 5-11
below.
42
Figure 5-11- Back panel of temperature control system
5.6 Graphical User Interface
The final interface provided to the user will consist of a monitoring screen through which the
user will be able to look at the current situation of the system and then will be able to perform the
desired tasks. This interface will also provide the monitoring of the entire smart home system.
The individual systems mentioned above will be embedded in the final interface. The final GUI
is shown in the figures 5-12 and 5-13 below.
43
Figure 5-12- Final GUI: Monitoring & Control
Figure 5-13- Final GUI: Settings Panel
44
5.7 Data Logging
LabVIEW also provides the facility of data logging. There will be an excel file associated with
every system which will keep a complete log of the working as shown in the figure 5-14. The
data log will consist of the power consumption including the current and voltage consumed by a
particular load. At the end of the day the user will be able to see the daily consumption of
electricity and then plan the changes accordingly. Moreover this data logging can also indicate
the excessive use of a particular item. The user will be able to compare his power consumption
with that of the local power providers.
Figure 5-14- Data logging in excel
5
The user
World W
user wou
the system
below.
5.8 Contr
r will be ab
Wide Web. T
uld be able t
m. The auto
rol acros
ble to contro
The user wil
to see the fro
mation syste
Figure 5-15- Fi
ss the Glo
ol this syste
ll be provide
ont panel of
em can be op
inal GUI: Access
obe
m sitting fr
ed with a pa
f the system
perated from
sing Front Pane
rom anywhe
articular UR
on his scree
m a browser
el through intern
ere in the w
RL. By using
en and woul
like shown i
net browser
world throug
g this addres
ld able to co
in the figure
45
h the
ss the
ontrol
e 5-15
46
6 Conclusion This project presents a novel technique to implement a smart home automation system
which is both affordable and can be easily replicated with locally available equipment. The
automation system is based on a star network and each subsystem communicates with the central
control. This eliminates interference and we can take down any subsystem for maintenance
without affecting the working of other subsystems in the automation system. The automation
system is controlled through LabVIEW software and the accessibility of data over the internet
enables the user to access the system from anywhere in the world.
During the course of completion of this project, a lot of problems were faced. Configuration of
XBees with Arduino UNO and LabVIEW is difficult. There is no complete support over the
internet and no library of XBee in NI LabVIEW, which makes it difficult to interface and
communicate with the module.
6.1 Recommendations and Future Work
The prototype of the system is operating with only two XBees. The system is capable of using
mesh network topology to control the home with more than two XBees, but due to limited
resources, this goal was not achieved. The system can be made to use pre-programmed modes,
e.g. movie mode, sleep mode, vacation mode etc.
• The automation system based on LabVIEW is not capable of detecting fault. The system
can be made to detect faults as the technology progresses.
• The automation system uses PIR sensors, which can be triggered by house pets. Also PIR
sensors work best in cold to moderate temperature environment. PIR with 360o can be
used to accurately detect human occupants.
• The home automation system uses sensors that are easily available. Most of the sensors
are cheap and doesn’t provide a high resolution.
• The system is not standalone and requires the server to be powered on for 24 hours. This
means that the server needs a UPS.
• If the server crashes or is hacked in, the whole automation system is compromised.
47
• The system only controls the ON/OFF state of load. It can’t control the speed in case of
fan or thermostat in case of AC. A more elaborate system can be designed which involves
reed relays.
48
7 References [1] ABI Research “1.5 Million Home Automation Systems Installed in the US This Year.” 2014.
URL: https://www.abiresearch.com/press/15-million-home-automation-systems-installed-in-
th.
[2] B. Hamed, Design & Implementation of Smart House Control Using LabVIEW, vol. 1, issue
6, IJSCE, January 2012.
[3] Measurement Computing, USB 12-Bit DAQ Device with 8 Analog Input and 16 Digital I/O.
February 2014.
URL: http://www.mccdaq.com/usb-data-acquisition/USB-1208FS.aspx
[4] National Instruments, Introduction to Data Acquisition, May 2014.
URL: http://www.ni.com/white-paper/3536/en/
[5] Arduino, Arduino Board Uno, 2014.
URL: http://arduino.cc/en/Main/arduinoBoardUno
[6] Smarthome, What is X10, 2014.
URL: http://www.smarthome.com/sh-learning-center-what-is-x10.html.
[7] SmartHomeUSA , About UPB Technology, 2014 .
URL: https://www.smarthomeusa.com/info/UPB/about
[8] Digital Trends, ZigBee vs Z-Wave vs Insteon: Home automation protocols explained, 2014.
URL: http://www.digitaltrends.com/home/zigbee-vs-zwave-vs-insteon-home-automation-
protocols-explained/#!IZN7S
[9] Digi International, ZigBee® Wireless Standard,2014.
URL: http://www.digi.com/technology/rf-articles/wireless-zigbee
[10] Digi International, The Major Differences in the XBee Series 1 vs. the XBee Series 2,
2014.
URL: http://www.digi.com/support/kbase/kbaseresultdetl?id=2213
[11] R. Faludi, Building wireless sensor networks, Beijing: O’Reilly & Associates, 2010.
[12] Digi International, Digi Knowledge Base.
URL: http://www.digi.com/support/kbase/kbaseresultdetl?id=3222