B6 IOT Based Home Automation Systems Using Google Assistance
B6 IOT Based Home Automation Systems Using Google Assistance
ASSISTANCE
ABSTRACT
INTRODUCTION
As the computer science engineering students of Presidency University this project gives us a
chance to practice all the knowledge and skills which we already gain along the academic session
in solving problems through a project in order to be an efficient and a good engineer. “Home
automation” refers to the automatic and electronic control of household features, activities, and
appliances. The utilities and features of our home can be easily controlled via Internet. There are
three main elements of a home automation system: sensors, controllers, and actuators. Having day
to day developing technology is a proud moment to the whole world. The foremost aim of the
technology is to increase the efficiency and to decrease the effort. In this trending world, Internet
of Things is being given extreme importance. In that, Automation, leads to have less effort and
much efficiency. By using IoT, we are successful in controlling the appliances in various areas, in
which one of them is to control the home automation by using Node Microcontroller. We can also
use other boards like raspberry pi, beagle bone etc., In the present- day technology, the whole
work is done through communication so the effective way of communication can be done through
voice. Even though the technology is developing in our day to day © 2021 JETIR June 2021,
Volume 8, Issue 6 www.jetir.org (ISSN-2349-5162) JETIR2106678 Journal of Emerging
Technologies and Innovative Research (JETIR) www.jetir.org e807 life, there is no help coming
into existence for the people who are physically not good on the basis of technology. As the
speech enabled, home automation system deploys the use of voice to control the devices. It mainly
targets the physically disabled and elderly persons. The home automation will not work if the
speech recognition is poor. The speech given by the user will be given as input to the Microphone.
Microphone recognizes the speech given by the person and sends it to the recognizing module. It
searches for the nearest word even if there are any disturbances in it. If the command (ON/OFF) is
given, the action is done. Similarly, the line following robot functions with respect to the speech
commands given to it. The line following robot moves forward and backward with the help of
sensors and a motor driver board. Home is the place where one desires to be rest 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 favourite 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 cosier 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 is
blessed with their 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.
LITERATURE SURVEY:
Manish Prakash Gupta (2018) have proposed “Home automation using voice via Google assistant.
The spoken commands from google assistant sends message to micro-controller this micro-
controller pass the message to relay which will switch On and Off the appliances. Aayush Agarwal,
Anshul Sharma, Asim Saket Samad and S Babeetha (2018) “UJALA- Home Automation System
Using Google Assistant” This project presents a design and prototype of Home Automation system
that will use ESP8266 Wi-Fi module as a network provider in connecting with other appliances.
Further we will connect the specific home to our database and it can be accessed from anywhere
through a specific IP address or website. Also, an app would be developed which will allow the user
to control their devices using the Google Assistant. Md Sarwar Kamal in (2017)“Efficient low cost
supervisory system for Internet of Things enabled smart home.” This paper proposes an efficient
low cost supervisory system for smart home automation that can be managed using IoT. The
proposed system is based on Apriority algorithm and will help to monitor and control all the home
appliances and electronic devices through a supervisory system in a most efficient and reliable
manner. Both the consumers and the suppliers will get the opportunity to manage the power
distribution by monitoring the electricity consumption. Nikhil Singh, Shambhu Shankar Bharti,
Rupal Singh, Dushyant Kumar Singh (2014)“Remotely controlled home automation system”,
Advances in Engineering and Technology Research (ICAETR) This paper describes an
investigation into the potential for remote controlled operation of home automation systems. It
considers problems with their implementation, discusses possible solutions through various network
technologies and indicates how to optimize the use of such systems. The home is an eternal,
heterogeneous, distributed computing environment (Greaves, 2002) which certainly requires a
careful study before developing any suitable Home Automation System (HAS) that will accomplish
its requirements. Nevertheless, the latest attempts at introducing Home Automation Systems in
actual homes for all kinds of users are starting to be successful thanks to the continuous
standardization process that is lowering the prices and making devices more useful and easier to use
for the end user. Even so several important issues are always to be handled strictly before
developing and installing a Home Automation System; factors like security, reliability, usefulness,
robustness and price are critical to determine if the final product will accomplish the expected
requirements. © 2021 JETIR June 2021, Volume 8, Issue 6 www.jetir.org (ISSN-2349-5162)
JETIR2106678 Journal of Emerging Technologies and Innovative Research (JETIR) www.jetir.org
e808 Sean Dieter Tebje Kelly, Nagender Kumar Suryadevara, Subhas Chandra Mukhopadhyay
(2013)“Towards the Implementation of IoT for Environmental Condition Monitoring in Homes” In
this paper, we have reported an effective implementation for Internet of Things used for monitoring
regular domestic conditions by means of low cost ubiquitous sensing system. The description about
the integrated network architecture and the interconnecting mechanisms for the reliable
measurement of parameters by smart sensors and transmission of data via internet is being
presented. The longitudinal learning system was able to provide a self-control mechanism for better
operation of the devices in monitoring stage. The framework of the monitoring system is based on a
combination of pervasive distributed sensing units, information system for data aggregation, and
reasoning and context awareness. Results are encouraging as the reliability of sensing information
transmission through the proposed integrated network architecture is 97%. The prototype was tested
to generate real-time graphical information rather than a test bed scenario. Jawarkar, Ahmed,
Ladhake, and Thakare (2008)“Micro-controller based Remote Monitoring using Mobile through
Spoken Commands” propose remote monitoring through mobile phone involving the use of spoken
commands. The spoken commands are generated and sent in the form of text SMS to the control
system and then the microcontroller on the basis of SMS takes a decision of a particular task.
Potamitis, Georgila, Fakotakis, and Kokkinoss, G. (2003) suggested the use of speech to interact
remotely with the home appliances to perform a particular action on behalf of the user. The
approach is inclined for people with disability to perform real-life operations at home by directing
appliances through speech. Voice separation strategy is selected to take appropriate decision by
speech recognition. Tan, Lee and Soh (2002) proposed the development of an Internet-based system
to allow monitoring of important process variables from a distributed control system (DCS). It
proposes hardware and software design considerations which enable the user to access the process
variables on the DCS, remotely and effectively rent designations. Prof. Era Johri in (2001) have
successfully completed the project on “Remote Controlled Home Automation”.
CHAPTER 2
PROPOSED SYSTEM
PROPOSED SYSTEM:
In this proposed system we are going to implement the home automation by using the IOT which
can we can operate the electric devices by our phone through the blynk app. By this we can easily
know the operate And even we can know the electric devices on/off wherever we are in the world
in project not only used in the houses we can use as required as we can.
BLOCK DIAGRAM:
CHAPTER 03
HARDWARE CONSTRAINTS
HARDWARE CONSTRAINTS
ESP32
ESP32 is a low-cost, low-power Microcontroller with an integrated Wi-Fi and Bluetooth. It is the
successor to the ESP8266 which is also a low-cost Wi-Fi microchip albeit with limited vastly
limited functionality.
It is an integrated antenna and RF balun, power amplifier, low-noise amplifiers, filters, and power
management module. The entire solution takes up the least amount of printed circuit board area.
This board is used with 2.4 GHz dual-mode Wi-Fi and Bluetooth chips by TSMC 40nm low power
technology, power and RF properties best, which is safe, reliable, and scale-able to a variety of
applications.
ESP32 Spec List
ROM: 448 KB, SRAM: 520 KB, Support up to: 16MB flash
Wi-Fi: 802.11b/g/n/e/i
2 × 8-bit DACs
o [D26][D25]
9 × touch sensors Note: Touch sensor 1 is [D0]. However, it’s not available as a pin in this
particular ESP32 development board (version with 30 GPIOs). GPIO 0 is available on the
version with 36 pins.
o [D13][D12][D14][D24][D33][32]
o [D15][D2][D4]
Internal Sensors: This mode allows us to fetch internal sensor data from the ESP32 itself. The
three sensors available are as follows:
Power Micro-USB, 3.3V, 5V, GND Micro-USB: ESP32 can be powered through
USB port
Analog Pins ADC1_0 to ADC1_5 and Used to measure analog voltage in the range of
ADC2_0 to ADC2_9 0-3.3V.
DAC pins DAC1 and DAC2 Used for Digital to analog Conversion
RTC GPIO RTCIO0 to RTCIO17 These 18 GPIO pins can be used to wake up the
pins ESP32 from deep sleep mode.
SRAM 520 KB
Input/output
There are totally 39 digital Pins on the ESP32 out of which 34 can be used as GPIO and the
remaining are input only pins. The device supports 18-channels for 12-bit ADC and 2-channel for
8-bit DAC. It also has 16 channels for PWM signal generation and 10 GPIO pins supports
capacitive touch features. The ESP32 has multiplexing feature, this enables the programmer to
configure any GPIO pin for PWM or other serial communication through program. The ESP32
supports 3 SPI Interface, 3 UART interface, 2 I2C interface, 2 I2S interface and also supports CAN
protocol.
3 UART interface: The ESP32 supports 3 UART interface for TTL communication. This would
require 3 sets of Rx and Tx pins. All the 6 pins are software configurable and hence any GPIO
pin can be programmed to be used for UART.
External Interrupt: Again since the ESP32 supports multiplexing any GPIO pin can be
programmed to be used as an interrupt pin.
GPIO23 (MOSI), GPIO19(MISO), GPIO18(CLK) and GPIO5 (CS): These pins are used for
SPI communication. ESP32 supports two SPI, this is the first set.
GPIO13 (MOSI), GPIO12(MISO), GPIO14(CLK) and GPIO15 (CS): These pins are used
for SPI communication. ESP32 supports two SPI, this is the second set.
GPIO21(SDA), GPIO22(SCL): Used for IIC communication using Wire library.
Reset Pin: The reset pin for ESP32 is the Enable (EN) pin. Making this pin LOW, resets the
microcontroller.
There are total three ways by which you can power your ESP32 board-
Micro USB Jack: Connect the mini USB jack to a phone charger or computer through a cable and
it will draw power required for the board to function
5V Pin: The 5V pin can be supplied with a Regulated 5V, this voltage will again be regulated to
3.3V through the on-board voltage regulator. Remember ESP32 operated with 3.3V only.
3.3V Pin: If you have a regulated 3.3V supply, then you can directly provide this to the 3.3V pin of
the ESP32.
Applications
The ability to display numbers, characters and graphics. This is in contrast to LEDs,
which are limited to numbers and a few characters.
Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the
task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to keep
displaying the data.
LCD CONNECTIONS
Depending on how many lines are used for connection to the microcontroller, there are 8-bit
and 4-bit LCD modes. The appropriate mode is determined at the beginning of the process in a
phase called “initialization”. In the first case, the data are transferred through outputs D0-D7 as it
has been already explained. In case of 4-bit LED mode, for the sake of saving valuable I/O pins of
the microcontroller, there are only 4 higher bits (D4-D7) used for communication, while other may
be left unconnected.
Consequently, each data is sent to LCD in two steps: four higher bits are sent first (that
normally would be sent through lines D4-D7), four lower bits are sent afterwards. With the help of
initialization, LCD will correctly connect and interpret each data received. Besides, with regards to
the fact that data are rarely read from LCD (data mainly are transferred from microcontroller to
LCD) one more I/O pin may be saved by simple connecting R/W pin to the Ground. Such saving
has its price. EvenEven though message displaying will be normally performed, it will not be
possible to read from busy flag since it is not possible to read from display.
AC DEVICES
Alternating current is mainly used in the industry of the transportation and production of electricity.
In fact, almost every household in the world is powered by AC. DC is generally not used for these
purposes due to more power lost to heat compared to AC, higher risks of producing a fire, higher
costs, and issues with converting high voltage and low current to low voltage and high current
using transformers.AC is also the more popular current when it comes to powering electric motors,
a device that converts electric energy into mechanical energy. Some household appliances that we
use that rely on this are, but aren't limited to: refrigerators, dishwashers, garbage disposals, and
toasters.
LED
A light-emitting diode is a two-lead semiconductor light source. It is a p–n junction diode that
emits light when activated. When a suitable voltage is applied to the leads, electrons are able to
recombine with electron holes within the device, releasing energy in the form of photons. This
effect is called electroluminescence, and the color of the light (corresponding to the energy of the
photon) is determined by the energy band gap of the semiconductor.
Motor Pump
A Motor pump is a mechanical device, used to move the liquids/gases from one place to
another by using mechanical action. The working principle of the water pump is, it converts the
motor’s energy from mechanical to fluid flow. These are classified into various types based on the
technique they use for supplying the liquid like direct, gravity and displacement.
A pump operates by using a mechanism like rotary or reciprocating and they consume energy for
performing mechanical work to move the liquid. Pumps use several energy sources for their
operations like manual, wind power, electricity, engines, etc. These are available in many shapes
based on its application like medical to large industries.
GOOGLE ASSISTANT
The Google Assistant is an Artificial Intelligence based Virtual assistant software which
allows its users to control all the apps in their device. It allows the users to control and command
most of the apps in their devices using voice commands. This provides more convenience to the
people as they only have to command the Google assistant thorough voice command. 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 smart phones, it began to be
deployed on other Android devices in February 2017, including third-party smart phones and
Android Wear (now Wear OS), and was released as a standalone app on the iOS operating system
in May 2017.
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.
DC motor
Definition
A DC motor is defined as a class of electrical motors that convert direct current electrical
energy into mechanical energy. From the above definition, we can conclude that any electric motor
that is operated using direct current or DC is called a DC motor. In the next few sections, we will
understand the DC motor construction and how a DC motor converts the supplied DC electrical
energy into mechanical energy.
CHAPTER 04
SOFTWARE CONSTRAINTS
Arduino boards are able to read analog or digital input signals from different sensors and
turn it into an output such as activating a motor, turning LED on/off, connect to the cloud and
many other actions.
You can control your board functions by sending a set of instructions to the
microcontroller on the board via Arduino IDE (referred to as uploading software).
Unlike most previous programmable circuit boards, Arduino does not need an extra piece
of hardware (called a programmer) in order to load a new code onto the board. You can
simply use a USB cable.
Additionally, the Arduino IDE uses a simplified version of C++, making it easier to learn
to program.
Finally, Arduino provides a standard form factor that breaks the functions of the micro-
controller into a more accessible package.
After learning about the main parts of the Arduino UNO board, we are ready to learn how
to set up the Arduino IDE. Once we learn this, we will be ready to upload our program onthe
Arduino board.
ARDUINO DATA TYPES
Data types in C refers to an extensive system used for declaring variables or functions of
different types. The type of a variable determines how much space it occupies in the storage
and how the bit pattern stored is interpreted.
The following table provides all the data types that you will use During Arduino
programming.
Void
The void keyword is used only in function declarations. It indicates that the function is
expected to return no information to the function from which it was called.
Example:
Void Loop ( )
Boolean
A Boolean holds one of two values, true or false. Each Boolean variable occupies one
byte of memory.
Example:
Boolean state= false ; // declaration of variable with type boolean and initialize it
with false.
Boolean state = true ; // declaration of variable with type boolean and initialize it
with false.
Char
A data type that takes up one byte of memory that stores a character value. Character
literals are written in single quotes like this: 'A' and for multiple characters, strings use double
quotes: "ABC".
However, characters are stored as numbers. You can see the specific encoding in the
ASCII chart. This means that it is possible to do arithmetic operations on characters, in
whichthe ASCII value of the character is used. For example, 'A' + 1 has the value 66, since
theASCII value of the capital letter A is 65.
Example:
Char chr_a = ‘a’ ;//declaration of variable with type char and initialize it with
character a.
Char chr_c = 97 ;//declaration of variable with type char and initialize it with
character 97
Unsigned char
Unsigned char is an unsigned data type that occupies one byte of memory. The
unsigned char data type encodes numbers from 0 to 255.
Example:
Unsigned Char chr_y = 121 ; // declaration of variable with type Unsigned char
and initialize it with character y
Byte
A byte stores an 8-bit unsigned number, from 0 to 255.
Example:
int
Integers are the primary data-type for number storage. int stores a 16-bit (2-byte) value.
This yields a range of -32,768 to 32,767 (minimum value of -2^15 and a maximum value of
(2^15) - 1).
The int size varies from board to board. On the Arduino Due, for example, an int stores a
32-bit (4-byte) value. This yields a range of -2,147,483,648 to 2,147,483,647 (minimum value
of -2^31 and a maximum value of (2^31) - 1).
Example:
int counter = 32 ;// declaration of variable with type int and initialize it with 32.
Unsigned int
Unsigned int’s (unsigned integers) are the same as int in the way that they store a 2
byte value. Instead of storing negative numbers, however, they only store positive values,
yielding a useful range of 0 to 65,535 (2^16) - 1). The Due stores a 4 byte (32-bit) value,
ranging from 0 to 4,294,967,295 (2^32 - 1).
Example:
Unsigned int counter= 60 ; // declaration of variable with type unsigned int and
initialize it with 60.
Word
On the Uno and other ATMEGA based boards, a word stores a 16-bit unsigned
number. On the Due and Zero, it stores a 32-bit unsigned number.
Example
word w = 1000 ;//declaration of variable with type word and initialize it with 1000.
Long Long variables are extended size variables for number storage, and store 32 bits
(4 bytes), from 2,147,483,648 to 2,147,483,647.
Example:
Long velocity= 102346 ;//declaration of variable with type Long and initialize it
with 102346
Unsigned long
Unsigned long variables are extended size variables for number storage and store 32
bits (4 bytes). Unlike standard longs, unsigned longs will not store negative numbers, making
their range from 0 to 4,294,967,295 (2^32 - 1).
Example:
Unsigned Long velocity = 101006 ;// declaration of variable with type Unsigned Long
and initialize it with 101006.
Short
A short is a 16-bit data-type. On all Arduinos (ATMega and ARM based), a short
stores a 16-bit (2-byte) value. This yields a range of -32,768 to 32,767 (minimum value of -
2^15 and a maximum value of (2^15) - 1).
Example:
short val= 13 ;//declaration of variable with type short and initialize it with 13
Float
Data type for floating-point number is a number that has a decimal point. Floating-point
numbers are often used to approximate the analog and continuous values because they have
greater resolution than integers.
Example:
float num = 1.352;//declaration of variable with type float and initialize it with
1.352.
Double
On the Uno and other ATMEGA based boards, Double precision floating-point
number occupies four bytes. That is, the double implementation is exactly the same as the
float, with no gain in precision. On the Arduino Due, doubles have 8-byte (64 bit) precision
Example:
double num = 45.352 ;// declaration of variable with type double and initialize it with
45.352.
In this section, we will learn in easy steps, how to set up the Arduino IDE on our
computer and prepare the board to receive the program via USB cable.
Step 1: First you must have your Arduino board (you can choose your favorite board) anda
USB cable.
In case you use Arduino UNO, Arduino Duemilanove, Nano, Arduino Mega2560, or
Diecimila, you will need a standard USB cable (A plug to B plug), the kind youwould connect
to a USB printer as shown in the following image.
You can get different versions of Arduino IDE from the Download page on the
Arduino Official website. You must select your software, which is compatible with your
operating system (Windows, IOS, or Linux). After your file download is complete, unzip the
file.
Step 3: Power up your board.
The Arduino Uno, Mega, Duemilanove and Arduino Nano automatically draw power
from either, the USB connection to the computer or an external power supply. If you are using
an Arduino Diecimila, you have to make sure that the board is configured to draw power from
the USB connection. The power source is selected with a jumper, a
small piece of plastic that fits onto two of the three pins between the USB and power
jacks. Check that it is on the two pins closest to the USB port. Connect the Arduino board to
your computer using the USB cable. The green power LED (labeled PWR) should glow.
After your Arduino IDE software is downloaded, you need to unzip the folder. Inside
the folder, you can find the application icon with an infinity label (application.exe).
Doubleclick the icon to start the IDE.
Step 5: Open your first project.
a new project.
Here, we are selecting just one of the examples with the name Blink. It turns the LED on
and off with some time delay. You can select any other example from the list.
Select the serial device of the Arduino board. Go to Tools ->Serial Port menu. This is
likely to be COM3 or higher (COM1 and COM2 are usually reserved for hardware serial
ports). To find out, you can disconnect your Arduino board and re-open the menu, the entry
that disappears should be of the Arduino board. Reconnect the board and select that serial
port.
Step 8: Upload the program to your board.
Before explaining how we can upload our program to the board, we must demonstrate
the function of each symbol appearing in the Arduino IDE toolbar.
F- Serial monitor used to receive serial data from the board and send the serial
data to the board.
Now, simply click the "Upload" button in the environment. Wait a few seconds; you will see
the RX and TX LEDs on the board, flashing. If the upload is successful, the message "Done
uploading" will appear in the status bar.
Note: If you have an Arduino Mini, NG, or other board, you need to press the reset button
physically on the board, immediately before clicking the upload button on the Arduino
Software.
ARDUINO PROGRAMMING STRUCTURE
In this chapter, we will study in depth, the Arduino program structure and we will
learn more new terminologies used in the Arduino world. The Arduino software is open-
source. The source code for the Java environment is released under the GPL and the C/C++
microcontroller libraries are under the LGPL.
Sketch: The first new terminology is the Arduino program called “sketch”.
Structure
Arduino programs can be divided in three main parts: Structure, Values (variables and
constants), and Functions. In this tutorial, we will learn about the Arduino software
program, step by step, and how we can write the program without any syntax or
compilation error.
Let us start with the Structure. Software structure consist of two main functions:
Setup( ) function
Loop( ) function
Void setup ( )
PURPOSE:
The setup() function is called when a sketch starts. Use it to initialize the variables, pin
modes, start using libraries, etc. The setup function will only run once, after each power up or
reset of the Arduino board.
INPUT
OUTPUT
RETURN
Void Loop ( )
{
PURPOSE:
After creating a setup() function, which initializes and sets the initial values, the loop()
function does precisely what its name suggests, and loops secutively, allowing your
program to change and respond. Use it to actively control the Arduino board.
INPUT
OUTPUT
RETURN