Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

IoT Based Home Automation

Abstract:

We live in an exciting time where more and more everyday items “things” are becoming
smart! “Things” have sensors and can communicate to other “things” and can provide control to
more “things”. The Internet of Things, IoT, is upon us in a huge way and people are rapidly
inventing new gadgets that enhance our lives. The price of microcontrollers with the ability to
talk over a network keeps dropping and developers can now tinker and build things
inexpensively.

In the advancement of technologies controlling and monitoring electrical appliances


using laptop, computer with the help of internet connection is possible. So it gives a more space
at a home, university and industrial controlling electrical appliances anywhere in the world. By
using Internet of Things we can control many devices such as light, power plug, Fan, computer,
security system and etc.It reduces human efforts and power efficiency.
With the introduction of IoT many devices are using this technology. Hence in this
project we are going to design a prototype that can be used to control real-time home appliances
like lights, fan and motors etc using the IoT platform. We are also going to design an Android
based application that can be used to control the appliances.

Introduction:
The main objective of this project is to design and implement a prototype that can be used
to control home appliances in real time using IoT platform.

The Basic Components Used in This Project Are:


Arduino Uno:

Arduino is an open source computer hardware and software company, project, and user
community that designs and manufactures single-board microcontrollers and microcontroller kits
for building digital devices and interactive objects that can sense and control objects in the
physical world. The project's products are distributed as open-source hardware and software,
which are licensed under the GNU Lesser General Public License (LGPL) or the GNU General
Public License (GPL), permitting the manufacture of Arduino boards and software distribution
by anyone. Arduino boards are available commercially in preassembled form, or as do-it-
yourself (DIY) kits.

Arduino board designs use a variety of microprocessors and controllers. The boards are
equipped with sets of digital and analog input/output (I/O) pins that may be interfaced to various
expansion boards (shields) and other circuits. The boards feature serial communications
interfaces, including Universal Serial Bus (USB) on some models, which are also used for
loading programs from personal computers. The microcontrollers are typically programmed
using a dialect of features from the programming languages C and C++. In addition to using
traditional compiler toolchains, the Arduino project provides an integrated development
environment (IDE) based on the Processing language project.

The Arduino project started in 2003 as a program for students at the Interaction Design
Institute Ivrea in Ivrea, Italy, aiming to provide a low-cost and easy way for novices and
professionals to create devices that interact with their environment using sensors and actuators.
Common examples of such devices intended for beginner hobbyists include simple robots,
thermostats, and motion detectors.

A program for Arduino may be written in any programming language with compilers that
produce binary machine code for the target processor. Atmel provides a development
environment for their microcontrollers, AVR Studio and the newer Atmel Studio.

The Arduino project provides the Arduino integrated development environment (IDE),
which is a cross-platform application written in the programming language Java. It originated
from the IDE for the languages Processing and Wiring. It includes a code editor with features
such as text cutting and pasting, searching and replacing text, automatic indenting, brace
matching, and syntax highlighting, and provides simple one-click mechanisms to compile and
upload programs to an Arduino board. It also contains a message area, a text console, a toolbar
with buttons for common functions and a hierarchy of operation menus.
A program written with the IDE for Arduino is called a sketch. Sketches are saved on the
development computer as text files with the file extension .ino. Arduino Software (IDE) pre-1.0
saved sketches with the extension .pde.

The Arduino IDE supports the languages C and C++ using special rules of code
structuring. The Arduino IDE supplies a software library from the Wiring project, which
provides many common input and output procedures. User-written code only requires two basic
functions, for starting the sketch and the main program loop, that are compiled and linked with a
program stub main() into an executable cyclic executive program with the GNU toolchain, also
included with the IDE distribution. The Arduino IDE employs the program avrdude to convert
the executable code into a text file in hexadecimal encoding that is loaded into the Arduino board
by a loader program in the board's firmware.

The open-source nature of the Arduino project has facilitated the publication of many
free software libraries that other developers use to augment their projects.

NodeMCU:

NodeMCU is an open source IoT platform. It includes firmware which runs on the
ESP8266 Wi-Fi SoC from Espressif Systems, and hardware which is based on the ESP-12
module. The term "NodeMCU" by default refers to the firmware rather than the development
kits. The firmware uses the Lua scripting language. It is based on the eLua project, and built on
the Espressif Non-OS SDK for ESP8266. It uses many open source projects, such as lua-cjson,
and spiffs.

NodeMCU was created shortly after the ESP8266 came out. On December 30, 2013,
Espressif Systems began production of the ESP8266. The ESP8266 is a Wi-Fi SoC integrated
with a Tensilica Xtensa LX106 core, widely used in IoT applications

NodeMCU started on 13 Oct 2014, when Hong committed the first file of nodemcu-
firmware to GitHub. Two months later, the project expanded to include an open-hardware
platform when developer Huang R committed the gerber file of an ESP8266 board, named devkit
v0.9. Later that month, Tuan PM ported MQTT client library from Contiki to the ESP8266 SoC
platform, and committed to NodeMCU project, then NodeMCU was able to support the MQTT
IoT protocol, using Lua to access the MQTT broker. Another important update was made on 30
Jan 2015, when Devsaurus ported the u8glib to NodeMCU project, enabling NodeMCU to easily
drive LCD, Screen, OLED, even VGA displays.

In summer 2015 the creators abandoned the firmware project and a group of independent
but dedicated contributors took over. By summer 2016 the NodeMCU included more than 40
different modules. Due to resource constraints users need to select the modules relevant for their
project and build a firmware tailored to their needs.

ESP8266 Arduino Core

As Arduino.cc began developing new MCU boards based on non-AVR processors like
the ARM/SAM MCU and used in the Arduino Due, they needed to modify the Arduino IDE so
that it would be relatively easy to change the IDE to support alternate tool chains to allow
Arduino C/C++ to be compiled down to these new processors. They did this with the
introduction of the Board Manager and the SAM Core. A "core" is the collection of software
components required by the Board Manager and the Arduino IDE to compile an Arduino C/C++
source file down to the target MCU's machine language. Some creative ESP8266 enthusiasts
have developed an Arduino core for the ESP8266 WiFi SoC that is available at the GitHub
ESP8266 Core webpage. This is what is popularly called the "ESP8266 Core for the Arduino
IDE" and it has become one of the leading software development platforms for the various
ESP8266 based modules and development boards, including NodeMCUs.

Relay Driver:

A relay is an electrically operated switch. Many relays use an electromagnet to


mechanically operate a switch, but other operating principles are also used, such as solid-state
relays. Relays are used where it is necessary to control a circuit by a low-power signal (with
complete electrical isolation between control and controlled circuits), or where several circuits
must be controlled by one signal. The first relays were used in long distance telegraph circuits as
amplifiers: they repeated the signal coming in from one circuit and re-transmitted it on another
circuit. Relays were used extensively in telephone exchanges and early computers to perform
logical operations.

A type of relay that can handle the high power required to directly control an electric
motor or other loads is called a contactor. Solid-state relays control power circuits with no
moving parts, instead using a semiconductor device to perform switching. Relays with calibrated
operating characteristics and sometimes multiple operating coils are used to protect electrical
circuits from overload or faults; in modern electric power systems these functions are performed
by digital instruments still called "protective relays".

A simple electromagnetic relay consists of a coil of wire wrapped around a soft iron core,
an iron yoke which provides a low reluctance path for magnetic flux, a movable iron armature,
and one or more sets of contacts (there are two in the relay pictured). The armature is hinged to
the yoke and mechanically linked to one or more sets of moving contacts. It is held in place by a
spring so that when the relay is de-energized there is an air gap in the magnetic circuit. In this
condition, one of the two sets of contacts in the relay pictured is closed, and the other set is open.
Other relays may have more or fewer sets of contacts depending on their function. The relay in
the picture also has a wire connecting the armature to the yoke. This ensures continuity of the
circuit between the moving contacts on the armature, and the circuit track on the printed circuit
board (PCB) via the yoke, which is soldered to the PCB.

When an electric current is passed through the coil it generates a magnetic field that
activates the armature, and the consequent movement of the movable contact(s) either makes or
breaks (depending upon construction) a connection with a fixed contact. If the set of contacts
was closed when the relay was de-energized, then the movement opens the contacts and breaks
the connection, and vice versa if the contacts were open. When the current to the coil is switched
off, the armature is returned by a force, approximately half as strong as the magnetic force, to its
relaxed position. Usually this force is provided by a spring, but gravity is also used commonly in
industrial motor starters. Most relays are manufactured to operate quickly. In a low-voltage
application this reduces noise; in a high voltage or current application it reduces arcing.
When the coil is energized with direct current, a diode is often placed across the coil to
dissipate the energy from the collapsing magnetic field at deactivation, which would otherwise
generate a voltage spike dangerous to semiconductor circuit components. Such diodes were not
widely used before the application of transistors as relay drivers, but soon became ubiquitous as
early germanium transistors were easily destroyed by this surge. Some automotive relays include
a diode inside the relay case.

If the relay is driving a large, or especially a reactive load, there may be a similar
problem of surge currents around the relay output contacts. In this case a snubber circuit (a
capacitor and resistor in series) across the contacts may absorb the surge. Suitably rated
capacitors and the associated resistor are sold as a single packaged component for this
commonplace use.

If the coil is designed to be energized with alternating current (AC), some method is used
to split the flux into two out-of-phase components which add together, increasing the minimum
pull on the armature during the AC cycle. Typically this is done with a small copper "shading
ring" crimped around a portion of the core that creates the delayed, out-of-phase component,
which holds the contacts during the zero crossings of the control voltage.

Working Principle:
Since the aim of this project is to control real time appliances using IoT platform, hence
we are going to use different appliances like Bulb, Tube-light, Fan and a Motor. Here we are
going to use two different microcontroller platforms for implementing our idea.
The project consists of two parts. The first one is the transmit part that is an android
mobile phone through which we are going to control the devices. The control signals will be sent
through an Android Application. We are using the MIT App Inventor software/platform to
design the Android Application.
The second part is the receive part to which the devices/appliances are connected. Here
we are going to use the NODEMCU and Arduino Uno board. The reason for using an Arduino
board is because of more number of I/O pins in comparison with the NODEMCU.
The NODEMCU will receive the signals through the WiFi modem and feed the signals to
the Arduino Uno board through its Tx & Rx pins. Now we are using relay driver to control the
different appliances. The Arduino Uno controller will send the appropriate signal to the relays in
order to make a device switch on of switch off.

Hardware Used:

 Arduino UNO R2.


 ESP8266 NODEMCU.
 Relay Driver.

Software Used:

 Arduino IDE.
 MIT App Inventor.

Programming Language Used:

 Embedded C & C++.

Applications:

 Home Automation.
 Industrial Automation.
 Institutions.
 Commercial Complex.

Advantages:

 Remotely Operated.
 Low Pollution Levels.
 Consumes Less Space.
 Low Operational Cost.
Disadvantages:

 Requires Internet Connection.

Block Diagram:

Control End:
Receive End:

You might also like