Вы находитесь на странице: 1из 38

A

Major Pr oject Repor t on

Home Automation Using Google Assistant


Submit ted
To

Rajiv Gandhi Proudyogiki Vishwavidyalaya


For the award of Degr ee of

Bachelor of Engineering
In
Electronics and Communication Engineering

Submit ted by

AAKASH VASULE (0545EC163D01)


DHIRAJ RATHORE (0545EC151008)
PANKAJ JHARBADE (0545EC163D05)
VIVEK BHISE (0545EC151028)

Under the Guidance


Prof. Nilesh Mishra

Department of Electronics & Communication Engineering


SHRI BALAJI INSTITUTE OF TECHNOLOGY & MANAGEMENT
BETUL 2018-2019

1
SHRI BALAJI INSTITUTE OF TECHNOLOGY &
MANAGEMENT, BETUL
Department of Electronics and Communication Engineering

Certificate

This is to certify that the work embodied in this report entitled “HOME
AUTOMATION USING GOOGLE ASSISTANT” being submitted by
AAKASH VASULE (0545EC163D01), DHIRAJ RATHORE (0545EC151008)
PANKAJ JHARBADE (0545EC163D05), VIVEK BHISE (0545EC151028)
is partial fulfillment of the requirement for the award of degree of Bachelor
of Engineering in Electronics and Communication Engineering
discipline, to “Rajiv Gandhi Proudyogiki Vishvavidyalaya, Bhopal”
during the academic year 2018-2019 is a record of bonfire piece of work,
carried out by students under supervision and guidance of Department
Electronics and Communication Engineering at Shri Balaji Institute of
Technology & Management, Betul (M.P)

APPROVED & SUPERVISED BY

Prof. NILESH MISHRA


(Project Guide)

Prof. SHASANK MANE Dr. AMIT J. Modak


(H.O.D) (Principal)

2
SHRI BALAJI INSTITUTE OF TECHNOLOGY &
MANAGEMENT, BETUL
Department of Electronics and Communication Engineering

CERTIFICATE OF APPROVAL

The Dissertation entitled “HOME AUTOMATION USING GOOGLE


ASSISTANT” being submitted by AAKASH VASULE (0545EC163D01), DHIRAJ
RATHORE (0545EC151008), PANKAJ JHARBADE (0545EC163D05), VIVEK
BHISE (0545EC151028) has been examined by us and is hereby approved for
award of degree of Bachelor of Engineering.

(Internal Examiner) (External Examiner)


Date: Date:

3
SHRI BALAJI INSTITUTE OF TECHNOLOGY &
MANAGEMENT, BETUL
Department of Electronics and Communication Engineering

CANDIDATE DECLARATION

We hereby declare that the work, which is being presented in this


report, entitled “HOME AUTOMATION USING GOOGLE ASSISTANT” is
submitted for the requirement for the award of degree of Bachelor of
Engineering in Electronics and Communication Engineering, submitted in
the department of Electronics and Communication Engineering at Shri
Balaji Institute of Technology &Management, Betul is an authentic
record of our own work carried under guidance of Prof. NILESH MISHRA. I
have not submitted the matter emb1odied in this report for award of any
other degree or at any other university/Institute.

Name of Candidates
AAKASH VASULE
DHIRAJ RATHORE
PANKAJ JHARBADE
VIVEK BHISE

4
ACKNOWLEDGEMENT

We express deep gratitude for enthusiasm and valuable


suggestions that we got from my Prof. NILESH MISHRA for successful
completion of the report of the project. This was not possible without the
invaluable guidance of our project guide.

We deeply indebted to our project Coordinator Prof. NILESH


MISHRA Department of Electronics & Communication Engineering, for
providing us support and resources for successful completion of the work.

We are also thankful to our head of department Prof. SHASHANK


MANE for providing all the resource and constant encouragement.

We pay deep regards to our Principal Dr. Amit. J. Modak who is


instrumental in setting standards for the students to achieve.

We are grateful to all the Teachers and Staff members of


Department for their valuable academic support.

Finally, we pay deep regards to Family Members for their moral


support and the people who related directly or in directly to this thesis work.

1. AAKASH VASULE
2. DHIRAJ RATHORE
3. PANKAJ JHARABADE
4. VIVEK BHISE

Date:
Place: Betul

5
ABSTRACT

Home automation or demotic a term for home automation coined by


Jim Hill has been evolving drastically. We saw many home automation technologies
introduced over these years from Zig bee automation to Amazon Echo, Google
Home and Home from Apple. It has become a craze these days. Google Home price
is around 150$ (USD) with an additional cost of the devices to be connected to, the
total cost of the system reaches over 250$ (USD). Apple Home Kit too is pretty more
expensive, over 100$ (USD) more than the Google Home just for a basic setup.
Philips Hue, a smart light which is controlled by the Google Assistant, Amazon Echo
and Siri, voice assistant by Apple is priced around 145$ (USD).
Similarly, Belikin’s Wemo light is priced around 44$
(USD) per unit and this can be controlled both by Siri and Google Assistant. So,
overall we can see here that to make our home smart we need to invest quite a lot,
let’s say some 250$ (USD) for a basic setup. What if we can automate our house
within (cost of the Smartphone is not included as it is assumed to be owned by
every individual these days) 10$ (USD) and can control up to 8 appliances using
Google Assistant? Well, this paper describes the implementation of such a system.
The system is implemented using ordinary household appliances Natural language
voice commands are given to the Google Assistant and with the help of IFTTT (If
This Then That) application and the Blynk application the commands are decoded
and then sent to the microcontroller, the microcontroller in turn controls the relays
connected to it as required, turning the device connected to the respective relay On
or OFF as per the users request to the Google Assistant. The microcontroller used
is Node MCU (ESP8266) and the communication between the microcontroller and
the application is established via Wi-Fi [Internet]

6
INDEX
Title Page No.
Certificate 2
Certificate of Approval 3
Candidate Declaration 4
Acknowledgement 5
Abstract 6
List of Figure 9
List of Publication 10

Chapter-1Introduction 11-14
1.1 Home Automation 11
1.1.1 Customer Statement of Requirement 12-13
1.1.2 Requirements
User Data 14
Chapter-2 Component 15-27
2.1 Hardware 15
2.1.1 Node MCU (ESP8266) 15-17
2.1.2 Hi link PM-01 17-18
2.1.3 Transistor BC547 19
2.1.4 Resistor 20
2.1.5 Diode 21
2.1.6 LED (3mm) 22
2.1.7 Relay 23
2.2 Software
2.2.1 Adafruit 24
2.2.2 IFTTT 25
2.2.3 Google Assistant 26-27

Chapter-3 Layout 28-29


3.1 Circuit Layout 28
3.2 Etching Process 29

7
Title Page No.
3.3 Circuit Assemble 29

Chapter-4 Program 30-34

4.1 Programing 30-32


4.2 How to program 33-34

Chapter-5 Working 35-36

5.1 Circuit Working 35


5.2 Flow chart 35

Chapter-6 Conclusion & Future work 36

Chapter-7 Reference 37

8
LIST OF FIGURES
Figure No. Figure Title Page No.

1.1 Model of user input 12

1.2 Model of communication 14

1..3 Model of user group 14

2.1.1 Node MCU [ESP8266] 17

2.1.2 Hi Link PM 01 18

2.1.3 Transistor BC547 19

2.1.3 Pin dig BC547 20

2.1.4 Resistor 21

2.1.5 Diode 1N4007 22

2.1.6 Relay 23

3.1 Circuit Layout 28

5.1 Block dig of working 29

5.2 Flowchart of s/w working 29

9
LIST OF PUBLICATION

AAKASH VASULE, DHIRAJ RATHORE, PANKAJ JHARBADE, VIVEK BHISE


and Mr. Nilesh Mishra, “Home Automation Using Google Assistant” in
International Journal of Advanced Research in Electrical, Electronics and
instrumentation Engineering, Vol. 5, Issue 2, Page No. 343-345, Mar-Apr(Online)
2019

10
CHAPTER 1
INTRODUCTION
1.1 HOME AUTOMATION
Home, it is the place where one fancies or desires to be after a long tiring

day. People come home exhausted after a long hard working day. Some are way too tired

that they find it hard to move once they land on their couch, sofa or bed. So any small

device/technology that would help them switch theirs lights on or off, or play their

favorite music etc. on a go with their voice with the aid of their smart phones would make

their home more comfortable.

Moreover, it would be better if everything such as warming bath water and

adjusting the room temperature were already done before they reach their home just by

giving a voice command. So, when people would arrive home, they would find the room

temperature, the bath water adjusted to their suitable preferences, and they could relax

right away and feel cozier and rather, feel more homely.

Human assistants like housekeepers were a way for millionaires to keep up

their homes in the past. Even now when technology is handy enough only the well to do

people of the society are blessed with these new smart home devices, as these devices

costs are a bit high. However, not everyone is wealthy enough to be able to afford a

human assistant, or some smart home kit. Hence, the need for finding an inexpensive and

smart assistant for normal families keeps growing.

This paper proposes such inexpensive system. It uses the Google Assistant, the

IFTTT application, the Adafruit application and the Node-MCU microcontroller as the

major components along with a relay board comprising of 4/8 relays along with ULN 2803

IC. Natural language voice is used to give commands to the Google Assistant. All of the

components are connected over the internet using Wi-Fi which puts this system under

the Internet of things (IOT).

11
1.1.1 Customer Statement of Requirements(CSR)

Problem Statement

As the modern software system, home automation control system should


achieve any requirements from users by its intelligence and generalization. In our
home automation system.

Identify the human languages

It is impossible for any users to understand the instructions or algorithm


of programming. What they can do is control the elements with human languages
and signal of body. So the users require the system to identify the human
languages instead of machine instructions or other programming languages.

Human voice instruction Voice is the most directly and simple way for peo-
ple to convey their requirement. For example, when the sunlight is insufficient
inside the room, the user can just send a voice message just like Turn on the
light to modify the brightness of the room. This condition requires the excellent
flexibility because different users maintain the various ways of speaking and the
system should be compatible to cater to a large number of people. And this
requirement is the core case of the whole system.

Simple gestures Some users also demand the system to be equipped with
the alternative controlling ways. And gesture is a good choice. Gesture s the
easiest way of communicating for some one who cannot speak. For example the
user can slide one of his fingers to modify the volume of MP3 player. The
technology of identifying gestures for system is complex in algorithm and
hardware design, but it can really simplify the operation of users.

Figure 1.1: Model of User Input.

Abundant operations for elements

In general the users have more requirements to control the elements of


the system than just turning it on and off. For the lamps, if the users want to
12
modify the brightness of the room, users can change the brightness of the lamp
instead of turning it on or off. Or if the user is using the MP3 player, he can
modify the volume or skip to the next or to the last song. This requirement is
important because the users in general have their own customs of using the
system and the system should make the users comfortable with the abundant
operations of the elements.

Application on cellphone platform

When the users are using the system, it is inconvenient and impossible
to hold several terminals such as cellphones, IPads and controllers. For users,
it is significant to concentrate the functions of different devices into one
terminal. In general, the most frequently used device is cellphone for users. So
the users require the system to be developed on the cellphone platform such
as Android and IOS. As one application of mobile device, the users can log into
the home automation system directly with less cost than a whole controller.
Android is the most widely used mobile system and it can be compatible with
a large number of users if the system developed on Android. Another reason is
that the Android system can easily process the voice information because it is
a Linux based OS and it can easily access Google Voice. Also Android primarily
uses for touchscreen devices. So for users the Android system is the best choice
of platform for our home automation system.

Feedback information

At any point of time, the user might want to know the status of the
different elements of the house. For this purpose the user would require
the system to send a feedback to the user interface. The users should know
whether the system recognizes the correct information and execute the right
actions. Also if the identification failed, the users should be announced to
send the messages again or cancel the action by the feedback information.

Wireless communication and remote controlling

The users prefer controlling the elements at their house remotely using
a cell phone. So the system should support wireless communication. Another
problem is that WIFI and Bluetooth and other high-speed type of
communication cannot be available all the families in general. So the system
should use the TCP/IP protocol between the communication of server and the
central controller. In addition, the users demand the wireless communication
functions of elements of the home automation system because to increase the
flexibility of the system by allowing the user to change the position of the various
elements of the home automation system. This flexibility is lost in case of wired
system because of the constraints due to using wires

13
Figure1.2: Model of Communication.

1.1.2 User data

The users demand the system to storage


the data of different IDs. In general users have two aspects of
requirements of users data. First the users have their own customs of
living. With the data of history of special users, the system can easily
recognized the messages the users send, and create a user friendly
interface for different users. Also the system can create several classes for
many users. With this function, the system can limit some functions for
special classes or groups. For example, if the user A and B have been
divided into the class Kids, A and B cannot operate some limited elements
such as microwaves. In this way the system can also guarantee the safety
of the house and its users.

Figure1.3: Model of User Group.

14
CHAPTER 2
COMPONENTS
2.1 Hardware
Electronic hardware consists of interconnected electronic
components which perform analog or logic operations on received and locally stored
information to produce as output or store resulting new information or to provide control for
output actuator mechanisms.

Electronic hardware can range from individual chips/circuits to


distributed information processing systems. Well-designed electronic hardware is composed
of hierarchies of functional modules which inter-communicate via precisely defined interfaces.

Hardware logic is primarily a differentiation of the data processing


circuitry from other more generalized circuitry.

2.1.1 NODE MCU (ESP8266) :-

This ESP8266 development board really looks like an Arduino Nano. Speaking of Arduino,
another advantage of this board is that you can connect it directly to your PC or Mac.

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

Node MCU was created shortly after the ESP8266 came out. On December 30,
2013, Espressif Systems[6] began production of the ESP8266. The ESP8266 is a Wi-Fi SoC
integrated with a Tensilica Xtensa LX106 core, widely used in IoT applications (see related
projects). Node MCU started on 13 Oct 2014, when Hong committed the first file of node mcu-
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

15
SoC platform, and committed to Node MCU project, then Node MCU 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 Node MCU project, enabling Node MCU to easily
drive LCD, Screen, OLED, even VGA displays.

In summer 2015 the creators abandoned the firmware project and a group of independent
contributors took over. By summer 2016 the Node MCU 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.

Pins
Node MCU provides access to the GPIO (General Purpose Input/Output) and a pin mapping
table is part of the API documentation

I/O index ESP8266 pin

0 [*] GPIO16

1 GPIO5

2 GPIO4

3 GPIO0

4 GPIO2

5 GPIO14

6 GPIO12

7 GPIO13

8 GPIO15

9 GPIO3

10 GPIO1

11 GPIO9
16
12 GPIO10
[*] D0 (GPIO16) can only be used for GPIO read/write. It does not
support open-drain/interrupt/PWM/I²C or 1-Wire.

Fig 2.1.1 : Node MCU [ESP8266]

2.1.2 Ultra-compact power module HLK-PM01 :-

Product features
1. Meet UL, CE requirements,
2. Ultra-thin, ultra-small
3. All voltage input (AC: 90 ~ 264V)
4. Low ripple and low noise
5. Output overload and short circuit protection
6. High efficiency, high power density
7. The product is designed to meet the requirements of EMC and Safety Test
8. Low power consumption, environmental protection, no-load loss <0.1W
9. 100% load aging and testing
10. 1 year warranty period

17
Figure 2.2.2: Hi link PM-01

18
2.1.3 Transistor BC547 :-

BC547 is an NPN bi-polar junction transistor. A transistor, stands for transfer of


resistance, is commonly used to amplify current. A small current at its base controls a larger
current at collector & emitter terminals.

BC547 is mainly used for amplification and switching purposes. It has a maximum
current gain of 800. Its equivalent transistors are BC548 and BC549.

The transistor terminals require a fixed DC voltage to operate in the desired region
of its characteristic curves. This is known as the biasing. For amplification applications, the
transistor is biased such that it is partly on for all input conditions. The input signal at base is
amplified and taken at the emitter. BC547 is used in common emitter configuration for
amplifiers. The voltage divider is the commonly used biasing mode. For switching
applications, transistor is biased so that it remains fully on if there is a signal at its base. In the
absence of base signal, it gets completely off.

Fig2.1.3 -Transistor BC547

Pin Diagram :-

Figure: Pin Diagram BC547

19
2.1.4 Resistor :-

A resistor is a passive two-terminal electrical component that implements electrical


resistance as a circuit element. In electronic circuits, resistors are used to reduce current flow,
adjust signal levels, to divide voltages, bias active elements, and terminate transmission lines,
among other uses. High-power resistors that can dissipate many watts of electrical power as
heat, may be used as part of motor controls, in power distribution systems, or as test loads
for generators. Fixed resistors have resistances that only change slightly with temperature,
time or operating voltage. Variable resistors can be used to adjust circuit elements (such as a
volume control or a lamp dimmer), or as sensing devices for heat, light, humidity, force, or
chemical activity.

Resistors are common elements of electrical networks and electronic circuits and are
ubiquitous in electronic equipment. Practical resistors as discrete components can be
composed of various compounds and forms. Resistors are also implemented
within integrated circuits.

The electrical function of a resistor is specified by its resistance: common commercial


resistors are manufactured over a range of more than nine orders of magnitude. The nominal
value of the resistance falls within the manufacturing tolerance, indicated on the component.

We need 150 ohm and 330 ohm resisters.

Figure 2.1.4 : Resisters

20
2.1.5 Diode 1N4007:-

A diode is a device which allows current flow through only one direction. That
is the current should always flow from the Anode to cathode. The cathode terminal can be
identified by using a grey bar as shown in the picture above.

For 1N4007 Diode, the maximum current carrying capacity is 1A it with stand
peaks up to 30A. Hence we can use this in circuits that are designed for less than 1A. The
reverse current is 5uA which is negligible. The power dissipation of this diode is 3W

Features :-

 Average forward current is 1A


 Non-repetitive Peak current is 30A
 Reverse current is 5uA.
 Peak repetitive Reverse voltage is 1000V
 Power dissipation 3W
 Available in DO-41 Package

Fig 2.1.5:- Diode 1N4007

Applications of Diode :-

 Can be used to prevent reverse polarity problem


 Half Wave and Full Wave rectifiers
 Used as a protection device
 Current flow regulators

21
2.1.6 Light-emitting diode :-

A light-emitting diode (LED) is a semiconductor light source that emits light


when current flows through it. Electrons in the semiconductor recombine with electron
holes, releasing energy in the form of photons. This effect is called electroluminescence. The
color of the light (corresponding to the energy of the photons) is determined by the energy
required for electrons to cross the band gap the semiconductor. White light is obtained by
using multiple semiconductors or a layer of light-emitting phosphor on the semiconductor
device.

Appearing as practical electronic components in 1962, the earliest LEDs emitted low-
intensity infrared light. Infrared LEDs are used in remote-control circuits, such as those used
with a wide variety of consumer electronics. The first visible-light LEDs were of low intensity
and limited to red. Modern LEDs are available across the visible, ultraviolet,
and infrared wavelengths, with high light output.

Early LEDs were often used as indicator lamps, replacing small incandescent bulbs,
and in seven-segment displays. Recent developments have produced white-light LEDs
suitable for room lighting. LEDs have led to new displays and sensors, while their high
switching rates are useful in advanced communications technology.

LEDs have many advantages over incandescent light sources, including lower energy
consumption, longer lifetime, improved physical robustness, smaller size, and faster
switching. Light-emitting diodes are used in applications as diverse as aviation
lighting, automotive headlamps, advertising, general lighting, traffic signals, camera flashes,
lighted wallpaper and medical devices.

Unlike a laser, the color of light emitted from an LED is neither coherent nor
monochromatic, but the spectrum is narrow with respect to human vision, and functionally
monochromatic.

Fig2.1.6 :- LED

22
2.1.7 Relay :-
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 separate low-power
signal, 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".

Magnetic latching relays require one pulse of coil power to move their contacts in
one direction, and another, redirected pulse to move them back. Repeated pulses from the
same input have no effect. Magnetic latching relays are useful in applications where
interrupted power should not be able to transition the contacts.

Magnetic latching relays can have either single or dual coils. On a single coil device,
the relay will operate in one direction when power is applied with one polarity, and will reset
when the polarity is reversed. On a dual coil device, when polarized voltage is applied to the
reset coil the contacts will transition.

Fig2.1.6 :- Internal structure of Relay

23
2.2 Software :-
2.2.1 Adafruit :- Adafruit IO is a system that makes data useful. Our focus
is on ease of use, and allowing simple data connections with little programming required.
IO includes client libraries that wrap our REST and MQTT APIs. IO is built on Ruby on Rails,
and Node.js.
Adafruit IO is currently in beta. If you would like to join the beta, head over
to io.adafruit.com to sign up.

Adafruit.io is a cloud service - that just means we run it for you and you don't have
to manage it. You can connect to it over the Internet. It's meant primarily for storing
and then retrieving data but it can do a lot more than just that!

What can Adafruit IO do for me?

 Display your data in real-time, online


 Make your project internet-connected: Control motors, read sensor data, and
more!
 Connect projects to web services like Twitter, RSS feeds, weather services, etc.
 Connect your project to other internet-enabled devices
 The best part? All of the above is do-able for free with Adafruit IO.

2.2.2 IFTTT :-

If This Then That, also known as IFTTT is a free web-based service to create chains of
simple conditional statements, called applets.

An applet is triggered by changes that occur within other web services such
as Gmail, Facebook, Telegram, Instagram, or Pinterest.

For example, an applet may send an e-mail message if the user tweets using a hashtag, or
copy a photo on Facebook to a user's archive if someone tags a user in a photo.

In addition to the web-based application, the service runs on iOS and Android. In February
2015, IFTTT renamed its original application to IF, and released a new suite of apps called Do,
which lets users create shortcut applications and actions. As of 2015, IFTTT users created

24
about 20 million recipes each day. All of the functionalities of the Do suite of apps have since
been integrated into a redesigned IFTTT app.

IFTTT is an initialize for "If This Then That."

IFTTT employs the following concepts:

 Services (formerly known as channels) are the basic building blocks of IFTTT. They mainly
describe a series of data from a certain web service such as YouTube or eBay. Services can
also describe actions controlled with certain APIs, like SMS. Sometimes, they can
represent information in terms of weather or stocks. Each service has a particular set of
triggers and actions.
 Triggers are the "this" part of an applet. They are the items that trigger the action. For
example, from an RSS feed, you can receive a notification based on a keyword or phrase.
 Actions are the "that" part of an applet. They are the output that results from the input
of the trigger.
 Applets (formerly known as recipes) are the predicates made from Triggers and Actions.
For example, if you like a picture on Instagram (trigger), an IFTTT app can send the photo
to your Dropbox account (action).
 Ingredients are basic data available from a trigger—from the email trigger, for example;
subject, body, attachment, received date, and sender’s address.

2.2.3 Google Assistant:-

Google Assistant is an artificial intelligence-powered virtual assistant developed


by Google that is primarily available on mobile and smart home devices. Unlike the
company's previous virtual assistant, Google Now, Google Assistant can engage in two-way
conversations.

Assistant initially debuted in May 2016 as part of Google's messaging app Allo, and its
voice-activated speaker Google Home. After a period of exclusivity on the Pixel and Pixel
XL smartphones, it began to be deployed on other Android devices in February 2017,
including third-party smartphones and Android Wear (now Wear OS), and was released as a
standalone app on the iOS operating system in May 2017. Alongside the announcement of
a software development kit in April 2017, the Assistant has been, and is being, further

25
extended to support a large variety of devices, including cars and third party smart home
appliances. The functionality of the Assistant can also be enhanced by third-party developers.

In 2017, Google Assistant was installed on more than 400 million devices.

Users primarily interact with Google Assistant through natural voice, though keyboard
input is also supported. In the same nature and manner as Google Now, the Assistant is able
to search the Internet, schedule events and alarms, adjust hardware settings on the user's
device, and show information from the user's Google account. Google has also announced
that the Assistant will be able to identify objects and gather visual information through the
device's camera, and support purchasing products and sending money, as well as identifying
songs.

At CES 2018, the first Assistant-powered smart displays (smart speakers with video screens)
were announced, with the first one being released in July 2018.

2.2.4 Arduino IDE :-

Arduino is an open-source 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 both physically and digitally. Its products are licensed under
the GNU Lesser General Public License (LGPL) or the GNU General Public
License(GPL),[1] 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 or breadboards (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.

26
The Arduino project started in 2003 as a program for students at the Interaction
Design Institute Ivrea in Ivrea, Italy,[2] 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.

The name Arduino comes from a bar in Ivrea, Italy, where some of the founders of
the project used to meet. The bar was named after Arduino of Ivrea, who was the margrave of
the March of Ivrea and King of Italy from 1002 to 1014.

27
CHAPTER 3
Layout
3.1 Circuit Layout:-
A schematic, or schematic diagram, is a representation of the
elements of a system using abstract, graphic symbols rather than realistic pictures. A
schematic usually omits all details that are not relevant to the key information the schematic
is intended to convey, and may include oversimplified elements in order to make this essential
meaning easier to grasp.
In an electronic circuit diagram, the layout of the symbols may not
look anything like the circuit as it appears in the physical world: instead of representing the
way the circuit looks, the schematic aims to capture, on a more general level, the way
it works.

Fig3.1 - Circuit layout

3.2 Etching Process :-


Etching is traditionally the process of using strong acid or mordant to cut
into the unprotected parts of a metal surface to create a design in intaglio (incised) in the
metal.[14] In modern manufacturing, other chemicals may be used on other types of material.
As a method of printmaking, it is, along with engraving, the most important technique for old
28
master prints, and remains in wide use today. In a number of modern variants such
as microfabrication etching and photochemical milling it is a crucial technique in much
modern technology, including circuit boards.

In traditional pure etching, a metal (usually copper, zinc or steel) plate is covered
with a waxy ground which is resistant to acid. The artist then scratches off the ground with a
pointed etching needle where he or she wants a line to appear in the finished piece, so
exposing the bare metal. The échoppe, a tool with a slanted oval section, is also used for
"swelling" lines. The plate is then dipped in a bath of acid, technically called
the mordant (French for "biting") or etchant, or has acid washed over it. The acid "bites" into
the metal (it dissolves part of the metal) where it is exposed, leaving behind lines sunk into
the plate. The remaining ground is then cleaned off the plate. The plate is inked all over, and
then the ink wiped off the surface, leaving only the ink in the etched lines.

3.3 Circuit Assemble :-

Complete Circuit Assemble :-

29
CHAPTER 4
PROGRAM
4.1 Programming :-
#include <ESP8266WiFi.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"

#define Relay1 D6
#define Relay2 D5
#define Relay3 D2
#define Relay4 D1

#define WLAN_SSID "mr wasule" // Your SSID


#define WLAN_PASS "akki@007" // Your password

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

#define AIO_SERVER "io.adafruit.com"


#define AIO_SERVERPORT 1883 // use 8883 for SSL
#define AIO_USERNAME "Mr Wasule" // Replace it with your username
#define AIO_KEY "50a98bb44f6b48b69e645badadf8fb577894" // 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_ Mr Wasule
"/feeds/Relay1"); // FeedName
Adafruit_MQTT_Subscribe Light2 = Adafruit_MQTT_Subscribe(&mqtt, AIO_ Mr Wasule
"/feeds/Relay2");
Adafruit_MQTT_Subscribe Light3 = Adafruit_MQTT_Subscribe(&mqtt, AIO_ Mr Wasule
"/feeds/Relay3");
Adafruit_MQTT_Subscribe Light4 = Adafruit_MQTT_Subscribe(&mqtt, AIO_ Mr Wasule
"/feeds/Relay4");

30
void MQTT_connect();

void setup() {
Serial.begin(115200);

pinMode(Relay1, OUTPUT);
pinMode(Relay2, OUTPUT);
pinMode(Relay3, OUTPUT);
pinMode(Relay4, 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);
}

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);

31
}
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);

}
}

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!");

32
4.2 How to program :-

Step 1: Connect your Node MCU to your computer

You need a USB micro B cable to connect the board. Once you plugged it in, a blue LED will
start flashing. If your computer is not able to detect the Node MCU board, you may need to
download the driver on this page.

Step 2: Open Arduino IDE

You need to have at least Arduino IDE version 1.6.4 to proceed with this.

Go to File > Preferences. In the "Additional Boards Manager URLs" field, type (or copy-
paste) http://arduino.esp8266.com/stable/package_esp8266com_index.json. Don't forget to
click OK!

Then go to Tools > Board > Board Manager. Type "esp8266" in the search field. The entry
"esp8266 by ESP8266 Community" should appear. Click that entry and look for the install
button on the lower right

33
Step 3: Write and dump program in Node MCU

34
CHAPTER 5
WORKING
5.1 Circuit Working :-

Fig 5.1 :- Block dig of working

5.2 Flow Chart :-

Fig5.2 :- Flowchart of software working

35
CHAPTER 6
Conclusion & Future work

Conclusion :-
The approach discussed in the project was successful Home Automation
using Google Assistant design was successfully implemented. This system is highly reliable
and efficient for the aged people and differently abled person on a wheel chair who cannot
reach the switch for the switching ON/OFF the device and are dependent on others.

Future work :-
The future scope for project can be huge. There are many
factors to improve on to make & more powerful, intelligent, scalable, and to become better
overall for home automation. For example, controlling the speed of the fan, more number of
devices can be integrated, like a coffee machine, air conditioner etc. To make the system
respond more faster own private Blink server can be made. Well, no system is ever perfect. It
always has a scope for improvement. One just needs to put on a thinking cap and try and
make the system more better.

36
CHAPTER 7
REFERENCES

 IFTTT:

https://ifttt.com/discover https://www.pocketlint.com/SmartHome/SmarHomenew

 Node MCU:

https://nodemcu.readthedocs.io/en/master

https://iotbytes.wordpress.com/nodemcupinout

 Google Assistant:

https://assistant.google.com/intl/en_in/

 IoT:

https://internetofthingsagenda.techtarget.com/definition /IoT-device

 Arduino IDE:

https://www.arduino.cc/en/Guide/Environment

 Wikipedia:

https://www.wikipedia.org/

37
38

Вам также может понравиться