Professional Documents
Culture Documents
INTRODUCTION
In the present day, security systems play an important role in the protection of
lives and investment. This is achieved by the incorporation of various subsystems
into the security system with a single control unit such as surveillance, intruder
control, access control, fire detection, etc. A smart home is one that is equipped
with lighting, heating, and electronic devices that can be controlled remotely by
Smartphone or via the internet. An internet-based home automation system
focuses on controlling home electronic devices whether you are inside or outside
your home (Nathan, Abafor, Aronu & Edoga, 2015). Home automation gives an
individual the ability to remotely or automatically control things around the home.
A home appliance is a device or instrument designed to perform a specific
function, especially an electrical device, such as a refrigerator, for household use.
The words appliance and devices are used interchangeably.
|1
to the internet from a wireless router or wireless hotspot and this would act as the
gateway for the Arduino to communicate with the internet.
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 media 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
to a central controller if it is a wireless home automation system. On the other
hand, the appliances are connected to a central controller if the medium uses wired
communication method. Wireless system had been introduced in order to dispose
of wired communication among home appliances.
In the present day, home automation is becoming essential for the purpose of
improving life conditions. Home automation offers convenience and ease in the
use of home appliances. This ranges from using a smart phone in turning on a TV
to locking and unlocking doors. It also offers an efficient use of energy. However,
to get or acquire such systems installed costs a lot of money and that is the major
reason why home automation has not received much demand and attention in
|2
some parts of the world (including Nigeria). In addition, it is also complex to
install and configure. There is therefore the need to develop a cost effective and
easy to configure system so that a lot of people will be willing to acquire it in their
homes, offices and schools.
iii. To develop a remotely control system that enables data transfer through
wireless transfer medium.
In order to fulfill the stated objectives, several steps must be taken. These steps
involve both software programming and hardware implementation. These steps
are as follows:
ii. Create a simple, yet, reliable home automation system using Arduino as a
microcontroller that will be the medium between the android and the home
appliances.
iii. To find a suitable app that will work efficiently with the Arduino board in
order to control the home appliances.
|3
iv. Program the Arduino 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.
|4
emitting diode)
DigitalRead: DigitalRead is used to read the status of any digital Pin in Arduino.
We have to give the digital Pin number in the small brackets.
Dupont connector: Dupont is also called Jumper Wire cables. They are low cost
and used to connect hardware such as sensors, Arduino boards and
breadboards together.
Jumper wires: Jumper wires are simply wire that have connector pins at each
end, allowing them to be used to connect two points to each other without
soldering. Jumper wires are typically used with breadboards and other
prototyping tools in order to make it easy to change a circuit as needed.
Male and Female headers: Just like people the Male has a sticking out “pin”
which he plugs into something. The Females on the other hand have a
“hole” in which to receive something, usually a “pin”!
|5
Male breakaway header: Breakaway header is like the duct tape of electronics.
It’s great for connecting things together, soldering to perf-boards, fits into
any breakout or breadboard, etc.
Pin headers: Pin headers are stiff metallic connectors that are soldered to a circuit
board and stick up to receive a connection from a female socket.
Smart Home: Smart home is a term that refers to modern homes that have
appliances, lighting and/or electronic devices that can be controlled
remotely by the owner, often via a mobile app. Smart home-enabled
devices can also operate in conjunction with other devices in the home and
communicate information to other smart devices.
Smart object or device: A smart object is an object that enhances the interaction
with not only people but also with other smart objects. Also known as
smart connected products or smart connected things, they are products,
assets and other things embedded with processors, sensors, software and
connectivity that allow data to be exchanged between the product and its
|6
environment, manufacturer, operator/user, and other products and systems.
Connectivity also enables some capabilities of the product to exist outside
the physical device, in what is known as the product cloud.
|7
CHAPTER TWO
LITERATURE REVIEW
2.1 Introduction
The onus of this chapter is to present a review of related works on the subject
matter of investigation. Herein, the review is conducted under the concept of home
automation system, arduino, android and home automation in the real world.
|8
2.2.1 Existing Home Automation Systems
|9
source physical processing stage focused around a straightforward microcontroller
board, and an environment for composing programs for the board. Arduino can be
utilised to create interactive items, taking inputs from a diverse collection of
switches or sensors and controlling an assortment of lights, engines, and other
physical output. Arduino activities can be remaining solitary or they can be
associated with programs running on a machine (e.g. flash, processing and
maxmsp). The board can be amassed by hand or brought preassembled; the open-
source IDE can be downloaded free of charge. Focused around the processing
media programming language is an execution of wiring, a comparative physical
computing platform (Ahmed 2015).
Terminology
The term Arduino covers the hardware, software, development team, design
philosophy, and morale of the user community. Originally developed in Ivrea,
Italy, Arduino was named after the king of Italy about 1000 years ago, “Arduin of
Ivrea”. The name Arduino is a masculine Italian name meaning “strong friend”,
and is always capitalized being a proper name. The Arduino I/O Board is the
physical, tangible part of the Arduino system. The board is based on the Atmel
AVR ATmega8 microprocessor and later derivatives containing a serial port,
power supply circuitry, expansion connectors, and various support components.
| 10
communications.
Serial Port
The serial port is used to communicate between the Arduino and PC in the
development stage when uploading programs to the I/O Board. There are several
types of serial communication protocols. The Arduino’s serial port is used in an
asynchronous mode, meaning it doesn’t require an independent clock signal. The
asynchronous method uses one signal to transmit data and another to receive data
(Barret 2012).
Power Supply
There are a number of ways to power an Adruino, the simplest method having the
Arduino’s USB cable connected to a PC. The USB standard allows for the supply
of up to 100mA for an unenumerated USB device and as much as 500mA for a
properly enumerated USB device, which is enough to power several LEDs and
low-power sensors. For greater electrical loads, however, an external, stronger
power supply will be required (Wheat 2011).
Expansion Connectors/Ports
The Arduino Uno provides four sets of expansion connectors with the purpose of
adding additional circuitry: Power connector, Analog connector, and Digital I/O
connectors (2 sets). The power connector provides connection to the main supply
voltages (Vin, 5V, 3V3, GND) as well as the –RESET pin. The analog connector
presents the six analog inputs, A0-A6, which can also be configured to be used as
digital I/O lines (Wheat 2011). In the ATmega328 convention, these digital I/O
connectors are called ports, namely Port B, Port C, and Port D. Each of the I/O pin
has an alternate peripheral function, configurable when programming the Arduino
(Wheat 2011).
Shields
Additional features and external hardware may be added to the Arduino using the
daughter card concept, known as “Shields” in the Arduino convention. These
| 11
shields mate with the expansion connectors on the arduino board, allowing the I/O
Board to act like a small motherboard, providing mechanical and electrical
connections to additional circuitry.
This section will give an overview of how the Arduino Uno is programmed. A
compiler, hosted on a computer separate from the Arduino Uno, produces a
machine code to be uploaded into the Arduino board (.hex file), using the program
source files provided by the program writer (.c and .h files). This is done in three
steps.
- Compilation – program source files are converted into assembly code (.asm
file).
The Arduino Development Environment contains a text editor, a message area for
status displays, a text console, a tool bar of common functions, and a menu bar.
ADE also provides a user-friendly interface allowing for quick code upload, which
is possible as the Arduino is ready-made with a bootloader program (Azrul, 2013).
ADE is a user-friendly interface making the development and programming
process easier.
Verify/Compile
| 12
Save
New
Open
Upload
The figure above shows the buttons available on the ADE toolbar. The buttons
provide single click access to the most commonly used features. “Upload to I/O
Board” button compiles written code and uploads it to the Arduino Board, while
“Serial Monitor” button opens the serial monitor feature, allowing text data to be
send to and received from the Arduino board. The other buttons are self-
explanatory.
Sketchbook Concept
In order to make the Arduino a friendly platform for art students, the sketchbook
concept is employed in the Arduino Environment. Programs written are called
‘sketches’ and maintained within a sketchbook in the Arduino environment. An
individual sketch can be accessed via the ‘Sketchbook’ entry under the file tab
(Azrul, 2013).
Built-in Functions
The Arduino WiFi Shield is based on the HDG104 Wireless LAN 802.11b/g
System in-Package (SiP), allowing an Arduino board to connect to the internet
using the 802.11b and 802.11g wireless specifications (WiFi). The WiFi library is
used to write sketches (programs) to connect to the internet using the shield. An
| 13
onboard micro-SD card slot accessible through the SD Library is also available
and can be used to store files for serving over the network (Azrul, 2013).
The Arduino WiFi Shield communicates with the Arduino using the SPI (serial
peripheral interface) bus through the ICSP header, located on pins 11, 12, and 13
on the Arduino Uno. Pin 10 is used to select the HDG104 and pin 4 is used for the
SD card. Additionally, pin 7 is used as a handshake pin between the WiFi shield
and the Arduino. As a result, each of these pins cannot be used for general I/O
(Azrul, 2013). Connecting to a network with the WiFi shield requires the name of
the network, known as SSID (service set identifier) and a password or key
depending on the type of connection. The WiFi shield can connect to open
networks or secured networks with WEP, WPA, or WPA2 encryption. A
password is required for WPA and WPA2 networks, while for WEP a key and key
index is necessary (Azrul, 2013).
Android is a Linux based operating system which is primarily designed for touch
screen mobile devices such as smart phones and tablet computers. The operating
system has developed a lot in the last 15 years starting from black and white
phones to recent smart phones. The android is a powerful operating system and it
supports large number of applications in Smartphones. These applications are
more comfortable and advanced for the users. The hardware that supports android
software is based on ARM architecture platform. The android is an open source
operating system means that it’s free and any one can use it. The android has got
millions of apps available that can help you managing your life one or other way
and it is available low cost in market at that reason android is very popular.
According to Nikhil, Agrawal and Pande (2017), the first commercial android
version (Android 1.0) was released in September 2008. Since then, it has been
continually developed by Google and the Open Handset Alliance. It has seen a
number of updates to its base operating system since the initial release. Versions
1.0 and 1.1 were not released under specific code names, but since 2009, Android
1.5 Cupcake and other Android versions have had confectionery-themed code
| 14
names. A version of Android KitKat exclusive to Android Wear devices was
released on June 25, 2014, with an API level of 20. Each is in alphabetical order
with Android 7.0 Nougat version released in August 2016 (Nikhil, Agrawal &
Pande, 2017). As at September 03, 2019, the latest version of android system was
version 10.0. Unlike the previous versions, this version did not have an attractive
sweet name or any other type of name beyond the version number.
Many Android users use their Android phones just for calls, SMS, browsing and
basic apps. However, from the development prospective, one must know about the
Android internal structure. Android uses several partitions like boot, system,
recovery, data etc to organise files and folders on the device just like Windows
OS. Each of these partitions has its own functionality, which most of us do not
know the significance of each partition and its contents. There are mainly 6
partitions in Android phones, tablets and other Android devices (Nikhil, Agrawal
& Pande, 2017).
Android libraries: Android libraries are available on top of Linux kernel. There
is a set of libraries including open-source Web browser engine web kit, well
known library like SqLite database which is a useful option for storage and
sharing of application data, libraries to play and record and video, secured socket
layer (SSL) libraries responsible for internet security etc.
Android Runtime system: This section which is the third part of the android
architecture, provides a key component called Dalvik Virtual Machine specially
| 15
designed and optimised for android. The Dalvik Virtual Machine makes use of
Linux core features like memory management and multi-threaded, which is
intrinsic in the java language. The Dalvik Virtual Machine enables every android
application to run in its own process, with its own instance of the Dalvik Virtual
Machine.
Android Linux Kernel: In the Linux layers Linux 2.6 with approximately 115
patches. This provides basic system functionality like process management,
memory management, device management like camera, keypad, display etc. also,
the kernel handles all the things that Linux is really good such s networking and a
vast array of device drivers, which take the pain out of interfacing to peripheral
hardware.
In an ideal world, any device that can be connected to a remote network can be
automated and controlled. In the real world, home automation most commonly,
connects simple binary devices. This includes “on and off” devices such as lights,
power outlets and electronic locks. Also, devices such as security sensors which
have only two states, open and closed are automated as well. For a home to
become truly smart, internet enabled devices must be attached to this network and
controlled remotely. The home computer was the classic control unit for which
most of the earlier home automation systems were built or designed. In recent
times, most especially in the 21st century, home automation systems distribute
programming and monitoring control between dedicated devices in the home like
the control panel of a security system interdem with a user-friendly application
interface that can be accessed via internet enabled-PC, smart phone, tablet, etc.
| 16
household devices on the market, the end result is usually a separate control
scheme for each device (Ahmed 2015).
In the near future, home automation may be standardised to let users truly take
advantage of all of these additional possibilities. For manufacturers in the present
times, home security systems specialized in home automation is hinged on the
most critical and useful part of a smart home. This means that doors, windows and
environmental devices (thermostat, smoke detectors, temperature, humidity, fire
and carbon dioxide sensors) at the basic level. For a real-time security,
convenience and control, home automation systems from security providers also
include options for video cameras.
The 21st century homes have become more and more self-controlled and
automated due to the comfort automation provides, especially when employed in a
private home. Home automation system serves as a means that allow users to
control electric appliances of varying kind. Many existing and well-established
home automation systems are based on wired communication. This does not pose
a problem until the system is planned well in advance and installed during the
physical construction of the building. Nonetheless, for already existing buildings,
the implementation cost goes very high. In contrast, Wireless systems can be of
great help for automated systems. With the advancement of wireless technologies
such as Wi-Fi, cloud networks in the recent past, wireless systems are used every
day and everywhere. This reduces the hitches associated with wired-network.
Wireless systems like Wi-Fi have become more and more common in automated
homes. Likewise, in home and building automation systems, the use of wireless
technologies gives several advantages that could not be achieved using a wired
network only.
| 17
System scalability and easy extension: The deploying of a wireless network is
especially advantageous as extension of the network is necessary. In contrast to
wired installations, with cabling extension is tedious and this makes wireless
installations a seminal investment.
| 18
network infrastructure connecting its parts. The proposed system consists of two
main components; the first part was the server (web server), which presents
system core that manages, controls, and monitors users’ home. Users and system
administrator can locally (LAN) or remotely (internet) manages and control
system code. Second part was hardware interface module, which provided
appropriate interface to sensors and actuator of home automation system. Unlike
most of available home automation system in the market the proposed system is
scalable that one server can manage many hardware interface modules as long as
it exists on WiFi network coverage. System supported a wide range of home
automation devices like power management components, and security
components.
Rajneesh, Abhinav and Sh. Nishant (2015) while investigating internet of things
based controlling of appliances using GSM/GPRS enabled embedded server for
remote access observed that the internet has initially started as the “Internet Of
Computers”, a global network enabling services that now include the World Wide
Web (WWW), File Transfer Protocol and others allowing computers and hence
users to communicate with each other and exchange information. There are
several definitions for the Internet of Things (IoT) that explain what are the main
functionalities of it and what we should expect from when connecting “Things”
with each other and with the internet. Internet of Things (IoT) is an ideal emerging
technology to influence the internet and communication technologies. Simply
“Internet of Things” connects living and nonliving things through internet.
It can therefore be inferred from the above that the main aim of IoTs is to enable
the users to control and monitor smart devices through internet. In this an
interface between users and smart home by using GSM and internet technologies
or simply creating GSM based wireless communication from the web server into
the smart home.
Corroborating the above view in their paper titled “Home Automation Using
Internet of Things”, Vinay and Kusuma (2015) noted that with advancement in
Automation technology, life is getting simpler and easier in all aspects. In today’s
world Automatic systems are being preferred over manual system. With the rapid
| 19
increase in the number of users of internet, IoT is the latest and emerging internet
technology. Internet of things is a growing network of everyday object-from
industrial machine to consumer goods that can share information and complete
tasks while you are busy with other activities. Wireless Home Automation system
(WHAS) using IoT is a system that uses computers or mobile devices to control
basic home functions and features automatically through internet from anywhere
around the world, an automated home is sometimes called a smart home. It is
meant to save the electric power and human energy. The home automation system
differs from other system by allowing the user to operate the system from
anywhere around the world through internet connection.
Basil Hamed (2012) designed and implemented a control and monitor system for
smart house. Smart house system consists of many systems that controlled by
LabVIEW software as the main controlling system. Also, the smart house system
was supported by remote control system as a sub controlling system. The system
also is connected to the internet to monitor and control the house equipment’s
from anywhere in the world using LabVIEW.
Deepali, Mohd and Shreerang (2013) also conducted a study and investigated
Home Automation and Security System Using Android ADK. The prime
objective of this paper is to assist handicapped/old aged people. It gives basic idea
of how to control various home appliances and provide a security using Android
phone/tab. The design consists of Android phone with home automation
application, Arduino Mega ADK. User can interact with the android phone and
send control signal to the Arduino ADK which in turn will control other
embedded devices/sensors.
| 20
Basma, Sherine and Mahmoud (2013) proposed a new design for the smart home
using the wireless sensor network and the biometric technologies. The proposed
system employs the biometric in the authentication for home entrance which
enhances home security as well as easiness of home entering process. The
structure of the system is described and the incorporated communications are
analyzed, also an estimation for the whole system cost is given which is
something lacking in a lot of other smart home designs offers. WB-SH is designed
to be capable of incorporating in a building automation system and it can be
applied to offices, clinics, and other places. The authors argued that with an
imagination for the future, the smart home will employ the biometric technology
in a larger and more comprehensive form.
This chapter has reviewed works related to home automation, arduino technology
and android technology. It is apparent from the literature review that the rapid
growth of technology has drastically changed the living standards of modern
society. Based on the increasing number of electronic devices being made in a
household, automated home control system has become an increasing useful
feature. Current systems, however, have problems with complexity, high costs,
non-open sources and multiple incompatible standards; resulting in the limited
venture of the home automation into the homes of the rich or hobbyists. This
project intends to design an affordable and easy to use home automation system,
which will be done by interfacing the Arduino microcontroller with wireless
control via Bluetooth while creating a simple, easy-to-use system to control home
appliances.
| 21
CHAPTER THREE
METHODOLOGY
3.1 Methodology
| 22
The methodology is chosen for this project because
Each phase is presented for approval before moving to the next phase.
To achieve these purposes, this chapter tend to answer questions like “the why,
the how or by what means people do what they do”. With respect to this work,
this chapter will be focusing wholistically with detailed analysis and the design of
the proposed home automation system using arduino uno.
arduino UNO
Proto board
Android phone
Some resistors
jumper wires
Relay modules
Light bulbs
Block connectors.
3.2.2 Software
| 23
Arduino 1.0.3 (Arduino Software)
Arduino UNO
The arduino model consists of 6 analog input pins and 14 digital GPIO pins which
can be used as input-output, 6 of which provides PWM output and analog using
pinMode(), digitalWrite(), digitalRead() and analogRead() functions. 6 analog
input channels are from pins A0 to A5 and provide 10-bit resolution. The board
can be powered either from using a USB cable which operates at 5 volts or by DC
jack which operates between 7 to 20 volts. There is an onboard voltage regulator
to generate 3.3 volts for operating low powered devices. Since the ATmega328
work on USART, SPI and I2C communication protocol, has 0 (Rx) and 1(Tx) pins
for USART communication, SDA (A4) and SCL (A5) pin for I2C and SS (10),
MOSI (11), MISO (12) and SCK (13) pins for SPI communication protocol. These
specifications make Arduino Uno board perfect for Home Automation project.
| 24
HC-06 Bluetooth Module
AT+UART = 9600, 1, 0 – for changing the baud rate to 9600, stop bit to 1
and parity bit to 0.
EN/Key pin: This pin is used to set Bluetooth module in either command mode or
data mode. Command mode can be accessed by setting this pin high and data
mode can be accessed setting it low. By default, it is set as low in data mode.
VCC: This is the power supply pin which is connected to either 5V or 3.3V.
| 25
TXD: This pin used for serial transmission of the data.
State: This pin tells whether the module is connected or disconnected with the
other device.
VCC 3.3 V to 5 V
GND Ground
| 26
is either “0000” or “1234”.
HC-06 Bluetooth module has built-in red led which indicates the connection
status. Before any connection, it blinks continuously in some periodic manner and
after it gets connected, its blinking speed slows down.
GPS receiver
Industrial control
Microcontroller projects
Relay
Relay Configurations
There are various configurations for a relay’s contacts depending on its use. Four
common types of relays will be discussed here (Azrul, 2013):
Single Pole, Single Throw (SPST): This type of relay uses one coil to control one
switch with two contacts
Single Pole, Double Throw (SPDT): This type of relay uses one coil to operate
| 27
one switch with three contacts.
Double Pole, Single Throw (DPST): One coil is used to operate independent
SPST switches at the same time. It is useful for switching two loads at the same
time.
Double Pole, Double Throw (DPDT): This type of relay uses one coil to operate
two independent DPDT switches at the same time. This relay can be configured as
an H-bridge circuit.
In this project, we are going to use an electromagnetic relay to turn on and off the
home appliances like, bulb, fan or any ac powered source in our home by giving
DC signals from the Arduino UNO. The relay has 6 pins, two of which VCC and
Ground are used to give power to the relay. One pin is the Data pin which is used
to take the signal either “1” or “0” from microcontrollers. Other 3 pins Normally
Closed (NC), Common, Normally Open (NO) are used to connect AC powered
| 28
appliances. This relay works in two conditions either in Normally Open or in
Normally Close condition:
Normally Open: It closes the circuit whenever the relay is activated and it opens
the circuit whenever the relay is deactivated.
Normally Close: It opens the circuit whenever the relay is activated and it closes
the circuit whenever the relay is deactivated.
VCC 5V
GND Ground
Data pin “1” or “0” from
microcontroller
NC For Normally Closed Circuit
COM Common
NO For Normally Open Circuit
(Source: Author’s computation, 2021)
They are used to control a high voltage circuit with a small voltage signal.
Relays are used in substation and grids when supplying electricity from one
point to another.
| 29
Functionality
The circuit is designed using Arduino, Bluetooth, relay, and electric bulbs. We
have connected the Bluetooth serially with the Arduino. The relay is used to
operate the home appliances. We have used four relays for four appliances. We
can change the numbers of the relay to operate various home appliances
accordingly. While moving to the hardware, the LEDs will be replaced by Bulbs.
The command for controlling the home appliances will be sent through a
“Bluetooth terminal HC-05 app” from your smartphone to the Bluetooth,
connected to the Arduino. The Arduino reads the data coming serially to the
Bluetooth. Hence, actions are performed according to the command coming from
the Bluetooth to the Arduino.
In order for the Arduino-Uno board to be able to interact with the application used
in this project certain program (code called sketch) needs to be uploaded to the
Arduino-Uno. Arduino Company provides user friendly software which allows
| 30
writing any code for any function wanted to be performed by the Arduino-Uno
and upload it to the board. See section 3.4.1 below for the full source code of the
Arduino-Uno board.
#include<SoftwareSerial.h>
int bulb1 = 8;
int bulb2 = 9;
int bulb3 = 10;
int bulb4 = 11;
SoftwareSerial bt(0,1); /* (Rx,Tx) */
String str;
void setup() {
bt.begin(9600);
Serial.begin(9600);
pinMode(bulb1,OUTPUT);
pinMode(bulb2,OUTPUT);
pinMode(bulb3,OUTPUT);
pinMode(bulb4,OUTPUT);
}
void loop() {
if (bt.available())
{
str = bt.read();
Serial.println(str);
//bulb1
if(str==”bulb1 on”)
{
digitalWrite(bulb1,HIGH);
Serial.println(“BUlB 1 is ON”);
}
else if(str==”bulb1 off”)
{
digitalWrite(bulb1,LOW);
Serial.println(“BUlB 1 is OFF”);
}
else
{
digitalWrite(bulb1,LOW);
}
//bulb2
| 31
if(str==”bulb2 on”)
{
digitalWrite(bulb2,HIGH);
Serial.println(“BUlB 2 is ON”);
}
else if(str==”bulb2 off”)
{
digitalWrite(bulb2,LOW);
Serial.println(“BUlB 2 is OFF”);
}
else
{
digitalWrite(bulb2,LOW);
}
////bulb3
if(str==”bulb3 on”)
{
digitalWrite(bulb3,HIGH);
Serial.println(“BUlB 3 is ON”);
}
else if(str==”bulb3 off”)
{
digitalWrite(bulb3,LOW);
Serial.println(“BUlB 3 is OFF”);
}
else
{
digitalWrite(bulb3,LOW);
}
//bulb4
if(str==”bulb4 on”)
{
digitalWrite(bulb4,HIGH);
Serial.println(“BUlB 4 is ON”);
}
else if(str==”bulb4 off”)
{
digitalWrite(bulb4,LOW);
Serial.println(“BUlB 4 is OFF”);
}
else
{
digitalWrite(bulb4,LOW);
}
}
}
| 32
To include the libraries required for the project, SoftwareSerial.h library is
imported for serial communication with Bluetooth Module HC-06.
#include<SoftwareSerial.h>
int bulb1 = 8;
int bulb2 = 9;
int bulb3 = 10;
int bulb4 = 11;
String str;
pinMode(bulb1,OUTPUT);
pinMode(bulb2,OUTPUT);
pinMode(bulb3,OUTPUT);
pinMode(bulb4,OUTPUT);
Bluetooth serial communication and serial monitor are initiated at 9600 baud rate.
bt.begin(9600);
Serial.begin(9600);
If the data got from the smartphone using Bluetooth Module HC-06 is “bulb1 on”
then we turn on the bulb 1 by setting data pin of the relay as HIGH. If data is
“bulb1 off” then we turn off the bulb by setting the data pin of the relay as LOW.
If no data received for bulb 1 then we set our bulb 1 to LOW. The same thing is
done for bulb 2, bulb 3, bulb 4.
if(str==”bulb1 on”)
{
digitalWrite(bulb1,HIGH);
Serial.println(“BUlB 1 is ON”);
| 33
}
else if(str==”bulb1 off”)
{
digitalWrite(bulb1,LOW);
Serial.println(“BUlB 1 is OFF”);
}
else
{
digitalWrite(bulb1, LOW);
}
Hence, you can control any home appliance in your home by using Arduino UNO,
Bluetooth, and relay. We have also provided the technical information for the
components required for constructing this project. The circuit diagram consists of
LEDs which will be replaced by the AC bulbs used in the home.
| 34
TX pin RX
port
RX pin TX
port
In this project, an android phone is used as the remote control for the user
alongside with an App called Arduino Bluetooth Home Automation. Arduino
| 35
Bluetooth Home Automation is a simple Android app that will make controlling
the pins of Arduino-Uno from an Android phone wirelessly possible. Arduino
Bluetooth Home Automation 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.
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.
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 (e.g. 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. Apply the same for the other appliances only use different relays and
different Arduino- Uno Ports. Connect the android phone with the Bluetooth
module and now all the connected appliances can be controlled wirelessly using
the android device.
| 36
Figure 4: Connecting the Appliances to the Arduino Board
Make the connection for Home Automation project as given in the circuit diagram.
First of all, we connect the bulb with AC powered sources and with relays as given
in the circuit diagram. Then the relays are given DC power from the Arduino Uno
board. Data pins of the relays are connected at pins 8, 9, 10 and 11 to the Arduino
which are the output pins of Arduino. Then connect the HC-06 module with the
Arduino Board as shown in the diagram and power the Adruino Board. Upload the
code given at the end of the project using Arduino IDE. Turn on the Bluetooth in
your smartphone and connect the HC-06 module by entering the password. By
default, the password is “0000” or “1234”. After successfully connecting your
| 37
smartphone with the HC-06, Open “Bluetooth terminal HC-06 app in your
smartphone” and it will show your device connected to HC-06. Now send the data
“Bulb1 turn on” or “Bulb2 to turn off” to turn on or off any bulb. This is how you
can control other appliances in your home remotely.
| 38
CHAPTER FOUR
This chapter discusses the results and any limitation and/or problems encountered
during the period of the project.
4.1 Results
Figure 5: Mobile App for controlling communication with Arduino via bluetooth
module
As seen in Figure 5 above, the android app helps in establishing the connection
between Bluetooth module. It also helps in controlling the appliance connected to
| 39
the Arduino via Bluetooth module. Once the ON button is pressed on the screen,
the first appliance, in this case, a light bulb will be switched on. Once it is pressed
OFF, it will switch off.
The sketch as shown in chapter three was uploaded into the Arduino after
connections (wiring) were done. The code was then uploaded into the Arduino and
tested for communication. Figure 6 below illustrates the connection and
communication between Bluetooth module and Arduino. Thereafter, connection
was also established between the Relay module, Arduino and home appliances and
tested for automation.
| 41
Figure 8: Packaged Home Automation System Prototype Using Adapter Box
4.2 Discussion
Some problems and issues were encountered during this project. Bluetooth
connection between the android phone and the Arduino-Uno board was
| 42
unsuccessful in the early stages of this project. This problem was encountered
when the HC-05 Bluetooth module was meant to be used for this project. This
problem has been tackled by research on the matter and finally replacing the HC-
05 module with the HC-06 Bluetooth module.
Another issue is 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.
Furthermore, one of major limitations of the present research premised on the fact
that the system does not store data in a cloud server since it does not employ the
integration of cloud networking.
CHAPTER FIVE
| 43
SUMMARY, CONCLUSION AND RECOMMENDATIONS
5.1 Summary
This research was set up to establish a home automation system using Arduino
microcontroller and android device as a remote-control through Bluetooth module.
The home automation circuit is built around an Arduino Uno board, Bluetooth
module HC-06 and a 2-channel relay board. The number of channels depends on
the number of appliances you wish to control. Arduino Uno was powered with a
12V DC adaptor/power source. The relay module and Bluetooth module were in
turn, powered using a board power supply of Arduino Uno. Results of the
experiment through the prototype shows that the home appliances can be
controlled using an android app. We can either use on/off buttons to control the
appliances. It is also discovered that we can control more electrical appliances by
increasing the number of channels in the relay used. For instance, using an 8-
channel relay, we can control up to eight devices.
5.2 Conclusion
Home automation system can make home even more intelligent. This System can
be used for building automation, industrial automation, hospital automation for
| 44
patients and agricultural automation for farmers. Different sensor can interface
with the system such as motion sensor, light sensor, flame sensor, temperature
sensor etc. Automation toggling of device based on certain situation can also be
implemented WIfi and Ethernet based home automation systems can be
developed.
Using this system as framework, the system can be expanded to a distributed home
automation system that consists of server, sensors. Server controls and monitors
the various sensors, and can be easily configured to handle more hardware
interface module (sensors) with various other options which could include home
security features like capturing the photo of a person moving around the house and
storing it onto the cloud. This will reduce the data storage than using the CCTV
camera which will record all the time and stores it. The system can be expanded
for energy monitoring, or weather stations. This kind of a system with respective
changes can be implemented in the hospitals for disabled persons or in industries
where human invasion is impossible or dangerous, and it can also be implemented
for environmental monitoring.
It is deduced from the study that IoT has become so vital in daily life and it is
creating a big impact for the future. For example, solutions can be provided
instantly for traffic flows, reminders about vehicle maintenance, reduce energy
consumption, etc. Monitoring sensors will diagnose pending maintenance issues,
and even prioritise maintenance crew schedules for repair equipment. Data
analysis systems will help metropolitan and cosmopolitan cities to function easily
in terms of traffic management, waste management, pollution control, law
enforcement and other major functions efficiently.
Linked devices can help people personally get an alert from the refrigerator
reminding them to shop some vegetables when the vegetable tray is empty, the
home security systems enables people to open the door for some guest with help of
connected devices (IoT). Since there is a massive growth in number of devices day
by day, the amount of data generated would also be enormous. Here is where Big
| 45
Data and IoT go hand in hand.
Big Data manages the enormous amount of data generated using its technologies.
The Internet of Things (IoT) and big data are two vital subjects in commercial,
industrial, and many other applications. The name IoT refers to the world of
machines or devices connected to the Internet, by which a large amount of big data
is collected, stored and managed. Big data additionally refers to the analysis of this
generated data to produce useful results. The main motivating power behind the
IoT and big data has been the collection and analysis of data related to consumer
activities in order to find out why and what customers buy.
It was not too long ago that visualised houses of the future where things would be
done on their own- lights coming on by themselves, coffee being brewed just the
way an individual like, as waking up and taking a shower knowing the weather
outside and adjusting the water temperature accordingly. The world is at a point
where technology to achieve all that has been around for a while and has now
become affordable. Hence, it is not a particularly big surprise that the world is
witnessing some amazing things happening in the world of automation.
5.3 Recommendations
There are some recommendations for Future works. Some of them are:
a) The home automation system was limited to control Lights on/off, Fan
on/off, On/off different appliance which makes use of Bluetooth wireless
control. Future work should make use of cloud networking connection and
also include temperature and humidity, motion detection, fire and smoke
detection and light level control and data stored in a cloud server. This will
enable users to control their homes remotely from anywhere using internet
service and smartphones.
b) There is the need to design a smart home which employs the biometric
technology in a larger and more comprehensive form.
c) Better to use relay modules and connect it directly than using normal relays
with breadboard.
| 46
d) Try to find a way to amplify the Bluetooth module signal to work in greater
distance.
e) Test each and every component before using them especially the relays for
safety purposes.
REFERENCES
| 47
Ahmed Sirajuddin Ahmed Alhaj (2015). “Home Automation System Using
Arduino”. Unpublished B.Sc. Project, Faculty of Electrical Engineering,
Universiti Teknologi Malaysia.
Ahmed, Sirajuddin Ahmed Alhaj (2015). “Home Automation System Using
Arduino”. A thesis submitted in fulfillment of the requirements for the
award of the degree of Bachelor of Engineering (Electrical - Electronics),
Universiti Teknologi Malaysia.
AlShu’eili H., Gupta, G. S. & Mukhopadhyay, S. (2011). "Voice Recognition
Based Wireless Home Automation System," 2011 4th International
Conference on Mechatronics (ICOM),
Azrul, R.B.A. (2013). “Design of a Home Automation System Using Arduino with
Wireless Control”. Final Project Report Submitted to the Department of
Electrical & Electronic Engineering, Universiti Teknologi PETRONAS
Bandar, Seri Iskandar.
Barrett, S. F. (2012). Arduino Microcontroller: Processing for Everyone! Second
Edition, Morgan & Claypool Publishers.
Basil Hamed (2012). “Design & Implementation of Smart House Control Using
LabVIEW” at International Journal of Soft Computing and Engineering
(IJSCE) ISSN: 2231-2307, Volume-1, Issue-6, January.
Basma M.M.E, Sherine, M. A. and Mahmoud, A.F. (2013). “Smart Home Design
using Wireless Sensor Network and Biometric Technologies” at Volume 2,
Issue 3, March 2013.
Deepali Javale, Mohd. Mohsin, Shreerang Nandanwar (2013). “Home Automation
and Security System Using Android ADK” in International Journal of
Electronics Communication and Computer Technology (IJECCT) Volume
3 Issue 2 (March 2013).
Ilyas Baig, Chiktay Muzamil and Salahuddin Dalvi (2016). “Home Automation
Using Arduino Wifi Module Esp8266”. A project report, in partial
fulfillment for the award of the degree of B.E IN Electronics &
Telecommunication, Anjuman-I-Islam’s Kalsekar Technical Campus,
Panvel
Nathan D., Abafor C., Aronu U. & Edoga, O. (2015). “Design of a Home
Automation System Using Arduino”. International Journal of Scientific &
Engineering Research, Volume 6, Issue 6, pp.795-803.
Nikhil, M.D, Agrawal, Tejas S. and Pande, S.D. (2017). “A Research On Android
Technology With New Version Naugat(7.0,7.1)”. IOSR Journal of
Computer Engineering (IOSR-JCE), Volume 19, Issue 2, Ver. I (Mar.-Apr.
2017), PP 65-77
Rajneesh, Abhinav and Sh. Nishant (2015). “Internet of Things based Controlling
of Appliances using GSM/GPRS Enabled Embedded Server for Remote
| 48
Access”. IJSRD - International Journal for Scientific Research &
Development, Vol. 3, Issue 05, 939- 941.
Sirsath N. S, Dhole P. S, Mohire N. P, Naik S. C & Ratnaparkhi N.S (2013).
“Home Automation using Cloud Network and Mobile Devices”.
Department of Computer Engineering, 44, Vidyanagari, Parvati, Pune-
411009, India University of Pune,
Vinay, Sagar, K.N. and Kusuma S.M. (2015). “Home Automation Using Internet
of Things”. International Research Journal of Engineering and
Technology (IRJET), Volume: 02 Issue: 03, pp.1965- 1970
Wheat, D. (2011). Arduino Internals. USA: Apress.
| 49