Está en la página 1de 23

INDIVIUAL ASSIGNMENT

SMART HOME CONTROL SYSTEM


CT047-3-2-SPCC

SYSTEM PROGRAMMMING AND COMPUTER CONTROL

NP2F1701IT

Dibesh Shrestha (NP000029)

HAND OUT DATE: 29 AUGUST 2017

HAND IN DATE: 3 NOVEMBER 2017

WEIGHTAGE: 50%

INSTRUCTIONS TO CANDIDATES

1. Submit your assignment to the administration counter.


2. Students are advised to underpin their answers with the use of references (sites
using the Harvard Name System of Referencing)
3. Late submission will be awarded zero (0) unless Extenuating Circumstances (EC)
are upheld
4. Cases of plagiarism will be penalized
5. The assignment should be bound in an appropriate style (Comb Bound or Stapled)
6. Where the assignment should be submitted in both hardcopy and softcopy, the
softcopy of the written assignment and source code (where appropriate) should be
on a CD in an envelope/ CD cover and attached to the hardcopy.
7. You must obtain 50% overall to pass this module
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

Acknowledgement
This project report is prepared for the partial fulfillment of the requirement for the degree
of BSc.IT in accordance to the rules and regulations prescribed by Asia Pacific University
(APU). I would like to express our deepest gratitude to our college Lord Buddha Education
Foundation (LBEF) and our university APU which provided this opportunity to learn many
things related to graphical programming languages. This project wouldn’t be completed
without the kind cooperation of faculties of this college.

Further, I am grateful to Mr. Suresh Chand faculty member of SYSTEM


PROGRAMMING AND COMPUTER CONTROL for his guidance and help to complete
this project. I also would like to show my appreciation to all who supported directly or
indirectly to complete this project in limited timeframe.

Sincerely,

Dibesh Shrestha (NP000029)

B. Sc.IT ‘A’
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

Executive Summary
This project is about “Smart Home Control System” which is developed by using
LabVIEW programming language. This system controls various device of the house
through TCP/IP connections. Different types of devices like curtain, television, lights,
doors etc. are controlled by this system. This prototype shows the clear picture of what
the system does. This prototype is designed so that actual physical implementation in
the future will be easy.
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

Table of Contents
List of Figures ....................................................................................................................... i
1 Introduction .................................................................................................................. I
1.1 LabVIEW .............................................................................................................. I
1.2 Controls and Functions of LabVIEW.................................................................... I
2 Protocol Design .......................................................................................................... III
2.1 Server Module ..................................................................................................... III
2.2 Client Module......................................................................................................IV
2.3 TCP/IP .................................................................................................................IV
2.3.1 TCP Open Connection .................................................................................. V
2.3.2 TCP Write ..................................................................................................... V
2.3.3 TCP Read .....................................................................................................VI
2.3.4 Type Listen ................................................................................................ VII
2.3.5 TCP Close Connection.............................................................................. VIII
3 System Design ...........................................................................................................IX
4 Implementation of Hardware/Device…………………………………………………9
References ....................................................................................................................... XVI
Appendix ....................................................................................................................... XVII
Appendix I: Marking Grid ........................................................................................ XVII
Appendix II: Floor Plan ........................................................................................... XVIII
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

List of Figures
Figure 1: Server Module .................................................................................................... III
Figure 2: Client Module .....................................................................................................IV
Figure 3: TCP Open Connection Function ......................................................................... V
Figure 4: TCP Open Connection in Client Side.................................................................. V
Figure 5: TCP Write Function ............................................................................................ V
Figure 6: TCP Write Function in Client side .....................................................................VI
Figure 7: TCP Read Function ............................................................................................VI
Figure 8: TCP Read in serve side ......................................................................................VI
Figure 9: TCP Listen ........................................................................................................ VII
Figure 10: TCP Listen in Server Module ......................................................................... VII
Figure 11: TCP Close Connection Function ................................................................... VIII
Figure 12: TCP Close Connection .................................................................................. VIII
Figure 13Ultrasonic Sensor.............................................................................................. XII
Figure 14 Relay ................................................................................................................ XII
Figure 15Login Screen .................................................................................................... XIII
Figure 16 Level 0 ............................................................................................................ XIII
Figure 17Level 1 ............................................................................................................. XIV
Figure 18 Logged In Screen ............................................................................................ XIV

i
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

1 Introduction
The goal of this assignment is to build a smart home control system for a house where
system controls the various devices that are installed in the house through TCP/IP
connections. The system is to be built in such a way that will allow the user to key in the
master PIN number to gain access to the control system from the master bedroom and the
main entrance to level 0. The installed devices in the house are equipped with motor/sensors
that allow them to be controlled through a network TCP/IP. With the floor plan provided
with the system design, the whole system is expected to be able to control devices that are
in the home through TCP/IP based on the design of the floor plan. The system is to be
designed with the central control keypad in the master bedroom and the main entrance
where database is used to store authorized user data of the system. The user will also have
the ability to add or modify PIN numbers and other login details through this central control
keypad.

1.1 LabVIEW
LabVIEW (short for Laboratory Virtual Instrumentation Engineering Workbench) is a
platform and development environment for a visual programming language from National
Instruments that offers more flexibility than standard laboratory instruments because it is
software-based. The graphical language is named "G". To create a VI, the programmer uses
the LabView programming environment to make the user interface by dragging and
dropping objects, and arranging them as desired. There is wide selection of hardware
interfaces and meters to enable the programs to monitor and control electronic equipment.
There are two types of panel. They are front panel and block panel. The Front panel consists
of tools palette and controls palette which are required for programming. And B the Block
panel consists of functions palette which are used for giving inputs and outputs to various
controls which are wired together.

1.2 Controls and Functions of LabVIEW


LabVIEW consists of many hardware interfaces that allows us to create a virtual
environment of smart home security which makes it easy to develop the prototype of Smart
home control system. Different types of controls and functions are used in LabVIEW
programs to meet the requirement of the system. Some of them are listed below;

Controls

I
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

Controls that are used in designing process are listed below:

 Boolean
 Vertical Fill Slide
 Horizontal Fill Slide
 Button
 String Control
 Constant
 Windows Media Player so on.

Functions

Different types of function that are used in designing process of prototype. They are listed
below:

 While Loop
 Case Structure
 Event Structure
 String Subset
 Decimal String to Number
 Number to Decimal
 String Subset
 Search/Split String
 Type Cast
 Two Button Dialog
 Concatenate String
 Clear Error
 TCP Open Connection
 TCP Close Connection
 TCP Write
 TCP Read
 TCP Listen
 Property Node and so on.

II
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

2 Protocol Design
2.1 Server Module

Figure 1: Server Module

The above mentioned figure is block diagram of Server module in LabVIEW. Different
function related to TCP are used in the system. Functions used for TCP network connection
are TCP Listen, TCP Read, and TCP Close Connection. TCP Listen is used to connect the
client through the help of port number and IP address. TCP Listen receive the signal and
its port is checked whether there is the port with same IP address or not. If there is port,
then it is relay to the TCP read. TCP read function is used to read the data and performed
the function which is declared by the programmer. TCP Close Connection is used to close
the TCP Network Connection.

III
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

2.2 Client Module

Figure 2: Client Module

The above figure is of Client Module of the system. There are three types of TCP protocol
functions used in this module. They are TCP Open Connection, TCP write, and TCP Close
Connection. TCP Open Connection is used to open TCP network connection of client
module and server module. TCP write function is used to write the data on the memory so
that it can be pass to the server for performing respective function. And TCP Close
Connection is used to end the connection of two modules i.e. client module and server
module.

2.3 TCP/IP

TCP/IP (Transmission Control Protocol/Internet Protocol) is the set of rules for establishing
connection. It is the basic communication tool for network connection. TCP defines how
applications can create channels of communication across a network. It also manages how
a message is assembled into smaller packets before they are then transmitted over the net
and reassembled in the right order at the destination address. IP defines how to address and
route each packet to make sure it reaches the right destination. Each gateway computer on
the network checks this IP address to determine where to forward the message. It helps to
communicate in single or interconnected network. TCP palette in Lab VIEW is used with
DAQ, instrument, File I/O communication, the process involves opening of connection,
writing data, reading data and closing connection. This process is carried out by different
functions of communication palette.

IV
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

They are TCP Open Connection, TCP Close Connection, TCP Read, TCP Write and
TCP Listen. These functions are described below: (Anon., 2015)

2.3.1 TCP Open Connection


TCP open connection function is used to open TCP network connection with address and
remote port or service name. (Anon., 2017)

Figure 3: TCP Open Connection Function

In this prototype, the TCP open connection is used to open connection through port number.
It is used in client side for establishing connection with server.

Figure 4: TCP Open Connection in Client Side

2.3.2 TCP Write


TCP write function is used to write data to TCP network connection. It passes the message
through network. (Anon., 2017)

Figure 5: TCP Write Function

V
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

It is used in the client side of this system to write data. Case number is written through it
so that it can be pass to server for functioning equipment.

Figure 6: TCP Write Function in Client side

2.3.3 TCP Read


TCP read number of bytes from TCP network connection and sending result to data out.

Figure 7: TCP Read Function

It is used in server side to read the fixed size message header to describe message. In this
prototype to read the data for the TCP listener.

Figure 8: TCP Read in serve side

VI
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

2.3.4 Type Listen


TCP Listen function is TCP VI and Function. It creates a listener and waits for an
accepted TCP network connection at specific port. (Anon., 2017)

Figure 9: TCP Listen

It is used to listen the signal from the client module to check whether there is port with
same IP address or not. If there is, then it relays to TCP read function.

Figure 10: TCP Listen in Server Module

VII
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

2.3.5 TCP Close Connection


TCP Close connection is used to close the TCP network connection.

Figure 11: TCP Close Connection Function

TCP close connection is used in both client and server side.

Figure 12: TCP Close Connection

VIII
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

3 System Design
3.1 Flowchart
Client

IX
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

X
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

Server

XI
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

4 Implementation of Hardcore/Devices
4.1 Ultrasonic Sensor

Figure 13Ultrasonic Sensor

Ultrasonic sensors are the device measures distance by using ultrasonic waves. The sensor
head emits an ultrasonic wave and receives the wave reflected back from the target.
Ultrasonic Sensors measure the distance to the target by measuring the time between the
emission and reception.

4.2 Relay

Figure 14 Relay

A relay is an electrically operated switch that uses an electromagnet to mechanically


operate a switch, but other operating principles are also used, such as solid-state relays.
Relays are used where it is necessary to control a circuit by a separate low-power signal, or
where several circuits must be controlled by one signal.

XII
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

5 User Interface

Figure 15Login Screen

Above mentioned image is the login screen where user login the system entering the
username and password.

Figure 16 Level 0

XIII
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

Figure 17Level 1

Figure 18 Logged In Screen

XIV
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

6 Conclusion
In a nutshell, the smart home control system is a very good source of help for big homes
with several level and wide area. But this could also mean more expensive to be
implemented. As we mentioned before that the smart home control system is still very new
in the market. Lastly, the system is complete with basic functionalities that should satisfy
most users. However, there are still a lot of rooms for improvements.

XV
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

References
Anon., 2015. National Instruments. [Online]
Available at:
https://www.labviewmakerhub.com/doku.php?id=learn:tutorials:labview:basics:intro
[Accessed October 2017].
Anon., 2017. National Instrument. [Online]
Available at: http://searchnetworking.techtarget.com/definition/TCP-IP
[Accessed October 2017].
Anon., 2017. National Instrument. [Online]
Available at: http://zone.ni.com/reference/en-XX/help/371361G-
01/lvcomm/tcp_vi_descriptions/
[Accessed October 2017].
Anon., 2017. Nationall Instruments. [Online]
Available at: https://en.wikipedia.org/wiki/Relay
[Accessed October 2017].
Christiano, M., 2015. ALL ABOUT CIRCUITS. [Online]
Available at: https://www.allaboutcircuits.com/technical-articles/graphical-programming-
languages-labview/
[Accessed September 2017].

XVI
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

Appendix
Appendix I: Marking Grid

Component Total Marks Obtain


Marks

1. Meet Criteria Requirement. 15

2. User interface 15

Software running without error. (i.e. No runtime 10


3.
errors, syntax errors etc.)

Codes are consistent, clean, modular and follows 10


4.
programming logic.

5. Algorithm and Documentation 10

6. Practical class work 20

7. Presentation 20

Total 100

XVII
SMART HOME CONTROL SYSTEM CT047-3-2-SPCC

Appendix II: Floor Plan

XVIII

También podría gustarte