You are on page 1of 13

Contents

Abstract ...................................................................................................................................................... 2
Acknowledgement ..................................................................................................................................... 2
Introduction ............................................................................................................................................... 3
1. LabVIEW and Smart Home Control System ................................................................................... 3
2. LabVIEW Features .......................................................................................................................... 3
Project Requirement .................................................................................................................................. 5
Limitation and Assumption ........................................................................................................................ 5
Flowchart ................................................................................................................................................... 6
Server - Client......................................................................................................................................... 6
Protocol Design .......................................................................................................................................... 7
TCP/IP..................................................................................................................................................... 7
Control Interface .................................................................................................................................... 9
Indicator/Server Interface ..................................................................................................................... 9
Additional Features .................................................................................................................................. 12
Future Enhancements .............................................................................................................................. 12
Conclusion................................................................................................................................................ 12
Bibliography ............................................................................................................................................. 13

System Programming and Computer Control (CT047-3-2-SPCC) 1


Abstract

This project involves the development of Smart House Control System by using
LabVIEW as the platform. This project is built in purpose to use sensors to do the automation
and control the motors. This project is separated into two modules showing the client and server.
The client works as a remote control and the server works as the house.

Acknowledgement

First of all, I want to show my special thanks to my SPCC lecturer Mr. SEYED AMIR
HOSSEIN MOUSAVI for introducing LabVIEW and give the great knowledge on how to use
LabVIEW, so that I manage to finish this Smart House Project. I also show my gratitude to all
of my classmates, and my friends who have helped me so much in doing this projects. I really
appreciate the help and time from my lecturer and friends.

System Programming and Computer Control (CT047-3-2-SPCC) 2


Introduction

1. LabVIEW and Smart Home Control System


Laboratory Virtual Instrument Engineering Workbench or LabVIEW is a programming
environment in which we create a program by using notations and wires connecting each
notations with the others. (Travis, 2006). In this regards, LabVIEW is a bit different from others
programming language such as C which is structured and C++ which is Object Oriented,
LabVIEW is more towards data flow oriented, it will only process and execute until the input
data needed is presents. This will made LabVIEW a strong programming platform because of its
ability to perform execution in parallel. (National Instruments, 2014)
Data Acquisition is a process of gather signal of data by using the proper device for each different
type of signal. In the traditional approach, it is very hard to acquire data because of the need of
proper receiving device, but by using LabVIEW and PXI, it can be easily done and have much
benefits. The benefits are low cost, higher performance, smaller size and flexibility.
Smart Home Control System is a project developed in purpose of helping the customer or user
to have a home which can do thing automatically or controlled from distance. In this project, the
modules will be separated into two modules which one will become the controller or remote and
the second is the representation of the house itself. Then the house representation will be
controlled by a remote which need user authentication.
National Instruments or NI, is a corporation which provide powerful application like LabVIEW, and
technology flexible solution that will accelerate productivity and drive rapid innovation (Instruments,
2014)

2. LabVIEW Features
LabVIEW has incorporated many function and feature in their application. Below are some
features of LabVIEW according to a university in Utah (University of Utah, 2008).
1. Global and Local Variables
In LabVIEW, Global variables is used when we need to manipulate data in several place.
It made us easier to manipulate the data and only need to define the data once. Global
variable can be used to write or read.

System Programming and Computer Control (CT047-3-2-SPCC) 3


2. Web Server
NI has integrated a web server in the version of LabVIEW 5.1 or above. This feature
allows user to view and control the front panel from a web browser. With this feature,
user can set the server IP and Port to be available to public or so called port forwarding.
3. Customizing Controls
In LabVIEW, Controls and Indicators can be customized like importing the picture to
change the control or indicator appearance and change the color. LabVIEW also allow
us to create a custom controls with our own data type or so called Type Definition.
4. Sound VIs
LabVIEW supports sounds in their programming, it can be found in Sound subpalette of
the Graphic & Sound palette. It enables user to incorporate and manipulate sound in the
application.
5. Data Logging
LabVIEW also enable user to debug their application and store all the value of front panel
controls with a corresponding time and date stamp to a file. Then this file can be showed
by using file I/O function and can be reviewed.
6. Find Features
When user develop a program, there are times where they need to search the instance of
an object, like when user create a local variable or property node. They can use find to
search the whereabouts of an instance. Find Features also can be used to find the controls
and indicators in front panel or in block diagram.

System Programming and Computer Control (CT047-3-2-SPCC) 4


Project Requirement

Smart Home Control System will be fulfilled by using LabVIEW because of its availability of
indicators and controls. For the virtualization of a smart home or server, we need at least a lamp,
door, curtain, and TV. For the remote, we need some button to controls the server. Then we need
to connect this two modules using a TCP/IP Connection. All of this requirement can be achieved
by using LabVIEW.

Limitation and Assumption

In this project, the server is based on virtualization only. This lead to some limitation that we
cannot do, like checking the temperature of a room. So we assume the temperature will up until
the normal temperature of a room which is 27°C when the AC is turned off.
We also assume only one user can logged in at each time so there is no collision of controls
between users.

System Programming and Computer Control (CT047-3-2-SPCC) 5


Flowchart

Server Client

System Programming and Computer Control (CT047-3-2-SPCC) 6


Protocol Design

TCP/IP
In this project, we use a connection oriented or TCP/IP as our protocols and Client-Server as the
architecture. As stated by Beal, Client-Server architecture is a network architecture which a
computer become either client or server (Beal, 2002). Server is a powerful computer which
process any request from the client.
TCP/IP is a protocol that works like an addressing of house, but it address each computer and
device. IP consist of public IP and private IP. The difference is public IP is used to communicate
from one local area network to another, while private IP is used to determine the address of each
computer in that local area network. With the help of ports, a communication between each
application is possible while IP will establish a connection between hosts. A combination of IP
Address and Port Number is called Socket Address.
In the implementation of TCP connection in LabVIEW, we use our computer as both Client and
Server. So we put localhost or 127.0.0.1 as the address and for the port number, we can use
Dynamic ports which not controlled and not registered by IANA. Its range from 49,152 to
65,535.
In LabVIEW, we need to start the server first because server is always listening while client only
need to send data where needed only. Then the first thing to do in the implementation is assigning
an ID to each controls and send the length of concatenated ID with value, this will make a
flexibility of number of bytes that will be read on the server.

System Programming and Computer Control (CT047-3-2-SPCC) 7


TCP Read and TCP Write is used to send and read the bytes of data and converts it to/from
Strings.

TCP Listen in Server

TCP Open Connection in Client

In the picture above, TCP Listen is used to open a service and continuously listen any incoming
request. We put the same number of port as the server which is 45000 and set the wait time to
-1 or forever. TCP Read is used to ready byte of binary and give the output in the form of string
We use 2 TCP Read because the number of bytes sent for ID and value is different for each case.
So we create the first TCP Write to send the length of string and the first TCP read to get the
number of string length for the second TCP Read Bytes to Read input. The received string then
will be split into ID and value. ID is for the case structure while the value is for changing the
indicator state.

System Programming and Computer Control (CT047-3-2-SPCC) 8


Control Interface

Figure 1. This control in client shows login page and the tab control for each floor.
Indicator/Server Interface
1. Garage in Server Front Panel:

Figure 2. Garage in Server will open and close when the button switched.

System Programming and Computer Control (CT047-3-2-SPCC) 9


2. Level 1 Server Interface

Figure 3. This picture show the level 1 floor (38 indicators can be controlled)

System Programming and Computer Control (CT047-3-2-SPCC) 10


3. Level 2 Server Interface

Figure 3. This picture show the level 2 floor (16 indicators can be controlled)

System Programming and Computer Control (CT047-3-2-SPCC) 11


Additional Features
1. Multiuser Login, Register and Delete
This Smart House System incorporated with a multiuser login system, logged in user then
have the privileges to add or delete user.
2. Fill and Empty Pool Water
There is feature to empty or fill a pool in this Smart House, It is operated by using two
controls for each empty and fill.
3. Air conditioner and Thermometer
Air conditioner also incorporated in the Smart House control, user can set the room
temperature and the thermometer will move based on the air conditioner temperature. If
the Air conditioner is turned off, then the temperature will be slowly reduced until the
normal room temperature.

Future Enhancements
1. Control enabled via web server
At future, it is possible to deploy the control interface into a webserver via a forwarded
IP and port. This feature will have much advantages, one of the example is checking IP
camera by logging in into their control interface.
2. Motor sensor and other sensors.
A Motor sensor can be used to automate light on or opening a door when a user enter the
corresponding room. Some sensor like rain sensor also can be used to automate curtain
closed when raining. Then temperature sensor to automate Air conditioner.

Conclusion
By using LabVIEW, automation can be achieved easily and more flexible. Smart Home
Control System is one of the example of automation in home. It also enables the user to control
their home with only by remote or by their own device.

System Programming and Computer Control (CT047-3-2-SPCC) 12


Bibliography
Beal, V., 2002. client-server architecture. [Online]
Available at: http://www.webopedia.com/TERM/C/client_server_architecture.html
[Accessed 5 12 2015].

Instruments, N., 2014. About NI. [Online]


Available at: http://www.ni.com/company/about-ni/
[Accessed 5 12 2015].

National Instruments, 2014. Top 5 LabVIEW Rookie Mistakes. [Online]


Available at: http://www.ni.com/newsletter/51735/en/
[Accessed 5 12 2015].

Travis, J., 2006. Introduction to Graphical Programming with LabVIEW. [Online]


Available at: http://www.informit.com/articles/article.aspx?p=662895&seqNum=3
[Accessed 5 12 2015].

University of Utah, 2008. LabVIEW Features. [Online]


Available at: http://www.physics.utah.edu/~bergman/3620-6620/supp/LV_Adv_Prog/2049ch02.pdf
[Accessed 5 12 2015].

System Programming and Computer Control (CT047-3-2-SPCC) 13

You might also like