Download as pdf or txt
Download as pdf or txt
You are on page 1of 44

Declaration

The Project is our own and all the sources of material used for the project have been duly
acknowledged.

Name Signature
 Asegid Girma …………………………...
 Ame Abdela ……………………………
 Ayenew Mesfin …………………………..
 Blen Tena ……………………........
 Markos Goa …………………………..
College: Engineering and Technology

Department: Electrical and computer engineering


Project title: Home Automation using Wi-Fi

I certify that this project satisfies all the requirements as a semester project for the
Electrical and computer engineering department.
Name of program coordinator Signature

------------------------------------- ---------------------------------------------
This is to certify that I have read this project and that in my opinion it is fully adequate, in
scope and quality, as semester project in department. Of electrical and computer engineering

Name of Advisor signature

-------------------------------------------------- -------------------------------------------
Signature examining committee member’s signature Date

1. Chairman 1____________ ___________ ___________


2. Examiner 2 ____________ ___________ ___________

It is approved that this project has been written with the formatting rules laid
down by the department of the university.

I
ACKNOWLEDGMENT
First of all we would like to thank our God for being here with us from the very start and we
would like to express our gratitude to Bule Hora University, Department of Electrical and
Computer Engineering for giving us the chance to do this semester project on Monitoring and
Controlling of Home Appliance Using ESP8266 WIFI.
Our special and heartfelt thanks goes to our advisor Mr. Balam for his continuous follow up and
support in doing this project starting from the selection of Title. And a special thanks for our Co
adviser Mr.gurmessa, a great contribution for this project. Last but not least a special thanks to
our Friends at different peer and all the group members for their continuous motivation and
support in the entire process of these semester project.

II
ABSTRACT
“Automation” word is becoming very popular these days. Automation is the most frequently
spelled term in the field of electronics. The hunger for automation brought many revolutions in
the existing technologies. These had greater importance than any other technologies due to its
user-friendly nature. Automation is the use of control systems and information technology to
control equipment and reducing the need for the human intervention. These can be used as a
replacement of the existing switches in home which produces sparks and also results in fire
accidents in few situations. Considering the advantages of Wi-Fi an advanced automation system
was developed to control the appliances in the house.
The code is developed in IDE Arduino Software for controlling the hardware appliance in our
project. The main idea behind the “Automation” devices is that they can operate to some extent
interactively and autonomously thereby helping people in managing the appliances freely and
smartly. Based on this approach, a home automated system is designed by implementing related
software and hardware. This project proposes an implementation of home automated system to
remotely control the home appliances using Wi-Fi. A low cost Wi-Fi module ESP8266 along
with ATmega 328 MCU is used to build automation Units. The user can remotely operate home
appliances like lights, fan, etc. through Telnet. The lights in any room can be controlled from any
place in the house, within the Wi-Fi range, through telnet by using a single keyword. Arduino
Uno is used as a compiler. Wi-Fi module ESP8266 follows some predefined AT command.
Telnet will be connected with home access point using one IP address. So the concept of
automation is being used to make home automated.

III
TABLE OF CONTENTS

Contents
Declaration .................................................................................................................................................... I
ACKNOWLEDGMENT .................................................................................................................................... II
ABSTRACT ................................................................................................................................................ III
TABLE OF CONTENTS.................................................................................................................................... IV
Acronyms ............................................................................................................................................... VII
CHAPTER ONE ............................................................................................................................................... 1
INTRODUCTION ........................................................................................................................................ 1
1.1 BACKGROUND ................................................................................................................................ 1
1.2 STATEMENT OF THE PROBLEM ...................................................................................................... 2
1.3 OBJECTIVES ..................................................................................................................................... 3
1.4 PROJECT SCOPE .............................................................................................................................. 3
1.5 SIGNIFICANCE OF THE PROJECT ..................................................................................................... 3
1. 6 OUTLINE OF THE PROJECT ............................................................................................................. 4
CHAPTER TWO .............................................................................................................................................. 5
LITERATURE REVIEW ................................................................................................................................ 5
2.1 REVIEW OF RELATED LITERATURE ................................................................................................. 5
2.2 REVIEW OF FOREIGN STUDIES ....................................................................................................... 5
CHAPTER THREE ............................................................................................................................................ 7
SYSTEM BLOCK DIAGRAM OF THE PROPOSED SYSTEM ............................................................................ 7
Preview ..................................................................................................................................................... 7
3.1 OVERVIEW OF EMBEDDED SYSTEM ............................................................................................... 7
3.2 DESIGN APPROACH OF THE PROJECT ............................................................................................ 8
3.2 SYSTEM COMPONENTS ................................................................................................................ 10
3.3 DISCREPITION OF THE BLOCK DIAGRAM ..................................................................................... 18
2)Applications and Advantages of Arduino based device control using Wi-Fi. .............................. 19
CHAPTER FOUR..................................................................................................................................... 21
4.1 RESULT ANALYSIS ..................................................................................................................... 21
4.1.1PRACTICAL CIRCUIT BOARDS AND EXPLANATION .................................................................... 21

IV
How to make it work ?.......................................................................................................................... 22
CHAPTER FIVE .................................................................................................................................. 25
CONCLUSIONS AND RECOMEDATION ....................................................................................... 25
5.1 CONCLUSION ................................................................................................................................ 25
5.2 LIMITETION OF THE PROJECT ....................................................................................................... 25
5.3 FUTURE WORK.............................................................................................................................. 25
5.4 RECOMENDETION......................................................................................................................... 26
REFERENCE ............................................................................................................................................ 27
APPENDIXES ....................................................................................................................................... 29

V
TABLE OF FIGURE
Figure 1system architecture ......................................................................................................................... 9
Figure 2 ardiuno .......................................................................................................................................... 10
Figure 3 ESP8266Module ........................................................................................................................... 13
Figure 4 Relay ........................................................................................................................................... 15
Figure 5 Block diagram................................................................................................................................ 18
Figure 6_Home Automation System using Arduino and ESP8266 ............................................................ 21
Figure 7 ESP-01 ESP8266 Module Pin Out .................................................................................................. 22
Figure 8 Connecting to Wi-Fi to Telnet ...................................................................................................... 23
Figure 9 Result obtained on pressing * in Telnet App ............................................................................... 24
Figure 10Result obtained when 9 are pressed. ............................................................................................ 24

VI
Acronyms
Wi-Fi=wireless fidelity

IOP=distracted control system

GPRS=general packet radio service

SMS=short message service

GSM=global service for mobile

LAN=local area network

VCR=voucher card

TCP=transmission control protocol

MCU=microcontroller unit

USB=universal serial bus

AC=alternate current

DC=direct current

IDE=integrate development environment

IP=internet protocol

GPIOS=graphics programming interfaces

APSD=ad‟s programing support development

RF=radio frequency

PBC=personal computer based

UART=universal asynchronous receiver or transmitter

VII
TTL=time to live

AP=access protocol

LMA=local network access

COM=computer output microform

NC=normal close

NO= normal open

PC=personal computer

IETF=internet engineering task force

JVM=java virtual machine

CLDC=connected limited device configuration

MIDP=mobile information device profile

VIII
CHAPTER ONE
INTRODUCTION
1.1 BACKGROUND

Automation is the most frequently spelled term in the field of electronics. The hunger for
automation brought many revolutions in the existing technologies. These had greater importance
than any other technologies due to its user-friendly nature. These can be used as a replacement of
the existing switches in home which produces sparks and also results in fire accidents in few
situations. Considering the advantages of Wi-Fi an advanced automation system was developed
to control the appliances in the house.

Wi-Fi (Short for Wireless Fidelity) is a wireless technology that uses radio frequency to transmit
data through the air. Wi-Fi has initial speeds of 1mbps to 2mbps. Wi-Fi transmits data in the
frequency band of 2.4 GHz. It implements the concept of frequency division multiplexing
technology. Range of Wi-Fi technology is 40-300 feet.
The controlling device for the automation in the project is a Microcontroller. The data sent from
PC over Wi-Fi will be received by Wi-Fi module connected to Microcontroller. Microcontroller
reads the data and decides the switching action of electrical devices connected to it through
Relays and Tries switches. The Microcontroller is programmed used embedded „C‟ language

1
1.2 STATEMENT OF THE PROBLEM
Home automation systems face many challenges; among these are high cost of ownership,
inflexibility, poor manageability, and difficulty in achieving security. The main objective of this
semester project is to design and implement a home automation system using Internet of Things
that is capable of controlling and automating most of the house appliances through an easy
manageable Wireless-Fidelity. The proposed system has a great flexibility by using Wi-Fi
technology to interconnect its distributed sensors to home automation server. This will decrease
the deployment cost and will increase the ability of upgrading, and system reconfiguration.

2
1.3 OBJECTIVES

1.3.1 GENERAL OBJECTIVE


The main objective of this project is to develop a home automation system using an Arduino board
with Wireless Fidelity.

1.3.2 SPECIFIC OBJECTIVES


 Crating a Wi-Fi using telnet
 To control fan and lump
 Able to reduce physical appearance of human
 We can able to control home remotely

1.4 PROJECT SCOPE


In order to achieve this objective of the project, several scopes have been outlined. This project
consists of hardware and software. The hardware will give an output to control the home
equipment. The hardware consists of:
a) The Arduino Ethernet Shield
b) Arduino Uno
c) Home controlling equipment box
d) GSM Module

This project work is complete on its own in remotely and automatically switching ON and OFF
of electrical appliance and only limited to household appliances. It sends a feedback message
indicating the new present state of the appliance. It does not implement control of multiple
appliances or automatic detection of faults in the controlled appliance.

1.5 SIGNIFICANCE OF THE PROJECT

 To provide low cost Wi-Fi control system


 Provide a reliable remotely switch for home appliances
 Provide a scalable control system for home appliance
 Avoid fire caused by short circuit
 Save energy and lessen the amount of bill payment of electricity

3
1. 6 OUTLINE OF THE PROJECT
The project is organized into five chapters, Chapter one contains the complete details about the
Introduction of Proposed Systems and The literature review and other project done related to this
proposed system is discussed in chapter two, Chapter three describes about the design issues,
software and hardware requirements for the Implementation of automation through Wi-Fi.
Chapter four consists of the result analysis, contains coding, applications and advantages and
final Chapter contains conclusion and proposed works to enhance the project in the future
explained briefly.

4
CHAPTER TWO
LITERATURE REVIEW
2.1 REVIEW OF RELATED LITERATURE
When people think about home automation, most of them may imagine living in a smart home.
One remote controller for every household appliance cooking, the rice automatically, starting air
conditioner automatically, heating water for bath automatically and shading the window
automatically when night coming. To some extent home automation equals to smart home. They
both bring out smart Living condition and make our life more convenient and fast.

2.2 REVIEW OF FOREIGN STUDIES

In their paper, Tan, Lee and Soh (2002) proposed the development of an Internet-based system
to allow monitoring of important process variables from a distributed control system (DCS) [1].
This paper proposes hardware and software design considerations which enable the user to
access the process variables on the DCS, remotely and effectively Georgila, Fakotakis, and
Kokkinakis, G. (2003) suggested the use of speech to interact remotely with the home appliances
to perform a particular action on behalf of the user [2]. The approach is inclined for people with
disability to perform real-life operations at home by directing appliances through speech. Voice
separation strategy is selected to take appropriatedecision by speech recognition
In the year 2006, S. M. Anamul Haque,S. M. Kamruzzaman and Md. Ashraful, Islam proposed a
system entitled “A System for Smart-Home Control of Appliances Based on Time and Speech
Interaction” that controls the home appliances using the personal computer [3]. This system is
developed by using the Visual Basic 6.0 as programming language and Microsoft voice engine
tools for speech recognition purpose. Appliances can be either controlled by timer or by voice
command.
Ciubotaru-Petrescu, Cioarga, and Stanescu (2006) present a design and implementation of SMS
based control for monitoring systems [4]. The paper has three modules involving sensing unit for
monitoring the complex applications.
A processing unit, that is microcontroller and a communication module that uses GPRS modem
or cell phone via serial port RS-232. The SMS is used for status reporting such as power failure.
Jawarkar, Ahmed, Ladhake, and Thakare (2008) propose remote monitoring through mobile
phone involving the use of spoken commands [5]. The spoken commands are generated and sent

5
in the form of text SMS to the control system and then the microcontroller on the basis of SMS
takes a decision of a particular task. Prof. Era Johri Dept, Of Information and Technology [6].
K.J.Somaiya College Of Engineering VIDYAVIHAR, MUMBAI “Remote Controlled Home
Automation Using Android application via Wi-Fi Connectivity”.
Satish Palaniappan: explained this paper survey of all existing system such as Wi -Fi, GSM,
Bluetooth, Zigbee and compare the available feature. Based on all the system surveyed is
identified as ideal system for home automation with remote access [7].
In general, Kevin Ashton (1999) was the first one who applied the idea of “Internet of Things”.
The Internet of Things (IoT) is the network which is very useful for exchanging and controlling
the data between the networks and systems etc [8]. IOT is becoming like the part of human life
and brought the great revolution in communication for both people and machines. Bluetooth, Wi-
MAX and Wireless LAN (Wi-Fi), ZigBee, and Global System for Mobile Communication
(GSM) are the most widely used communication technologies in home automation.
Our project based on a home automated system is designed by implementing related software
and hardware. Project is to design and implement a home automation system using Internet Of
Things that is capable of controlling and automating most of the house appliances through an
easy manageable Wireless-Fidelity. The proposed system has a great flexibility by using Wi-Fi
technology to interconnect its distributed telnet to home automation. This will decrease the
deployment cost and will increase the ability of upgrading, and system reconfiguration.
Our project is different in a sense it has its own software level application to control the home
appliances.
In general when we are going to our project, the aim is to control the home appliances similar to
the above writer. We are using ardiuno uno and wifi, ESP8266 module, so we are control
remotely by using telnet application using our mobile phone. Wi-Fi is more advanced than
Bluetooth ,Zigbee, GSM home automation control system because Wi-Fi coverage area is far
with comparing to thus Bluetooth and others. Since, we can control home appliance at far
distance remotely with in a Wi-Fi range by our mobile phone.

6
CHAPTER THREE
SYSTEM BLOCK DIAGRAM OF THE PROPOSED SYSTEM

Preview
In this chapter we introduce the system block diagram and the description of the system block
diagram.

3.1 OVERVIEW OF EMBEDDED SYSTEM

An Embedded System is a combination of computer hardware and software, and perhaps


additional mechanical or other parts, designed to perform a specific function. A good example is
the microwave oven. Almost every household has one, and tens of millions of them are used
every day, but very few people realize that a processor and software are involved in the
preparation of their lunch or dinner.
This is in direct contrast to the personal computer in the family room. It too is comprised of
computer hardware and software and mechanical components (disk drives, for example).
However, a personal computer is not designed to perform a specific function rather; it is able to
do many different things. Many people use the term general-purpose computer to make this
distinction clear. As shipped, a general-purpose computer is a blank slate; the manufacturer does
not know what the customer will do wish it. One customer may use it for a network file server
another may use it exclusively for playing games, and a third may use it to write the next great
American novel.
At the possible risk of confusing you, it is important to point out that a general-purpose computer
is itself made up of numerous embedded systems. For example, my computer consists of a
keyboard, mouse, video card, modem, hard drive, floppy drive, and sound card-each of which is
an embedded system. Each of these devices contains a processor and software and is designed to
perform a specific function. For example, the modem is designed to send and receive digital data
over analog telephone line. That's it and all of the other devices can be summarized in a single
sentence as well.

If an embedded system is designed well, the existence of the processor and software could be
completely unnoticed by the user of the device. Such is the case for a microwave oven, VCR, or
alarm clock. In some cases, it would even be possible to build an equivalent device that does not

7
contain the processor and software. This could be done by replacing the combination with a
custom integrated circuit that performs the same functions in hardware. However, a lot of
flexibility is lost when a design is hard-cooled in this way. It is much easier, and cheaper, to
change a few lines of software than to redesign a piece of custom hardware. Frequently, an
embedded system is a component within some larger system. For example, modern cars and
trucks contain many embedded systems. One embedded system controls the anti-lock brakes,
other monitors and controls the vehicle's emissions, and a third displays information on the
dashboard. In some cases, these embedded systems are connected by some sort of a
communication network, but that is certainly not a requirement.

3.2 DESIGN APPROACH OF THE PROJECT


In this chapter we discuss about the block diagram monitoring and controlling of home
appliances using esp8266 Wi-Fi. In this work we will design a system which is based on Home
automated system using internet of things concept. Here for communication point of view we are
using Wi-Fi module Esp8266 which is worked on AT command set. Basically we are using TCP
protocols for communicating with telnet.

8
Figure 1system architecture

9
3.2 SYSTEM COMPONENTS

3.2.1 HARDWARE

Figure 2 ardiuno

3.2.1.1 ARDUINO UNO BOARD


Arduino is an open source electronics prototyping platform based on flexible, easy-to-use
hardware and software. It is intended for artists, designers, hobbyists and anyone interested in
creating interactive objects or environments.
Arduino Uno is based on ATmega328 microcontroller (MCU). It consists of 14 digital
input/output pins, six analogue inputs, a USB connection for programming the on board MCU, a
power jack, an ICSP header and a reset button. It is operated with a 16MHz crystal oscillator and
contains everything needed to support the MCU. It is very easy to use as you simply need to
connect it to a computer using a USB cable, or power it with an AC-to-DC adaptor or battery to
get started. The MCU on board is programmed in Arduino programming language using Arduino
IDE.
The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has 14
digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz
ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset button. It
contains everything needed to support the microcontroller; simply connect it to a computer with

10
a USB cable or power it with a AC-to-DC adapter or battery to get started. The Uno differs from
all preceding boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it
features the Atmega16U2 (Atmega8U2 up to version R2) programmed as
a USB-to-serial converter.
The Uno is a microcontroller board based on the ATmega328P. It has 14 digital input/output pins
(of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB
connection, a power jack, an ICSP header and a reset button. It contains everything needed to
support the microcontroller;
simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or
battery to get started..
"Uno" means one in Italian and was chosen to mark the release of Arduino Software (IDE) 1.0.
The Uno board and version 1.0 of Arduino Software (IDE) were the reference versions of
Arduino, now evolved to newer releases. The Uno board is the first in a series of USB Arduino
boards.

3.2.1.2 HISTORY OF ARDUINO UNO


The project began in Ivrea, Italy (the site of the computer company Olivetti), in 2005 to make a
device for controlling student-built interaction design projects less expensive than other
prototyping systems available at the time. As of May 2011, more than 300,000 Arduino units are
"in the wild." Founders Massimo Banzi and David Cuartielles named the project after Arduin of
Ivrea, the main historical character of the town. "Arduino" is an Italian masculine first name,
meaning "strong friend". The English version of the name is
"Hardwin".The Arduino project is a fork of the open-source Wiring Platform. Wiring was
created by
Colombian artist and programmer Hernando Barragán as a master's thesis at the Interaction
Design Institute Ivrea under the supervision of Massimo Banzi and Casey Reas. Furthermore,
Wiring is based on Processing and its integrated development environment created by Casey
Reas and Ben Fry.
“Arduino was built around the Wiring project of Hernando Barragan. Wiring was Hernando's
thesis project at the Interaction Design Institute Ivrea. It was intended to be an electronic version
of Processing that used our programming environment and was patterned after the Processing
syntax. It was supervised by myself and Massimo Banzi, an Arduino founder. I don't think

11
Arduino would exist without Wiring and I don't think
Wiring would exist without Processing. And I know Processing would certainly not exist without
Design By Numbers andJohn Maeda.”

3.2.1.3 TECHNICAL SPECIFICATIONS


Table3.1 of Technical Specification of Arduino uno is Given Below

12
3.2.2 ESP 8266 MODULE

Figure 3 ESP8266Module

The ESP8266 Wi-Fi Module is a self-contained SOC with integrated TCP/IP protocol stack that
can give any microcontroller access to your Wi-Fi network. The ESP8266 is capable of either
hosting an application or offloading all Wi-Fi networking functions from another application
processor. Each ESP8266 module comes pre-programmed with an AT command set firmware,
meaning, you can simply hook this up to your Arduino device and get about as much Wi-Fi-
ability as a Wi-Fi Shield offers (and that‟s just out of the box)! The ESP8266 module is an
extremely cost effective board with a huge, and ever growing, community.
This module has a powerful enough on-board processing and storage capability that allows it to
be integrated with the sensors and other application specific devices through its GPIOs with
minimal development up-front and minimal loading during runtime. Its high degree of on-chip
integration allows for minimal external circuitry, including the front-end module, is designed to
occupy minimal PCB area. The SP8266 supports APSD for VoIP applications and Bluetooth co-
existence interfaces, it contains a self- calibrated RF allowing it to work under all operating
conditions, and requires no external RF parts. There is an almost limitless fountain of
information available for the ESP8266, all of which has been provided by amazing community
support. In the Documents section below you will find many resources to aid you in using the
ESP8266, even instructions on how to transforming this module into an IoT (Internet of Things)
solution!

13
ESP-01 is the one of the most popular ESP8266 module available in the market. ESP8266 is a
self-contained Sock with integrated TCP/IP stack which helps any microcontroller having UART
to access a Wi-Fi network. It can act as both Wi-Fi access point as well as a Wi-Fi client. It is
pre-programmed with AT commands, so we can easily access and configure it using a
microcontroller.
ESP8266 runs on 3.3V and its input pins are not 5V tolerant. So we need to reduce the 5V output
of the Arduino Tx pin to 3.3V by using voltage dividing resistors to connect to Rx pin of
ESP8266 module. Arduino TTL input pins will detect 3.3V as logic high, so we can directly
connect 3.3V output of ESP8266 Tx to Arduino Rx pin.

3.2.2.1 FEATURES
 802.11 b/g/n
 Wi-Fi Direct (P2P), soft-AP
 Integrated TCP/IP protocol stack
 Integrated TR switch, blunt, LNA, power amplifier and matching network
 Integrated PLLs, regulators, DCXO and power management units
 +19.5dBm output power in 802.11b mode
 Power down leakage current of <10uA
 1MB Flash Memory
 Integrated low power 32-bit CPU could be used as application processor
 SDIO 1.1 / 2.0, SPI, UART
 STBC, 1×1 MIMO, 2×1 MIMO
 A-MPDU & A-MSDU aggregation & 0.4ms guard interval
 Wake up and transmit packets in < 2ms
 Standby power consumption of < 1.0mW (DTIM3)

3.2.2.2 SPECIFICATION OF ESP 8266


 Wi-Fi Direct (P2P), soft-AP
 Integrated TCP/IP protocol stack
 Integrated TR switch, balun, LNA, power amplifier and matching network
 Integrated PLLs, regulators, DCXO and power management units
 19.5dBm output power in 802.11b mode

14
 Power down leakage current of <10uA
 1MB Flash Memory
 Integrated low power 32-bit CPU could be used as application processor

 Standby power consumption of < 1.0mW (DTIM3)

Interface Wi-Fi Module with Arduino Uno: The connection between Arduino and ESP is very
simple: ESP8266-Rx goes to Arduino Tx, ESP-8266 Tx goes to Arduino Rx.

3.2.3 RELAY MODULE BOARD

Figure 4 Relay

A relay is an electrical device which is generally used to control high voltages using very low
voltage as an Input. This consists of a coil wrapped around a pole and a two small metal flaps
(nodes) that are used to lose the circuit. One of the nodes is fixed and other is movable.
Whenever electricity is passed through the coil, it creates a magnetic field and attracts the
moving node towards the static node and the circuit gets completed. So, just by applying small
voltage to power up the coil we can actually complete the circuit for the high voltage to travel.
Also, as the static node is not physically connected to the coil there is very less chance that the
Microcontroller powering the coil gets damaged if something goes wrong.
A relay allows you to turn on or turn off a circuit using voltage and/or current much higher than
what Arduino could handle. Relay provides complete isolation between the low-voltage circuit
on Arduino side and the high-voltage side controlling the load. It gets activated using 5V from
Arduino, which, in turn, controls electrical appliances like fans, lights and air-conditioners.

15
This is Four Channel relay board controlled by computer USB port. The USB relay board is with
4 SPDT relays rated up to 10A each. You may control devices 220V / 120V (up to 4) directly
with one such relay unit. It is fully powered by the computer USB port. Suitable for home
automation applications, hobby projects, industrial automation. The free software allows to
control relays manually, create timers (weekly and calendar) and multi vibrators, use date and
time for alarms or control from command line. We provide software examples in Lab view,
.NET, Java, Borland C++, Python

3.2.3.2 HOW THE RELAY MODULE WORKS


When the relay is off, the COM terminal is connected to the NC (Normally Closed) terminal,
which means if you connect the bulb to the NC terminal; it will turn ON even when the relay
isn‟t energized. But that‟s not what we want.

We want to turn on the bulb only when we send a signal from smartphone. That‟s the reason we
connect the load to the NO (Normally Open) terminal, so that when the relay is triggered from
the Arduino, the contact switches from the NC terminal to the NO terminal, thereby completing
the circuit.

3.2.3.3 FEATURES OF RELAY


 Datasheet - here
 Power led: Yes
 Relay leds: Yes High quality
 4 SPDT Relay channels - selectable by user:
o JQC-3FC/T73 DC5V (7A / 250VAC, 10A / 125VAC, 12A / 120VAC, 10A /28VDC)
o RAS-05-15 (10A / 250VAC, 15A / 120VAC, 15A / 24VDC)
 PCB parameters: FR4 / 1.5mm / two layers / metalized holes / HAL / white stamp / solder
mask / extra PCB openings for better voltage isolation / doubled high voltage tracks
 Power supply: from USB port
 Current consumption: 400 mA
 Chip: FT245RL
 Size: 77mm x 56mm x 17mm
 Supported by DRM software (Windows and Linux): Yes
 Supported by Den kovi Command line tool (Windows, Linux): Yes

16
 Android software available (low cost but very useful): Yes - New
 Software examples - here
 Documentation: here

3.2.3.4 ADVANTAGES OF RELAY


 High quality
 Low cost
 No extra power supply
 Software with many functions
 Control electrical devices according weekday/date/time
 Create timers or pulses with our software
3.2.3.5 APPLICATIONS
 Home automation
 Robotics
 Alarms
 Timers
 Open doors and windows via PC
 Aquariums applications
Generally, the relay board with 4 SPDT Relays controlled from USB port of your computer. The
main purpose of this USB relay module is to help you building projects regarding robotics and
home automation (domestic). You may control different electrical devices like home lights, DC
motors, pneumatic cylinders, lasers and so on. Each such board requires one USB port. The more
USB ports you have the more such relay units you may connect and control. . The relay module
outputs are controlled by FT245RL. It has 8 bit data output
register (this device use only 4 of them). THE USB relay card cannot be controlled directly via
COM port - you need to download our DRM Software to control the device. The USB relay unit
cannot work without PC. Only one such device can be supplied from single USB port. If you
want to supply many such
devices you need USB HUB with extra power supply

17
First we can connect ESP8266 with the Arduino Uno. The ESP8266 runs on 3.3V, it may
damage if you connect it directly to 5V from Arduino. The pin out of the ESP-01 ESP8266
module is shown below.

Figure 5 Block diagram

3.3 DISCREPITION OF THE BLOCK DIAGRAM


1) A smartphone or an Android mobile which should have the android app installed in it.
2) ESP_8266 Wi-Fi module – the project will be connected to the smartphone using Wi-
Fi technology.
3) Controller or the main processing circuit- In this project, Arduino Uno is the main
controlling / processing unit.
4) Relays to control devices – they have used 5-12volt Single push single throw relays.
5) Output devices – they connected 3 DC devices to 3 relays (5-12 volt DC Fan ,5- 12
volt DC bulb and 5-12 volt DC Buzzer).

18
2)Applications and Advantages of Arduino based device control using Wi-Fi.
1. Home automation using Wi-Fi and Arduino can prove to be very useful for
Elderly/Handicapped people
2. A single android smartphone can control multiple devices
3. Any android phone can be used, no internet required once the app is downloaded.

3.2.2 SOFTWARE

3.2.2.1 SOFTWARE DESIGN


First download the Arduino software IDE from Arduino official website. After downloading the
software, install it in your system. Here we will write the code for the home automated system
and the code is uploaded in ATmega 328 controller.

Telnet enables the establishment of a connection to a remote system in such a way that the local
terminal appears to be a terminal at the remote system. Telnet is an open standard for remote
communication, typically over IP. It was once used to handle remote logins and to provide
command-line services to an end user.

Telnet is a protocol used on the Internet or local area networks to provide a bidirectional
interactive text-oriented communication facility using a virtual terminal connection. User data is
interspersed in-band with Telnet control information in an 8-bit byte oriented data connection
over the Transmission Control Protocol (TCP).

Telnet was developed in 1969 beginning with RFC 15, extended in RFC 854, and standardized
as Internet Engineering Task Force (IETF) Internet Standard STD 8, one of the first Internet
standards. The name stands for "teletype network".[1][2]

Historically, Telnet provided access to a command-line interface (usually, of an operating


system) on a remote host, including most network equipment and operating systems with a
configuration utility (including systems based on Windows NT). However, because of serious
security concerns when using Telnet over an open network such as the Internet, its use for this
purpose has waned significantly in favour of SSH.

The term telnet is also used to refer to the software that implements the client part of the
protocol. Telnet client applications are available for virtually all platforms. The telnet function is

19
to establish a connection using the Telnet protocol, either with command line client or with a
programmatic interface. For example, a common directive might be: "To change your password,
telnet into the server, log in and run the password command." Most often, a user will be telnet
ting to a Unix-like server system or a network device (such as a router) and obtaining a login
prompt to a command line text interface or a character-based full-screen manager.

The developed application for mobile phone which are java enabled or those phones in which
programming is done in J2ME. The two applications are given below.

a) An application which provide telnet connection between a mobile phone and remote server.

b) A Text Reader application for a J2ME mobile phones.

These two applications are only applicable to those mobile sets which are having JVM (Java
Virtual Machine) a run time environment for running an application. The Text Reader
application is developed by using CLDC 1(Connected Limited Device Configuration) and MIDP
1(Mobile Information Device Profile) and Telnet application is developed by using MIDP 2 and
CLDC 1. Mobile phones which will use these applications must have a) Screen Size: 96*54 b)
Input keyboard c) Memory size from 128 KB to 2 MB. d) GPRS or any internet connectivity.

Telnet gives you command line access to a remote computer. While you can transfer files via
telnet, its main differences is you can execute commands more advanced things like
starting/restarting services. Telnet is a method of remotely accessing a server. It is accomplished
via the use of a Telnet client which actually emulates the servers program on your own
computer. You can use Telnet to make/remove directories; create, rename, remove files; change
modes; get information from the server; manipulate files; etc.
There is no limit the number of systems to which you can establish a Telnet session. To start
Telnet session, sign on to the home system, then establish a client session. To establish a
connection to a telnet server, create a Telnet instance and provide the required hostname

20
CHAPTER FOUR
4.1 RESULT ANALYSIS

4.1.1PRACTICAL CIRCUIT BOARDS AND EXPLANATION

Figure 6_Home Automation System using Arduino and ESP8266

Firstly we develop the code in IDE arduino software and then we will compile the code, then if
will shows the error and in the code if present after fixing the error s, compile will show done
perfectly we will dump the code in to arduiouno board by data cable . we apply 12v to the board
by using adapter we will connect it to for node relay to the arduion uno board. By using jumper
wire between input pin (1,2,3,4) pin of relay board to digital pin (8,9,10,11) of arduiouno board
fan is connected to first relay between “COM” PIN 8 “NO” pin . In the same manner connect the
LED, another fan and buzzer to the reaming relay

The transmitter pin of ESP8266 is connected to the receiver digital pin of arduino and receiver
pin of Wi-Fi is connected to the transmitter of digital pin of arduino.

First we can connect ESP8266 with the Arduino Uno. The ESP8266 runs on 3.3V, it may
damage if you connect it directly to 5V from Arduino. The pin out of the ESP-01 ESP8266
module is shown below.

21
Figure 7 ESP-01 ESP8266 Module Pin Out

Connect the VCC and CH_PD of the ESP8266 to the 3.3V output pin of Arduino. CH_PD is
Chip Power Down pin, which is active low. So we will give 3.3V to it, which will enable the
chip. Then connect the TXD pin of the ESP8266 with the digital pin 2 of the Arduino. Then
make a voltage divider to make 3.3V for the RXD of the ESP8266 which is connected to the pin
3 of Arduino. Here we are using software through digital pins 2 & 3 of Arduino. Lastly, connect
the ground of the ESP8266 with the ground of the Arduino.
Now we can connect relays to Arduino. Connect three relays to pins 8,9,10.11 of the Arduino.
Also connect 5V and ground from the Arduino to power the relay. Note that here I am using
relay modules which having built in transistor driver.
The code is very long but easy to understand as it is well commented. First we will initialize the
software with digital pins of Arduino for the communication with ESP8266. After that we will
initialize pins to which we will connect relays as output pins. Then we will configure ESP8266
in access point mode. Arduino + ESP8266 is programmed as an access point such that we can
control those relays through a TELNET application in your mobiles.

How to make it work ?


After uploading the code to the Arduino, open the serial monitor from the Arduino IDE. It will
show you the IP address as shown below.

ESP8266 – Arduino Server – IP Address


First connect your mobile to the access point created by ESP8266 module (ESP_xxxxxx).
Update the IP address in the control file created. Now you can control your home appliances
very easily

22
When we enter „ *‟ in the telnet application ,then the mobile sends the data through Wi-Fi
module to the arduino will execute the program that was dumped and by using the input data
received from the Wi-Fi module through the digital pin „2‟.
We can also control all the appliance by using the command by entering „9‟ from the telnet

The microcontroller will run and send the output data to the relay by using (8, 9, 10, 11) pins of
arduino board.
The process will repeat, i.e. for different commands that are applied from mobile using telnet
application. Will be transmitted to the arduino through Wi-Fi module and the microcontroller
will acts according to the input received data and send the output data to input of the relay. The
relay will operate according to the input data.
Using telnet application we can communicate with our appliances. Following are the screenshot taken
from mobile phone of the Telnet application. As shown in figure 4.3 below, write IP address and port in
application it will connect with Wi-Fi. So according to special keyword user can easily operate the lights
of all rooms.

Figure 8 Connecting to Wi-Fi to Telnet

Following are the screenshots of the result being obtained by pressing different keywords. When * is
entered we get the notification on the mobile app and the corresponding LED lights up. It is shown in
figure 4.4 below:

23
Figure 9 Result obtained on pressing * in Telnet App

Similarly by pressing 9 and | all the LED,fan and buzzer were on. This condition is shown in figure 4.5 as
follows:

Figure 10Result obtained when 9 are pressed.

Similarly all four LEDs are turned off one by one by using $ , #,6 and 8 [ keywords]

24
CHAPTER FIVE
CONCLUSIONS AND RECOMEDATION
5.1 CONCLUSION
In this work we presented a model of Wi-Fi Based Remotely Operated Home Automated System
using the Concept of Internet of Things. As we saw the device got connected with Wi Fi module
and was operated remotely through a mobile application. Here we tried to reduce the cost issue
with proper connectivity and some good features. This proposed model has a wide variety of
applications such as in home automation System, Hospital Automated System and so on. It also
has a number of advantages like faster and efficient system, reduces human effort reduces delays
and increases efficiency. There are a lot of features that can be added to the presently designed
system. This system is super-cost effective and can give the user, the ability to control any
electronic device without even spending for a remote control. This project helps the user to
control all the electronic devices using his/her smartphone. A Wi-Fi based wireless home
automation system can be implementing and it is easy to install in an existing home. A research
work proved that Wi-Fi is faster than Bluetooth. Wi-Fi technology has ability to transmit data
within a long physical range.

5.2 LIMITETION OF THE PROJECT


 We are not check the status. This means if any one of home appliance accidentally mal
functional we don‟t know.
 It is only one directional communication.
 We are not increase or decrease the speed of fan when we are wanting.

5.3 FUTURE WORK


1. Arduino based device control using Wi-Fi on Smartphone project can be enhanced to control
the speed of the fan or volume of the buzzer etc.
2. We can replace Wi-Fi by GSM modem so that we can achieve device controlling by sending
SMS using GSM modem.
3. We can also make it two way communication

25
4. We can check the status if any one of home appliance accidentally mal functional by sending
SMS or any alert.

5.4 RECOMENDETION
Home automation system still can be improved for future development. Some modification and
renovation on the system have to be made in order to easily manageable. Therefore we
recommended for future work:-

 The system should be tested to be practically used in our homes

 The system should be installed by skillful and knowledgeable persons

 Use the combination of different home appliances’

 Implement a big system which indicates the whole project

26
REFERENCE
Journals and other books:

1.Tan, Lee and Soh “proposed the development of an Internet-based system to allow
monitoring of important process variables from a distributed control system (DCS)”. Journal of
Microprocessors and Microsystems, Vol. 26, pp.281-289, 2002.

2.Georgila, Fakotakis, and Kokkinakis, (2003) “ suggested the use of speech to interact remotely
with the home appliances to perform a particular action on behalf of the user” International Journal
of Computer Science and Network Security, Vol. 7, No. 5, May 2007

3. S. M. Anamul Haque,S. M. Kamruzzaman and Md. Ashraful, Islam,( 2006,)” proposed a


system entitled “A System for Smart-Home Control of Appliances Based on Time and Speech
Interaction” that controls the home appliances using the personal computer”. Nornabihah Ahmad
International Conference on Science and Technology: Application in Industry and Education (2006)

4. Ciubotaru-Petrescu, Cioarga, and Stanescu (2006)” present a design and


implementation of SMS based control for monitoring systems”. Marathwada Mitra
Mandal‟s Institute of Technology, University of Pune, India Network and Complex Systems ISSN
2224-610X (Paper) ISSN 2225-0603 (Online) Vol 2, No.2, 2012

5. Jawarkar, Ahmed, Ladhake, and Thakare (2008)” propose remote monitoring through mobile
phone involving the use of spoken commands”. Advances in Engineering and Technology
Research (ICAETR), International Conference on. IEEE, 2014

6.Era Johri Dept “Remote Controlled Home Automation Using Android application via Wi-Fi
Connectivity”. VarshaGaiwal PES‟s Modern College of Engineering, Pune-04, International
Journal of Engineering Research and General Science Volume 3,

7.Satish Palaniappan: “Wi -Fi, GSM, Bluetooth, Zigbee and compare the available feature”.
Communications and Signal Processing (ICCSP), 2015 International Conference on. IEEE,
2015, page no. 1763-1767.

8.Kevin Ashton (1999)= “based of Internet of Things”. A vision, architectural elements, and future
directions." Future Generation Computer Systems, 29.7,2013, page no. 1645-1660.

Websites:
• http://www.iot-playground.com
• http://www.instructables.com

27
• http://en.wikipedia.org
• http://www.journals.elsevier.com/easyiot

28
APPENDIXES

#include <SoftwareSerial.h> //#include <SoftwareSerial.h> //Including the software serial


library

int ch = 0, l = 0;

#define r1 8

#define r2 9

#define r3 10

#define r4 11

SoftwareSerial esp8266(2, 3); // (Rx,Tx) This will make the Arduino pin 2 as the RX pin and
Arduino pin 3 as the TX. Software UART

void setup()

// esp8266.print(command); // Send the command to the ESP8266 // long int


time = millis();

Serial.begin(9600); // Setting the baudrate to 9600

esp8266.begin(9600); // Set it according to your esp’s baudrate. Different esp’s have different
baud rates.

29
pinMode(r1, OUTPUT);

pinMode(r2, OUTPUT);

pinMode(r3, OUTPUT);

pinMode(r4, OUTPUT);

//pinMode(LDR,OUTPUT);

// pinMode(LDR,LOW);

digitalWrite(r1, LOW);

digitalWrite(r2, LOW);

digitalWrite(r3, LOW);

digitalWrite(r4, LOW);

esp8266.print("AT\r\n");

delay(1000);

esp8266.print("AT+RST\r\n"); //This command will reset module to default

delay(1000);

esp8266.print("AT+CWMODE=3\r\n"); // This will configure the mode as access point

delay(1000);

30
esp8266.print("AT+CWSAP=\"ESP8266\",\"E-systems\",5,0\r\n");

delay(1000);

esp8266.print("AT+CIPMUX=1\r\n"); // This will configure the ESP8266 for multiple


connections

delay(1000);

esp8266.print("AT+CIPSERVER=1,80\r\n"); // This will set the server on port 80

delay(1000);

esp8266.print("AT+CIFSR\r\n");// This will get ip address and will show it

delay(1000); //192.168.4.1

nani: if (esp8266.available())

do

l = 0;

l = esp8266.read();

l = char(l);

} while (l != 'L');

31
}

else {

goto nani;

esp8266.print("AT+CIPSEND=0,24\r\n");

esp8266.print("\r\nCONNECTED TO ESP8266\r\n");

for (int i = 0; i <= 100; i++)

esp8266.read();

void loop()

l = 0;

32
l = esp8266.read();

l = char(l);

if (l == '*')

digitalWrite(r1, HIGH);

delay(100);

l = '0';

if (l == '#') // Checking that whether the esp8266 is sending a message or not


(Software UART Data)

digitalWrite(r1, LOW);

delay(100); // Waiting for 1 sec

l = '0';

if (l == '@')

digitalWrite(r2, HIGH);

delay(100);

33
// Waiting for 1 sec

l = '0';

if (l == '$') // Checking that whether the esp8266 is sending a message or not (Software UART
Data)

digitalWrite(r2, LOW);

delay(100);

// Waiting for 1 sec

l = '0';

if (l == '5')

digitalWrite(r3, HIGH);

delay(100);

// Waiting for 1 sec

l = '0';

34
}

if (l == '6') // Checking that whether the esp8266 is sending a message or not (Software UART
Data)

digitalWrite(r3, LOW);

delay(100);

l = '0';

if (l == '7')

digitalWrite(r4, HIGH);

delay(100);

l = '0';

if (l == '8') // Checking that whether the esp8266 is sending a message or not (Software UART
Data)

digitalWrite(r4, LOW);

delay(100);

35
l = '0';

if (l == '9')

digitalWrite(r1, HIGH);

delay(100);

digitalWrite(r2, HIGH);

delay(100);

digitalWrite(r3, HIGH);

delay(100);

digitalWrite(r4, HIGH);

delay(100);

l = '0';

// }

36

You might also like