Академический Документы
Профессиональный Документы
Культура Документы
Bachelor of Engineering
In
Electronics and Communication Engineering
Submit ted by
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)
2
SHRI BALAJI INSTITUTE OF TECHNOLOGY &
MANAGEMENT, BETUL
Department of Electronics and Communication Engineering
CERTIFICATE OF APPROVAL
3
SHRI BALAJI INSTITUTE OF TECHNOLOGY &
MANAGEMENT, BETUL
Department of Electronics and Communication Engineering
CANDIDATE DECLARATION
Name of Candidates
AAKASH VASULE
DHIRAJ RATHORE
PANKAJ JHARBADE
VIVEK BHISE
4
ACKNOWLEDGEMENT
1. AAKASH VASULE
2. DHIRAJ RATHORE
3. PANKAJ JHARABADE
4. VIVEK BHISE
Date:
Place: Betul
5
ABSTRACT
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
7
Title Page No.
3.3 Circuit Assemble 29
Chapter-7 Reference 37
8
LIST OF FIGURES
Figure No. Figure Title Page No.
2.1.2 Hi Link PM 01 18
2.1.4 Resistor 21
2.1.6 Relay 23
9
LIST OF PUBLICATION
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
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.
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
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
11
1.1.1 Customer Statement of Requirements(CSR)
Problem Statement
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.
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.
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.
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.
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
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.
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 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.
Pin Diagram :-
19
2.1.4 Resistor :-
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.
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 :-
Applications of Diode :-
21
2.1.6 Light-emitting diode :-
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.
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!
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.
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.
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.
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.
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.
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
// 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);
30
void MQTT_connect();
void setup() {
Serial.begin(115200);
pinMode(Relay1, OUTPUT);
pinMode(Relay2, OUTPUT);
pinMode(Relay3, OUTPUT);
pinMode(Relay4, OUTPUT);
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());
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;
uint8_t retries = 3;
32
4.2 How to program :-
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.
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 :-
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