Anda di halaman 1dari 22

INDIVIDUAL ASSIGNMENT

CT047-3-2-SPCC
SYSTEM PROGRAMMING AND COMPUTER
CONTROL

NP2F1701IT
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

1
INDIVIDUAL ASSIGNMENT
LORD BUDDHA EDUCATION FOUNDATION

CT047-3-2-SPCC

SYSTEM PROGRAMMING AND COMPUTER CONTROL


NP2F1701IT

“Smart House Control System”

Submitted By:

Anup Sapkota (NP000020)

Submitted to:

Suresh Chand

2
Acknowledgement

I would like to express my heartfelt gratitude towards our Lecturer Mr. Suresh Chand
for his patient guidance and encouragement which helped us in completing this
project. Also, our sincere thanks goes to our coordinator Ms. Dolma Sherpa for her
practical suggestions and helpful advices.

Further, we would like to thank Asian Pacific University for providing us wonderful
project to make us able to develop a project in a real-time system. It has developed
our more technical skills and helps us to be more creative.

Special thanks go to my those who have taken part in each and every section
continuously for the completion of this project in a given time frame.

Last but not the least we would like to thank all the faculty members of the LBEF.

3
Executive Summary

The project in the smart home management system is made using the powerful system
of LabVIEW. The purpose of this assignment is to build a smart home control system.
The smart home system will be included as a package for the home owners. 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 controlled using the central control keypad which make the
control over the whole system.

4
Contents
1. Introduction ....................................................................................................................... 1
1.1 LabView ........................................................................................................................... 1
1.2 Benefits of LabVIEW ........................................................................................................ 1
2. Flowchart ........................................................................................................................... 2
2.1 Client................................................................................................................................ 2
3.2 Server............................................................................................................................... 3
3. Floor plan........................................................................................................................... 4
4. Program Design ................................................................................................................. 5
4.1 Server Module ................................................................................................................. 5
4.2 Client Module .................................................................................................................. 6
4.3 TCP/IP .............................................................................................................................. 6
4.4 TCP Open Connection ...................................................................................................... 7
4.5 TCP Write ......................................................................................................................... 7
4.6 TCP Read .......................................................................................................................... 8
4.7 TCP Close Connection ...................................................................................................... 9
4.8 Type Cast Function .......................................................................................................... 9
5. Hardware/Sensor Device ................................................................................................. 11
5.1 Slider .............................................................................................................................. 11
5.2 Tv and Remote Light Control ......................................................................................... 11
6. User Interface .................................................................................................................. 12
7. Limitation......................................................................................................................... 14
8. Conclusion ....................................................................................................................... 15
9. References ....................................................................................................................... 16
Appendix.............................................................................................................................. 17
Appendix I: Marking Grid..................................................................................................... 17

5
1. Introduction
The rise of the technology has made the life easier and comfortable. The use of the
technology is increasing in every sector. Thus, there is huge increament in the
technological rise in the housing sector as well.

The purpose of this assignment is to build a smart home control system. The smart
home system will be included as a package for the home owners. 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 required to have a central control keypad which will manually be
located in the master bedroom and the main entrance.

This documentation will include the core explanation of the system with the guide
which will give brief explanations on every function in the system.

1.1 LabView

“LabVIEW is a highly productive development environment that engineers and


scientists use for graphical programming and hardware integration to rapidly design
and deploy measurement and control systems. Within this flexible platform, engineers
scale from design to test from small to large systems and refining their processes to
achieve maximum performance.”

1.2 Benefits of LabVIEW

There are numerous benefits of using LabVIEW. The main advantages of LabVIEW
are as follows :-

 Graphical use of programming language.


 Easier viewer experience.
 Simple drag and drop methods.
 Capable of integrating software with the hardware environment.

1
2. Flowchart
2.1 Client

2
3.2 Server

3
3. Floor plan

Fig: Floor plan

Picture above shown the floor plan that had been added feature into the home which
include the use of light, curtain, door, air-con and air-con temperature.

4
4. Program Design

4.1 Server Module

Figure 1: Server Module

Above figure is block diagram of Server module in LabVIEW. Different function


related to TCP are used in this 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.

5
4.2 Client Module

Figure 2: Client Module

Client Module of the system is shown in above figure. Three type of TCP protocol
functions are 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.

4.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. It
helps to communicate in single or interconnected network. TCP palette in LabVIEW
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. They are TCP Open
Connection, TCP Close Connection, TCP Read, TCP Write and TCP Listen. These
functions are described below: (Anon., 2015)

6
4.4 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 also, TCP open connection is used to open connection through port
number. It is used in client side for establishing connection.

Figure 4: TCP Open Connection in Client Side

4.5 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


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.

7
Figure 6: TCP Write Function in Client side

4.6 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

8
4.7 TCP Close Connection

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

Figure 9: TCP Close Connection Function


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

Figure 10: TCP Reads

4.8 Type Cast Function

Type cast function is data manipulation function. Cast x is the data type of input and
type is used to convert data into required data type and *(type)*&x is the output of
convert data type.

9
Figure 11: Type Cast Function
It is used in this prototype to convert receive data into string data type. It is used in
both client side and server side.

10
5. Hardware/Sensor Device
Hardware devices require for implementation of this prototype are described below:

5.1 Slider

Slider is required for doors and windows. Door required slide door open so that it can
sensor the people and open the door automatically. For window slider is used for
opening and closing of curtain as the user give instruction through.

5.2 Tv and Remote Light Control

11
6. User Interface

12
User Manual

Bedroom1Bulb and Bedroom2Bulb2 is a switch which controls the bulb of bedroom1


and bedroom respectively.

Room2window slider controls the curtain of room2window. Whereas room1window


controls the curtain of room1window.

Passage Bulb switch controls the bulb of passage, whereas Door2 controls the passage
door.

MasterRoomBulbRight controls the right bulb of master bedroom. Door3 controls the
door of master bedroom. MasterRoomBulbLeft controls the left bulb of master
bedroom.

13
7. Limitation
The smart home system needs server and client to connect each other to be able to
function properly. The major problems involved in the LabVIEW program are:-

 There will be a chance where the port connections overflowing and the system
will not be able to function as the way it should.
 Some of the hardware device may not tie up properly as mentioned in
LabVIEW.
 Some of the hardware recommended in the LabVIEW are expensive to use.
 The home security system can only operate only in the availability of
electricity

14
8. Conclusion
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. The smart home control system is still very new in the market. The
usefulness and the comfort of using this system of design has increased the popularity
in the recent trend. This has made this system of design an ultimate choice usually for
the big house and offices.

The system is complete with basic functionalities that should satisfy most users.
However, there are still a lot of rooms for improvements. By doing more in depth
research and reviewing feedbacks from the users, we should be able to implement
more features into the system and meets the needs and demands of the home users.

15
9. References

Anon., 2015. National Instruments. [Online]


Available at: http://www.ni.com/white-paper/2710/en/
[Accessed October 2017].

Anon., 2017. http://www.ni.com. [Online]


Available at: http://www.ni.com/labview/whatis

Anon., 2017. http://www.ni.com. [Online]


Available at: http://www.ni.com/labview/whatis/multicore

Anon., 2017. http://www.ni.com/. [Online]


Available at: http://www.ni.com/labview/requirements

Anon., 2017. National Instrument. [Online]


Available at: http://zone.ni.com/reference/en-XX/help/371361G-
01/lvcomm/tcp_open_connection/#Input2
[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].

16
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, and modular and 10


4.
follow programming logic.

5. Algorithm and Documentation 10

6. Practical class work 20

7. Presentation 20

Total 100

17

Anda mungkin juga menyukai