You are on page 1of 31

ABSTRACT

With advancement of automation technology, life is getting simpler and user easier in all
aspects. In today’s world automatic systems are being preferred over manual system. With
the rapid increase in the number of users of internet a part and of life, and IOT is the latest
and emerging internet technology. Internet of things is a growing network of everyday object-
form industrial machine to consumer goods that can share activities. Wireless Home
Automation system(WHAS) using IOT is a system that uses computer or mobile devices to
control basic home functions and features automatically through internet from anywhere
around the room, an automated home is sometimes called a smart home. It is meant to save
the electric power and human energy. The home automation system differs from other system
by allowing the user to operate the system from anywhere around the room through internet
connection.

5
TABLE OF CONTENTS
S.NO CONTENTS PAGE NO
1. INTRODUCTION
SYSTEM ANALYSIS
2.1 Problem Definition
2.2 Existing System
2. 2.3 Proposed System
2.4 System Requirements
2.4.1 Hardware Requirements
2.4.2 Software Requirements
SYSTEM DESIGN
3.1 Architectural Design
3. 3.2 GUI Design
4. PROJECT DESCRIPTION
SYSTEM DEVELOPMENT
5. 5.1 Language/Tool
5.2 Pseudo Code
SYSTEM TESTING AND VALIDATIONS
6. 6.1 Testing
7. USER MANUAL
8. SYSTEM IMPLEMENTATION
9. CONCLUSION
10. FUTURE ENHANCEMENT
11. BIBLIOGRAPHY
APPENDIX A– SAMPLE CODING
APPENDIX B– SAMPLE OUTPUT

6
INTRODUCTION

IoT is a network in which all physical objects are connected to the internet through
network devices or routers and exchange data. IoT allows objects to be controlled remotely
across existing network infrastructure. IoT is a very good and intelligent technique which
reduces human effort as well as easy access to physical devices. This technique also has
autonomous control feature by which any device can control without any human interaction.

7
1.2 KEY CHARACTERSTIC OF IOT

Intelligence

 In spite of all the popularity of smart technologies, intelligence in IoT is only concerned as
means of interaction between devices, while user and device interaction is achieved by
standard input methods and graphical user interface.

Connectivity

Connectivity empowers Internet of Things by bringing together everyday objects. It enables


network accessibility and compatibility in the things. With this connectivity, new market
opportunities for Internet of things can be created by the networking of smart things and
applications.

Dynamic nature

The primary activity of Internet of Things is to collect data from its environment, this is
achieved with the dynamic changes that take place around the devices. state of the devices
change dynamically, example sleeping and waking up, connected and/or disconnected as well
as the context of devices including temperature, location and speed.

Enormous scale

The management of data generated from these devices and their interpretation for
application purposes becomes more critical. Gartner (2015) confirms the enormous scale of
IoT in the estimated report where it stated that 5.5 million new things will get connected
every day and 6.4 billion connected things will be in use worldwide in 2016.

Sensing

IoT wouldn’t be possible without sensors which will detect or measure any changes in the
environment to generate data that can report on their status or even interact with the
environment. The sensing information is simply the analogue input from the physical world,
but it can provide the rich understanding of our complex world.

 Heterogeneity

8
Devices in IoT are based on different hardware platforms and networks and can interact
with other devices or service platforms through different networks. The key design
requirements for heterogeneous things and their environments in IoT are scalabilities,
modularity, extensibility and interoperability.

1.3 WORKING OF IOT

Senor/Devices

Sensors or devices collect data from their environment. This could be as simple as a
temperature reading or as complex as a full video feed.

Connectivity

It defines in Choosing which connectivity option is best comes down to the specific IoT
application, but they all accomplish the same task: getting data to the cloud.

Data processing

Once the data gets to the cloud, software performs some kind of processing on it. This
could be very simple, such as checking that the temperature reading is within an acceptable
range.

User interface

a user might have an interface that allows them to proactively check in on the system. For
example, a user might want to check the video feeds in their house via a phone app or a web
browser.

1.4 IOT BASED HOME AUTOMATION USING ESP8266

In this system iot based home automation along with the google assistant is a real time
monitoring system, in which the google assistant is an AI based voice command service.
Using voice, we can interact with google assistant it can search for the voice command that
we provide and recognized those commands and provides the result based on the voice
command that we give as an input to the google assistant. This service available on smart
phone and google home devices.

9
SYSTEM ANALYSIS

2.1 PROBLEM DISCRIPTION

It gets virtually impossible to keep track of appliances that are running and also to monitor
their performances. A simple home automation system was designed and developed using
GOOGLE ASSISTANT that controls electrical devices at home from a remote location by a
simple android smart phone.

2.2 EXISTING SYSTEM

Many existing, well established home automation systems are based on wired
communication.IOT is a system that uses computers or mobile devices to control basic home
function and features automatically through internet .Home automation or Smart Homes can
be described as introduction of technology within the home environment to provide
convenience, comfort, security and energy efficiency to its occupants. Remote environment
represents authorized users who can access the system on their smart phone applications
using the Internet via Wi-Fi, the importance of the home network has increasingly
emphasized in various domains. The most available home automation systems use different
wireless communications standard to exchange data and signaling between their components,
like Bluetooth, Zigbee, Wi-Fi and finally the Global System for Mobile Communication
(GSM).

2.3 PROPOSED SYSTEM:

The core of the proposed smart home automation system consists of the following hardware
comonents: AC Power supply, Arduino UNO, Node MCU, relay driver. The Arduino UNO
board which is flexible, inexpensive, offers a variety of digital and analog inputs, serial
interface and digital and PWM outputs. The Google Assistant is used to recognize the voice
commands and operates according to the command given. It can process the random voice
commands so it responds to any of the voice.

10
2.3.1 ARCHITECTURE

Fig 2.3.1 Proposed System Architecture

2.4 SYSTEM REQUIREMENT

2.4.1 HARDWARE REQUIREMENT

Arduino UNO
Node MCU(ESP2866)
Relay module

11
Connecting wires
AC Power supply

2.4.2 SOFTWARE REQUIREMENT

Operating system : windows 7

IDE : arduino IDE

SYSTEM DESIGN

System design is the process of defining the architecture, modules, interfaces,


and data for a system to satisfy specified requirements.

3.1 ARCHITECTURAL DESIGN

Architectural design is the high-level structure. It is an early stage of the


system design process. It represents the link between specification and design
processes and carried out in parallel with some specification activities.

ACTIVITY DIAGRAM

12
MQTT
IFTT
IO.adafriut
T
.com
Mobile
Node MCU Google
ESP8266 assistant
Power
supply
Arduin
Relay
o UNO
driver
R3

AC
Power
supply

WORKFLOW DIAGRAM

13
START

Initialize system peripheral

Google Assistant active on hearing,


OKAY GOOGLE

Does the
command
match with
the
command
set in the
IFTTT?

Load ON/OFF

RETURN

3.2 GUI(graphical user interface) DESIGN

14
PROJECT DESCRIPTION

15
The home automation system with google assistant will make use of the voice command
that we provide and based on those command its produced the result.

1. Google assistant

2. Adafruit io

1. Google assistant

This will make use of the user defined command and provides as the result based on those
command such as turning on the light, turning off the light.

2. Adafruit io

Adafruit it’s a dashboard which is used to connect the relay switches in the node
MCU(esp8266).so, the relay mainly use to control the high power circuit using a low power
signal

16
SYSTEM DEVELOPMENT

5.1 LANGUAGE AND TOOLS

5.1.1 ARDUINO IDE

It is a open source software that makes easy to write code and upload it to the arduino
board. The environment in written in java based on processing and other open source
software. This software used with any arduino board. The Arduino integrated development
environment is a cross-platform application that is written in the programming language Java.
It is used to write and upload programs to Arduino compatible boards, but also, with the help
of 3rd party cores, other vendor development boards.

5.1.2 POWER SUPPLY

Connecting the first pin of the regulator to ground. Place a 10micro-Farad capacitor
between pin2(Vout) and ground.watch the polarity.place a 10micro-Farad capacitor pin 3(V in)
and ground.connect pin 2 to the 3.3v or Vcc of the ESP8266.connect pin 3 to a 5v power
source, a USB port.

17
5.2PSEUDO CODE

1. Click on the Start Menu, and open up the Control Panel.

2. While in the Control Panel, navigate to System and Security. Next, click on System.

3. Once the System window is up, open the Device Manager.

4. Look under Ports (COM & LPT). You should see an open port named "Arduino UNO

(COMxx)". If there is no COM & LPT section, look under "Other Devices" for "Unknown

Device".

5. Right click on the "Arduino UNO (COmxx)" if not "Unknown Devices" port and choose the

"Update Driver Software" option.

6. Next, choose the "Browse my computer for Driver software" option and click on let me pick

the file(ref:pic 6)

7. Now click Have a Disk .

8. Finally, navigate to and select the driver file named "arduino.inf", located in the "Drivers"

folder of the Arduino Software download (not the "FTDI USB Drivers" sub-directory). If you

are using an old version of the IDE (1.0.3 or older), choose the Uno driver file named

"Arduino UNO.inf"

9. Windows will finish up the driver installation from there.

18
SYSTEM TESTING

6.1 TESTING

Testing is the process of executing a program or system with the intent of


finding errors. Or, it involves any activity aimed at evaluating an attribute or
capability of a program or system and determining that it meets its required
results. Software is not unlike other physical processes where inputs are received, and
outputs are produced. Where software differs is in the way it fails. Most physical
systems fail in a fixed (and reasonably small) set of ways. By contrast, software can
fail in many bizarre ways. Detecting all the different failure modes for software is
generally infeasible.
Testing is one of the most important stages in software development which can
prove whether the implementation and the requirements are in fidelity with each other.
Testing can also confirm if the software specifications are complete and consistent.
One of the main goals of testing is to have a minimum number of test cases that will
find most implementation errors. The software/system that is been tested out here is
known as OBSE (Objective Business Specification Environment). This is a process
wherein the queries submitted online are evaluated by a group of experts.
SYSTEM TESTING

The modules are integrated and tested with their requirements on the basis. System
testing is simply testing the system as a whole, it gets all the integrated modules of the
various components from the integration testing phase and combines all the different parts
into a system which is then tested. Testing is then done on the system as all the parts are now
integrated into one system the testing phase will now have to be done on the system to check
and remove any errors or bugs.

INTEGRATION TESTING:

Integration testing in the software testing model comes before system testing and after
the unit testing has been done. Integration testing in the software testing model comes before
system testing and after the unit testing has been done. The way that integration testing
works is by, getting the individual modules that have been through the unit testing phase and
integrating each module into a group. The integration testing phase will make sure when the

19
modules are being integrated together that any problems, for example errors or bugs, caused
due to the integration of the modules are eliminated. Integration testing does not deal with the
integration of the whole system but deals with the integration of a process in the system.
Integration Test Cases:

Test cases is created to make sure that the output, of the integrated modules are
producing the expected output and is working exactly how it is supposed to work. This is
simply a way to spot any errors or bugs that might have been made in the integration phase.
The tester will then work through the program and document all the data using the test case
that was created, the test case will test all inputs and outputs in the integrated modules.
If you are dealing with a large application or program then there may be various test cases
that might need to be created to test separate sections of the program. The various test cases
are normally gathered together and referred to as test suites, which is a set of test cases.

UNIT TESTING

In computer programming, unit testing is a software testing method by which


individual units of source code, sets of one or more computer program modules together with
associated control data, usage procedures, and operating procedures are tested to determine if
they are fit for use. In procedural programming, a unit could be an entire module, but it is
more commonly an individual function or procedure. In object-oriented programming, a unit
is often an entire interface, such as a class, but could be an individual method. Unit tests are
short code fragments created by programmers or occasionally by white box testers during the
development process. Ideally, each test case is independent from the others. Substitutes such
as method stubs, mock objects, fakes, and test harnesses can be used to assist testing a
module in isolation. Unit tests are typically written and run by software developers to ensure
that code meets its design and behaves as intended.

ACCEPTANCE TESTING:
System testing must also verify that file sizes are adequate, and their indexes
have been built properly. Sorting and rendering procedures assumed to be present in
lower level modules must be tested at the systems level to see that they in fact exist
and achieve the results modules expect.

20
USER MANUAL

Adafruit io

Google assistant

21
Aurduino IDE

22
SYSTEM IMPLEMENTATION

Implementation is the carrying out, execution, or practice of a plan, a method,


or any design for doing something. As such, implementation is the action that must
follow any preliminary thinking for something to happen. In an information
technology context, implementation encompasses all the processes involved in getting
new software or hardware operating properly in its environment, including
installation, configuration, running, testing, and making necessary changes.

 This system is implemented by using aurduino ide.


 it is a open source software which makes it easy to write code and upload it
to the board.

23
ARDUINO IDE INSTALLATION

24
CONCLUSION

The project has proposed the idea of smart homes that can support a lot of home
automation systems. A smart home contains a connection between wireless communication,
sensors, monitoring and tracking. Smart homes are a huge system that includes multiple
technologies and applications that can be used to provide security and control of the home
easily.

25
FUTURE ENHANCEMENT

There are a lot of other sensors that can be used to increase the security and control of the
home like pressure sensor that can be put outside the home to detect that someone will enter
the home. Changing the way of the automated notifications by using the GSM module to
make this system more professional.

26
BIBLIOGRAPHY

REFERNCES

[1] IFTTT: https://ifttt.com/discover

https://www.pocketlint.com/SmartHome/SmarHomenews

[2] https://www.pocketlint.com/SmartHome/SmarHomenews

[3] NodeMCU: https://nodemcu.readthedocs.io/en/master


https://iotbytes.wordpress.com/nodemcupinout/

[4] Google Assistant: https://assistant.google.com/intl/en_in/


https://www.pocketlint.com/Apps/Appsnews/Googleapp news

[5] IoT: https://internetofthingsagenda.techtarget.com/definition /IoT-device

[6] Adafruit: https://io.adafruit.com/suryajustin/dashboards/home

[8] Application/JSON: https://www.json.org/

[9] Arduino IDE: https://www.arduino.cc/en/Guide/Environment

[10] Wkipedia: https://www.wikipedia.org/

27
APPENDIX A-SAMPLE CODING

#include <ESP8266WiFi.h>

#include "Adafruit_MQTT.h"

#include "Adafruit_MQTT_Client.h"

#define Relay1 D3

#define Relay2 D4

#define Relay3 D6

#define Relay4 D7

#define WLAN_SSID "Redmi" // Your SSID

#define WLAN_PASS "suryajustin" // Your password

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

#define AIO_SERVER "io.adafruit.com"

#define AIO_SERVERPORT 1883 // use 8883 for SSL

#define AIO_USERNAME "suryajustin" // Replace it with your username

28
#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_USERNAME"/feeds/Relay1"); // FeedName

Adafruit_MQTT_Subscribe Light2 = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME


"/feeds/Relay2");

29
Adafruit_MQTT_Subscribe Light3 = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME
"/feeds/Relay3");

Adafruit_MQTT_Subscribe Light4 = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME


"/feeds/Relay4");

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

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

31
int Light1_State = atoi((char *)Light1.lastread);

digitalWrite(Relay1, Light1_State);

if (subscription == &Light2) {

Serial.print(F("Got: "));

Serial.println((char *)Light2.lastread);

int Light2_State = atoi((char *)Light2.lastread);

digitalWrite(Relay2, Light2_State);

if (subscription == &Light3) {

Serial.print(F("Got: "));

Serial.println((char *)Light3.lastread);

int Light3_State = atoi((char *)Light3.lastread);

digitalWrite(Relay3, Light3_State);

if (subscription == &Light4) {

Serial.print(F("Got: "));

Serial.println((char *)Light4.lastread);

int Light4_State = atoi((char *)Light4.lastread);

digitalWrite(Relay4, Light4_State);

32
}

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

33
}

Serial.println("MQTT Connected!");

APPENDIX B-SAMPLE OUTPUT

Google assistant

Adafruit IO

34
35

You might also like