You are on page 1of 7

Home Automation Using Internet of Things (IoT)

Thant Sin Aung#1, Dr.Aung Win Htut#2, Htun Htet Aung#3

Department of Electrical Power Engineering, Defence Services Technological Academy, Pyin Oo Lwin, Myanmar
1
Thantsinaung11@gmail.com
2
aungwinhtut@gmail.com
3
phoepyae.hha@gmail.com
Abstract — A smart home automated system is designed by of software in MCU solutions has increased during the past
developing related software for mobile phone and few years, for MCUs supporting the IoT, even more
implementing hardware. The paper proposes an software, tools and enablement will be needed. [4] A broad
implementation of IoT (Internet of Things) based smart home
ecosystem with easily accessible support is the key to
automated system to remotely control the home appliances
enable the development of embedded processing nodes and
using Wi-Fi and Bluetooth. A low cost Wi-Fi module
ESP8266, HC-05 Bluetooth Module and Arduino are used to IoT applications. [5]
build Smart Units. The user can remotely operate home II. SYSTEM OVERVIEW
appliances like lights, fan, door lock etc. The lights in any In this section an elaborated design of proposed home
room can be controlled from any place in the house, within the
automation system and the components used in it is
Wi-Fi and Bluetooth range. So the concept of IoT is being
used to make home smarter.
presented.
A. System Architecture
Keywords - Home automation, Internet of things, Wi-Fi
module, Smart home, Bluetooth In this work we will design a system which is based
on Home automated system using internet of things
I. INTRODUCTION concept. Here for communication point of view we are
Internet of Things (IoT) is extension of current internet using Wi-Fi module Esp8266 and Bluetooth module HC-
to provide communication, connection, and 05. Basically we are using TCP protocols for
internetworking between various devices or physical communicating with Wi-Fi devices.
objects also known as "Things". IoT term represents a B. System Components
general concept for the ability of network devices to sense
1) Wi-Fi Module: The ESP8266  is used as Wi-Fi
and collect data from the world around us, and then share
module that allows  microcontrollers access to a network.
that data across the Internet where it can be processed and
It is a self-contained  SOC (System on a Chip) that doesn’t
utilized for various interesting purposes. The Internet of
necessarily need a microcontroller to manipulate inputs
things can be defined as connecting the various types of
and outputs as you would normally do with an Arduino, for
objects like smart phones, personal computer and tablets to
example, because the ESP-01 acts as a small computer.
internet, which brings in new and useful type of
Depending on the version of the ESP8266, it is possible to
communication between things and people and also
have up to 9 GPIOs (General Purpose Input Output). Thus,
between things [2]. With the introduction of IoT, the
we can give a microcontroller internet access like the Wi-Fi
research and development of home automation are
shield does to the Arduino, or we can simply program the
becoming popular in the recent days. Home automation
ESP8266 to not only have access to a Wi-Fi network,
system represents and reports the status of the connected
but to act as a microcontroller as well. This makes the
devices in an intuitive, user-friendly interface allowing the
ESP8266 very versatile, and it can save you some money
user to interact and control various devices with the touch
and space in your projects.
of a few buttons. Some of the major communication
technologies used by today’s home automation system
include Bluetooth, Wi-MAX and Wireless LAN (Wi-Fi),
ZigBee, and Global System for Mobile Communication
(GSM) [3].Here we are using Wi-Fi and Bluetooth. It offers
the user complete access control of the appliances through
a remote interface. Automation is the use of control
systems and information technology to control equipment,
industrial machinery and processes, reducing the need for
the human intervention [4].
The wide variety of potential IoT applications need a
software development environment that ties together the
applications, the command, control and routing process and
the security of the node and system. While the importance
Fig. 2 Wi-Fi Module (ESP8266 ESP01)

2) Bluetooth Module (HC-05): HC‐05 module is an


easy to use Bluetooth SPP(Serial Port Protocol) module,
designed for transparent wireless serial connection setup.
The HC-05 Bluetooth Module can be used in a Master or
Slave configuration, making it a great solution for wireless
communication. This serial port Bluetooth module is fully
qualified Bluetooth V2.0+EDR (Enhanced Data Rate)
3Mbps Modulation with complete 2.4GHz radio transceiver
and baseband. It uses CSR Bluecore 04‐External single
chip Bluetooth system with CMOS technology and with
AFH (Adaptive Frequency Hopping Feature).

Fig. 3 Bluetooth module (HC-05)

3) Arduino Uno: Arduino Uno is a microcontroller


board based on the ATmega328P (datasheet). 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 an AC-to-DC adapter or battery
to get started.

Fig. 1 System architecture of home automation


Fig.6 Ethernet Shield with Arduino Uno
Fig. 4 Arduino Uno pin layout
6) DHT22: The DHT22 is a basic, low-cost digital
4) Raspberry Pi 3 Model B: Raspberry Pi 3 Model B temperature and humidity sensor. It uses a capacitive
is the latest iteration of the world's most popular single humidity sensor and a thermistor to measure the
board computer. It provides a quad-core 64-bit ARM surrounding air, and spits out a digital signal on the data
Cortex-A53 CPU running at 1.2GHz, four USB 2.0 ports, pin (no analog input pins needed). It’s fairly simple to
wired and wireless networking, HDMI and composite video use, but requires careful timing to grab data. The only
output, and a 40-pin GPIO connector for physical real downside of this sensor is you can only get new data
from it once every 2 seconds, so when using our library,
interfacing projects.
sensor readings can be up to 2 seconds old. Simply
connect the first pin on the left to 3-5V power, the
second pin to your data input pin and the right most pin
to ground. Although it uses a single-wire to send data it
is not Dallas One Wire compatible! If you want multiple
sensors, each one must have its own data pin!

Fig.7 DHT22

7) Light Dependent Resistor (LDR) : A Light


Dependent Resistor or a photo resistor is a device
whose resistivity is a function of the incident electro-
Fig.5 Raspberry Pi 3 pin layout
-magnetic radiation. Hence, they are light sensitive devices.
5) Ethernet Shield: The Arduino Ethernet shield allows They are also called as photo conductors, photo conductive
an Arduino board to connect to the internet using cells or simply photocells. They are made up of
the Ethernet library and to read and write an SD card using semiconductor materials having high resistance. There are
the SD library. To use the shield, mount it on top of an many different symbols used to indicate a LDR, one of the
Arduino board (e.g. the Uno). To upload sketches to the most commonly used symbol is shown in the figure below.
board, connect it to your computer with a USB cable as you The arrow indicates light falling on it.
normally would. Once the sketch has been uploaded, you
can disconnect the board from your computer and power it
with an external power supply. Connect the shield to your
computer or a network hub or router using an Ethernet
cable (CAT5 or CAT6 with RJ45 cable). Connecting to a
computer may require the use of a cross-over cable
(although many computers, including all recent Macs can
do the cross-over internally). Fig.8 Light dependent resistor

8) Ultrasonic Sensor: An Ultrasonic sensor is a


device that can measure the distance to an object by using
sound waves. It measures distance by sending out a sound 10) GAS SENSOR (MQ2) MODULE: Gas Sensor
wave at a specific frequency and listening for that sound (MQ2) module is useful for gas leakage detection (in home
wave to bounce back. By recording the elapsed time and industry). It is suitable for detecting H2, LPG, CH4,
between the sound wave being generated and the sound CO, Alcohol, Smoke or Propane. Due to its high sensitivity
wave bouncing back, it is possible to calculate the distance and fast response time, measurements can be taken as soon
between the sonar sensor and the object. as possible. The sensitivity of the sensor can be adjusted by
using the potentiometer.

Fig.9 Ultrasonic Sensor


Since it is known that sound travels through air at
about 344 m/s (1129 ft/s), you can take the time for the
sound wave to return and multiply it by 344 meters (or
1129 feet) to find the total round-trip distance of the sound
wave. Round-trip means that the sound wave traveled 2
times the distance to the object before it was detected by
the sensor; it includes the 'trip' from the sonar sensor to the
object AND the 'trip' from the object to the Ultrasonic
sensor .
Fig. 12 GAS sensor (MQ-2)

III. SYSTEM IMPLEMENT


This section deals with the implementation of the
proposed system that includes hardware design connecting
various components and software requirements for the
Fig.10 Ultrasonic sensor measuring object system.

The distance between the sensor and object can be calculate


A. Hardware Design
by the following formula.
Interfacing of GAS Sensor with Arduino Pro Mini:
Speed of Sound× time taken Gas sensor has 4 pins, Vcc, Ground, Analog and digital
distace= output.
2
To interface Gas sensor with Arduino pro mini connect
as given below:

9) RFID-RC522 (MF-RC522): The card reader and  Vcc to Arduino 5V pin


microcontroller uses SPI for communication (chip  GND to Arduino GND pin
supports I2C and UART protocols but not implemented on  Output to Arduino Analog A0 pin
library). The card reader and the tags communicate using a
13.56MHz electromagnetic field.

Fig.11 RFID-RC522
Fig.17 Interfacing DHT-22 and Bluetooth with Arduino Uno
To connect the ESP8266, following instructions must be
followed
 VCC will be connected to the 3.3V power supply
 GPIO0 and GPIO2 are general purpose digital
ports. GPIO0 also controls the module mode
(programming or normal operation).
 Rx: Goes to Arduino pin 11 (But needs a voltage
adjusting)
 CH_PD: Chip enables. Keep it on high (3.3V)
Fig.13 Interfacing DHT22 with UNO with 10kOhm pull up resistor.
After interfacing sensors and Wi-Fi module with Arduino  RST: Reset. Keep it on high (3.3V) with 10kOhm
pro mini, we will connect buzzer and LEDs as an individual pull up resistor for normal operation. Put it on 0V to
room lights with Arduino pro mini. So here our hardware part reset the chip.
is finish. In below figure full hardware interfacing is shown:  GND is ground.
 Tx: Goes to Arduino pin10

B. Wi-Fi weather station with ESP8266


In smart home automation system at least two weather
station is needed. ESP8266 is included to enable Wi-Fi
connection between weather stations and cloud server
through home router.
DHT22 is used to measure temperature and humidity.
No.2 pin of DHt22 is connected to no 12 pin of Arduino.
To use LDR, a voltage divider configuration with
Fig.14 Interfacing ESP8266 with USB-FTDI to program 10kOhm resistor is used to measure light. LDR pin is
connected to A1 pin of Arduino.
MQ2 gas sensor pin is connected to A0 pin of Arduino to
measure gas.

Fig.15 Interfacing ESP8266 with DHT22

Fig.16 Interfacing ESP8266 with (Light Bulb, Fan, other AC


devices by SSR)

Fig.18 Wi-Fi Weather Station (Arduino and ESP8266)

C. 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.
Once the Arduino IDE is installed, open the program
to get it ready to program ESP8266 devices. Under File,
Preferences, and Additional Boards Manager URLs, add widely used for home automation. In this paper a remotely
this link: operated mobile phone controlled home appliances system
http://arduino.esp8266.com/stable/package_esp8266com_i is proposed.
ndex.json
To control lamp, fan, air-con, pump motor, etc., an
This will allow the Arduino IDE to manage ESP8266
compatible boards. android APK can be used. To create a control app for home
To connect ESP8266 to home Wi-Fi network, SSID appliances, MIT app inventor is used to develop. The
and password for router must be supplied. The following following pictures are screen shots of APK development
two line of code set the SSID and password to join the main process.
router.

const char* ssid = "YourWiFi";


const char* password = "YourPassword";
Then Wi-Fi is initiated with the following code –
WiFi.begin(ssid, password);
After that trying to connect until connected.
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
Fig- Screen shots of APK development process
}

Fig.21 Screen shots of APK development process

We assume that IoT smart home automation system


should include local server for database backup and other
control purposes. In this case, Raspberry Pi 3 is chosen to
use. According to limited time, we left this part in our
Fig.19 Connecting to IoT Server article. We will continue this development in future.
To connect to IoT Server, basic http client method is
IV. CONCLUSION
used. Following code is used to set SSID and password for
In this work we presented a model of Wi-Fi Based
SIM router AP or mobile phone-internet enabled AP.
Remotely Operated Smart Home Automated System using
WiFiMulti.addAP("gh", "123456789");
the Concept of Internet of Things. As we saw the device
There are many famous IoT Servers. Among them
got connected with cloud and was operated remotely
Thingspeak is chosen to use with our home automation
through a mobile application. Here we tried to reduce the
system. It is easy to upload data and view it.
cost issue with proper connectivity and some basic home
control system requirement. 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. As IoT is growing day by
day we can see that such smart devices will also grow.

ACKNOWLEDGEMENTS
Fig.20 Viewing data from IoT cloud Server The authors would like to express their thanks to Col.
C. Control from Mobile Phone Myo Thein Kyaw, Director of studies, D.S.T.A for his
Nowadays mobile phone has become a part of our valuable contribution and also thank you all for helping us
daily life. Due to low cost of mobile phones, they are achieve one of the major goals in our lives.
REFERENCES

[1] Arduino Home Automation Projects by Marco Schwartz

[2] Home Automation with Arduino by Marco Schwartz

[3] Home Automation with the ESP8266 by Marco Schwartz

[4] Raspberry Pi Home Automation with Arduino by Andrew K.


Dennis

[5] Smart Home Automation with Linux and Raspberry Pi by


Steven Goodwin

[6] Smart Home Automation with Linux by Steven Goodwin

You might also like