Smart Home Automation using Labview

Published on January 2017 | Categories: Documents | Downloads: 67 | Comments: 0 | Views: 621
of 61
Download PDF   Embed   Report

Comments

Content

Sma
art Hom
me Autoomation
n using LabVIIEW
By

Bilal
B
Shaheeen
Hamza
H
Khaan
K
Kamil
Abbaas

neering in partial
p
fulfilllment of req
quirements for the
Thesiss submitted to the faculty of Engin
D
Degree
of BS Electricall Engineerin
ng

Department of
o Electricall Engineerinng,
E
and Applieed Sciences,,
Pakistan Innstitute of Engineering
N
Nilore,
Islamabad 456550, Pakistann
June, 20144

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.

vii

Table
T
of Coontents
ginality ............................................................................................................. iii 
Declaraation of Orig
Certificcate of Apprroval .................................................................................................................. iv 
Dedicattion ....................................................................................................................................... v 
Acknow
wledgementts ........................................................................................................................ vi 
Table oof Contents ..........................................................................................................................vii 
Table oof Tables ............................................................................................................................... x 
Table oof Figures ............................................................................................................................. xi 
Abstracct ....................................................................................................................................... xiii 




Inttroduction ............................................................................................................................. 1 
1.1 

Overview
w .......................................................................................................................... 1 

1.2 

Bird’s Eyye View ............................................................................................................... 1 

1.3 

Objectivees ......................................................................................................................... 2 

1.4 

Report layyout .................................................................................................................... 3 

Litterature Revview.................................................................................................................... 4 
2.1 

Automation ....................................................................................................................... 4 

2.2 

History .............................................................................................................................. 4 

2.3 

Types of Automationn ....................................................................................................... 5 

2.3
3.1 

Buildding Autom
mation ............................................................................................... 5 

2.3
3.2 

Poweer Automatiion ................................................................................................... 5 

2.3
3.3 

Indusstrial Autom
mation .............................................................................................. 5 

2.3
3.4 

Hom
me Automatiion .................................................................................................... 6 

2.4 

Types of Automationn Systems ........................................................................................ 6 

2.4
4.1 

Centrralized Systtems ................................................................................................. 6 

2.4
4.2 

Semii Distributedd/Centralizeed Systems .................................................................. 7 

2.4
4.3 

Distrributed Systtems ................................................................................................. 8 

viii

2.5 

Data Acqquisition Sysstems ............................................................................................... 9 

2.55.1 

Sensoors .................................................................................................................... 10 

2.55.2 

Data Acquisitionn Cards .......................................................................................... 12 

2.55.3 

Ardu
uino UNO.......................................................................................................... 15 

2.6 

Communiication .............................................................................................................. 16 

2.66.1 
2.7 

LabVIEW
W ....................................................................................................................... 19 

2.77.1 




Usingg DAQs wiith LabVIEW
W ................................................................................ 20 

Meethodology ......................................................................................................................... 21 
3.1 

Selection of DAQ caard .................................................................................................. 21 

3.2 

Modes off Communiccation ............................................................................................. 22 

3.22.1 

XBeee ....................................................................................................................... 22 

3.22.2 

XBeee ZigBee cooncepts ........................................................................................... 25 

3.22.3 

Addrressing of XBee
X
............................................................................................... 26 

3.3 


Typees of Comm
munication ....................................................................................... 16 

Relay Sysstem .................................................................................................................. 29 

Haardware Impplementatioon ................................................................................................... 30 
4.1 

Connectinng the XBeee to Arduino ................................................................................. 30 

4.2 

Software to Configurre XBee ......................................................................................... 31 

4.3 

Relay Cirrcuit .................................................................................................................. 33 

Sooftware Implementationn ..................................................................................................... 35 
5.1 

L
system .............................................................................................. 35 
External Lighting

5.2 

Internal Lighting
L
sysstem................................................................................................ 37 

5.3 

Fire Alarm
m System ......................................................................................................... 39 

5.4 

Burglar Alarm
A
................................................................................................................ 40 

5.5 

Temperatture Controll System ........................................................................................ 41 

5.6 

Graphicall User Interfface ............................................................................................... 42 

ix



5.7 

Data Logging ............................................................................................................. 44 

5.8 

Control across the Globe ........................................................................................... 45 

Conclusion ....................................................................................................................... 46 
6.1 



Recommendations and Future Work ......................................................................... 46 

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

5

became popular
p
but as there was not any sim
mplified prootocol to imp
mplement succh systems itt was
still not affordable by
b common man. ABI research
r
tellss that in 2012 the numbber of autom
mated
home rosse to 1.5 million
m
in US
S and this fiigure will riise to 8 milllion till 20117 as the cuurrent
analyses shows. [1]
Although
h the start of
o the autom
mation system
m used cablles to comm
municate witth controllerr and
devices. But since th
he advent off wireless tecchnology, thhe whole sceenario has chhanged a lott. The
a
system
s
to bee introduced in the markket was the X
X-10. Since then,
first wireeless home automation
many home automation systems have entereed the markeet and we arre witnessingg progress inn this
d by day.
domain day

2.3
2 Types of Auto
omation
There aree mainly fou
ur types of au
utomation diiscussed beloow:

2.3.1
1 Building
g Automa
ation
Building automation
n essentially
y means co
ontrolling thhe different devices prresent insidee the
network of a buildiing. This co
ould includee surveillannce systems,, power sysstems, and other
mechaniccal systems inside a building.
b
Most
M
of the building aautomation systems usee the
distributeed control sy
ystems for eaasier access in case of apppliance failuure.

2.3.2
2 Power Automati
A
ion
Power sy
ystem autom
mation, comm
monly known
n as power aautomation eemploy techhniques to coontrol
power pllants by usin
ng instrumen
ntation devicces and conttrol systems. Data is acqquired in forrm of
voltage or
o current waaveforms. Th
his acquired
d data is thenn sent to the database whhere the enggineer
or superv
visor uses th
he data for making
m
futurre decisions. The power system autoomation can even
perform fault detecttion and co
orrection wiithout humaan interferennce. The m
most used ppower
y Control an
nd Data Acquuisition or S
SCADA systtem.
automation system iss Supervisory

2.3.3
3 Industriial Autom
mation
Industriaal automation
n use differeent kinds of control to c arry out autoomation proocesses. Sincce the
industries now a days heavily relly on compu
uters and infoormation tecchnology, it bbecomes obvvious
utomation eq
quipment to monitor
m
and
d control diffferent parts oof the plant. Most of thee time
to use au

6

HMI (Hu
uman Mach
hine Interfacce) is used to monitor and controol the activiity of a proocess.
Industriaal automatio
on is used for processs control, eenergy manaagement annd environm
mental
managem
ment.

2.3.4
4 Home Automatio
A
on
Home au
utomation as discussed in
n the previou
us paragraphhs is the autoomation applied to houseehold
appliancees. It can incclude intellig
gent event triiggering, whhere the systtem takes ann action accoording
to the sig
gnal receiveed from the environmen
nt or the ort
rthodox scheeduled taskss e.g. turninng the
outdoor light
l
on and off at a speecific time. The
T basic puurpose of hoome automattion systemss is to
provide the
t user con
nvenience an
nd offer a mo
ore comfortaable and seccure life. In addition to these
and many
y other num
merous featurres, it can help
h
you savve energy, w
which is becooming a preecious
commodity in our co
ountry. The present hom
me automatioon systems can providee the user coontrol
over inteernet and thu
us enabling the user to monitor annd control hhis/her housee from anyw
where
around th
he world.[2]

2.4
2 Types of Auto
omation Systems
S
Automation systems have been present
p
for more
m
than a hundred yeears now andd have consttantly
evolved with
w the chaanging techn
nologies. Theese systems have changed from a siimple to com
mplex
schemes.. Based on the
t level off complexity
y, automationn systems aare further ccharacterizedd into
three majjor categoriees:

2.4.1
1 Centrali
lized Systtems

Figure 2-1 - Tyypical Centralizeed Systems

7

These sy
ystems are th
he oldest of automation
a
systems.
s
Alll the devicess are controllled or moniitored
from onlly one rack or control panel.
p
The systems
s
are usually lesss complex w
when it com
mes to
logic butt they requirre a lot of hardware
h
and
d space as th
the number oof inputs annd outputs ggo up,
because now
n
these in
nputs and ou
utputs would
d require sepparate data cables. Proggrammable L
Logic
Controlleer or PLC is based on thee same conccept. Block ddiagram is shhown in figuure 2-1.

2.4.2
2 Semi Diistributed
d/Centrallized Systems

Figu
ure 2-2 - Semi Distributed/Centr
D
ralized Systems

These sy
ystems are partially
p
disttributed and
d partially ceentralized coontrol systeems, as show
wn in
figure 2--2. This systtem also con
nsists of a main
m
controlller which ccontrols diffferent periphherals
attached to it throug
gh a field bus.
b
The perripherals connnected with
th the centraal controllerr also
contain a processor, and can be programmed
d separately from the ceentral controoller. This syystem
is a little bit more complex than the old centrral systems bbut provide more flexibiility. Thoughh this
a
ing and saves a good deal
d
of hardw
ware, the usser must repprogram the main
is very accommodat
controller to change the
t logic to desired
d
settin
ngs.

8

2.4.3
3 Distribu
uted Systtems
These are the new systems and are generallly more exppensive thann the rest of the types. T
These
type of systems
s
conttain multiplee subsystem
ms, each linkked together to form a m
mesh networrk, as
shown in
n figure 2-3. The commu
unication beetween the ssubsystems ccan be achieeved using ccables
or radio frequencies. Each roo
om of the house or bbuilding cann have its own subsyystem,
independ
dent of otherr subsystemss present insiide the wholle building. This subsystem is capabble of
controllin
ng the lights, temperatu
ure etc. on its
i own. Whhile this subbsystem conntrols the deefined
parameteers of the roo
om, the conttroller of the subsystem is controlledd by anotherr controller w
which
communicates with all
a the contro
ollers of all the
t subsystem
ms present innside a buildding.

Figu
ure 2-3 - Mesh Network
N
of Distrributed Systems

As the whole
w
system
m works in a mesh like network,
n
it iis not affecteed if one off the subsysteem is
taken dow
wn for main
ntenance or iff it malfuncttions. The leevel of flexibbility in this type of systtem is
more thaan the rest off the system
ms available in the past. A highly usser friendly interface ennables
the novicce user to customize th
he settings to
o suit his/heer needs. Thhough it is vvery flexiblee, 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
Centralized

Semi-Centralized/Decentralized

Pros

Cons

Simple

Extensive cabling required

Less software required

Large space required

Easy to update software etc.

Complex

Easily upgradeable hardware

Lacking redundancy

Easy to maintain and upgrade
Decentralized

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]

10

Figure 2-4
2 - DAQ Systeems

The phy
ysical quanttities can be
b temperatu
ure, light ettc. These pphysical pheenomena caan be
measured
d by differen
nt type of seensors availaable in the m
market. Somee of the com
mmon sensorrs are
given bellow.
Table 2-22 Sensor Typees

Sensor

Pheno menon

Thermoco
ouple, Therm
mistor

Tempeerature

Photo Sen
nsor

Light

Micropho
one

Sound

Strain Gaage, Piezoeleectric Transd
ducer

Force aand Pressuree

Potentiom
meter

Positioon and Displacement

2.5.1
1 Sensors
s
2.5.1.1 Temperatur
T
e sensors
They aree temperaturee sensors wiith voltage liinearly propportional to ddegree
centigrad
de. It works in a range of -55 to 15
50 degree ccentigrade. D
Due to

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.
Figure 2-5 Sensor LM 35

Temperature

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

Figure 2-6 - Passive IR Sensor

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.

12

2.5.1.4 Smoke
S
detecctor
It is a deevice that detects smoke which resullts in the eveent of fire staarting. Manyy smoke deteectors
work on the principlee of photoeleectric and ionization.
Two maiin types of sm
moke detecto
ors;
Optical
It is ligh
ht sensor in which theree is light so
ource like buulb and a leens to
focus its light in a form of beam.. In the absen
nce of smokke the light ppasses
straight through
t
in frront of the detector and if
i smoke is ppresent it cuuts the
path of light and ligh
ht reaches sensor
s
and trrigger the allarm as show
wn in
7.
figure 2-7
Ionization

Figuree 2-7 - Smoke Deetector

These seensors usess radio isottopes like americium--241 to prooduce
ionization
n in air. Whenever theree is smoke diifference is ddetected cauusing alarm tto trigger.

2.5.2
2 Data Ac
cquisition
n Cards
Data Acq
quisition carrds, shown in
n figure 2-8,, act as a briidge betweenn the real phhysical worldd and
the digitaal world. It digitizes the incoming data so thatt the compuuter can inteerpret them. Data
Acquisitiion cards are used to prrocess the physical
p
quanntities after they have bbeen transfoormed
into electtrical signalss by sensing
g instrument.. As newer ttechnology hhas arrived, Data Acquissition
(DAQ) cards
c
with more
m
resolutiion and inpu
ut/output poorts are avaiilable in the market. Wee can
then exploit the disp
playing and processing capabilities
c
of a PC to further anallyze the acqquired
data. Eveen though th
he technology
y advances has
h brought in new techhniques, the bbasic structuure of
every DA
AQ card is allmost the sam
me. Every DAQ
D
containns a signal coonditioning ccircuitry whhich is
compriseed of an amp
plifier and an
nalog to digiital converteer, input/outpput ports andd microcontrroller
or microp
processor.
Data Accquisition Devices
D
are available in differennt types, m
mainly charaacterized byy IO
(input/ou
utput) ports,, sampling rate, resolu
ution and coost. DAQ ddevices are interfaced with
computerr in a num
mber of diffferent ways.. Most of tthe DAQ ddevices are PCI (Perippheral

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 singleended 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]

15

2.5.3
3 Arduino
o UNO
nd 3.0 com
mpatible deviice shown iin figure 2-10. It is used in
Arduino UNO is a USB 2.0 an
duino UNO is mainly ssold as micrrocontroller board baseed on
multitudee of projectts. The Ard
ATmega 328 chip. The
T board supports
s
14 digital I/O pins. It alsoo have 6 annalog inputs. The
board can
n be program
mmed throug
gh the USB port with thhe Arduino ID
DE softwaree that comess with
the packaage.
Although
h the UNO can
c be used as DAQ caard, but its ssampling ratte is much loower than thhe NI
DAQ carrds. The max
ximum samp
pling rate thaat the UNO ccan achieve is about 5kS
Samples/sec..

Figure 2-102
Arduino UN
UNO

The Ard
duino UNO has an AD
DC with 10
0-bit resolutiion. The A
Arduino UNO
O communiicates
through serial
s
port by
y using its 0 (RX) and 1 (TX) pins. RX pin is ussed to receivve and TX ppins is
used to trransmit the data.
d
Althou
ugh the numb
ber of analo g channels iis less than tthat of a NI DAQ
card, butt it is inexpeensive and iss easily avaiilable. The oonly downsiide is the sloow samplingg rate

16

(30 Sam
mples/sec) an
nd the diffiiculty in intterfacing thhe Arduino UNO with LabVIEW. The
interfacin
ng will be diiscussed in th
he coming chapters. [5]

2.6
2 Comm
municatiion
Commun
nication is th
he process of
o transferrin
ng data from
m the data accquisition caard to the deesired
load. Wee are using wireless
w
com
mmunication in which deevices know
wn as XBee, based on ZiigBee
technolog
gy are used to
t transfer our signals frrom LabVIE
EW to load.

2.6.1
1 Types of
o Commu
unication
n
The two types of co
ommunicatio
on are poweer-line comm
munication aand wirelesss communicaation.
Wireless technology was chosen
n but the reaasons to droop power-linne Communnication wouuld be
briefly diiscussed.
2.6.1.1 Power-line
P
Communica
C
ation:
It is a co
ommunicatio
on technique in which a person moddulates the data and sendds it over thee line
and dem
modulates it at the receiiver’s end to
o read whatt informatioon was sendd. The differrence
between other comm
munications is
i that it doees not requirre any new wiring as thhe wiring ussed in
our homees is used fo
or sending in
nformation. This meanss all the deviices connectted to powerr line
can be co
ontrolled and
d monitored..
A carrierr in the range of 20 to 200 kHz com
mmonly know
wn as narrow
w band is m
modulated intto the
wiring of the house. The reason
n to use thiis band is too avoid inteerference wiith radio channel
y and it is not
n legal to operate
o
in the range of thhose frequenncies. The carrier is digiitized
frequency
and the each
e
receiverrs used havee an address and can be ccontrolled byy signals trannsmitted oveer the
line and decoded att the receiv
ver. So we can use devvices pluggged inside ppower sockeets or
permanen
ntly wire theem.
Advanta
ages:


No
N new wirin
ng was needeed.



Anything
A
plugged inside socket could
d be controllled.

Disadvan
ntages:

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

20

LabVIEW
W analyzes the
t block diagram and compiles
c
it tto create a pproficient maachine code.. This
machine code avoidss the disadvantages relaated with perrformance thhat are associated with other
languagees. LabVIEW
W can also break down the
t applicatiion into mannifold threadds which cann then
be run in
n parallel pro
oviding efficcient results and better ccontrol as coompared to a single threeaded
serial app
plication. LaabVIEW pro
ovides option for both ggraphical proogramming and a code to be
written by
b the user in
i C but thee graphical programming
p
g is consideered more feeasible becauuse it
provides the ease of combining
c
a number of modules alreeady provideed by the software. One node
is conneccted with thee other by means
m
of wirees. The whoole sketch alsso gives a general idea aabout
the physiical realizatiion of the system. Furth
hermore LabbVIEW provvides remotte access thrrough
internet making
m
it easy for the usser to controll his applicaation sitting iin any part oof the world.

2.7.1
1 Using DAQs
D
with
h LabVIE
EW
LabVIEW
W can comm
municate witth the outer world
w
usingg different kiinds of hardw
ware periphherals.
In most cases,
c
a DAQ
Q card is used to obtain
n the data froom the real w
world. The ddata obtained can
be manip
pulated at useer’s will.
There aree different ty
ypes of anallysis available in LabVIE
EW. One caan perform ccurve fitting,, take
FFT of th
he acquired signal, timee and frequen
ncy analysiss and much more. The aacquired datta can
be displaayed in graph
hs, tables an
nd with a GU
UI for the endd user. The iinformation flow is show
wn in
figure 2-12.

Figurre 2-12- Processing acquired siggnal in LabVIEW
W

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 )

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

Analog Inputs

 

22

Arduino UNO was purchased because
b
it was
w a well-rrounded subbstitute for tthe expensivve NI
gh our decission favored
d the purchaase of UNO
O, but it prroved difficuult to
DAQ card. Althoug
interface with NI Lab
bVIEW softw
ware. The prroblems willl be discusseed in the com
ming chapterrs.

3.2
3 Modees of Com
mmunica
ation
3.2.1
1 XBee
The com
mmon misconception is that peoplee think that XBee and ZigBee are identical thhings.
XBees arre digital rad
dios that may
y or may no
ot be using Z
ZigBee experrtise like eveeryone nowaadays
possessess a cellphon
ne with Wi-F
Fi and it caan be used tto downloadd and transfeer data. Thinnk of
XBee as the cellphon
nes and ZigB
Bee as the Wi-Fi.
W
3.2.1.1 Types
T
of XBee
There aree many typees of XBees available in
n the market.. We selecteed two of thee XBees, serries 1
type and series 2 typee. A brief co
omparison beetween the tw
wo is made in the next ffew lines
Series 1 XBee
The chip
p used is man
nufactured by
b Freescalee to offer higgh quality pooint to pointt communicaation.
The stand
dard followeed is just 802
2.15.4 firmw
ware which iss faster than ZigBee.
Series 2 XBee
p used is manufacture
m
ed by Ember Networkks in whichh different type of ZiigBee
The chip
standardiized mesh neetworking caan be implem
mented. Thee ZigBee meesh network is unsurpasssed in
low poweer scenarios.
The both
h types of Xbees are further diviided in XBeees and Xbbees-Pro verrsions. The only
differencce between th
hem is that in Pro versio
ons power traansmission ccapacity is hhigher. [10]
Table 3-2- Product Co
omparison (Seriies 1 vs. Series 2)

Characteeristics
Indoor/Urban ran
nge

XBee Serie s 1
up to 100
1 ft. (30m))

3 ft. (100m
m)
Outdo
oor RF line--of-sight ran
nge up to 300

XBee Series 2
uup to 133 ft. (40m)
uup to 400 ft. (120m)

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

PCB,

Antenna Options

Integrated

Whip, PCB,

U.FL, RPSMA

Network Topologies

Number of Channels

Whip,

U.FL, RPSMA

Point to point, Star, Mesh Point to point, Star, Mesh
(with DigiMesh firmware)
16

Direct

Sequence 16

Channels
PAN

Filtration Options

Integrated

ID,

Direct

Sequence

Channels
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

6

RSSI
PWM/DIO10

Open-Collector with
Pull-up

Both

Output

Module Reset
RX Signal Strength Indicator
/Digital IO

7

DIO11

Both

Input

Digital I/O 11

8

[reserved]

-

Disabled

Do not Connect

25

9

DIO8
8

Both
B

Input

Diggital IO 8

10

GND
D

-

-

G
Ground

11

DIO4
4

Both
B

Disabled

Diggital IO 4
Clear to sennd Flow Conttrol or

12

CTS/DIIO7

Both
B

Output

digital IO 7. C
CTS, if enablled is an
ooutput.

13

ON/Sleeep

Ou
utput

Output

Module Statuss Indicator or Digital
IO 9
Foor compatibillity with othher XBee

14

VREF
F

In
nput

-

moodules, conneect this pin iif Analog
Sampliing is desiredd

15

DIO5
5

Both
B

Output

Diggital IO 5
Request to ssend flow coontrol,

16

RTS/DIIO6

Both
B

Input

Digital IO 6. R
RTS, if enablled, is an
input

17

AD3/DIIO3

Both
B

Disabled

A
Analog Inpuut 3 or Digitaal IO 3

18

AD2/DIIO2

Both
B

Disabled

A
Analog Inpuut 2 or Digitaal IO 2

19

AD1/DIIO1

Both
B

Disabled

A
Analog Inpuut 1 or Digitaal IO 1

Both
B

Disabled

Analog Inpput 0, Digitall IO 0

20

AD0/DIIO0

3.2.2
2 XBee ZiigBee concepts
XBee can
n be configu
ured as threee device typ
pes Coordinaator, Router and End deevice as show
wn in
figure 3-1.
3.2.2.1 Coordinator
C
r
When sett in this mod
de the modulle is in charg
ge of setting up the netw
work. In eachh network thhere is
one coordinator and to start the network
n
a ch
hannel and P
PAN ID is asssigned. It allows routerrs and

26

end deviices to join the network
k. It requiress continuouss power as it is like thee main CPU
U and
cannot slleep during operation.
o
3.2.2.2 Router
R
It’s like a node and is
i able to joiin a ZigBee network. A
After joining it is not onlly able to reeceive
and send
d informatio
on but it can
c
also route the infformation m
meaning thaat it can coonvey
informatiion to other devices so th
hat informattion can travvel to longer distances.
3.2.2.3 End
E device
They sav
ve power as they do nott transmit kn
nowledge to other moduules and can sleep whenn they
are not needed. They
y can be multtiple in num
mber and are aable to sendd and receivee informationn.

Figure 3-1- A typical ZigBee network

3.2.3
3 Address
sing of XBee
X
To transffer informattion between
n radios onee should knnow the desttination adddress of the radio
receiving
g the informaation. Each XBee
X
module is assigneed with a diffferent 64 bitt address andd this
is fixed. Then there is
i dynamic short 16 bit address
a
assiggned by coorrdinator to oother radios. For a
network this address is unique.

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

6

0x13

7

0xA2

64-bit Destination Address (Serial Number)

8

0x00

MSB is byte 5, LSB is byte 12

9

0x40

10

0x77

11

0x9C

12

0x49

13

0xFF

14

0xFE

15

0x02

16

0x44(D)

17

0x02(02)

18

0x04

Command Parameter

19

0xF5

Checksum

0x0000000000000000 = Coordinator
0x000000000000FFFF = Broadcast

Destination Network Address
(Set to 0xFFFE to send a broadcast)
Remote command options (set to 0x02 to apply changes immediately)
AT Command Name (Two ASCII characters)

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

30

4 Ha
ardware Imp
plemen
ntation
4.1
4 Conn
necting th
he XBee to
t Arduino
XBee pins are too small to en
nter inside any
a breadbooard so PCB
B were madde as the boards
compatib
ble with XBeee were rath
her expensiv
ve. The RX ((data in) pinn of Arduinoo is attachedd with
TX (dataa out) pin off XBee Coo
ordinator and
d the TX pi n Arduino iis connectedd with RX ppin of
XBee. Th
he layout of PCB is show
wn in figure 4-1. The finnal PCB is shhown in figuure 4-2.

Figure 4-1- Pro
oteus layout of X
XBee PCB

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

33

4.3
4 Relay
y Circuit
To conneect the load
d with routerr XBee a reelay circuit w
was needed. It was dessigned in Prroteus
software and consistted of relayss, diodes, NPN
N
transistoors, DC suppply, resistoors and load. The
figure 4-4
4 below shows the layou
ut in Proteuss.

J2
6 V DC supply

J
J1
1
2

1
2
2
220V
AC

R
RL1
G
G5CLE-14-DC5

D1
DIODE

J4
J
J3
1
2

R1

Q1
TIP122

12R

1
2
LOAD

X
XBee
output

Figure 4-4- Rela
ay Circuitry to sswitch load

Figure 4-5- PC
CB layout of relaay circuit

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.

EXTERNAL 
LIGHTING

INTERNAL 
LIGHTING

TEMPERATU
RE CONTROL

LABVIEW

BURGLAR 
ALARM 
SYSTEM

FIRE 
ALARM 
SYSTEM

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

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 airconditioners. 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

45

5.8
5 Contrrol acrosss the Glo
obe
The userr will be ab
ble to contro
ol this system sitting frrom anywheere in the w
world through the
World Wide
W
Web. The
T user willl be provideed with a paarticular UR
RL. By usingg this addresss the
user wou
uld be able to
t see the fro
ont panel off the system on his screeen and woulld able to coontrol
the system
m. The automation systeem can be op
perated from
m a browser like shown iin the figuree 5-15
below.

Figure 5-15- Fiinal GUI: Accesssing Front Paneel through internnet browser

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-inth.
[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-automationprotocols-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

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close