UNIVERSITI TEKNIKAL MALAYSIA MELAKA - …eprints.utem.edu.my/17296/1/Design And Implementation...
-
Upload
phungthien -
Category
Documents
-
view
214 -
download
1
Transcript of UNIVERSITI TEKNIKAL MALAYSIA MELAKA - …eprints.utem.edu.my/17296/1/Design And Implementation...
UNIVERSITI TEKNIKAL MALAYSIA MELAKA
DESIGN AND IMPLEMENTATION OF INTELLIGENT HOME
AND ELECTRICAL APPLIANCES CONTROL USING
ANDROID AND WIFI TECHNOLOGY
This report submitted in accordance with requirement of the Universiti Teknikal
Malaysia Melaka (UTeM) for the Bachelor Degree of Engineering Technology
(Industrial Electronics) (Hons.)
by
IBTISAM BINTI A. HAMID
B071210072
900327-03-5576
FACULTY OF ENGINEERING TECHNOLOGY 2015
UNIVERSITI TEKNIKAL MALAYSIA MELAKA
BORANG PENGESAHAN STATUS LAPORAN PROJEK SARJANA MUDA
TAJUK: DESIGN AND IMPLEMENTATION OF INTELLIGENT HOME AND
ELECTRICAL APPLIANCES CONTROL USING ANDROID AND WIFI
TECHNOLOGY
SESI PENGAJIAN: 2014/15 Semester 2
Saya IBTISAM BINTI A. HAMID
mengaku membenarkan Laporan PSM ini disimpan di Perpustakaan Universiti Teknikal Malaysia Melaka (UTeM) dengan syarat-syarat kegunaan seperti berikut:
1. Laporan PSM adalah hak milik Universiti Teknikal Malaysia Melaka dan penulis. 2. Perpustakaan Universiti Teknikal Malaysia Melaka dibenarkan membuat salinan
untuk tujuan pengajian sahaja dengan izin penulis. 3. Perpustakaan dibenarkan membuat salinan laporan PSM ini sebagai bahan
pertukaran antara institusi pengajian tinggi. 4. **Sila tandakan ( )
SULIT
TERHAD
TIDAK TERHAD
(Mengandungi maklumat yang berdarjah keselamatan atau kepentingan Malaysia sebagaimana yang termaktub dalam AKTA RAHSIA RASMI 1972)
(Mengandungi maklumat TERHAD yang telah ditentukan oleh organisasi/badan di mana penyelidikan dijalankan)
(TANDATANGAN PENULIS)
Alamat Tetap:
KI-12-10 KASTURI IDAMAN, JALAN PEKAKA 8/1 SEKSYEN 8 KOTA DAMANSARA
47810 PETALING JAYA
SELANGOR, MALAYSIA
Disahkan oleh:
(TANDATANGAN PENYELIA)
Cop Rasmi:
** Jika Laporan PSM ini SULIT atau TERHAD, sila lampirkan surat daripada pihak berkuasa/organisasi
berkenaan dengan menyatakan sekali sebab dan tempoh laporan PSM ini perlu dikelaskan sebagai
SULIT atau TERHAD.
DECLARATION
I hereby, declared this report entitled “Design and Implementation of Intelligent
Home and Electrical Appliances Control Using Android and WiFi Technology ” is
the results of my own research except as cited in references.
Signature :
Name : IBTISAM BINTI A. HAMD
Date : ………………………
v
APPROVAL
This report is submitted to the Faculty of Engineering Technology of UTeM as a
partial fulfillment of the requirements for the degree of Bachelor of Engineering
Technology (Industrial Electronics) (Hons.). The member of the supervisory is
as follow:
……………………………….
(Mr Mohd Fauzi Bin Ab Rahman)
vi
ABSTRACT
Currently, the advancement in technology makes people like to be easier in
managing their life. Nowadays they more rely on technology when doing anything
such as finding information and make something that make their life easier, example
voice starter car and others. This project focuses on the controlling of home
appliances remotely when the user is away from the house. The system is Android
based to revolutionize the standard of living. This project is divided into two
sections: the hardware and the software sections. The hardware section consists of
smart phones as the controlling device, the power supply module and the control
module. By using the Wi-Fi module, which is allows an electronic device to
exchange data or connects using microwaves radio. The transmitter of Wi-Fi
transmits the data given by the application using radio waves technology. The Wi-Fi
works on radio waves technology, as the data to be passed through Wi-Fi is
converted into the electromagnetic signal which is then sent using the antenna. This
signal is received and decoded by the router at the receiving end. This signal is
passed to the controller and operates the received information and performs
operations on the appliances, which are driven by the driver circuitry to operate any
of the connected appliances, it forwards to the microcontroller, and the
microcontroller decodes the message, switch on or switch off the appropriate
appliance. Overall, the work employs software and the signals to produce this
product. The overall project will be applied with a constructed work, tested working
and perfectly functional.
vii
ABSTRAK
Pada masa ini, kemajuan teknologi membuat manusia lebih mudah dalam
menguruskan kehidupan mereka. Pada masa kini mereka lebih bergantung kepada
teknologi ketika melakukan apa-apa seperti mencari maklumat dan membuat sesuatu
yang menjadikan kehidupan mereka lebih mudah. Projek ini memberi tumpuan
dalam mengawal peralatan rumah secara kawalan jauh apabila pengguna berada jauh
dari rumah. Sistem ini berasaskan system aplikasi Android untuk merevolusikan taraf
hidup. Projek ini dibahagikan kepada dua bahagian: perkakasan dan bahagian-
bahagian perisian. Bahagian perkakasan terdiri daripada telefon pintar yang
bertindak sebagai peranti kawalan, modul bekalan kuasa dan modul kawalan.
Dengan menggunakan modul Wi-Fi yang membolehkan peranti elektronik untuk
menukar data atau menghubungkan dengan menggunakan gelombang mikro .
Pemancar Wi-Fi menghantar data yang diberikan oleh aplikasi telefon pintar
menggunakan teknologi gelombang radio. Wi-Fi berfungsi sebagai penghantar
gelombang radio di mana data yang dihantar akan melalui isyarat kawalam
ditukarkan kepada isyarat elektromagnet yang kemudiannya dihantar menggunakan
antena. Isyarat ini diterima dan dinyahkod oleh router di bahagian hujung modul.
Isyarat ini dialirkan kepada pengawal dan mengendalikan maklumat yang diterima
dan melaksanakan operasi pada alat yang dipacu oleh litar pemandu untuk
mengendalikan mana-mana peralatan yang berkaitan, Ia menghantarnya kepada
pengawal mikro dan pengawal mikro menyahkod mesej, suis pada atau matikan
perkakas yang sesuai mengikut arahan yang diberikan. Secara keseluruhan, kerja-
kerja yang menggunakan perisian dan isyarat untuk menghasilkan produk ini.
ix
ACKNOWLEDGMENTS
In The Name Of Allah, the Most Beneficent and the Most Merciful. A deep
sense of thankfulness to Allah SWT who has given me the full strength, ability and
patience to complete this Bachelor Degree Project as it is today.
Firstly, I would like to take this opportunity to put into words my deepest
gratitude and appreciation to my the project supervisor, Mr Mohd Fauzi bin Ab
Rahman for his support, guidance, patience, encouragement and abundance of ideas
during the completion of this project. Secondly, special thanks to both honourable
panels, for their comments, invaluable suggestions and outstanding deliberations to
improve the project during the project presentation.
I would also like to express my extraordinary appreciation to my family
especially to my parents, Mr A.Hamid Bin Mamat and Puan Rosnah Binti Ali and
also to my family members for their invaluable support along the duration of my
studies until the completion of this Bachelor Degree Project. Finally yet importantly,
thanks to my beloved friends who are directly or indirectly contributed due to their
supports and guidance and helped greatly to point me in the right direction until the
completion of this Bachelor Degree Project
x
TABLE OF CONTENTS
DECLARATION ................................................................................................................. iv
APPROVAL ........................................................................................................................... v
ABSTRACT ......................................................................................................................... vi
ABSTRAK .......................................................................................................................... vii
DEDICATIONS ................................................................................................................. viii
ACKNOWLEDGMENTS ................................................................................................... ix
LIST OF FIGURES ........................................................................................................... xiv
LIST OF TABLE ................................................................................................................. xv
LIST OF SYMBOLS AND ABBREVIATIONS .............................................................. xvi
CHAPTER 1 .......................................................................................................................... 1
1.0 Introduction ............................................................................................................. 1
1.1 Background ............................................................................................................. 1
1.2 Objective ................................................................................................................. 2
1.3 Problem Statement .................................................................................................. 2
1.4 Scope of Project ....................................................................................................... 2
1.5 General Flowchart ................................................................................................... 3
1.6 Report Outlines ........................................................................................................ 4
1.7 Project Summary ..................................................................................................... 5
xi
CHAPTER 2 .......................................................................................................................... 7
2.0 Introduction ............................................................................................................. 7
2.1 Smart Home and Controlling System ...................................................................... 7
2.2 Research from Previous Project .............................................................................. 8
2.3 Hardware and Software Review .............................................................................. 9
2.3.1 Smart Phones as Controlling Device ............................................................... 9
2.3.2 Android Application....................................................................................... 10
2.3.2.1 Latest Android Version ........................................................................... 10
2.3.3 Android Apps Developer ............................................................................... 11
2.3.3.1 Advantages of Using App Inventor ........................................................ 12
2.3.4 Wireless Networking ...................................................................................... 14
2.3.4.1 Advantages of using Wifi (Green Mountain, n.d.) ................................. 15
2.3.5 WiFi Module (ESP8266) ............................................................................... 15
2.3.6 Arduino Controller ......................................................................................... 17
2.3.6.1 Introduction to Arduino .......................................................................... 17
2.3.6.2 Arduino UNO ......................................................................................... 18
2.3.6.3 Advantages of Arduino UNO (Instruments, n.d.) .................................. 19
2.4 Conclusion ............................................................................................................. 20
CHAPTER 3 ........................................................................................................................ 22
3.0 Introduction ........................................................................................................... 22
3.1 Project Implementation and Development ............................................................ 22
3.2 Block Diagram of the Project ................................................................................ 24
3.3 Hardware Development ......................................................................................... 25
xii
3.3.1 Printed Circuit Board (PCB) .......................................................................... 25
3.3.2 Arduino UNO Circuit ..................................................................................... 26
3.3.3 Power Supply Circuit ..................................................................................... 27
3.3.4 Relay Circuit .................................................................................................. 27
3.4 Software Development .......................................................................................... 28
3.4.1 Apps Inventor ................................................................................................. 28
3.4.2 Programming for Arduino .............................................................................. 29
3.4.3 Proteus 8 Software ......................................................................................... 30
3.5 Testing And Evaluation ......................................................................................... 31
3.6 Expected System Outcome .................................................................................... 32
3.7 Conclusion ............................................................................................................. 33
CHAPTER 4 ........................................................................................................................ 35
4.0 Introduction ........................................................................................................... 35
4.1 Project Prototype ................................................................................................... 35
4.2 Hardware Development and Experimental Works ................................................ 35
4.3 Software Development and Experimental Works ................................................. 37
4.3.1 Arduino Programming ................................................................................... 37
4.3.2 Android Application Development ................................................................ 39
4.4 Experimental Results ............................................................................................. 41
4.4.1 System Interface ............................................................................................. 41
4.4.2 System Display on Smartphone ..................................................................... 42
4.5 Overall System Flow ............................................................................................. 43
4.5.1 Declaration of the WiFi Network ................................................................... 43
xiii
4.5.2 Display on Serial Monitor .............................................................................. 44
4.5.3 IP Adress Verification .................................................................................... 45
4.5.4 Output Gained ................................................................................................ 46
4.5.5 Testing and Evaluating of Project .................................................................. 47
4.6 Project Analysis ..................................................................................................... 50
4.6.1 Notification Efficiency ................................................................................... 50
4.6.2 Connectivity of the Hardware and WiFi Source ............................................ 50
4.7 Project Limitation .................................................................................................. 55
CHAPTER 5 ........................................................................................................................ 56
5.0 Introduction ........................................................................................................... 56
5.1 Summary of Research ........................................................................................... 56
5.2 Achievement of Research Objectives .................................................................... 57
5.3 Significance of Research ....................................................................................... 57
5.4 Future Works ......................................................................................................... 57
APPENDIX A ...................................................................................................................... 60
APPENDIX B ...................................................................................................................... 66
APPENDIX C ...................................................................................................................... 69
REFERENCES ..................................................................................................................... 71
xiv
LIST OF FIGURES
Figure 1.1: The Flowchart of The System ................................................................... 4
Figure 2.1: Android Version ...................................................................................... 10
Figure 2.2: Process Flow of Inventing Apps on Android Phones .............................. 12
Figure 2.3: User interface using App Inventor........................................................... 12
Figure 2.4: Types of Wireless Communication Technologies ................................... 15
Figure 2.5: ESP8266 Wifi Module ............................................................................ 16
Figure 2.6: The Architecture of Arduino Uno ........................................................... 19
Figure 3.1: Flow Chart of Project Planning ............................................................... 23
Figure 3.2: Block Diagram of Home Appliances System ......................................... 24
Figure 3.3: PCB Layout ............................................................................................. 26
Figure 3.4: Arduino Uno Circuit ................................................................................ 26
Figure 3.5 : Power Supply circuit .............................................................................. 27
Figure 3.6 : Relay ....................................................................................................... 28
Figure 3.7: Three Main components of App Inventor ............................................... 29
Figure 3.8: Coding Example for the Arduino Program ............................................. 30
Figure 3.9: Interphase of Proteus 8 ............................................................................ 31
Figure 3.10: Full Project Expectation /Overview ...................................................... 33
Figure 4.1:Layout of Full Connection of Arduino UNO and ESP8266 WiFi Module .................................................................................................................................... 36
Figure 4.2: Arduino Uno and Wifi Module Assembly ............................................. 36
Figure 4.3: Code for Arduino IDE ............................................................................. 38
Figure 4.4: Window Panel for Apps Development .................................................... 39
Figure 4.5:Coding Block Screen ................................................................................ 40
Figure 4.6: Viewer Screen Display ............................................................................ 41
Figure 4.7: Launcer Icon Display............................................................................... 42
Figure 4.8: Display of Apps on Smartphone .............................................................. 43
Figure 4.9: Network Registeration and Declaration in Arduino Program ................. 44
Figure 4.10 : Display of the Serial Monitor ............................................................... 45
Figure 4.11: IP Address Insertion .............................................................................. 46
Figure 4.12: Output Gained........................................................................................ 47
Figure 4.13: The lamp in ON mode ........................................................................... 48
Figure 4.14: Lamp in OFF Mode ............................................................................... 48
Figure 4.15: Fan in OFF Mode .................................................................................. 49
Figure 4.16: Fan in ON Mode .................................................................................... 49
Figure 4.17: Layouts and Marking of the Tested Areas............................................. 51
Figure 4.18: Example of Test Done Outside the House............................................. 53
Figure 4.19: Graph of Distance Vs Time taken to ON/OFF the Device ................... 54
xv
LIST OF TABLE
Table 1: Testing and Evaluation of Prototype............................................................ 32
Table 2: Time Taken to Start-Up the Application ..................................................... 50
Table 3: Connection of Tested Areas ......................................................................... 51
Table 4: Distance and Connectivity of the System .................................................... 53
Table 5: Distance and Time Taken to ON/OFF the Device ....................................... 54
xvi
LIST OF SYMBOLS AND ABBREVIATIONS
IDE = Integreated Development Environment
SDK = Software Development Kit
UteM = Universiti Teknikal Malaysia Melaka
1
CHAPTER 1 INTRODUCTION
1.0 Introduction
This chapter is the project background, objectives, problem statement, and
scope of the project, general flowchart and project outlines in order to give an overall
view of the project.
1.1 Background
Nowadays home is outfitted with many electrical home appliances that need
to be controlled by people. However this may not be controlled by all the time
because people may not be not at home all the time. We proposed a new technology
so that the ordinary services of the mobile phones can be used to communicate with
and control the home appliances. Here, the switch board of our regular use is
replaced by Wi-Fi module which will communicate with microcontroller and the
android based smart phone. The home appliances monitoring and controlling is done
wirelessly through Android smart phone which user can monitor and can turns the
ON/OFF the targeted electrical home appliances such as electrical fan and lamp
remotely. The purpose of this project are for cost and energy saving.
2
1.2 Objective
The main objective of the project can be outlined as follows
To design and fabricate a smart home system that is capable of
monitoring and controlling the household appliances using Android
application with the presence of Wi-Fi connection
To evaluate and analyse the performance of the home controlling system
and effective while using system.
1.3 Problem Statement
Nowadays, people are too busy in their daily routine and very often are away
from home for working. Sometimes, they are forgotten to turn ON/OFF the
appliances and as a result, the operation is put into operation for long hours. Thus, a
project based on a microcontroller device using Android and Wi-Fi technology is
developed. It can automatically control any electrical home appliances remotely
using mobile phone. This project also can save cost and energy in daily life
1.4 Scope of Project
The main target of this project is to develop a system that can control and
monitor the targeted home appliances by using Android and Wi-Fi technology. This
project is focus on the users which have limited time and distance to control the
home appliances when they are away from home since the users can control it by
using mobile phone.
In order to build this project, the scope is developed within these areas:
1. Design and build the system which using microcontroller and the technology
of Android and Wi-Fi.
3
2. Develop and analyse the controlling device.
3. Simulate the circuit and construct the circuit by using Proteus software.
4. Testing and troubleshooting.
1.5 General Flowchart
The appliances which are to be controlled are the interface with driver
circuitry to microcontroller which is wirelessly connected to Wi-Fi that use Android
based smart phone as controlling device. The appliances which are to be controlled is
light on-off, controlling the speed of fan as well as on-off. The user can access the
smart phone application and gives command to Wi-Fi module. The Wi-Fi module
can processing router with help of electromagnetic signal which will processing
microcontroller. The transmitter of Wi-Fi transmits the data given by the application
using radio waves technology. The Wi-Fi works on radio waves technology, as the
data to be passed through Wi-Fi is converted into the electromagnetic signal which is
then sent using the antenna. This signal is received and decoded by the router at the
receiving end. This signal is passed to the controller and operates the received
information and performs operations on the appliances. The switching action can be
take place with help of driver circuitry. The driver circuitry can control and manage
the devices as per there required conditions. Devices can be on-off and senses by the
driver circuitry.
The Figure 1.1 shows diagram which represents the activity diagram of
system. It shows the process of flow of activities. Initially there are two modes of
operations one is user mode and second is automatic mode.
4
Figure 1.1: The Flowchart of The System
1.6 Report Outlines
The project is outlined as follows;
Chapter 1:
The first chapter is about the brief introduction and summary of idea of the
project. It highlighted more on the overview of the project, the list of objectives, brief
explanations on the problem statement, work scope and finally the project significant
and expectations.
Chapter 2:
The background of the project is discussed in this chapter together with the
methods, concepts, and related theory that were used in this project. The concept of
the research and how it is the relationship between theories is also discussed in this
chapter.
5
Chapter 3:
Chapter 3 is about the methodology section. In the methodology chapter, it
illustrates the schedule or steps that needed to be completed in order to achieve the
objective of the project. This chapter also explains the procedures taken in
completing this project together with the project development are also explained in
this chapter.
Chapter 4:
This chapter contains the result from the steps or procedure described in the
methodology. The result that we have obtained will be analysing based on the
objectives and problem statement.
Chapter 5:
Chapter five is described to the conclusion and the future recommendation
associated with the achieved results. The result will be summarized in this section.
All the simulation, data collection and analysis that were obtained from the project
will be discussed in detail. The result was compared with the outlined objectives in
order to state the hypothesis in obtaining the specific result and do the conclusion of
the project.
1.7 Project Summary
This idea of this project started due to problem faced by people on wasting
energy and cost to monitor the home and electrical appliances in turning ON or OFF
the electrical appliances. From this project, the application created will become the
user interface to help a person to control the fan and lamp switch remotely. Less
movement required for them to perform this activity. This project will be
implemented on basic electrical appliances such as lamp and fans in the house. In the
6
future, this project can also be installed widely in other places such as industrial
building and hospital ward.
7
CHAPTER 2 THEORETICAL BACKGROUND
2.0 Introduction
In this chapter, the literature review which contains the information and ideas
in completing the project is discussed. There are several sources that had been taken
as a resource such as books, thesis, journal and website. It was included the operation
of the circuit, the hardware and software which is useful in the project. Other than
that, in this chapter also make a study about several projects that related to make
some improvement or take some idea from the other project. It is useful to complete
a project that has created.
2.1 Smart Home and Controlling System
The development of digital information has led the rapid change in human
lifestyle. The use of electricity is very important as one of the main source of energy
that is vital in today modern life. Some kinds of mechanism using available
technology could be used to reduce wastage in electricity usage. Thus a prototype
based on a microcontroller device using Android and Wi-Fi technology is developed.
It can automatically control any electrical equipment at home remotely using mobile
phone. Hence the electrical energy saving in daily life can be made more efficient
and effective.
As the technology grows, Wi-Fi and Android technology has been widely
accepted as a part of medium of communication (Akyildiz, Su, Sankarasubramaniam,
& Cayirci, 2002). The purpose of using this technology is to provide widest coverage
at minimal cost. Therefore the use of Android and Wi-Fi would facilitate in
controlling the electrical device at home from long distance and low in maintenance
8
and independent from any physical geographical boundary. Thus this project is
proposed to develop a system is to facilitate the home owner to optimize usage of
electricity remotely using smart phone with the presence of internet connection.
Lights and other electrical appliances turned on continuously and it leads to
energy waste. Thus this research is carried out to provide a mechanism through the
development of a prototype to provide a service to the home owner to optimize the
usage of electricity through remote control using Android services. The followings
are the objectives of the research project to ensure it meets the aim. (J, Lathkar, & B,
2014)
2.2 Research from Previous Project
Research from other previous projects was needed to complete this project. It
was useful to upgrade the system that has been demonstrated before. Other than that,
some other technologies that has been used in this project can get help from others
study in this field to know the function and to master on technology that used in this
project.
One of the systems is wireless Bluetooth technology implemented on home
automation system by (Lee, Chuah, & Chieng, 2013). The system was implemented
by using Bluetooth module for controlling the home system. The next project is
Ubiquitous home control and monitoring system by using Android and smart phone
but using the technology of (IoT) and was proposed by (Kumar, 2014). This project
is based on various wireless technologies that can support some form of remote data
transfer, sensing and control such as Bluetooth, Wi-Fi, RFID, and cellular networks.
The next research is the home system project that use the technology of Radio
Frequency Identification (RFID) by (Darianian & Michael, 2008). The project
introduces RFID reader system architecture for a home comprised of several readers
in master slave architecture using network connectivity like WLAN RFID reader to
read the identification information from the tags and exchange it with the back-end
system for further processing.
9
Based on the mentioned literature review, there are a few flaws and
disadvantages of these previous projects. For wireless Bluetooth implemented home
automation system, there is limited range of connectivity since the effective area
under control from a Bluetooth module is 100 meters in diameter (J et al., 2014).
While for Ubiquitous home controlling system, which the system use the
combination of a of Bluetooth and GSM technology, the disadvantages of these
systems are twofold. Firstly, a high end personal computer has been utilized which
not only increases the cost of installation but also increases the energy consumption.
Secondly, development and hosting of web pages which also add to the cost. And the
advantages of using GSM is users have to remember different AT commands to
control the connected devices proposed mobile IP since that the users are not
provided with a graphical user interface . The last disadvantage for project that use
RFID is it is also limited as they work only with reading distances up to 5cm. But
they are currently still too large, heavy and consume too much power compared to
the mobile devices of today and are not very stylish for home environment and
therefore not suitable for resilient long day usage. (Darianian & Michael, 2008).
2.3 Hardware and Software Review
This part is to review the hardware and software that will be used on this
project. This part is very crucial as it explain some ctitical informations regarding
parts and components for the hardware and some knowledge with the regards to the
software.
2.3.1 Smart Phones as Controlling Device
A smartphone is a mobile phone with an advanced mobile operating
system. They typically combine the features of a cell phone with those of other
popular mobile devices, such as personal digital assistant (PDA), media
player and GPS navigation unit. Most smartphones have a touchscreen user
interface and can run third-party apps, and are camera phones. (Nusca, 2011). Smart
phones gives the opportunity to the developers to create new applications for the
advance smart phone usage (Hwang, 2012). According to a study made, smart phone