Control Home Appliances Via Internet (Cohavi) Software Development.

(1)

i

CONTROL HOME APPLIANCES VIA INTERNET (CoHAVI) – SOFTWARE DEVELOPMENT

SHIRRENE A/P NAI SOWAT

This report is submitted in partial fulfillment of the requirements for the award of Bachelor of Electronic Engineering (Computer Engineering)

With Honours

Faculty of Electronic and Computer Engineering Universiti Teknikal Malaysia Melaka


(2)

ii

UNIVERSTI TEKNIKAL MALAYSIA MELAKA

FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER

BORANG PENGESAHAN STATUS LAPORAN

PROJEK SARJANA MUDA II

Tajuk Projek : Control Home Appliances via Internet (CoHAVI) Sesi

Pengajian : 2008/2009

Saya SHIRRENE A/P NAI SOWAT (HURUF BESAR)

mengaku membenarkan Laporan Projek Sarjana Muda ini disimpan di Perpustakaan dengan syarat-syarat kegunaan seperti berikut:

1. Laporan adalah hakmilik Universiti Teknikal Malaysia Melaka.

2. Perpustakaan dibenarkan membuat salinan untuk tujuan pengajian sahaja.

3. Perpustakaan dibenarkan membuat salinan laporan ini sebagai bahan pertukaran antara institusi pengajian tinggi.

4. Sila tandakan ( ) :

SULIT*

(Mengandungi maklumat yang berdarjah keselamatan atau kepentingan Malaysia seperti yang termaktub di dalam AKTA RAHSIA RASMI 1972)

TERHAD* (Mengandungi maklumat terhad yang telah ditentukan oleh

organisasi/badan di mana penyelidikan dijalankan)

TIDAK TERHAD

Disahkan oleh:

__________________________ ___________________________________

(TANDATANGAN PENULIS) (COP DAN TANDATANGAN PENYELIA)

Alamat Tetap: 35, Jln Besar,

34500 Batu Kurau, Perak.


(3)

iii

“I hereby declare that this report is the result of my own work except for quotes as cited in the references.”

Signature : ... Author : SHIRRENE A/P NAI SOWAT Date : 30 APRIL 2009


(4)

iv

“I hereby declare that I have read this report and in my opinion this report is sufficient in terms of the scope and quality for the award of Bachelor of Electronic

Engineering (Computer Engineering) With Honours.”

Signature : ………..

Supervisor’s Name : EN. ABD. SHUKUR B. JA’AFAR


(5)

v


(6)

vi

ACKNOWLEDGEMENT

Here, I would like to extend my deepest gratitude and appreciation towards some individuals who have been assisted me throughout my project, Control Home Appliances via Internet, CoHAVI.

First of all, I would like to thank my university, Universiti Teknikal Malaysia Melaka towards the great opportunity for me to have my final year project which is to be completed within a year. My foremost gratitude goes to En. Abd. Shukur b. Ja’afar, my Supervisor for the opportunity he had given to me to be a part of his students under final year project. Thanks for his precious time and helpful guidance throughout the year. Honestly, it is the most valuable chance for me to explore and expose myself to the real engineering fields which needs me to be equal in knowledge, skills and managements.

Next, I would like to thank all my colleagues for being supportive and positive minded. I would like to take this opportunity to thank those who directly or indirectly support me, provide ideas and constructive criticisms, and motivate me to do my best in everything.

Last but not least, a special thanks to my family for their love, blessings and inspirations.

To everyone, thank you for the supports and inspirations.


(7)

vii

ABSTRACT

Current technology of smart home requires human to control appliances in a short range and it costs too much in maintenace. The inflexibility features decrease the efficiency of the system. Control Home Appliances via Internet, (CoHAVI) is a system which resembles a smart home environment. The concept is simple where the home is automated and therefore provides ease and convenience to everyday activities in the home. This project is to develop a web-based monitoring and control system for a home model. Hence, to build a system that uses internet as an interface of the system to control and monitor the home appliances. CoHAVI is developed by using ASP.NET and Visual Basic.NET which will communicate with transmitter device through serial port (RS 232). CoHAVI will be implemented on Hamachi server and Internet acts as a medium to control appliances such as lamps, fans, microwave and so on. CoHAVI provides a great service to remote system such as desktop and PDA, in order to control, monitor and coordinate home appliances in a long range. The success of CoHAVI system is a breakthrough of a smart home remote system.


(8)

viii

ABSTRAK

Konsep rumah pintar masa kini memerlukan individu untuk mengawal peralatan di rumah pada jarak yang dekat dan kos membaik pulih sistem adalah tinggi. Ciri-ciri yang tidak fleksibel ini mengurangkan tahap kecekapan sistem ini. ‘Control Home Appliances via Internet,’ ataupun (CoHAVI) merupakan sistem yang mencerminkan konsep rumah pintar. Konsepnya mudah, iaitu rumah diautomasi untuk memudahkan kerja seharian. Projek ini bertujuan untuk membina satu sistem pengawalan peralatan menggunakan aplikasi laman web. Seterusnya, membina satu sistem yang menggunakan aplikasi internet sebagai perantara untuk mengawal dan mengawasi peralatan di rumah. Sistem CoHAVI dibina menggunakan ‘ASP.NET’ dan ‘Visual Basic.NET’ yang akan berinteraksi dengan litar penghantar isyarat menggunakan ‘serial port’ (RS232). CoHAVI akan dikawal oleh ‘server Hamachi’ dan internet menjadi perantara untuk mengawal peralatan seperti lampu, kipas, ketuhar gelombang mikro dan sebagainya. CoHAVI memberikan perkhidmatan yang terbaik dalam pengawalan jarak jauh melalui komputer atau PDA, untuk mengawal, mengawasi dan mengkoordinasi peralatan di rumah dari jarak yang jauh. Kejayaan projek ini adalah satu penemuan baru di dalam aplikasi rumah pintar.


(9)

ix

TABLE OF CONTENTS

CHAPTER CONTENT PAGE

PROJECT TITLE i

REPORT STATUS APPROVAL ii

DECLARATION iii

SUPERVISOR’S APPROVAL iv

DEDICATION v

ACKNOWLEDGEMENT vi

ABSTRACT vii

ABSTRAK viii

TABLE OF CONTENTS ix

LIST OF TABLES xiii

LIST OF FIGURES xiv

LIST OF ABBREVIATIONS xvii

LIST OF APPENDICES xix

I INTRODUCTION

1.1 OVERVIEW 1

1.2 PROBLEM STATEMENT 2

1.3 OBJECTIVES 2

1.4 SCOPE OF WORKS 3


(10)

x

II LITERATURE REVIEW

2.1 RESEARCHED PROJECTS 4

2.1.1 HOME APPLIANCES CONTROL

SYSTEM (HACS) 4

2.1.1.1 REMOTE CONTROL

APPLICATION 6

2.1.2 BESTARIHOME - SMART HOME

SYSTEMS 9

2.1.2.1 DESIGN PRINCIPLES 9

2.1.2.2 TECHNOLOGIES 10

2.1.2.3 FEATURES 10

2.1.2.4 IMPLEMENTATION 11

2.2 ASP.NET AND .NET FRAMEWORK 13

2.2.1 OVERVIEW 13

2.2.2 WEB FORM 14

2.2.3 SERVER-SIDE PROGRAMMING 14 2.2.4 BASED ON THE .NET FRAMEWORK 14

2.2.5 SECURITY 15

2.2.6 DEBUGGING AND TRACING 15

2.2.7 DEPLOYMENT 16

2.2.8 VISUAL BASIC .NET (VB.NET) 16

2.3 INTRODUCTION TO DATABASE 17

2.3.1 CONCEPTS 18

2.3.2 SQL - STRUCTURED QUERY

LANGUAGE 19

2.4 HAMACHI – SERVER 20

2.4.1 OVERVIEW 20

2.4.2 OPERATION 20


(11)

xi

III METHODOLOGY

3.1 PROJECT OVERVIEW 24

3.2 CoHAVI DESIGN MODEL 26

3.2.1 SOFTWARE / HARDWARE

CONNECTION 27

3.3 SOFTWARE DESIGN TECHNIQUE 28

3.4 INTERNET SET UP 29

3.4.1 UPLOAD PROJECT TO IIS 29

3.4.2 HAMACHI SETTINGS 33

3.4.3 DATABASE SETTINGS 34

3.5 WEB PAGE DEVELOPMENT 39

3.5.1 SERIAL PORT SETTING 43

3.5.2 WEBCONFIG IN VISUAL STUDIO 2005 43

3.6 DATABASE DEVELOPMENT 44

3.6.1 SQL SERVER DEVELOPMENT 45

3.6.1.1 STEPS TO CREATE A DATABASE 45

IV RESULTS

4.1 INTRODUCTION 50

4.2 RESULTS 51

4.2.1 WEBPAGE 51

4.2.1.1 SERIAL DATA 56

4.2.2 DATABASE – SQL 57

V CONCLUSION

5.1 OVERVIEW 58


(12)

xii

REFERENCES 66


(13)

xiii

LIST OF TABLES

NO TITLE PAGE

1.1 Current Smart Home versus Future Smart Home 2


(14)

xiv

LIST OF FIGURES

NO TITLE PAGE

2.1 Home Appliances Control System Overview 5 2.2 Hardware Block Diagram of the Communication Adapter Board 5 2.3 Software Block Diagram of Home Appliance Communication

Adapter 6

2.4 Remote Control System 7

2.5 Program Update System 8

2.6 Menu of Application 8

2.7 Remote Control Application 9

2.8 3-Level Generic Specifications 9

2.9 Communication Architecture of BestariHome 10 2.10 Smart Home Implementation Process Flow 11

2.11 System Diagram of BestariHome 12

2.12 Server-side Programming Model 14

2.13 Example of Database 17

2.14 Rows of Columns of a Database 17

3.1 Basic Flowchart of CoHAVI Development 25

3.2 CoHAVI Design Model 26

3.3 Block Diagram of Software and Hardware Connection 27

3.4 Software Design 28

3.5 Website Project File 29

3.6 Place Project to ‘wwwroot’ 30

3.7 Run Menu 30

3.8 Website in IIS 31


(15)

xv

3.10 Name the Application 32

3.11 Hamachi Server 33

3.12 Provide Network Name and Password 33

3.13 Login to Security of the SQL server 34

3.14 User Group Selections 35

3.15 Select New User 35

3.16 Click on Login Name Button 36

3.17 Enter “ASPNET” 36

3.18 Select the Object Name 37

3.19 Database User Settings 37

3.20 User Displayed on the List 38

3.21 CoHAVI System 39

3.22 Flowchart of Webpage Development 40

3.23 Flowchart of New User Registration Process 41

3.24 Flowchart of Serial Communication 42

3.25 Tables definition in Microsoft SQL Server 2005 Enterprise

Edition 44

3.26 Connect to SQL Server 45

3.27 New Database 45

3.28 Database Name 46

3.29 New Table 46

3.30 Table Definition 47

3.31 Table Definition of UserAccount_t 47

3.32 Primary Key Setting 48

3.33 Example of UserAccount_t 48

3.34 Table Definition of Appliances_t 49

3.35 Example of Appliances_t 49

4.1 Control Home Appliances via Internet 50

4.2 Login Page 51

4.3 New User Registration Form 52

4.4 Application Status 53

4.5 Change Password 54

4.6 Change Password Successful 54


(16)

xvi

4.8 User Account Maintenance 56

4.9 User Details 57

4.10 Edit Personal Details 58

4.11 Monitor and Control Appliances 59

4.12 Activities Log 60

4.13 New User Approvals by Administrator 61

4.14 Table User_Account_t 63


(17)

xvii

LIST OF ABBREVIATIONS

AC - Alternating current ADO - ActiveX Data Objects

ANSI - American National Standards Institute ASP - Active Server Pages

CLR - Common Language Runtime CLS - Common Language Specification CoHAVI - Control Home Appliances via Internet COM - Component Object Model

CPU - Central Processing Unit DLL - Dynamic Link Library GUI - Graphical User Interface HTML - HyperText Markup Language

IANA - Internet Assigned Numbers Authority IDE - Integrated Development Environment IIS - Internet Information Service

IO - Input Output

NAT - Network Address Translation OOP - Object Oriented Programming

PC - Personal Computer

PDA - Personal Digital Assistance

RF - Radio Frequency

SDK - Software Development Kit SPP - Serial Port Profile

SQL - Structured Query Language

VB - Visual Basic


(18)

xviii


(19)

xix

LIST OF APPENDICES

NO TITLE PAGE

A VB/SQL Commands 67

B C#/SERIAL COMMUNICATION 70


(20)

1

CHAPTER I

INTRODUCTION

1.1 OVERVIEW

Smart home has been the talk of decade, predicted to be the next gigantic leap in the field of remote monitoring. A smart home allows the entire home to be automated and therefore provides ease and convenience to everyday activities in the home. Automated control, edutainment features, communication features and smart appliances, all contribute to the ease and convenience a smart home permits, and remote access to these features through telephone or Internet makes it even more convenient and applicable.

Control Home Appliances via Internet, (CoHAVI) is a system which resembles a smart home environment. CoHAVI works on a basis of smart home which provides various services to remote system such as desktop and palm-top, in order to control, monitor and coordinate home appliances in a long range. This concept mainly uses internet as the interface to control home appliances. Users can access to this system anywhere around the world as long as there is an internet access. In general, CoHAVI system provides users with security, convenience and energy management features, as well as having added benefits for disabled individuals.


(21)

2

1.2 PROBLEM STATEMENT

Current technology of home control system requires human to control home appliances in a very short range. Some systems are vendor dependent and cost too much in maintenance supports. Current home control system with smart home concept is not flexible and not adaptable to new standard of lifestyle. These could not deliver the system to the fullest efficiency and it is not applicable for users to control their appliances all the time. In some cases, their home appliances need to be maintained or controlled even when users are not around their home. This is when Control Home Appliances via Internet, (CoHAVI) system is needed to play its vital role. CoHAVI can be accessed whenever there is an internet access. Table 1.1 shows the current and future trends of smart home concepts.

Table 1.1 Current Smart Home versus Future Smart Home

Current Smart Home Future Smart Home  Affordable by high-end homes  Standard features in every home

 Vendor dependent  Open standards and DIY

concept

 Very expensive maintenance  Zero maintenance  Proprietary and stand-alone  Integrated solution  Not flexible and adaptable to

new lifestyle

 Modular and expandable

1.3 OBJECTIVES

The objectives of Control Home Appliances via Internet, (CoHAVI) are as below:

a) To develop a web-based monitoring and control system for a home model. b) To build a system that uses internet as an interface of the system to control


(22)

3

1.4 SCOPE OF WORKS

The main scope of Control Home Appliances via Internet (CoHAVI) project is to develop a software controller system using ASP.NET 2.0 and Visual Basic.NET which will communicate with transmitter device through serial port (RS 232). CoHAVI will be implemented on Hamachi server and Microsoft SQL Server 2005 is needed in order to create database to store data. Internet acts as a medium for CoHAVI to be accessed and through this project, distance will no longer be a trouble for users to monitor and control their home appliances effectively.

1.5 REPORT STRUCTURE

This paper of Control Home Appliances via Internet, (CoHAVI) consists of 5 chapters. First part of this paper discusses the basic features of a typical smart home system, the factors that initiate CoHAVI to be developed and its objectives.

The second part describes literature review and background study of CoHAVI system.

The third part which is Chapter III covers the design and development of a Control Home Appliances via Internet, (CoHAVI) system. Internet and database settings are discussed in detail.

Chapter IV consists of the results and application of CoHAVI. It includes the webpage and database development.

Finally, the last part concludes the overall development process and the system as well.


(23)

4

CHAPTER II

LITERATURE REVIEW

There have been several smart home projects undertaken by individuals over the last few years. The most popular of these has been Microsoft founder, Bill Gates’ residence on Mercer Island east of Seattle. The home includes art frames that can display different “paintings” on demand and customize the music played in a room based on the guest’s preference. Some of the smart home researched projects are discussed below.

2.1 RESEARCHED PROJECTS

2.1.1 HOME APPLIANCES CONTROL SYSTEM (HACS)

Home Appliances Control System consists of home appliances, a cellular phone, bluetooth communication adapters for the appliances and cellular phone as shown in Figure 2.1. Hardware and software for those adapters, Java applications running on the cellular phone and the interface software between the Java applications and the adapter have been made for the prototype system.

Bluetooth act as a communication medium for the home appliances and cellular phone connections. The home appliances can gain communication functionality easily by attaching the bluetooth communication adapter.


(24)

5

Figure 2.1 Home Appliances Control System Overview [5]

The home appliance communication adapter and the cellular phone communication adapter use common board. Figure 2.2 shows the hardware block diagram of the communication adapter board. The communication adapter hardware consists of a 20MHz 16bit CPU, SRAM and a bluetooth module. The CPU is used for its low cost availability even though it is not powerful. Serial ports connect the communication adapter board to the home appliance and to the cellular phone.


(1)

LIST OF APPENDICES

NO TITLE PAGE

A VB/SQL Commands 67

B C#/SERIAL COMMUNICATION 70


(2)

CHAPTER I

INTRODUCTION

1.1 OVERVIEW

Smart home has been the talk of decade, predicted to be the next gigantic leap in the field of remote monitoring. A smart home allows the entire home to be automated and therefore provides ease and convenience to everyday activities in the home. Automated control, edutainment features, communication features and smart appliances, all contribute to the ease and convenience a smart home permits, and remote access to these features through telephone or Internet makes it even more convenient and applicable.

Control Home Appliances via Internet, (CoHAVI) is a system which resembles a smart home environment. CoHAVI works on a basis of smart home which provides various services to remote system such as desktop and palm-top, in order to control, monitor and coordinate home appliances in a long range. This concept mainly uses internet as the interface to control home appliances. Users can access to this system anywhere around the world as long as there is an internet access. In general, CoHAVI system provides users with security, convenience and energy management features, as well as having added benefits for disabled individuals.


(3)

1.2 PROBLEM STATEMENT

Current technology of home control system requires human to control home appliances in a very short range. Some systems are vendor dependent and cost too much in maintenance supports. Current home control system with smart home concept is not flexible and not adaptable to new standard of lifestyle. These could not deliver the system to the fullest efficiency and it is not applicable for users to control their appliances all the time. In some cases, their home appliances need to be maintained or controlled even when users are not around their home. This is when Control Home Appliances via Internet, (CoHAVI) system is needed to play its vital role. CoHAVI can be accessed whenever there is an internet access. Table 1.1 shows the current and future trends of smart home concepts.

Table 1.1 Current Smart Home versus Future Smart Home

Current Smart Home Future Smart Home  Affordable by high-end homes  Standard features in every home

 Vendor dependent  Open standards and DIY

concept

 Very expensive maintenance  Zero maintenance  Proprietary and stand-alone  Integrated solution  Not flexible and adaptable to

new lifestyle

 Modular and expandable

1.3 OBJECTIVES

The objectives of Control Home Appliances via Internet, (CoHAVI) are as below:

a) To develop a web-based monitoring and control system for a home model. b) To build a system that uses internet as an interface of the system to control


(4)

1.4 SCOPE OF WORKS

The main scope of Control Home Appliances via Internet (CoHAVI) project is to develop a software controller system using ASP.NET 2.0 and Visual Basic.NET which will communicate with transmitter device through serial port (RS 232). CoHAVI will be implemented on Hamachi server and Microsoft SQL Server 2005 is needed in order to create database to store data. Internet acts as a medium for CoHAVI to be accessed and through this project, distance will no longer be a trouble for users to monitor and control their home appliances effectively.

1.5 REPORT STRUCTURE

This paper of Control Home Appliances via Internet, (CoHAVI) consists of 5 chapters. First part of this paper discusses the basic features of a typical smart home system, the factors that initiate CoHAVI to be developed and its objectives.

The second part describes literature review and background study of CoHAVI system.

The third part which is Chapter III covers the design and development of a Control Home Appliances via Internet, (CoHAVI) system. Internet and database settings are discussed in detail.

Chapter IV consists of the results and application of CoHAVI. It includes the webpage and database development.

Finally, the last part concludes the overall development process and the system as well.


(5)

CHAPTER II

LITERATURE REVIEW

There have been several smart home projects undertaken by individuals over the last few years. The most popular of these has been Microsoft founder, Bill Gates’ residence on Mercer Island east of Seattle. The home includes art frames that can display different “paintings” on demand and customize the music played in a room based on the guest’s preference. Some of the smart home researched projects are discussed below.

2.1 RESEARCHED PROJECTS

2.1.1 HOME APPLIANCES CONTROL SYSTEM (HACS)

Home Appliances Control System consists of home appliances, a cellular phone, bluetooth communication adapters for the appliances and cellular phone as shown in Figure 2.1. Hardware and software for those adapters, Java applications running on the cellular phone and the interface software between the Java applications and the adapter have been made for the prototype system.

Bluetooth act as a communication medium for the home appliances and cellular phone connections. The home appliances can gain communication functionality easily by attaching the bluetooth communication adapter.


(6)

Figure 2.1 Home Appliances Control System Overview [5]

The home appliance communication adapter and the cellular phone communication adapter use common board. Figure 2.2 shows the hardware block diagram of the communication adapter board. The communication adapter hardware consists of a 20MHz 16bit CPU, SRAM and a bluetooth module. The CPU is used for its low cost availability even though it is not powerful. Serial ports connect the communication adapter board to the home appliance and to the cellular phone.