You are on page 1of 27

INDIVIDUAL ASSIGNMENT

Name
Student ID
Module Name

Koh Sheng Gui


TP039143
System Programming & Computer
Control

Module Lecturer
Intake Code
Hand Out Date
Hand In Date

( CT047-3-2-SPCC )
Mr. Seyed Amir Hossein Mousavi
UC2F1505IT(MBT)
30th June 2015
21st August 2015

Table of Contents
Acknowledgement:................................................................................................ 2
Introduction:.......................................................................................................... 3
National Instruments LabView............................................................................ 3
Project Requirement.............................................................................................. 4
Reason that use LabView.................................................................................... 4
How does LabView work..................................................................................... 4
Hardware can used in LabView...........................................................................5
System design....................................................................................................... 7
Flowchart............................................................................................................ 7
Client:.............................................................................................................. 7
Server:............................................................................................................. 8
Protocol Design:.................................................................................................. 9
Client:.............................................................................................................. 9
Server:........................................................................................................... 11
Control Interface and Indicator Interface..........................................................13
Limitation............................................................................................................. 20
Future enhancement............................................................................................ 21
Conclusion........................................................................................................... 22
References:.......................................................................................................... 23
Appendices:......................................................................................................... 24
Gantt Chart.......................................................................................................... 25

Acknowledgement:
I would like to thanks my teacher Mr. Seyed Amir Hossein Mousavi, for gave me a
very clear instruction to accomplish the assignment, but also give me an advices to done my
assignment. Beside that, he also give me a direction when I cant solve the problem.
I also would like to thank all my friends who were helped me when I facing problems
during doing assignment. Furthermore, I would also like to thanks my parents to encourage
me when I doing this assignment.

Introduction:
This assignment is mainly to build a Smart Home Control System for a new housing
developer. The Smart Home Control System can monitor or control the light bulb, television,
curtain and more. This is let the user easy to monitor and control of the house.
This control system allow user to enter username and password to verify the identity of the
user, so that they can access the control.

After user login the system, user can control the

light, television, or fan and more.

National Instruments LabView


LabView is a program development application for hardware. It much like another
development system such as C or C++. However, LabView use graphical programming
language. It let user easily to create programs using graphical programme. LabView can help
user to know wheres the program flow because of graphical user interface and it act as
simulator. Some of the feature of the LabView such as:

Can connect external equipment or hardware for experiment or programming.


Simple input or output operations.
Built-in drivers or network port and some function library.

There have some few benefits of using LabView. One of the benefits using LabView is a
graphical programming code. It help user to see the code and check for the errors easily.
LabView compile the code into one single block and let user easily to drag-n-drop.
Beside that, LabView also can connect external tools to LabView, so that researcher can
easily expand both analysis and visualization function by creating their own function in the G
language because it is a tight software-hardware integration and support variety of data and
embedded control devices.

Project Requirement
Reason that use LabView

Act as Simulator, and user interface capabilities.

Because LabView easy to code and it can be simulator to view the application

Is a Multiplatform program

Using LabView can be no worried when you use or edit in other operating systems
platform.

Easy to design

Using LabView, Labview using the G language so it will create a simulate of


application and it design with drag-n-drop.

How does LabView work


When the program has been started, there have two windows opened. Grey color
windows is front panel where we design our virtual or simulation. White color windows is
where use program their code in there.

Hardware can used in LabView

Light sensor are recommend for the smart home system. The light sensors will be detect the
light and control the brightness of the light automatically based on the darkness or brightness
level of the area.

Ultrasonic sensors are also recommended for the systems. The sensors will use for open the
door when the user get close or in the range of the sensor and then the door will open.
Futhurmore, it can use in alarm systems. To detect the people when it nearby and alert.

System design
Flowchart
Client:

Server:

Protocol Design:
Client:

Figure 1.1 Client Network Model

Figure 1.2 Client Network Model (con't)


Using while loop and event structure for keep the network online and sending the action or
signal to the server by using TCP connection and the event structure is to handle the button
which fire the event.

10

Figure 2 Port and timeout in TCP Connection


TCP Open Connector is to connect the server side port number. Timeout is 6000 are the
default value.

Figure 3 TCP Write


TCP write function is to send the signal into the network. In this system, it will use 2 TCP
Write in the connection. one is for the string length, and another one is for data string.

Figure 4 TCP Close and Clear Errors


The use of TCP Close Connection is to stop the connection when it done. Clear Errors is to
clean up all the errors status.

11

Server:

Figure 5 Server Client Model


In server it also using while loop and event structure to listen connection from the client and
execute the event.

Figure 6 TCP Listen


12

In Server side, we using TCP Listen to receive the command from the Client side. Port
number is must be the same as the Client side, if not it cant be connected. The -1 is default
value of timeout of the connect that wait forever.

Figure 7 TCP Read


TCP Read is to receive the command and translate the type of the signal and send to the
event. The 4 is a value that byte to receive. There are 2 TCP Read, one is receive the number
of bytes and another is read the content.
Close connection and clear errors will be the same as Client side.

13

Control Interface and Indicator Interface


Login

Figure 8 Login UI
After User login, the LED will light up when it correct and it will appear panel.

Figure 9 login part

14

There read from the text file function used to read the characters from a text file.

15

Panel of Door control and the Light control. User can switch the tab for more control.

Example when the user click the light on.


S.Light Lv1 is a smart Light switch for Level 1, It will on all the light at level 1.

16

One of the control panel; television control panel.

17

Figure 10 Volume Control


It for changing the volume of the TV or media.

Select URL in Client side.

18

Figure 11 example of TV showing the media.

19

Figure 12 air condition panel


User can click on and off the turn on the air condition and have the air condition temperature.

20

Example of air condition in operate.

The code of air condition temperature.

21

Limitation
In by using LabView, I found my limitation that cannot done the part of alarm clock and
the alarm systems. Other than that, the curtain slider got the limitation that when I turn on the
curtain it must wait the timer goes off then can be execute next command.
Another limitation is multiple username and password. User only can done by create
single user and login by single user. Beside that, when create the username and password, it
will override the old single and it will be replace, so that the old id cannot be login.

22

Future enhancement
Smart home control system can add the CCTV in the security system. The CCTV is
mainly work as secure the home, when people broke in the house, the alarm system will alert
the house. Another than that, motion sensor or sound sensor can be installed in the house. It
can detect the motion of user when the user in the house and make certain of action and
execute.

23

Conclusion
Smart Home Control Systems is useful and let people easy to use and let people do
not need to manually open those facilities. The system is complete with basic functionalities
for most users. This devices may cost highly because it most high end and some of the how
the Smart Home Control Systems still need to improve .

24

References:
. 2015. . [ONLINE] Available at: http://www.robotshop.com/media/files/images/parallaxping-ultrasonic-sensor-large.jpg. [Accessed 20 August 2015].
YouTube. 2015. YouTube. [ONLINE] Available at: http://www.youtube.com/. [Accessed 21
August 2015].
Advantages of Using LabVIEW in Academic Research - National Instruments. 2015.
Advantages of Using LabVIEW in Academic Research - National Instruments. [ONLINE]
Available at: http://www.ni.com/white-paper/8534/en/. [Accessed 20 August 2015].

25

Appendices:
Create username and password.

create Server TV.

26

Gantt Chart

27

You might also like