Batch A7

You might also like

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

IOT Based Home Automation Can be Controlled Audio with Multi Languages

A PROJECT REPORT ON

IOT BASED HOME AUTOMATION CAN BE


CONTROLLED AUDIO WITH MULTI
LANGUAGES
Submitted to JNTUA in partial fulfillment of the
requirement For the award of the degree of
BACHELOR OF
TECHNOLOGY IN
ELECTRONICS AND COMMUNICATION ENGINEERING

Submitted by
DEGA SRIHARI (162H1A0419)
BATTULA PITCHIREDDY (162H1A0408)
AVVARI SRINIVASULU (162H1A0404)
MALLI KRISHNA BABU (162H1A0440)

Under the guidance of


Mr.AV KARTHIK KUMAR, M.Tech
Assoc. Prof.
Dept. of ECE, ASIT, GUDUR.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

AUDISANKARA INSTITUTE OF TECHNOLOGY


(Accredited By: NAAC with “A” GRADE | Approved By: AICTE | Affiliated to JNTUA)

NH-5, BYPASS ROAD, GUDUR-524101, SPSR NELLORE (Dt.). ANDHRA PRADESH.

AUDISANKARA INSTITUITE OF TECHNOLOGY


ECE Department, ASIT I
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

CERTIFICATE

This is to certify that the project report entitled “IOT BASED HOME
AUTOMATION CAN BE CONTROLLEDAUDIO WITH MULTI
LANGUAGES” is submitted by Mr. DEGA SRIHARI (162H1A0419), Mr.
BATTULA PITCHI REDDY (162H1A0408), Mr. AVVARI SRINIVASULU
(162H1A0404), Mr. MALLI KRISHNA BABU(162H1A0440) in partial fulfillment
of the requirement for the award of the Degree of Bachelor of Technology in
ELECTRONICS AND COMMUNICATION ENGINEERING to
“AUDISANKARA INSTITUTE OF TECHNOLOGY”, GUDUR is a record of
bonafide work carried out by them under my guidance and supervision from 05-
02-20 to 11-3-20.

The results presented in this report have been verified and are found to be
satisfactory. The results embodied in this report have not been submitted to any other
university for the award of any degree.

Project Guide Head of the Department


AV KARTHIK KUMAR (M.Tech) SYED KAREEMSAHEB, M.Tech., (Ph.D)
ASSOC. PROF., ASSOC. PROF. & HoD
Dept. of ECE, Dept. of ECE,
ASIT, GUDUR ASIT, GUDUR

Submitted for the viva-voce examination held on……………………………..

External Examiner
ACKNOWLEDGEMENT

First and foremost, we would like to thank our beloved parents for their blessings and
grace in making this project success. We avail this opportunity to express our
profound sense of sincere and deep gratitude to those who constantly guided,
supported and encouraged during the course of our project.

We wish to express our heartfelt thanks and deep sense of gratitude to the honorable
chairman Dr.VANKI PENCHALAIAH, M.L, for his encouragement and inspiration
throughout the process.

We would like to thank our college management for having allowed us to do the
project work. Lastly we would like to pay our regards and thank our principal Dr.
T.VENU MADHAV whose ideas are proved to be really worth full in our work.

We wish to express our deep sense of gratitude to our beloved and esteemed Head of
the Department of ECE, SYED KAREEMSAHEB, M.Tech, (Ph.D). For his
support, encouragement and valuable suggestions, this went a long way in the
successful completion of this project

Finally we would like to thank and express our gratitude to our project guide
ASSISTANT PROFESSOR, AV KARTHIK KUMAR M .Tech, and we regard for
his valuable suggestions and support throughout our project work.

DEGA SRI HARI 162H1A0419


BATTULA PITCHI REDDY 162H1A0408
AVVARI SRINIVASULU 162H1A0404
MALLI KRISHNA BABU 162H1A0440
ABSTRACT
This project purpose the study of Internet of things (IOT) based home
automation system. In fact, saving energy can save our money as well less
on our electricity bill each month. save energy is also important as
producing electricity.

Internet of things-based home automation system can be controlled over


mobile devices. This system can perform varied functions to be performed
at home. This allows accessibility over internet from any corner in the
world. The focus of this project is to minimize the usage of electricity and
reduce human efforts. The home automation system incorporates various
aspects of technologies such as wireless networking, communication over
cloud. The data to be analyzed is stored onto the cloud. The user can
access multiple appliances over the internet as they their convenience.
This is a low-cost system. This system can control multiple devices with
the help of audio.
INDEX
CONTENTS PAGE NO
CERTIFICATE II
ACKNOWLEDGEMENT III
ABSTRACT IV
LIST OF FIGURES
CHAPTER 1
INTERNET OF THINGS
1.1 Introduction 1
1.2 History 2
1.3 Trends & Characteristics 3
1.4 Features 4-5
1.5 IOT Protocols 6
1.6 Applications 7-8
1.7 Wireless Technologies 9-11
1.8 Wireless Communication 12-14
CHAPTER 2

LITERATURE SURVEY 15

CHAPTER 3
3.1 Existing Home Automation System 16
3.2 Proposed System 17
3.3 Block Diagram 18

CHAPTER 4
HARDWARE COMPONENTS
4.1 ESP 8266 Wifi Module(NodeMCU) 19-20
4.1.1 Features 21-27
4.2 Relay 28-29
4.2.1 Basic Design and Operations 30-33
4.2.2 Types of Relay 34-42
4.3 8 Channel Relay 42-46
4.4 Transformers 46
4.4.1 Classification Parameters 47-48
4.4.2 Types of Transformers 48-52
4.4.3 Steps to Convert 230V AC to 12 V DC Using 53-55
Step Down Transformer
4.5 Rectifiers 56
4.5.1 Types of Rectifiers 56
4.5.2 Bridge Rectifier 57-58

CHAPTER 5
SOFTWARE
5.1 Arduino IDE 59-63

CHAPTER 6
6.1 ADVANTAGES 64
6.2 APPLICATIONS 64

CHAPTER 7
RESULT 65

CHAPTER 8
8.1 Conclusion 66
8.2 References 66

APPENDIX I (Software Code) 67-71

APPENDIX II (Acronyms) 72
LIST OF FIGURES

Fig No. Name of the figure Page No.


1.1 TECHNOLOGY ROAD MAP: IOT 3
1.2 SMART HOME 8
1.3 INFRAD TRANSMISSION 13
1.4 MICROWAVE TRANSMISSION 13
1.5 LIGHTWAVE TRANSMISSION 14
3.1 BLOCK DIAGRAM OF HOME AUTOMATION 18
4.1 ESP 8266 WIFI MODULE 19
4.2 NODE MCU DEVPLOMENT KIT/V 0.9 20
4.3 NODE MCU DEVPLOMENT KIT/V 0.9 20
4.4 ESP-12E MODULE 22
4.5 POWER REQIUREMENTS 23
4.6 INPUT/OUTPUT PINS 24
4.7 LED PIN 25
4.8 SERIAL COMMUNLICATION 26
4.9 PIN IAYOUT 26
4.10 SIMPLE REIAY 27
4.11 TYPES OF POLE AND THROW 32
4.12 LATCHING REIAY 35
4.13 MERCURY,WETTED REED RELAY 37
4.14 REED RELAY 39
4.15 SOLID-STATE RELAY 40
4.16 25A AND 40A SOLID STATE RELAY 41
4.17 8 CHANNEI RELAY 42
4.18 SCHEM VIEW 44
4.19 PCB VIEW 45
4.20 TRANSFORMER 47
4.21 STEP-DOWN TRANSFORMER 49
4.22 SYMBOL & PHYATICSICAL VIEW
SINGLE PHASE STEP-DOWN TRANSFORMER 51
4.23 CENTRE TAPPED STEP- DOWN TRANSFORMER 52
4.24 MULTI-TAPPED STEP-DOWN TRANSFORMER 52
4.25 STEP-DOWN TRANSFORMER 53
CONVERT AC TO DC 54
4.27 FILTER 55
NODE MCU CONNECTION WIT
IOT Based Home Automation Can be Controlled Audio with Multi Languages

CHAPTER 1

INTERNET OF THINGS

1.1 Introduction

The Internet of things (IoT) is a system of interrelated computing devices,


mechanical and digital machines provided with unique identifiers (UIDs) and the
ability to transfer data over a network without requiring human-to-human or human-
to-computer interaction.

The definition of the Internet of things has evolved due to the convergence of
multiple technologies, real-time analytics, machine learning, commodity sensors,
and embedded systems.[1] Traditional fields of embedded systems, wireless sensor
networks, control systems, automation (including home and building automation), and
others all contribute to enabling the Internet of things. In the consumer market, IoT
technology is most synonymous with products pertaining to the concept of the "smart
home", covering devices and appliances (such as lighting fixtures, thermostats,
home security systems and cameras, and other home appliances) that support one or
more common ecosystems, and can be controlled via devices associated with that
ecosystem, such as smartphones and smart speakers.

There are a number of serious concerns about dangers in the growth of IoT,
especially in the areas of privacy and security, and consequently industry and
governmental moves to address these concerns have begun.

1.2 History

The main concept of a network of smart devices was discussed as early as 1982, with
a modified Coca-Cola vending machine at Carnegie Mellon University becoming the
first Internet-connected appliance, able to report its inventory and whether newly
loaded drinks were cold or not. Mark Weiser's 1991 paper on ubiquitous computing,
"The Computer of the 21st Century", as well as academic venues such as UbiComp
and PerCom produced the contemporary vision of the IoT. In 1994, Reza Raji
described the concept in IEEE Spectrum as "[moving] small packets of data to a large

ECE Department, ASIT 1


set of nodes, so as to integrate and automate everything from home appliances to
entire factories". Between 1993 and 1997, several companies proposed solutions
like Microsoft's at Work or Novell's NEST. The field gained momentum when Bill
Joy envisioned device-to-device communication as a part of his "Six Webs"
framework, presented at the World Economic Forum at Davos in 1999.

The term "Internet of things" was likely coined by Kevin Ashton of Procter &
Gamble, later MIT's Auto-ID Center, in 1999, though he prefers the phrase
"Internet for things".At that point, he viewed radio-frequency identification (RFID) as
essential to the Internet of things, which would allow computers to manage all
individual things.

Defining the Internet of things as "simply the point in time when more 'things or
objects' were connected to the Internet than people", Cisco Systems estimated that the
IoT was "born" between 2008 and 2009, with the things/people ratio growing from
0.08 in 2003 to 1.84 in 2010.[17]

The key driving force behind the Internet of things is the MOSFET (metal-oxide-
semiconductor field-effect transistor, or MOS transistor),[18] which was originally
invented by Mohamed M. Atalla and Dawon Kahng at Bell Labs in 1959.[19][20] The
MOSFET is the basic building block of most modern electronics,
including computers, smartphones, tablets and Internet services. MOSFET
scaling miniaturization at a pace predicted by Dennard scaling and Moore's law has
been the driving force behind technological advances in the electronics industry since
the late 20th century. MOSFET scaling has been extended into the early 21st century
with advances such as reducing power consumption, silicon-on-
insulator (SOI) semiconductor device fabrication, and multi-core
processor technology, leading up to the Internet of things, which is being driven
by MOSFETs scaling down to nanoelectronic levels with reducing energy
consumption.
1.3 Trends and Characteristics

Fig:1.1 Technology roadmap: Internet of things


The IoT's major significant trend in recent years is the explosive growth of
devices connected and controlled by the Internet The wide range of applications for
IoT technology mean that the specifics can be very different from one device to the
next but there are basic characteristics shared by most.

The IoT creates opportunities for more direct integration of the physical world into
computer-based systems, resulting in efficiency improvements, economic benefits,
and reduced human exertions

The number of IoT devices increased 31% year-over-year to 8.4 billion in the year
2012 and it is estimated that there will be 30 billion devices by 2020 The global
market value of IoT is projected to reach $7.1 trillion by 2020.
1.4 Features
Any IoT device comes up with the following features.

 Connectivity: In the case of IoT, the most important feature one can consider
is connectivity. Without seamless communication among the interrelated
components of the IoT ecosystems (i.e. sensors, compute engines, data hubs,
etc.) it is not possible to execute any proper business use case. IoT devices
can be connected over Radio waves, Bluetooth, Wi-Fi, Li-Fi, etc. We can
leverage various protocols of internet connectivity layers in order to
maximize efficiency and establish generic connectivity across IoT ecosystems
and Industry. There may be special cases where the IoT ecosystem is built on-
premises or in an intranet.

 Sensing: We humans can naturally understand and analyze our circumstances


easily based on our past experiences with various things or situations. In the
case of IoT in order to get the best of it, we need to read the analog signal,
convert it in such a way that we can derive meaningful insights out of it. We
use Electrochemical, gyroscope, pressure, light sensors, GPS,
Electrochemical, pressure, RFID, etc. to gather data based on a particular
problem. For example, for automotive use cases, we use Light detection
sensors along with pressure, velocity and imagery sensors. To make a use
case successful we need to choose the proper sensing paradigm.

 Active Engagements: IoT device connects various products, cross-platform


technologies and services work together by establishing an active engagement
between them. In general, we use cloud computing in blockchain to establish
active engagements among IoT components. In the case of Industry grade,
IoT solutions raw analog data need to be acquired, preprocessed and rescale
as per business capacity. As per Google, only 50% of structured and 1% of
unstructured data is used to make important business decisions. So, while
designing the IoT ecosystems carriers need to consider the future needs of
manipulating such a huge scale of data to satisfy incremental business needs.
One can confuse the need of active engagements with scale, practically it
means your systems should be able to handle huge data across various
technologies, platforms, products, and industries.

 Scale: IoT devices should be designed in such a way that they can be scaled
up or down easily on demand. In general, IoT is being used from smart home
automation to automating large factories and workstations, so the use cases
vary in scale. A carrier should design their IoT infrastructure depending upon
their current and future engagement scale.

 Dynamic Nature: For any IoT use case, the first and foremost step is to
collecting and converting data in such a way that means business decisions
can be made out of it. In this whole process, various components of IoT need
to change their state dynamically. For example, the input of a temperature
sensor will vary continuously based on weather conditions, locations, etc. IoT
devices should be designed this keeping in mind.

 Intelligence: In almost every IoT use cases in today’s world, the data is used
to make important business insights and drive important business decisions.
We develop machine learning/ deep learning models on top of this massive
data to obtain valuable insights. The analog signals are preprocessed and
converted to a format on which machine-learning models are trained. We need
to keep in mind the proper data infrastructure based on business needs.

 Energy: From end components to connectivity and analytics layers, the whole
ecosystems demand a lot of energy. While designing an IoT ecosystem, we
need to consider design methodology such that energy consumption is minimal.
1.5 IOT PROTOCOLS
IoT primarily exploits standard protocols and networking technologies.
However, the major enabling technologies and protocols of IoT are RFID, NFC, low-
energy Bluetooth, low-energy wireless, low-energy radio protocols, LTE-A, and Wi-
Fi-Direct. These technologies support the specific networking functionality needed
in an IoT system in contrast to a standard uniform network of common systems.

NFC AND RFID:


RFID (radio-frequency identification) and NFC (near-field communication) provide
simple, low energy, and versatile options for identity and access tokens, connection
bootstrapping, and payments.
 RFID technology employs 2-way radio transmitter-receivers to identify and
track tags associated with objects.
 NFC consists of communication protocols for electronic devices, typically a
mobile device and a standard device.

LOW-ENERGY BLUETOOTH:
This technology supports the low-power, long-use need of IoT function while
exploiting a standard technology with native support across systems.

LOW-ENERGY WIRELESS:
This technology replaces the most power-hungry aspect of an IoT system. Though
sensors and other elements can power down over long periods, communication links
(i.e., wireless) must remain in listening mode. Low-energy wireless not only reduces
consumption, but also extends the life of the device through less use.

RADIO PROTOCOLS:
ZigBee, Z-Wave, and Thread are radio protocols for creating low-rate private area
networks. These technologies are low power but offer high throughput unlike many
similar options. This increases the power of small local device networks without the
typical costs.
LTE-A:
LTE-A, or LTE Advanced, delivers an important upgrade to LTE technology by
increasing not only its coverage, but also reducing its latency and raising its
throughput. It gives IoT a tremendous power through expanding its range, with its
most significant applications being vehicle, UAV, and similar communication.

WI-FI-DIRECT:
Wi-Fi-Direct eliminates the need for an access point. It allows P2P (peer-to-
peer) connections with the speed of Wi-Fi, but with lower latency. Wi-Fi-Direct
eliminates an element of a network that often bogs it down, and it does not
compromise on speed or throughput.

1.6 IOT APPLICATIONS

Smart Home:
Whenever we think of IoT systems, the most important and efficient application that
stands out every time is Smart Home ranking as highest IOT application on all
channels. The number of people searching for smart homes increases every month
with about 60,000 people and increasing. Another interesting thing is that the database
of smart homes for IoT Analytics includes 256 companies and startups. More
companies are now actively being involved in smart homes than similar other
applications in the field of IoT. The estimated amount of funding for Smart Home
startups exceeds $2.5bn and is ever growing. The list of startups includes prominent
startup company names such as AlertMe or Nest as well as a number of multinational
corporations like Philips, Haier, or Belkin etc.
Let’s See Thing Worx IoT – Foundation, Studio, Components & Interface.

Fig:1.2 Internet of Things Applications – Smart Home


1.7 WIRELESS TECHNOLOGIES

Various types of wireless technology and networks allow devices to speak (send data)
to each other and to the web (TCP/IP Networks) without cables. There are a number
of different wireless technologies out there that can be implemented in hardware
products for the Internet of Things (IoT) and Machine to Machine
(M2M) communication.

The Institute of Electrical and Electronics Engineers (IEEE) has seven task groups in
place for 802.15 technologies. Those groups set the standards for common types of
wireless technologies used for personal area networks. Those 802.15 task groups
include: WPAN/Bluetooth, Coexistence, High Rate WPAN, Low Rate WPAN, mesh
Networking, Body Area Networks, and Visible Light Communication. Each
IEEE protocol has its own distinctive advantages and limitations. Promising
developments expand their potential applications and uses.

IEEE 802.15.4: WHAT IS ZIGBEE?

A wireless technology currently gaining traction in the LPWAN group, ZigBee is


an open global standard and is designed specifically to be used in M2M networks.
The technology is inexpensive to run and doesn’t require a lot of power, making it
an ideal solution for many industrial applications. The technology has a low latency,
and a low duty cycle, allowing products to maximize battery life.

The ZigBee protocol offers 128-bit AES encryption. The technology is also
used in Mesh networks, which allow nodes to be connected together through
multiple pathways. The wireless technology is hoped to ultimately be implemented in
things like smart home devices. The technology's ability to connect multiple devices
together simultaneously makes it ideal for a connected home environment where users
may want things like smart locks, lights, robots and thermostats to talk to one another.
The ZigBee Alliance recently standardized the technology in the hope to make that
connectivity possible. Currently all ZigBee devices are not capable of talking to all
other ZigBee devices. The hope is that standardization will correct that issue and that
the devices will offer a uniform experience for the end user.

At Link Labs, many of our customers are former ZigBee users, but found that range
and performance limited their applications.

IEEE 802.11: WIFI:

WiFi uses radio waves (RF) to allow two devices to communicate with one
another. The technology is most commonly used to connect Internet routers to
devices like computers, tablets and phones; however, it can be used to connect
together any two hardware components. WiFi is a local wireless network that runs of
the 802.11 standards set forth by the Institute of Electrical and Electronics Engineers
(IEEE).

WiFi can utilize both the global 2.4GHz UHF and 5GHz SHF ISM radio bands. The
WiFi Alliance certifies some products, allowing them to be labeled as ―Wi-Fi
Certified.‖ In order to receive that designation, and product must go through the
Alliance’s interoperability certification testing.

802.11b, 802.11g, and 802.11n run on the 2.4GHz ISM band. The band is susceptible
to interference from some Bluetooth devices as well as some microwave ovens and
cordless phones. Devices that run on either band can be operated in the United States
without a license from the FCC, but still require FCC part 15 certification. The first
six channels of frequencies from each are considered part of the amateur radio band.

IEEE 802.15.1: BLUETOOTH AND BLE:

Bluetooth and Bluetooth Low Energy (BLE) are wireless technologies used to transfer
data over short distances. The technology is frequently used in small consider devices
that connect to users phones and tablets. For instance, the technology is used in many
speaker systems. Bluetooth Low Energy uses less power than standard Bluetooth and
is used in hardware such as fitness trackers, smart watches and other
connected devices in order to wirelessly transmit data without heavily compromising
the battery power in a user’s phone.

BLE has only recently started to pick up steam. The technology was initially
introduced by smartphone maker Nokia in 2006 but didn’t become part of Bluetooth
standard until 2010. Today, BLE, which is also referred to as Bluetooth Smart, is
supported by the majority of smartphone and computer makers as well as most major
operating systems including Windows 8, OS X, Linux, Windows Phone, Android and
iOS.

Bluetooth uses UHF radio waves for data transfer. The technology was originally
standardized as IEEE 802.15.1, but the IEEE no longer maintains that specific
standard. Companies that work with Bluetooth are often affiliated with the Bluetooth
Special Interest group (SIG). The group currently has over 20,000 members and must
certify a product before it can be marketed as a Bluetooth device to the consumer or
business market. That certification helps ensure that all Bluetooth devices work in a
standardized way and provide a similar experience for consumers.

IEEE 802.16: WIMAX:

WiMax stands for Worldwide Interoperability for Microwave Access. This


wireless technology allows data to be transferred at a rate of 30-40 megabits per
second. The term refers specifically to interoperable implementations of the IEEE
802.16 wireless family. The technology was once used by several mobile carriers,
notably Sprint, to deliver wireless data to its customers. Sprint, along with many of
the other carriers who used the technology, has since switched over to using faster
LTE 4G networks for data.

The WiMax Forum certifies devices before they can be sold to consumer or
businesses. The technology can be used both indoors and outdoors, however, WiMax
devices typically produce a better signal when used outside or by a window.

Link Labs builds a new type of wireless technology, called Symphony Link.
Symphony Link solves many of the range and performance issues of the technologies
listed above.
1.8 Wireless Communication

Wireless communication plays a significant role in day to day life. Besides


communication, wireless technology has become an integral part of our daily
activities. The transmission of data or information from one place to another
wirelessly is referred as wireless communication. This provides an exchange of data
without any conductor through RF and radio signals. The information is transmitted
across the devices over some meters to hundreds of kilometers through well-defined
channels.

Different types of signals are used in communication between the devices for wireless
transmission of data. The following are the different electromagnetic signals are used
depending on their wavelength and frequency.

 Radio Frequency Transmission


 Infrared Transmission
 Microwave Transmission
 Lightwave Transmission
RADIO FREQUENCY TRANSMISSION:

Radio frequency is a form of electromagnetic transmission used in wireless


communication. RF signals are easily generated, ranging 3kHz to 300GHz. These are
used in wireless communication because of their property to penetrate through objects
and travel long distances.

Radio communication depends on the wavelength, transmitter power, receiver quality,


type, size and height of the antenna.

Drawbacks:
 These are frequency dependent
 These have the relatively low bandwidth for data transmission.

Infrared Transmission:

Infrared radiations are electromagnetic radiations with longer wavelengths than


visible light. These are usually used for short-range communications. These signals do
not pass through solid objects.

Examples like Television remote control, mobile data sharing.

Fig:1.3 Infrared Transmission

Microwave Transmission:

Microwaves are the form of electromagnetic transmission used in wireless


communication systems. The wavelength of microwave ranges from one meter to one
millimeter. The frequency varies from 300MHz to 300GHz. These are widely used for
long distance communications and are relatively less expensive.
Fig:1.4 Microwave Transmission Node

Drawbacks

 The microwave does not pass through buildings.


 Bad weather affects the signal transmission.
 These are frequency dependent.

Lightwave Transmission:

Light is an electromagnetic radiation with a wavelength ranging between infrared


radiations and ultraviolet radiations. The wavelength ranges from 430 to 750THz.
These are unguided optical signals such as laser and are unidirectional.

Fig:1.5 Lightwave Transmission


Drawbacks

 These signals cannot penetrate through rain and fog.


 The laser beam gets easily diverted by air.
CHAPTER 2

LITERATURE SURVEY

Introduction

IoT is a trending concept in which the machines or things are made to interact with
the environment by exchanging data and information sensed by the sensors. The
devices gather information and data from the surrounding environment by using
various latest technologies and then there is a data flow between devices. Typically,
IoT offers advanced connectivity of devices, systems, and services which is beyond
machine-to-machine communications (M2M) and covers a variety of protocols,
domains, and applications. The interconnection of these embedded devices will usher
in automation in nearly all fields, right from a Smart Grid, to the areas such as smart
cities. IoT is a concept which is expected to rule the world within a few years.

Literature survey:

N. Srikanth and Tan Karanda in their work have presented an application of Bluetooth
Technology for Home Automation. The Bluetooth technology which emerged in late
1990's is used for implementing the wireless home automation system. Various
appliances such as air conditioners, home theatres, cellular phones etc., are
interconnected, thus creating a Personal Area Network in Home Environment. The
communication between several client modules and the host server takes place
through the Bluetooth module. A Home Automation Protocol has been developed to
enhance communication between the host server and the client modules. The system
also allows integration or removal of devices to the network which makes the system
scalable. The wireless system aims at reducing the cost of Home Automation. But the
system does not use the trending mobile technology. A. Z. Alkar and U. Buhur have
developed an internet based wireless home automation system for multifunctional
devices. A flexible, low cost, wireless solution to the home automation is introduced.
The transformation of the initial simple functionality control mechanism of devices to
more complex devices has been discussed. The home appliances are connected
through a server to a central node. The system is secured from unauthorized users by
using SSL algorithm.

CHAPTER 3

3.1 EXISTING HOME AUTOMATION SYSTEM

The existing works were mainly focused on switching and controlling home
appliances or connected devices rather than remotely monitoring of home
environment.

In this system, Bluetooth module is interfaced to 8051 microcontroller. Wireless


communication is used by the Android application to send messages to the Bluetooth.
Program is written on 8051 micro controllers. In order to receive the commands,
communication between the 8051 microcontroller and the Bluetooth module takes
place serially. On the basis of command received from the Bluetooth, the
microcontroller automatically switches the electrical loads. This system consists of a
microcontroller, Bluetooth module, 16 x 2 alphanumeric LCD, two 5V relays, a lamp
and DC motor. For the above circuit, reset circuit and crystal circuit need to be
connected additionally to the controller so that it works properly. The statuses of
electrical loads are indicated using circuit LCD. It is also used to display data received
from Bluetooth. Here LCD is interfaced to the PORT1 of the microcontroller in 4-bit
mode.

Bluetooth module TX and RX pins are connected to the RXD and TXD pins of
controller. GND pin is connected to ground and Vcc pin is connected to the 5V. Serial
communication (UART protocol) is used by the controller to communicate with
Bluetooth module. To communicate with Bluetooth, a baud rate of 9600 is used. The
Bluetooth name and password can be changed by using Bluetooth AT commands.
3.2 Proposed system

Remote Password Operated Home Appliances Control Project Algorithm:

 Initialize the LCD and UART protocol

 Now read the data from Bluetooth module.

 Display the received data on LCD.

 Compare the received string with predefined strings and accordingly switch the

 Electrical loads.

 Display the status of electrical loads on LCD.

The system is installed beside the conventional electrical switches on the wall. The
risk of dangerous electric shocks can be avoided by using low voltage switches. The
system uses two GUIs- one on the personal computer and the other on Smartphone.
The status of the appliances i.e. weather it is on/off can be known by using this GUI.
Any changes in the status of the appliances, immediate intimation is shown on the
GUI. The window GUI will act as a server to forward or transmit any data to/from the
Smartphone and the main control board, after the Smartphone’s Bluetooth is
connected to the Bluetooth of the computer. In case, the Bluetooth connection
between the PC or laptop and the control board fails, then connection can be re-
established by using USB cable.

However, due to limited range of operation (maximum up to 100 m) the system is


unable to cope with mobility and can only be controlled within the vicinity. The
proposed system eliminates this drawback, making the system more flexible. The user
can monitor and control the devices from any remote location at any time using IOT.

3.3 Block diagram

Fig: 3.1 Block Diagram of Home Automation


CHAPTER 4

HARDWARE COMPONENTS

4.1 ESP8266 WI FI MODULE (NODE MCU)

Fig:4.1 ESP8266 WI FI MODULE


NodeMCU is an open source development board and firmware based in the widely
used ESP8266 -12E WiFi module. It allows you to program the ESP8266 WiFi
module with the simple and powerful LUA programming language or Arduino IDE.
With just a few lines of code you can establish a WiFi connection and define
input/output pins according to your needs exactly like arduino, turning your ESP8266
into a web server and a lot more. It is the WiFi equivalent of ethernet module. Now
you have internet of things (iot) real tool.
With its USB-TTL, the nodeMCU Dev board supports directly flashing from USB
port. It combines features of WIFI accesspoint and station + microcontroller. These
features make the NodeMCU extremely powerful tool for Wifi networking. It can be
used as access point and/or station, host a webserver or connect to internet to fetch or
upload data.

Fig:4.2 NodeMCU Development Board/kit v0.9 (Version1)


Since NodeMCU is open source platform, their hardware design is open for
edit/modify/build.

NodeMCU Dev Kit/board consist of ESP8266 wifi enabled chip. The ESP8266 is a
low-cost Wi-Fi chip developed by Espressif Systems with TCP/IP protocol. For more
information about ESP8266, you can refer ESP8266 WiFi Module.

There is Version2 (V2) available for NodeMCU Dev Kit i.e. NodeMCU
Development Board v1.0 (Version2), which usually comes in black colored PCB.
Fig:4.3 NodeMCU Development Board/kit v1.0 (Version2)

For more information about NodeMCU Boards available in market refer NodeMCU
Development Boards

NodeMCU Dev Kit has Arduino like Analog (i.e. A0) and Digital (D0-D8) pins on
its board.

It supports serial communication protocols i.e. UART, SPI, I2C etc.

Using such serial protocols, we can connect it with serial devices like I2C enabled
LCD display, Magnetometer HMC5883, MPU-6050 Gyro meter + Accelerometer,
RTC chips, GPS modules, touch screen displays, SD cards etc.

4.1.1 FEATURES:

The Internet of Things (IoT) has been a trending field in the world of technology. It
has changed the way we work. Physical objects and the digital world are connected
now more than ever. Keeping this in mind, Espressif Systems (A Shanghai-based
Semiconductor Company) has released an adorable, bite-sized WiFi enabled
microcontroller – ESP8266, at an unbelievable price! For less than $3, it can monitor
and control things from anywhere in the world – perfect for just about any IoT
project.

 ESP-12E MODULE:

The development board equips the ESP-12E module containing ESP8266 chip
having Tensilica Xtensa32-bit LX106 RISC microprocessor which operates at 80 to
160 MHz adjustable clock frequency and supports RTOS.
ESP-12E Chip
Tensilica Xtensa® 32-bit LX106
80 to 160 MHz Clock Freq.
128kB internal RAM
4MB external flash
802.11b/g/n Wi-Fi transceiver

Fig:4.4 ESP-12E MODULE


There’s also 128 KB RAM and 4MB of Flash memory (for program and data storage) just
enough to cope with the large strings that make up web pages, JSON/XML data, and
everything we throw at IoT devices nowadays.

The ESP8266 Integrates 802.11b/g/n HT40 Wi-Fi transceiver, so it can not only
connect to a WiFi network and interact with the Internet, but it can also set up a
network of its own, allowing other devices to connect directly to it. This makes the
ESP8266 NodeMCU even more versatile.

 POWER REQUIREMENT:

As the operating voltage range of ESP8266 is 3V to 3.6V, the board comes with a
LDO voltage regulator to keep the voltage steady at 3.3V. It can reliably supply up to
600mA, which should be more than enough when ESP8266 pulls as much as 80mA
during RF transmissions. The output of the regulator is also broken out to one of the
sides of the board and labeled as 3V3. This pin can be used to supply power to
external components.

Power Requirement
Operating Voltage: 2.5V to 3.6V
On-board 3.3V 600mA regulator
80mA Operating Current
20 µA during Sleep Mode

Fig:4.5 Power requirements

Power to the ESP8266 NodeMCU is supplied via the on-board MicroB USB
connector. Alternatively, if you have a regulated 5V voltage source, the VIN pin can
be used to directly supply the ESP8266 and its peripherals.

Warning:

The ESP8266 requires a 3.3V power supply and 3.3V logic levels for
communication. The GPIO pins are not 5V-tolerant! If you want to interface
the board with 5V (or higher) components, you’ll need to do some level
shifting.
 PERIPHERALS AND I/O:

The ESP8266 NodeMCU has total 17 GPIO pins broken out to the pin headers on
both sides of the development board. These pins can be assigned to all sorts of
peripheral duties, including:

 ADC channel – A 10-bit ADC channel.

 UART interface – UART interface is used to load code serially.

 PWM outputs – PWM pins for dimming LEDs or controlling motors.

 SPI, I2C & I2S interface – SPI and I2C interface to hook up all sorts of sensors and
peripherals.

 I2S interface – I2S interface if you want to add sound to your project.

Multiplexed I/Os
1 ADC channels
2 UART interfaces
4 PWM outputs
SPI, I2C & I2S interface

Fig:4.6 Inputs & output pins

Thanks to the ESP8266’s pin multiplexing feature (Multiple peripherals multiplexed


on a single GPIO pin). Meaning a single GPIO pin can act as PWM/UART/SPI.
 ON-BOARD SWITCHES & LED INDICATOR:

The ESP8266 NodeMCU features two buttons. One marked as RST located on the top
left corner is the Reset button, used of course to reset the ESP8266 chip. The
other FLASH button on the bottom left corner is the download button used while
upgrading firmware.

Switches & Indicators


RST – Reset the ESP8266 chip
FLASH – Download new programs
Blue LED – User Programmable

Fig:4.8 LED pin

The board also has a LED indicator which is user programmable and is connected to
the D0 pin of the board.

 COMMUNICATION:

The board includes CP2102 USB-to-UART Bridge Controller from Silicon Labs,
which converts USB signal to serial and allows your computer to program and
communicate with the ESP8266 chip.

Serial Communication

 CP2102 USB-to-UART converter


4.5 Mbps communication speed
Flow Control support

Fig:4.8 serial communication

If you have an older version of CP2102 driver installed on your PC, we recommend
upgrading now.

 ESP8266 NODEMCU PINOUT:

The ESP8266 NodeMCU has total 30 pins that interface it to the outside world. The
connections are as follows:
Fig:4.9 pin layout

For the sake of simplicity, we will make groups of pins with similar functionalities.

Power Pins There are four power pins viz. one VIN pin & three 3.3V pins. The VIN
pin can be used to directly supply the ESP8266 and its peripherals, if you have a
regulated 5V voltage source. The 3.3V pins are the output of an on-board voltage
regulator. These pins can be used to supply power to external components.
GND is a ground pin of ESP8266 NodeMCU development board.
I2C Pins are used to hook up all sorts of I2C sensors and peripherals in your project.
Both I2C Master and I2C Slave are supported. I2C interface functionality can be
realized programmatically, and the clock frequency is 100 kHz at a maximum. It
should be noted that I2C clock frequency should be higher than the slowest clock
frequency of the slave device.
GPIO Pins ESP8266 NodeMCU has 17 GPIO pins which can be assigned to various
functions such as I2C, I2S, UART, PWM, IR Remote Control, LED Light and Button
programmatically. Each digital enabled GPIO can be configured to internal pull-up or
pull-down, or set to high impedance. When configured as an input, it can also be set
to edge-trigger or level-trigger to generate CPU interrupts.
ADC Channel The NodeMCU is embedded with a 10-bit precision SAR ADC. The
two functions can be implemented using ADC viz. Testing power supply voltage of
VDD3P3 pin and testing input voltage of TOUT pin. However, they cannot be
implemented at the same time.
UART Pins ESP8266 NodeMCU has 2 UART interfaces, i.e. UART0 and UART1,
which provide asynchronous communication (RS232 and RS485), and can
communicate at up to 4.5 Mbps. UART0 (TXD0, RXD0, RST0 & CTS0 pins) can be
used for communication. It supports fluid control. However, UART1 (TXD1 pin)
features only data transmit signal so, it is usually used for printing log.
SPI Pins ESP8266 features two SPIs (SPI and HSPI) in slave and master modes.
These SPIs also support the following general-purpose SPI features:

 4 timing modes of the SPI format transfer

 Up to 80 MHz and the divided clocks of 80 MHz


 Up to 64-Byte FIFO

used to directly interface SD cards. 4-bit 25 MHz SDIO v1.1 and 4-bit 50 MHz SDIO
v2.0 are supported.
PWM Pins The board has 4 channels of Pulse Width Modulation (PWM). The PWM
output can be implemented programmatically and used for driving digital motors and
LEDs. PWM frequency range is adjustable from 1000 μs to 10000 μs, i.e., between
100 Hz and 1 kHz.

Control Pins are used to control ESP8266. These pins include Chip Enable pin (EN),
Reset pin (RST) and WAKE pin.

 EN pin – The ESP8266 chip is enabled when EN pin is pulled HIGH. When pulled
LOW the chip works at minimum power.

 RST pin – RST pin is used to reset the ESP8266 chip.

 WAKE pin – Wake pin is used to wake the chip from deep-sleep.

4.2 Relay

A relay is an electrically operated switch. It consists of a set of input terminals for a


single or multiple control signals, and a set of operating contact terminals. The switch
may have any number of contacts in multiple contact forms, such as make contacts,
break contacts, or combinations thereof.

Relays are used where it is necessary to control a circuit by an independent low-power


signal, or where several circuits must be controlled by one signal. Relays were first
used in long-distance telegraph circuits as signal repeaters: they refresh the signal
coming in from one circuit by transmitting it on another circuit. Relays were used
extensively in telephone exchanges and early computers to perform logical
operations.

The traditional form of a relay uses an electromagnet to close or open the contacts, but
other operating principles have been invented, such as in solid-state relays which
use semiconductor properties for control without relying on moving parts. 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.

Latching relays require only a single pulse of control power to operate the switch
persistently. Another pulse applied to a second set of control terminals, or a pulse with
opposite polarity, resets the switch, while repeated pulses of the same kind have no
effects. Magnetic latching relays are useful in applications when interrupted power
should not affect the circuits that the relay is controlling.

Electromechanical relay schematic showing a control coil, four pairs of normally


open and one pair of normally closed contacts

Fig: 4.10 SIMPLE RELAY


4.2.1 Basic design and operation:
A simple electromagnetic relay consists of a coil of wire wrapped around
a soft iron core (a solenoid), 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 contacts in the relay pictured). The armature is hinged to the yoke and
mechanically linked to one or more sets of moving contacts. The armature 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 trans is tors
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.

Contact materials for relays vary by application. Materials with low contact resistance
may be oxidized by the air or may tend to "stick" instead of cleanly parting when
opening. Contact material may be optimized for low electrical resistance, high
strength to withstand repeated operations, or high capacity to withstand the heat of an
arc. Where very low resistance is required, or low thermally induced voltages are
desired, gold-plated contacts may be used, along with palladium and other non-
oxidizing, semi-precious metals. Silver or silver-plated contacts are used for signal
switching. Mercury-wetted relays make and break circuits using a thin, self-renewing
film of liquid mercury. For higher-power relays switching many amperes, such as
motor circuit contactors, contacts are made with a mixtures of silver and cadmium
oxide, providing low contact resistance and high resistance to the heat of arcing.
Contacts used in circuits carrying scores or hundreds of amperes may include
additional structures for heat dissipation and management of the arc produced when
interrupting the circuit. Some relays have field-replaceable contacts, such as certain
machine tool relays; these may be replaced when worn out, or changed between
normally open and normally closed state, to allow for changes in the controlled
circuit.
Pole and throw:

Fig: 4.11 Types of Pole and throw

Since relays are switches, the terminology applied to switches is also applied to
relays; a relay switches one or more poles, each of whose contacts can be thrown by
energizing the coil. Normally open (NO) contacts connect the circuit when the relay is
activated; the circuit is disconnected when the relay is inactive. Normally closed (NC)
contacts disconnect the circuit when the relay is activated; the circuit is connected
when the relay is inactive. All of the contact forms involve combinations of NO and
NC connections.

The National Association of Relay Manufacturers and its successor, the Relay and
Switch Industry Association define 23 distinct electrical contact forms found in relays
and switches. Of these, the following are commonly encountered:
 SPST-NO (Single-Pole Single-Throw, Normally-Open) relays have a single Form
A contact or make contact. These have two terminals which can be connected or
disconnected. Including two for the coil, such a relay has four terminals in total.
 SPST-NC (Single-Pole Single-Throw, Normally-Closed) relays have a
single Form B or break contact. As with an SPST-NO relay, such a relay has four
terminals in total.
 SPDT (Single-Pole Double-Throw) relays have a single set of Form C, break
before make or transfer contacts. That is, a common terminal connects to either of
two others, never connecting to both at the same time. Including two for the coil,
such a relay has a total of five terminals.
 DPST – Double-Pole Single-Throw relays are equivalent to a pair of SPST
switches or relays actuated by a single coil. Including two for the coil, such a
relay has a total of six terminals. The poles may be Form A or Form B (or one of
each; the designations NO and NC should be used to resolve the ambiguity).
 DPDT – Double-Pole Double-Throw relays have two sets of Form C contacts.
These are equivalent to two SPDT switches or relays actuated by a single coil.
Such a relay has eight terminals, including the coil
 Form D – make before break
 Form E – combination of D and B

The S (single) or D (double) designator for the pole count may be replaced with a
number, indicating multiple contacts connected to a single actuator. For example,
4PDT indicates a four-pole double-throw relay that has 12 switching terminals.

EN 50005 are among applicable standards for relay terminal numbering; a typical EN
50005-compliant SPDT relay's terminals would be numbered 11, 12, 14, A1 and A2
for the C, NC, NO, and coil connections, respectively.

DIN 72552 defines contact numbers in relays for automotive use;

 85 = relay coil -
 86 = relay coil +
 87 = common contact
 87a = normally closed contact
 87b = normally open contact
4.2.2 Types of relay:
Coaxial relay:

Where radio transmitters and receivers share one antenna, often a coaxial relay is used
as a TR (transmit-receive) relay, which switches the antenna from the receiver to the
transmitter. This protects the receiver from the high power of the transmitter. Such
relays are often used in transceivers which combine transmitter and receiver in one
unit. The relay contacts are designed not to reflect any radio frequency power back
toward the source, and to provide very high isolation between receiver and transmitter
terminals. The characteristic impedance of the relay is matched to the transmission
line impedance of the system, for example, 50 ohms.

Contactor:

A contactor is a heavy-duty relay with higher current ratings, [14] used for switching
electric motors and lighting loads. Continuous current ratings for common contactors
range from 10 amps to several hundred amps. High-current contacts are made with
alloys containing silver. The unavoidable arcing causes the contacts to oxidize;
however, silver oxide is still a good conductor. Contactors with overload protection
devices are often used to start motors.

Force-guided contacts relay:

A force-guided contacts relay has relay contacts that are mechanically linked together,
so that when the relay coil is energized or de-energized, all of the linked contacts
move together. If one set of contacts in the relay becomes immobilized, no other
contact of the same relay will be able to move. The function of force-guided contacts
is to enable the safety circuit to check the status of the relay. Force-guided contacts
are also known as "positive-guided contacts", "captive contacts", "locked contacts",
"mechanically linked contacts", or "safety relays".

These safety relays have to follow design rules and manufacturing rules that are
defined in one main machinery standard EN 50205 : Relays with forcibly guided
(mechanically linked) contacts. These rules for the safety design are the one that are
defined in type B standards such as EN 13849-2 as Basic safety principles and Well-
tried safety principles for machinery that applies to all machines.

Force-guided contacts by themselves can not guarantee that all contacts are in the
same state, however they do guarantee, subject to no gross mechanical fault, that no
contacts are in opposite states. Otherwise, a relay with several normally open (NO)
contacts may stick when energised, with some contacts closed and others still slightly
open, due to mechanical tolerances. Similarly, a relay with several normally closed
(NC) contacts may stick to the unenergised position, so that when energised, the
circuit through one set of contacts is broken, with a marginal gap, while the other
remains closed. By introducing both NO and NC contacts, or more commonly,
changeover contacts, on the same relay, it then becomes possible to guarantee that if
any NC contact is closed, all NO contacts are open, and conversely, if any NO contact
is closed, all NC contacts are open. It is not possible to reliably ensure that any
particular contact is closed, except by potentially intrusive and safety-degrading
sensing of its circuit conditions, however in safety systems it is usually the NO state
that is most important, and as explained above, this is reliably verifiable by detecting
the closure of a contact of opposite sense.

Force-guided contact relays are made with different main contact sets, either NO, NC
or changeover, and one or more auxiliary contact sets, often of reduced current or
voltage rating, used for the monitoring system. Contacts may be all NO, all NC,
changeover, or a mixture of these, for the monitoring contacts, so that the safety
system designer can select the correct configuration for the particular application.
Safety relays are used as part of an engineered safety system.

Latching relay:

Fig:4.12 Latching relay with permanent magnet


A latching relay, also called impulse, bitable, keep, or stay relay, or simply latch,
maintains either contact position indefinitely without power applied to the coil. The
advantage is that one coil consumes power only for an instant while the relay is being
switched, and the relay contacts retain this setting across a power outage. A latching
relay allows remote control of building lighting without the hum that may be
produced from a continuously (AC) energized coil.

In one mechanism, two opposing coils with an over-center spring or permanent


magnet hold the contacts in position after the coil is de-energized. A pulse to one coil
turns the relay on and a pulse to the opposite coil turns the relay off. This type is
widely used where control is from simple switches or single-ended outputs of a
control system, and such relays are found in avionics and numerous industrial
applications.

Another latching type has a reagent core that retains the contacts in the operated
position by the remanent magnetism in the core. This type requires a current pulse of
opposite polarity to release the contacts. A variation uses a permanent magnet that
produces part of the force required to close the contact; the coil supplies sufficient
force to move the contact open or closed by aiding or opposing the field of the
permanent magnet.[17] A polarity controlled relay needs changeover switches or an H
bridge drive circuit to control it. The relay may be less expensive than other types, but
this is partly offset by the increased costs in the external circuit.

In another type, a ratchet relay has a ratchet mechanism that holds the contacts closed
after the coil is momentarily energized. A second impulse, in the same or a separate
coil, releases the contacts. [17] This type may be found in certain cars,
for headlamp dipping and other functions where alternating operation on each switch
actuation is needed.

A stepping relay is a specialized kind of multi-way latching relay designed for early
automatic telephone exchanges.

An earth leakage circuit breaker includes a specialized latching relay.

Very early computers often stored bits in a magnetically latching relay, such
as ferreed or the later remreed in the 1ESS switch.
IOT Based Home Automation Can be Controlled Audio with Multi Languages

Some early computers used ordinary relays as a kind of latch—they store bits in
ordinary wire spring relays or reed relays by feeding an output wire back as an input,
resulting in a feedback loop or sequential circuit. Such an electrically latching relay
requires continuous power to maintain state, unlike magnetically latching relays or
mechanically racheting relays.

In computer memories, latching relays and other relays were replaced by delay line
memory, which in turn was replaced by a series of ever-faster and ever-smaller
memory technologies.

Machine tool relay:

A machine tool relay is a type standardized for industrial control of machine tools,
transfer machines, and other sequential control. They are characterized by a large
number of contacts (sometimes extendable in the field) which are easily converted
from normally open to normally closed status, easily replaceable coils, and a form
factor that allows compactly installing many relays in a control panel. Although such
relays once were the backbone of automation in such industries as automobile
assembly, the programmable logic controller (PLC) mostly displaced the machine tool
relay from sequential control applications.

A relay allows circuits to be switched by electrical equipment: for example, a timer


circuit with a relay could switch power at a preset time. For many years relays were
the standard method of controlling industrial electronic systems. A number of relays
could be used together to carry out complex functions (relay logic). The principle of
relay logic is based on relays which energize and de-energize associated contacts.
Relay logic is the predecessor of ladder logic, which is commonly used
in programmable logic controllers.

Mercury relay:

A mercury relay is a relay that uses mercury as the switching element. They are used
where contact erosion would be a problem for conventional relay contacts. Owing to
environmental considerations about significant amount of mercury used and modern
alternatives, they are now comparatively uncommon.

ECE Department, ASIT 37


IOT Based Home Automation Can be Controlled Audio with Multi Languages

Fig:4.13 A mercury-wetted reed relay

A mercury-wetted reed relay is a form of reed relay that employs a mercury switch, in
which the contacts are wetted with mercury. Such relays are used to switch low-
voltage signals (one volt or less). Mercury reduces the contact resistance and
mitigates the associated voltage drop. Surface contamination may result in poor
conductivity for low-current signals. For high-speed applications, the mercury
eliminates contact bounce, and provides virtually instantaneous circuit closure.
Mercury wetted relays are position-sensitive and must be mounted according to the
manufacturer's specifications. Because of the toxicity and expense of liquid mercury,
these relays have increasingly fallen into disuse.

The high speed of switching action of the mercury-wetted relay is a notable


advantage. The mercury globules on each contact coalesce, and the current rise time
through the contacts is generally considered to be a few picoseconds. However, in a
practical circuit it may be limited by the inductance of the contacts and wiring. It was
quite common, before restrictions on the use of mercury, to use a mercury-wetted
relay in the laboratory as a convenient means of generating fast rise time pulses,
however although the rise time may be picoseconds, the exact timing of the event is,
like all other types of relay, subject to considerable jitter, possibly milliseconds, due
to mechanical imperfections.

The same coalescence process causes another effect, which is a nuisance in some
applications. The contact resistance is not stable immediately after contact closure,
and drifts, mostly downwards, for several seconds after closure, the change perhaps
being 0.5 ohm.

Multi-voltage relays:

Multi-voltage relays are devices designed to work for wide voltage ranges such as 24
to 240 VAC and VDC and wide frequency ranges such as 0 to 300 Hz. They are
indicated for use in installations that do not have stable supply voltages.

ECE Department, ASIT 38


Overload protection relay:

Electric motors need overcurrent protection to prevent damage from over-loading the
motor, or to protect against short circuits in connecting cables or internal faults in the
motor windings. The overload sensing devices are a form of heat operated relay where
a coil heats a bimetallic strip, or where a solder pot melts, to operate auxiliary
contacts. These auxiliary contacts are in series with the motor's contactor coil, so they
turn off the motor when it overheats.

This thermal protection operates relatively slowly allowing the motor to draw higher
starting currents before the protection relay will trip. Where the overload relay is
exposed to the same ambient temperature as the motor, a useful though crude
compensation for motor ambient temperature is provided.

The other common overload protection system uses an electromagnet coil in series
with the motor circuit that directly operates contacts. This is similar to a control relay
but requires a rather high fault current to operate the contacts. To prevent short over
current spikes from causing nuisance triggering the armature movement is damped
with a dashpot. The thermal and magnetic overload detections are typically used
together in a motor protection relay.

Electronic overload protection relays measure motor current and can estimate motor
winding temperature using a "thermal model" of the motor armature system that can
be set to provide more accurate motor protection. Some motor protection relays
include temperature detector inputs for direct measurement from
a thermocouple or resistance thermometer sensor embedded in the winding.

Polarized relay:

A polarized relay places the armature between the poles of a permanent magnet to
increase sensitivity. Polarized relays were used in middle 20th Century telephone
exchanges to detect faint pulses and correct telegraphic distortion.
Reed relay:

Fig:4.14 Reed relay

(from top) Single-pole reed switch, four-pole reed switch and single-pole reed relay. Scale in centimeters.

A reed relay is a reed switch enclosed in a solenoid. The switch has a set of contacts
inside an evacuated or inert gas-filled glass tube that protects the contacts against
atmospheric corrosion; the contacts are made of magnetic material that makes them
move under the influence of the field of the enclosing solenoid or an external magnet.

Reed relays can switch faster than larger relays and require very little power from the
control circuit. However, they have relatively low switching current and voltage
ratings. Though rare, the reeds can become magnetized over time, which makes them
stick "on", even when no current is present; changing the orientation of the reeds
or degaussing the switch with respect to the solenoid's magnetic field can resolve this
problem.

Sealed contacts with mercury-wetted contacts have longer operating lives and less
contact chatter than any other kind of relay.

Safety relays:

Safety relays are devices which generally implement protection functions. In the event
of a hazard, the task of such a safety function is to use appropriate measures to reduce
the existing risk to an acceptable level.[22]

Solid-state contactor:

A solid-state contactor is a heavy-duty solid state relay, including the necessary heat
sink, used where frequent on-off cycles are required, such as with electric heaters,
small electric motors, and lighting loads. There are no moving parts to wear out and
there is no contact bounce due to vibration. They are activated by AC control signals
or DC control signals from programmable logic controllers (PLCs), PCs, transistor-
transistor logic (TTL) sources, or other microprocessor and microcontroller controls.

Solid-state relay:

Fig:4.15 relays have no moving parts.

Fig: 4.16 25 A and 40 A solid state contactors

A solid-state relay (SSR) is a solid state electronic component that provides a function
similar to an electromechanical relay but does not have any moving components,
increasing long-term reliability. A solid-state relay uses a thyristor, TRIAC or other
solid-state switching device, activated by the control signal, to switch the controlled
load, instead of a solenoid. An optocoupler (a light-emitting diode (LED) coupled
with a photo transistor) can be used to isolate control and controlled circuits.

Static relay:

A static relay consists of electronic circuitry to emulate all those characteristics which
are achieved by moving parts in an electro-magnetic relay.
Time delay relay:

Timing relays are arranged for an intentional delay in operating their contacts. A very
short (a fraction of a second) delay would use a copper disk between the armature and
moving blade assembly. Current flowing in the disk maintains magnetic field for a
short time, lengthening release time. For a slightly longer (up to a minute) delay, a
dashpot is used. A dashpot is a piston filled with fluid that is allowed to escape
slowly; both air-filled and oil-filled dashpots are used. The time period can be varied
by increasing or decreasing the flow rate. For longer time periods, a mechanical
clockwork timer is installed. Relays may be arranged for a fixed timing period, or
may be field adjustable, or remotely set from a control panel. Modern microprocessor-
based timing relays provide precision timing over a great range.

Some relays are constructed with a kind of "shock absorber" mechanism attached to
the armature which prevents immediate, full motion when the coil is either energized
or de-energized. This addition gives the relay the property of time-delay actuation.
Time-delay relays can be constructed to delay armature motion on coil energization,
de-energization, or both.

Time-delay relay contacts must be specified not only as either normally open or
normally closed, but whether the delay operates in the direction of closing or in the
direction of opening. The following is a description of the four basic types of time-
delay relay contacts.

First, we have the normally open, timed-closed (NOTC) contact. This type of contact
is normally open when the coil is unpowered (de-energized). The contact is closed by
the application of power to the relay coil, but only after the coil has been continuously
powered for the specified amount of time. In other words, the direction of the
contact's motion (either to close or to open) is identical to a regular NO contact, but
there is a delay in closing direction. Because the delay occurs in the direction of coil
energization, this type of contact is alternatively known as a normally open, on-delay.

Vacuum relays:

A vacuum relay is a sensitive relay having its contacts mounted in an evacuated glass
housing, to permit handling radio-frequency voltages as high as 20,000 volts without
flashover between contacts even though contact spacing is as low as a few hundredths
of an inch when open.

4.3 8 Channel relay:

Fig: 4.17 8 Channel relay

Description:

8 Channel Relay Board is a simple and convenient way to interface 8 relays for
switching application in your project. Input voltage level support TTL as well as
CMOS. Easy interface with Microcontrollers based projects and analog circuits.

Specifications:

 Input supply 12 VDC @ 336 mA

 Output eight SPDT relay

 Relay specification 5 A @ 230 VAC

 Trigger level 2 ~ 15 VDC

 Header connector for connecting power and trigger voltage

 LED on each channel indicates relay status

 Screw terminal connector for easy relay output and aux power connection

 Four mounting holes of 3.2 mm each


Schematic:
Fig: 4.18 Schematic View

PCB:
Fig: 4.19 PCB View

Ports Description:
Input:

 VCC: Connected to positive supply voltage (supply power according to relay


voltage)
 GND: Connected to negative supply voltage
 IN1: Signal(LOW Level) triggering terminal 1 of relay module
 IN2: Signal(LOW Level) triggering terminal 2 of relay module
 IN3: Signal(LOW Level) triggering terminal 3 of relay module
 IN4: Signal(LOW Level) triggering terminal 4 of relay module
 IN5: Signal(LOW Level) triggering terminal 5 of relay module
 IN6: Signal(LOW Level) triggering terminal 6 of relay module
 IN7: Signal(LOW Level) triggering terminal 7 of relay
module IN8: Signal(LOW Level) triggering terminal 8 of relay
module

4.4 Transformers

A transformer is a passive electrical device that transfers electrical energy


from one electrical circuit to another, or multiple circuits. A varying current in any
one coil of the transformer produces a varying magnetic flux in the transformer's core,
which induces a varying electromotive force across any other coils wound around the
same core. Electrical energy can be transferred between separate coils without a
metallic (conductive) connection between the two circuits. Faraday's law of induction,
discovered in 1831, describes the induced voltage effect in any coil due to a changing
magnetic flux encircled by the coil.

Transformers are most commonly used for increasing low AC voltages at high current
(a step-up transformer) or decreasing high AC voltages at low current (a step-down
transformer) in electric power applications, and for coupling the stages of signal
processing circuits. Transformers can also be used for isolation, where the voltage in
equals the voltage out, with separate coils not electrically bonded to one another.

Since the invention of the first constant-potential transformer in 1885, transformers


have become essential for the transmission, distribution, and utilization of alternating
current electric power.[2] A wide range of transformer designs is encountered in
electronic and electric power applications. Transformers range in size
from RF transformers less than a cubic centimeter in volume, to units weighing
hundreds of tons used to interconnect the power grid.

Fig:4.20 Transformer

4.4.1 Classification parameters:

Transformers can be classified in many ways, such as the following:

 Power rating: From a fraction of a volt-ampere (VA) to over a thousand MVA.


 Duty of a transformer: Continuous, short-time, intermittent, periodic, varying.
 Frequency range: Power-frequency, audio-frequency, or radio-frequency.
 Voltage class: From a few volts to hundreds of kilovolts.
 Cooling type: Dry or liquid-immersed; self-cooled, forced air-cooled; forced oil-
cooled, water-cooled.
 Application: power supply, impedance matching, output voltage and current
stabilizer, pulse, circuit isolation, power distribution, rectifier, arc furnace,
amplifier output, etc..
 Basic magnetic form: Core form, shell form, concentric, sandwich.
 Constant-potential transformer descriptor: Step-up, step-down, isolation.
 General winding configuration: By IEC vector group, two-winding combinations
of the phase designations delta, wye or star, and zigzag; autotransformer, Scott-T
 Rectifier phase-shift winding configuration: 2-winding, 6-pulse; 3-winding, 12-
pulse; . . . n-winding, [n-1]*6-pulse; polygon; etc...
4.4.2 Types of Transformer:

1. Step up transformer

2. Step down

transformer Step up transformer:

A transformer in which the output (secondary) voltage is greater than its input
(primary) voltage is called a step-up transformer. The step-up transformer decreases
the output current for keeping the input and output power of the system equal.

Considered a step-up transformer shown in the figure below. The E1 and E2 are the
voltages, and T1 and T2 are the number of turns on the primary and secondary winding
of the transformer.

The number of turns on the secondary of the transformer is greater than that of the
primary, i.e., T2 > T1.Thus the voltage turn ratio of the step-up transformer is 1:2. The
primary winding of the step-up transformer is made up of thick insulated copper wire
because the low magnitude current flows through it.

Step down transformer:


A Step-Down Transformer is a device which converts high primary voltage to a low
secondary voltage. In a Step-Down Transformer, the primary winding of a coil has
more turns than the secondary winding. Figure 1 below shows the winding
representation of a typical Step-Down Transformer.

Fig :4.21 Representation of Windings in Step Down Transformer


WORKING PRINCIPLE OF STEP-DOWN TRANSFORMER:
Transformer work on the principle of ―Faraday’s law of electromagnetic induction‖.
Mutual induction between the windings is responsible for transmission action in a
transformer.

Faraday’s law states that ―when the magnetic flux linking a circuit changes, an
electromotive force is induced in the circuit proportional to the rate of change of the
flux linkage‖.

The emf (Electro Motive Force) induced between the two windings is determined by
the number of turns in primary and secondary winding respectively. This ratio is
called as Turns Ratio.
The voltage reduction capability of step down transformers depends on the turn ratio
of the primary and secondary coil. As the number of windings in secondary coil is less
as compared to the number of windings in primary coil, so the amount of flux linkage
to the secondary coil of the transformer will also be less compared to the primary coil.

Accordingly, the emf induced will be less in the secondary coil. Due to this, the
voltage reduces at the secondary winding compared to primary winding.
Turns Ratio:
The voltage reduction capability of step-down transformers depends on the turn ratio
of the primary and secondary coil. As the number of windings in secondary coil is less
as compared to the number of windings in primary coil, so the amount of flux linkage
to the secondary coil of the transformer will also be less compared to the primary coil.

Accordingly, the emf induced will be less in the secondary coil. Due to this, the
voltage reduces at the secondary winding compared to primary winding.

STEP DOWN TRANSFORMER EQUATION:


The formula used to design a Step- Down Transformer is

Where,
 Ns = number of turns in secondary

 Np = number of turns in primary

 Vs = Voltage in secondary

 Vp = Voltage in primary

The number of turns in secondary winding should always be less than the number of
turns in the primary winding of the transformer i.e. Np>Ns to work transformer as
―Step-Down Transformer‖.
As the number of turns will be less in secondary winding, so will be total induced emf
and hence the output voltage in the secondary will also be less than the primary input
voltage.

Let’s understand by considering the situation of Step-Down Transformer in which the


secondary turns [Ns] are 250, primary turns [Np] are 5000 and the input voltage [Vp]
is 240. Then the voltage at the secondary [Vs] can be calculated by using the formula:

Buy rearranging the equation we get:


Hence, the voltage at the secondary winding of the transformer is 12V, which is less
than that at the primary winding. Therefore, the transformer in said to be a Step-Down
Transformer.

TYPES OF STEP-DOWN TRANSFORMER:


Step Down Transformers can be classified into three categories based on tappings in
secondary coil. They are:

 Single Phase Step Down Transformer


 Center Tapped Step Down Transformer
 Multi Tapped Step Down Transformer

Single Phase Step Down Transformer:


Used to step down the current ratings and input voltage, and it gives low voltage and
current output.

Ex: 12V AC.

Fig: 4.22 Symbol and Physical View of Single Phase Step Down Transformer
Center Tapped Step Down Transformer:
This type of Step-Down Transformers will be having one primary winding and a
center split in the secondary winding, by which it gives the output voltage with the
center pint.
Ex: 12v-0-12v.

Fig: 4.23 Symbol and Physical View of Center Tapped Step Down Transformer
Multi Tapped Step Down transformer:
This type of Step-Down Transformers has multiple tapping in Secondary coil.
Multiple Tapping are used to get the desired varied output with secondary coils.

Ex: 0-12v, 0-18v.

Fig: 4.24 Symbol and Physical View of Multi Tapped Step Down Transformer
4.4.3 STEPS TO CONVERT THE 230V AC TO 12V DC USING STEP DOWN
CONVERTER:

Every electrical and electronic device that we use in our day-to-day life will
require a power supply. In general, we use an AC supply of 230V 50Hz, but this
power has to be changed into the required form with required values or voltage range
for providing power supply to different types of devices. There are various types of
power electronic converters such as step-down converter, step-up converter, voltage
stabilizer, AC to DC converter, DC to DC converter, DC to AC converter, and so on.
For example, consider the microcontrollers that are used frequently for developing
many embedded systems’ based projects and kits used in real-time applications. These
microcontrollers require a 12V DC supply, so the AC 230V needs to be converted
into 12V DC using the step-down converter in their power supply circuit.
3 Steps to Convert 230V AC to 12V
DC 1.Step Down the Voltage Level
The step-down converters are used for converting the high voltage into low voltage.
The converter with output voltage less than the input voltage is called as a step-down
converter, and the converter with output voltage greater than the input voltage is
called as step-up converter. There are step-up and step-down transformers which are
used to step up or step down the voltage levels. 230V AC is converted into 12V AC
using a step-down transformer. 12V output of stepdown transformer is an RMS value
and its peak value is given by the product of square root of two with RMS value,
which is approximately 17V.

Fig: 4.25 Step-down Transformer


Step-down transformer consists of two windings, namely primary and secondary
windings where primary can be designed using a less-gauge wire with more number
of turns as it is used for carrying low-current high-voltage power, and the secondary
winding using a high-gauge wire with less number of turns as it is used for carrying
high-current low-voltage power. Transformers works on the principle of Faraday’s
laws of electromagnetic induction.

2. Convert AC to DC:

230V AC power is converted into 12V AC (12V RMS value wherein the peak value
is around 17V), but the required power is 5V DC; for this purpose, 17V AC power
must be primarily converted into DC power then it can be stepped down to the 5V
DC. But first and foremost, we must know how to convert AC to DC? AC power can
be converted into DC using one of the power electronic converters called as Rectifier.
There are different types of rectifiers, such as half-wave rectifier, full-wave rectifier
and bridge rectifier.
Due to the advantages of the bridge rectifier over the half and full wave rectifier, the
bridge rectifier is frequently used for converting AC to DC.

Fig: 4.26 Convert AC TO DC

Bridge rectifier consists of four diodes which are connected in the form a bridge. We
know that the diode is an uncontrolled rectifier which will conduct only forward bias
and will not conduct during the reverse bias. If the diode anode voltage is greater than
the cathode voltage then the diode is said to be in forward bias. During positive half
cycle, diodes D2 and D4 will conduct and during negative half cycle diodes D1 and
D3 will conduct. Thus, AC is converted into DC; here the obtained is not a pure DC
as it consists of pulses. Hence, it is called as pulsating DC power. But voltage drop
across the diodes is (2*0.7V) 1.4V; therefore, the peak voltage at the output of this
rectifier circuit is 15V (17-1.4) approx.

3. Smoothing the Ripples Filter using :

15V DC can be regulated into 5V DC using a step-down converter, but before this, it
is required to obtain pure DC power. The output of the diode bridge is a DC
consisting of ripples also called as pulsating DC. This pulsating DC can be filtered
using an inductor filter or a capacitor filter or a resistor-capacitor-coupled filter for
removing the ripples. Consider a capacitor filter which is frequently used in most
cases for smoothing.

Fig: 4.27 Filter


We know that a capacitor is an energy storing element. In the circuit, capacitor stores
energy while the input increases from zero to a peak value and, while the supply
voltage decreases from peak value to zero, capacitor starts discharging. This charging
and discharging of the capacitor will make the pulsating DC into pure DC, as shown
in figure.
4.6 RECTIFIERS
A Rectifier is an electrical device that is made of one or more than one diode that
converts the alternating current (AC) into direct current (DC). It is used for
rectification where the process below shows that how
it converts AC into DC.
Rectification:
Rectification is the process of conversion of the alternating current (which
periodically changes direction) into direct current (flow in a single direction).
4.6.1 Types of Rectifiers:
Usually, the types of Rectifiers are classified based on their output. We will discuss
many types of Rectifiers such as:
 Single Phase Rectifiers
 Three Phase Rectifiers
 Controlled Rectifiers
 Uncontrolled Rectifiers
 Half Wave Rectifiers
 Full Wave Rectifiers
 Bridge Rectifiers
 Center-Tapped Rectifiers
4.6.2 Bridge Rectifier:
A bridge rectifier uses four diodes to convert both half cycle of the input AC into
DC output.
In this type of rectifier, the diodes are connected in a specific form as given below.

Positive Half Cycle:


During input positive half cycle, the diode D1 & D2 becomes forward bias while D3
& D4 becomes reverse bias. The diode D1 & D2 form a closed loop that provides a
positive output voltage across the load resistor RL.

Negative Half Cycle:


During the negative half cycle, the diode D3 & D4 becomes forward bias while D1 &
D2 becomes reverse bias. But the polarity across the load resistor RL remains the
same and provides a positive output across the load.

The output of full wave rectifier has low ripples compared to half-wave rectifier but
still, it’s not smooth and steady.

In order to make the output voltage smooth & steady, a capacitor is placed at the
output as shown in the figure below.

The capacitor charge & discharges which make smooth transitions between the half
cycles.

Advantages of a Bridge Rectifier:


 Low ripples in the output DC signal
 High rectifier efficiency
 Low power loss

CHAPTER 5

SOFTWARE

5.1 Arduino IDE

After setting up ESP8266 with Node-MCU firmware, let’s see the IDE
(Integrated Development Environment) required for development of NodeMCU.

NodeMCU with ESPlorer IDE

Lua scripts are generally used to code the NodeMCU. Lua is an open source,
lightweight, embeddable scripting language built on top of C programming language.

Arduino IDE:
NodeMCU is Lua based firmware of ESP8266. Generally, ESPlorer IDE is referred
for writing Lua scripts for NodeMCU. It requires to get familiar with ESPlorer IDE
and Lua scripting language.

There is another way of developing NodeMCU with a well-known IDE i.e. Arduino
IDE. We can also develop NodeMCU applications using Arduino development
environment. This makes things easy for Arduino developers than learning new
language and IDE for NodeMCU.

Let’s see about setting up Arduino IDE with NodeMCU.

 Open Arduino IDE and Go to File -> Preference.

 Now
on
Preference
window, En
ter below
link in
Additional
Boards
Manager URLs

http://arduino.esp8266.com/stable/package_esp8266com_index.json
 Now close Preference window and go to Tools -> Board -> Boards Manager
 In Boards Manager window, Type esp in the search box, esp8266 will be
listed there below. Now select latest version of board and click on
install.

 After installation of the board is complete, open Tools->Board->and select


NodeMCU 1.0(ESP-12E Module).
 Now Your Arduino IDE is ready for NodeMCU

EXAMPLE:

Let’s see how to write simple serial print sketch using Arduino IDE for NodeMCU.
First connect NodeMCU Development Kit with PC as shown in below figure.

Fig:5.1 NodeMCU connection with PC

 After setting up Arduino IDE for NodeMCU, open Arduino IDE and write
simple sketch of serial print as shown in below figure.

CHAPTER 6

ADVANTAGES AND APPLICATION


6.1 Advantages

 Adds Safety Through Appliance And Lighting Control


 Secures Home Through Automated Door Locks
 Increases Awareness Through Security Cameras
 Saves Time
 Saves Money and Increases Convenience

6.2 Application

 This project proposes to control the home appliances (Fan,Bulb,AC,Motor,


etc..) anywhere in the world.

 This project proposes to create Smart Home with the help of internet of
things.

 Maximizing home security.

 Reduce power bills and human efforts

CHAPTER

7 RESULT
After the successful connection to the server, the data of sensor are sent to the web
server for monitoring of the system. By entering the assigned IP address in the web
browser this web server page will appear. The web server gives the information about
the temperature in different places of the house and motion state in the house. It also
gives the status of the various electrical appliances like light, fan etc which we can
control remotely. The stored data can be analyzed at anytime and anywhere.And also
it shows the state of the motion detector along with the time. It also provides
information about time of motion detected and how many times as well. All this
information is stored in the cloud which can be checked by the user any time when
away from home.
CHAPTER 8

8.1 CONCLUSION

 Home Automation is undeniably a resource which can make a home


environment automated. People can control their electrical devices via these
home automation devices and set up controlling actions through mobile.

 In future this product may have high potential for marketing.

 Further it can be demonstrated from computer instead of mobile phone for


controlling the appliances of many large places like Industries, Hospitals,
Institutions, etc.

8.2 REFERENCES

 Chan, M., Campo, E., Esteve, D., Fourniols, J.Y., ―Smart homes-current
features and future perspectives,‖ Maturitas, vol. 64, issue 2, pp. 90-97, 2009.

 BCC Research, ―Sensors: Technologies and global markets,‖

 S.Hilton.(2012,14January). Progression from M2M to the Internet of


Things: an introductory blog. Available: http://blog.bosch-
si.com/progression- from- m2m-tointernet-of-things-an-introductory- blog/.

 Wikipedia. (2012, 12th December). Home automation.Available:


http://en.wikipedia.org/wiki/Home_automation.

 Vishwajeet H.Bhide ―A Survey on the Smart Homes using Internet of


Things (IoT)‖.
APPENDIX I

#include <ESP8266WiFi.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"

#define Relay1 D1
#define Relay2 D2
#define Relay3 D3
#define Relay4 D4
#define Relay5 D5
#define Relay6 D6
#define Relay7 D7

#define WLAN_SSID "AndroidAP" // Your SSID


#define WLAN_PASS "a12345689" // Your password

/************************* Adafruit.io Setup


*********************************/

#define AIO_SERVER "io.adafruit.com"


#define AIO_SERVERPORT 1883 // use 8883 for SSL
#define AIO_USERNAME "Praveen4F3" // Replace it with your username
#define AIO_KEY "aio_udzd01FxzeDFKz6msCvgb4gi8xCd" // Replace with
your Project Auth Key

/************ Global State (you don't need to change this!) ******************/

// Create an ESP8266 WiFiClient class to connect to the MQTT server.


WiFiClient client;
// or... use WiFiFlientSecure for SSL
//WiFiClientSecure client;

// Setup the MQTT client class by passing in the WiFi client and MQTT server and
login details.
Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT,
AIO_USERNAME, AIO_KEY);

/****************************** Feeds
***************************************/
// Setup a feed called 'onoff' for subscribing to changes.
Adafruit_MQTT_Subscribe Light1 = Adafruit_MQTT_Subscribe(&mqtt,
AIO_USERNAME"/feeds/Relay1"); // FeedName
Adafruit_MQTT_Subscribe Light2 = Adafruit_MQTT_Subscribe(&mqtt,
AIO_USERNAME "/feeds/Relay2");
Adafruit_MQTT_Subscribe Light3 = Adafruit_MQTT_Subscribe(&mqtt,
AIO_USERNAME "/feeds/Relay3");
Adafruit_MQTT_Subscribe Light4 = Adafruit_MQTT_Subscribe(&mqtt,
AIO_USERNAME "/feeds/Relay4");
Adafruit_MQTT_Subscribe Light5 = Adafruit_MQTT_Subscribe(&mqtt,
AIO_USERNAME"/feeds/Relay5"); // FeedName
Adafruit_MQTT_Subscribe Light6 = Adafruit_MQTT_Subscribe(&mqtt,
AIO_USERNAME "/feeds/Relay6");
Adafruit_MQTT_Subscribe Light7 = Adafruit_MQTT_Subscribe(&mqtt,
AIO_USERNAME "/feeds/Relay7");

void MQTT_connect();

void setup()
{ Serial.begin(115200);
pinMode(Relay1, OUTPUT);
pinMode(Relay2, OUTPUT);
pinMode(Relay3, OUTPUT);
pinMode(Relay4, OUTPUT);
pinMode(Relay5, OUTPUT);
pinMode(Relay6, OUTPUT);
pinMode(Relay7, OUTPUT);
// Connect to WiFi access point.
Serial.println(); Serial.println();
Serial.print("Connecting to ");
Serial.println(WLAN_SSID);
WiFi.begin(WLAN_SSID, WLAN_PASS);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println();
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
// Setup MQTT subscription for onoff feed.
mqtt.subscribe(&Light1);
mqtt.subscribe(&Light3);
mqtt.subscribe(&Light2);
mqtt.subscribe(&Light4);
mqtt.subscribe(&Light5);
mqtt.subscribe(&Light6);
mqtt.subscribe(&Light7);
}
void loop()
{ MQTT_connect
();
Adafruit_MQTT_Subscribe *subscription;
while ((subscription = mqtt.readSubscription(20000))) {
if (subscription == &Light1) {
Serial.print(F("Got: "));
Serial.println((char *)Light1.lastread);
int Light1_State = atoi((char *)Light1.lastread);
digitalWrite(Relay1, Light1_State);

}
if (subscription == &Light2)
{ Serial.print(F("Got: "));
Serial.println((char *)Light2.lastread);
int Light2_State = atoi((char *)Light2.lastread);
digitalWrite(Relay2, Light2_State);
}
if (subscription == &Light3)
{ Serial.print(F("Got: "));
Serial.println((char *)Light3.lastread);
int Light3_State = atoi((char *)Light3.lastread);
digitalWrite(Relay3, Light3_State);
}
if (subscription == &Light4)
{ Serial.print(F("Got: "));
Serial.println((char *)Light4.lastread);
int Light4_State = atoi((char *)Light4.lastread);
digitalWrite(Relay4, Light4_State);

}
if (subscription == &Light5) {
Serial.print(F("Got: "));
Serial.println((char *)Light5.lastread);
int Light5_State = atoi((char *)Light5.lastread);
digitalWrite(Relay5, Light5_State);

}
if (subscription == &Light6)
{ Serial.print(F("Got: "));
Serial.println((char *)Light6.lastread);
int Light6_State = atoi((char *)Light6.lastread);
digitalWrite(Relay6, Light6_State);

}
if (subscription == &Light7)
{ Serial.print(F("Got: "));
Serial.println((char *)Light7.lastread);
int Light7_State = atoi((char *)Light7.lastread);
digitalWrite(Relay7, Light7_State);

}
}
}

void MQTT_connect() {
int8_t ret;

// Stop if already connected.


if (mqtt.connected())
{ return;
}
Serial.print("Connecting to MQTT... ");
uint8_t retries = 3;
while ((ret = mqtt.connect()) != 0) { // connect will return 0 for connected
Serial.println(mqtt.connectErrorString(ret));
Serial.println("Retrying MQTT connection in 5 seconds...");
mqtt.disconnect();
delay(5000); // wait 5 seconds
retries--;
if (retries == 0) {
// basically die and wait for WDT to reset me
while (1);
}
}
Serial.println("MQTT Connected!");

}
APPENDIX II
VCC Collector voltage

GND Ground

AMI Advanced Metering Infrastructure

DA Distribution Automation

SCADA Supervisory Control and Data Acquisition

IoE Internet of Everything

IoT Internet of Things

IP Internet Protocol

LAN Local Area Network

M2M Machine-to-Machine Communication

PAN Personal Area Network

RFID Radio Frequency Identification

RPMA Random Phase Multiple Access

RPMA Random Phase Multiple Access

You might also like