Home Automation System Using Arduino
Home Automation System Using Arduino
Date of birth
12 12 1991
Title
Academic Session
2014/2015
CONFIDENTIAL
RESTRICTED
OPEN ACCESS
Certified by:
________________________
SIGNATURE
C0604564
(NEW IC NO. /PASSPORT NO.)
Date: 23
NOTES: *
rd
June 2015
________________________
SIGNATURE OF SUPERVISOR
MR.KAMAL KHALIL
NAME OF SUPERVISOR
Date:
23rd June2015
If the thesis is CONFIDENTAL or RESTRICTED, please attach with the letter from the
Signature
Name of Supervisor :
Date
_____________________
JUNE 2015
DECLARATION
Signature
Name
Date
ii
iii
ACKNOLEDGEMENT
The most sincere thanks and gratitude to the Al-Mighty Allah who has eased the
difficulty and cleared the ambiguity for me to fulfill this achievement which is my final year
project.
First of all, I would like to say that it has been my honor to be a student of Mr kamal
Khalil and also I would like to thank him my final year project supervisor, who is Mr. Kamal
Khalil for the guidance, support and encouragement he provided to me throughout the entire
duration while I was doing and preparing my biggest project yet which is my final year project
(FYP).
I also would like to take a moment thank my academic supervisor, Prof. Dr. Razali Ismail
for the support and guidance he showed me thought my four years as an Electrical-Electronics
Engineering student whenever I needed him.
Last but definitely not least, I would like to thank my Mother ,Father, family member and
friends for the constant encouragement and constant support they showed me throughout my
entire period as a university student which helped me to keep going and never give up.
iv
Abstract
This paper presents implementation of cost effective Home Automation System with and
remote control. This framework is intended to help and give help to satisfy the needs of the
elderly and the handicapped at houses. Additionally, the idea of home automation system will
improve the normal living status at houses. The fundamental control system uses a wireless
Bluetooth device gives a wireless access to smart phones. The system design does not remove
the existing electrical switches and gives a safer control over the switches with low voltage usage
technique. The switches status is synchronized every where each person interface demonstrates
the current existing switch status. This system is designed to control electrical devices
throughout the house with ease of installing it, ease of use and cost effective design and
implement.
Abstrak
Kertas kerja ini membentangkan satupembikinan sistem Automasi Kediaman kos rendah
dengan kos minimum dan kawalan jauh. Rangka kerja ini bertujuan untuk membantu dan
memberi bantuan untuk memenuhi keperluan warga tua dan orang kurang upaya di rumah.
Selain itu, idea sistem automasi rumah akan meningkatkan taraf hidup normal di rumah. Sistem
kawalan asas menggunakan peranti Bluetooth wayarles memberikan akses wayarles kepada
telefon pintar. Reka bentuk sistem tidak membuang suis elektrik yang sedia ada dan memberi
kawalan yang lebih selamat sepanjang suis dengan teknik penggunaan voltan rendah. Status suis
disegerakkan dalam setiap mana setiap muka orang menunjukkan status suis sedia ada semasa.
Sistem ini direka untuk mengawal alat-alat elektrik di seluruh rumah dengan mudah memasang
ia, kemudahan penggunaan dan kos rendah untuk mereka bentuk dan melaksanakan.
vi
CHAPTER
TITLE
PAGE
DECLARATION
DEDICATION
ii
ACKNOWLEDGEMENT
iii
ABSTRACT
iv
ABSTRAK
List of Contents
vi
List of Figures
ix
List of Tables
1.0
INTRODUCTION
1.1
Research background
1.2
Problem Statement
1.3
1.4
1.5
2.0
LITERATURE REVIEW
2.1
Introduction
2.2
2.3
Arduino
2.3.1
2.4
2.5
2.6
Bluetooth
10
10
11
12
Android
13
13
14
vii
3.0
Methodology
16
3.1
Introduction
16
3.2
Project Flow
16
3.3
17
3.4
System Design
19
3.5
Hardware Implementation
20
21
23
25
26
3.6
27
3.7
28
3.8
29
3.9
30
3.10
30
4.0
32
4.1
Results
32
4.2
33
viii
5.0
34
5.1
Conclusion
34
5.2
Future Recommendations
34
6.0
Project Management
35
References
37
Appendix A
38-41
ix
LIST OF FIGURES
Figure
Page
10
13
16
19
20
21
23
29
Figure12-Final Design
32
LIST OF TABLES
Table
Page
Table1-Arduino-Uno Specification
22
24
Table3-Ordering Information
25
25
29
35
36
36
Chapter 1
INTRODUCTION
1.1
Research background
Home automation system is getting popular and widely used in a lot of houses
worldwide. It has tons of advantages to users even more to the handicapped and/or elderly users
in which it will make it easier for them to control their home appliances. Home automation
systems can be labeled to two medium in which how it is connected and they are either wired or
wirelessly connected. The main difference between these two kinds is that home appliances are
linked wirelessly a central controller if it a wireless home automation system. On the other hand,
the appliances are connected to a central controller if the medium use wired communication
method. Wireless system had been introduced in order to dispose of wired communication
among home appliances. Arduino based, Bluetooth based home automation will be applied.
Another study shows that seventy five percent of the market share is Android and a total
of one hundred and six million android smartphone were shipped in the second half of 2012.
Android smartphone became the top operating system in the market in the present time
worldwide and it became the most popular operating system known to man.
1.2
Problem statement
In the present day home automation is becoming essential for the purpose of improving
our life condition. Convenience and ease of using home appliances is what home automation is
offering. Home automation offers a futuristic way of life in which an individual gets to control
his entire house using a smart phone, from turning on a TV to locking/unlocking doors; it also
offers an efficient use of energy.
But to get or acquire such system installed will cost a lot of money and that is the major
reason of why home automation has not received much demand and attention, adding to that also
the complexity of installing it and configuring it. Thus it is essential to make it cost effective and
easy to configure, if this is granted to people then they will be willing to acquire it in their
homes, offices and schools. In other words, a system modification for the home automation is
required in order to lower the price of applying it to houses. Also home automation offers ease of
mind and body to handicapped and/or elders in their houses by just one click to do what they
want as stated above.
1.3
To design and implement cost effective home automation system yet an efficient one.
To design a user friendly and a safe system to control home appliances especially aimed
to aid the elders and handicapped.
1.4
Scope of study
In order to fulfill the stated objectives several steps must be taken. These steps involve
Establishing a wireless network communication between the android and the home
automation system, using a microcontroller.
To find a suitable app that will work efficiently with the Arduino-Uno board in order to
control the home appliances.
1.5
Program the Arduino-Uno board in a way that will let it interact with the android app.
This study will be undertaken to create a home automation system at low cost and easy to
create, this will benefit both the manufacturer and the client. It will help the manufacturer by
making it easy and cheaper to apply it, and it will also benefit the clients by making it cost
effective and the most important advantage is that it will make the house a much more
convenient place for the clients especially for the elders and the handicapped.
Chapter 2
LITERATURE REVIEW
2.1
Introduction
This chapter will describe anything related to home automation, android and its operation
system, android development tools, Bluetooth technology, Bluetooth module, Arduino and it will
contain some examples to home automation projects.
2.2
2.3
Arduino
Arduino is open source physical processing which is base on a microcontroller board and
an incorporated development environment for the board to be programmed. Arduino gains a few
inputs, for example, switches or sensors and control a few multiple outputs, for example, lights,
engine and others. Arduino program can run on Windows, Macintosh and Linux operating
systems (OS) opposite to most microcontrollers frameworks which run only on Windows.
Arduino programming is easy to learn and apply to beginners and amateurs.
Arduino is an instrument used to build a better version of a computer which can control,
interact and sense more than a normal desktop computer. It's an open-source physical processing
stage focused around a straightforward microcontroller board, and an environment for
composing programs for the board.
Arduino can be utilized to create interactive items, taking inputs from a diverse collection
of switches or sensors, and controlling an assortment of lights, engines, and other physical
outputs. Arduino activities can be remaining solitary, or they can be associated with programs
running on your machine (e.g. Flash, Processing and Maxmsp.) The board can be amassed by
hand or bought preassembled; the open-source IDE can be downloaded free of charge.
Inexpensive - Arduino boards are moderately cheap compared with other microcontroller
boards. The cheapest version of the Arduino module can be amassed by hand, and even the
preassembled Arduino modules cost short of what $50.
Open source and extensible programming. The Arduino program language is available as open
source, available for development by experienced engineers. The lingo can be reached out
through C++ libraries, and people expecting to understand the specific purposes of different
interests can make the leap from Arduino to the AVR C programming language on which it is
based. Basically, you can incorporate AVR-C code clearly into your Arduino programs if you
have to.
Open source and extensible hardware - The Arduino is concentrated around Atmel's Atmega8
and Atmega168 microcontrollers. The plans for the modules are circulated under a Creative
Commons license, so experienced circuit designers can make their own particular interpretation
of the module, extending it and improving it. slightly inexperienced customers can build the
breadboard variation of the module remembering the finished objective to perceive how it
capacities and save money. [2]
2.4
Bluetooth
10
Other than the data, three channels of voice are accessible. The data can be traded to
speeds of up to 1 megabit per second (2 megabits for second in the Second Generation of this
Technology). A plan of "frequency hop" (hops of frequencies) permits to the gadgets to get
connected comprehensive in territories where an incredible electromagnetic interference exists.
Other than that is given plans of encryption and check. [3]
11
12
Arduino-Uno board doesnt support Bluetooth connection on its own, which makes the
idea of connecting it wirelessly to an Android device impossible. So a medium between the
Arduino-Uno board and android device is needed and in this project it is a Bluetooth module
specifically the HC-06 Bluetooth module.
The HC-06 is a user friendly need only basic knowledge and it is programmable using the
AT commands.
It comes only in one fixed mode either master or slave. In this project the
slave module was used.[6]
13
2.5 Android
2.5.1 Introduction to android
Android operating system is open source focused around Linux kernel with Java
programming interface planned fundamentally for touch screen contraptions. The Android
telephone was in the business sector since October 2008. Gadget producers, remote transporters
and fan engineers are permitted to adjust and distribute the product under the Apache License.
[7]
Google Play is Android essential application store. There were roughly 700,000
applications accessible for Android in October 2012 and created by a vast group of Android
application designer.
Android building design comprises of a few layers as demonstrated in Figure 2.1. The
applications need to go layer by layer to get to the hardware. A few libraries are accessible.
ARM architecture is the principle equipment platform for Android.
14
2.6
15
16
Chapter 3
METHODOLOGY
3.1 Introduction
This part will explain the path needed to undertake in order to achieve the goal of the
project.
17
Arduino Uno.
Proto Board.
Android phone.
Some Resistors.
Jumping Wires.
Relays Modules.
Light Bulbs.
Portable Fan.
Block-connectors.
18
19
Figure 3.4 shows the system breakdown of this project. In this project two types of
communication is used, first one is wireless (Via Bluetooth) and the second one is wired
(appliances connected to the controller). HC-06 is a Bluetooth module that will enable the
android phone to wirelessly connect with the controller.
Android Phone
Wireless Communication
(Bluetooth)
Arduino Board
HOME APLLIANCE
HOME APLLIANCE
Figure 7-SystemDesign
HOME APLLIANCE
20
3.5
Hardware Implementation
This part describes the implementation of the whole system, from arduino-uno board to
the appliances. This system is integrated using Arduino-Uno board, a HC-06 Bluetooth module,
relays modules, an android device, an android app to control the arduino board, and other
electronics components. Figure 3.5 shows the important part in the design.
21
The Arduino Uno is a microcontroller board based on the ATmega328. It has a 16 MHz
ceramic resonator, 14 digital input/output pins (of which 6 can be used as PWM outputs), 6
analog inputs, a USB connection, a power jack, an ICSP header, and a reset button. This board is
very simple and can be easily used, everything you need to support the microcontroller is in this
board, just plug it in a computer via USB cable and power using an AC-to-DC adapter or battery
to get started.
The difference seen in the Arduino Uno is that it does not use the FTDI USB-to-serial
driver chip but, it has the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USBto-serial converter. [2]
22
ATmega328
Operating-Voltage(OV)
5Volts
7 to 12 Volts
6 to 20 Volts
40 mA
50 mA
Flash Memory
SRAM
2 KB (ATmega328)
EEPROM
1 KB (ATmega328)
Clock Speed
16 MHz
Length
68.6 mm
Width
53.4 mm
Weight
25 g
23
24
Frequency
Modulation
Emission power
4dBm, Class 2
-84dBm at 0.1% BER
Sensitivity
Speed
Security
Profiles
Power supply
+3.3VDC 50mA
Working temperature
dimension
Mode
Slave
1234
25
A relay is a device that operates on electricity. It has a control and controlled systems. It
is mostly used to control circuit automatically. Basically, it is an automatic switch to control
using a low-current signal a high-current circuit.
XX VDC
Model of
Structure
Coil sensitivity
Contact form
03,05,06,09,12,24,48VDC
S:Sealed type
L:0.36W
A:1 form A
relay
SRD
B:1 form B
F:Flux free
D:0.45W
type
Table 3 Ordering information
C:1 form C
26
By connection the power source to the In Port and the wanted appliance to the
normally open Pin (NO) if you want it to be active high otherwise connect it to the normally
connected Pin (NC).
27
In this Project and android phone (Samsung Galaxy S Advance) is used as the remote
control for the user alongside with an App Called ArduDroid.
ArduDroid is a simple Android app that will make controlling the pins of Arduino-Uno
from an Android phone wirelessly possible. ArduDroid employs a simple Android user interface
to control Arduino Uno's digital and PWM pins, send text commands to Arduino-Uno and
receive data from Arduino over Bluetooth serial module.
In this Project the Digital Pin Function is only required to make the system work, so the
Arduino-Uno Board should be programmed to only support that feature.
28
In order for the Arduino-Uno board to be able to interact with the application used in this
project certain program (code) needs to be uploaded to the Arduino-Uno.
Arduino Company provides user friendly software which allows writing any code for any
function wanted to be performed by the Arduino-Uno and upload it to the board.
Refer to appendix A for the full source code of the Arduino-Uno board.
29
A connection between the Arduino-Uno and the Bluetooth module is required in order to
enable the android to control the Arduino-Uno.
First we need to connect the VCC pin of the Bluetooth module to the VCC port in the
Arduino-Uno board. Second we need to connect the GND pin of the Bluetooth module to the
GND port in the Arduino-Uno board. Lastly we need to connect the receiver of the Bluetooth
module to the transmitter of the Arduino-Uno board and the transmitter of the Bluetooth module
to the receiver of the Arduino-Uno board. Table 3.7 shows the process.
Arduino-Uno Board
VCC pin
VCC port
GND pin
GND port
TX pin
RX port
RX pin
TX port
30
After installing the app on the phone and connecting the Arduino-Uno board with the
Bluetooth module a test to make sure that the phone is interacting with arduino via the Bluetooth
module is needed.
If the light in the Bluetooth module stopped blinking then everything is working fine
otherwise the wiring need to be checked.
After everything is set and ready (android phone is connected to the Arduino) connecting
the Arduino to the home appliances is needed.
Using wires and connector blocks connect the positive end of the home appliance (eg.
Portable fan) to the normally open (in this project we want to make the output active high) port
in the relay module and the negative end of the appliance to a power source. Then connect the IN
port of the same relay module to the wanted Arduino-Uno port.
31
Apply the same for the other appliances only use different relays and different ArduinoUno Ports.
Connect the android phone with the Bluetooth module and now all the connected
appliances can be controlled wirelessly using the android device.
32
CHAPTER 4
This chapter discusses the results and any limitation and/or problems encountered
during the period of the project.
4.1
Results
33
4.2
Some problems and issues were encountered during this project. Bluetooth
connection between the android phone and the Arduino-Uno board was unsuccessful
in the early stages of this project. This problem was encountered when the xbee
Bluetooth module was meant to be used for this project. This problem has been
tackled by online search on the matter and finally replacing the xbee module with the
HC-06 Bluetooth module.
Another issue it was using the relay modules and connecting them. At first normal
relays were intentioned to be used in the project however soldering them into a
breadboard was troublesome because of the whole not matching the relay pins and the
breadboard needed specific modification, not to mention connecting everything using
soldering iron is not the ideal way if several tests and wiring and unwiring is in order.
This problem was tackled by using relay modules.
34
Chapter 5
5.1
Conclusion
It can be concluded that HOME AUTOMATION SYSTEM USING ARDUINO was a
success. This system consists of an Arduino-Uno board, a Bluetooth Module, an Android phone,
power sockets, home appliances and an android Application (ArduDroid). It is user friendly and
it is cost effective.
Also it can be concluded that the objectives of this project has been successfully met and
they are as follows:
Designed and implement cost effective home automation system yet an efficient one.
Designed a user friendly and a safe system to control home appliances especially aimed
to aid the elders and handicapped.
5.2
Future Recommendations
There are some recommendations for Future works. Some of them are:
1. Better to use relay modules and connect it directly than using normal relays
with breadboard.
2. Try to find a way to amplify the Bluetooth module signal to work in greater
distance.
3. Test each and every component before using them especially the relays for
safety purposes.
35
Chapter 6
PROJECT MANAGEMENT
This chapter shows the planning and management that has been done in order
to achieve the objectives of the project on the right time. Also, this chapter discusses
the period taken in each step in order to complete the tasks for the project. Last but not
least, the cost of the project has been estimated in this chapter.
Table 6 shows the schedule for the first part of the final year project
Tasks
Start Date
Duration (Days)
End Date
9/14/2014
9/20/2014
9/21/2014
9/27/2014
9/28/2014
10/4/2014
First evaluation
10/5/2014
10/11/2014
10/12/2014
10/18/2014
10/19/2014
10/25/2014
10/26/2014
11/1/2014
Second evaluation
11/2/2014
11/8/2014
Analyzing issues
11/9/2014
11/15/2014
SWOT analysis
11/16/2014
11/22/2014
Last evaluation
11/23/2014
11/23/2014
11/30/2014
12/6/2014
12/7/2014
12/7/2014
36
Table 7 shows the schedule for the second part of the final year project
Task
Start Date
Finish Date
Effort
(Days)
Reviewing FYP1
22/2/2015
28/2/2015
1/3/2015
7/3/2015
8/3/2015
14/3/2015
15/3/2015
21/3/2015
22/3/2015
28/3/2015
29/3/2015
4/4/2015
12/4/2015
18/4/2015
19/4/2015
25/4/2015
26/4/2015
2/5/2015
3/5/2015
9/5/2015
10/5/2015
18/5/2015
to other projects
Trying different methods and choosing
the best one
Part number
Quantity
Description
Material Cost
Arduino-Uno Board
RM72
Arduino-PC cable
RM3
RM4
RM5
RM60
Plug Top
RM7
2+2
RM11.40
Total
RM162.4
Table 8 Project cost
37
REFERENCES
[1]
Deepali Javale, Mohd. Mohsin, Shreerang Nandanwar and Mayur Shingate. International
Journal of Electronics Communication and Computer Technology (IJECCT) Volume 3
Issue 2 (March 2013).
[2]
[3]
[4]
[5]
Ming Yan and Hao Shi, SMART LIVING USING BLUETOOTHBASED ANDROID
SMARTPHONE, 2013.
[6]
[7]
[8]
[9]
38
Appendix A
String inText;
void setup() {
Serial.begin(9600);
Serial.println("ArduDroid 0.12");
Serial.flush();
}
void loop()
{
Serial.flush();
39
int ard_command = 0;
int pin_num = 0;
int pin_value = 0;
char get_char = ' ';
if (Serial.available() < 1) return;
get_char = Serial.read();
if (get_char != START_CMD_CHAR) return;
ard_command = Serial.parseInt();
pin_num = Serial.parseInt();
pin_value = Serial.parseInt();
40
digitalWrite(2, pin_value);
break;
case 3:
pinMode(3, OUTPUT);
digitalWrite(3, pin_value);
break;
case 4:
pinMode(4, OUTPUT);
digitalWrite(4, pin_value);
break;
case 5:
pinMode(5, OUTPUT);
digitalWrite(5, pin_value);
break;
case 6:
pinMode(6, OUTPUT);
digitalWrite(6, pin_value);
break;
case 7:
pinMode(7, OUTPUT);
digitalWrite(7, pin_value);
break;
case 8:
pinMode(8, OUTPUT);
digitalWrite(8, pin_value);
break;
41
case 9:
pinMode(9, OUTPUT);
digitalWrite(9, pin_value);
break;
case 10:
pinMode(10, OUTPUT);
digitalWrite(10, pin_value);
break;
case 11:
pinMode(11, OUTPUT);
digitalWrite(11, pin_value);
break;
case 12:
pinMode(12, OUTPUT);
digitalWrite(12, pin_value);
break;
case 13:
pinMode(13, OUTPUT);
digitalWrite(13, pin_value);
break;
}
}