IOT Based Lab Automation: M.Hamza Shahbaz BEE-FA14-073

You might also like

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

IOT Based Lab Automation

By
M.Hamza Shahbaz
BEE-FA14-073

Supervisor
Eng. Ussama Assad
School of Electrical
Engineering

A thesis submitted in partial fulfillment of the requirements for


the degree of Bachelor of Science in Electrical Engineering
(BEE)

In
School of Electrical Engineering,
The University of Faisalabad (TUF),
Faisalabad, Pakistan.

(April 2018)
Abstract

In this report a low cost flexible and reliable home automation system
with additional security using Arduino microcontroller, with IP
connectivity through local Wi-Fi for accessing and controlling devices
by authorized user remotely using Smart phone application presents.
To demonstrate the effectiveness and feasibility of this system, in this
project we present a home automation system using Arduino UNO
microcontroller and esp8266 as a connectivity module. It helps the
user to control various appliances such as light, fan, and can take
decision based on the feedback of sensors remotely. We have tested
our system through conducted experiment on various environmental
conditions. The primary goal of this project is to plan and give
execution points of interest of IOT for home. By implementing this
system, it is possible to explore a variety of different engineering
challenges, including software programming, PCB design, Wi-Fi,
TCP/IP protocols.

i
Dedication

This thesis is dedicated to:

The sake of Allah, my Creator and my Master,

My great teacher and messenger, Mohammed (May Allah bless and


grant him), who taught us the purpose of life,

The University of Faisalabad; my second magnificent home;

My great parents, who never stop giving of themselves in countless


ways,

My friends who encourage and support me,

All the people in my life who touch my heart,

I dedicate this research.

ii
Certificate of Originality

I hereby declare that this submission is my own work and to the


best of my knowledge it contains no materials previously
published or written by another person, nor material which to a
substantial extent has been accepted for the award of any degree
or diploma at The University of Faisalabad or at any other
educational institute, except where due acknowledgment has
been made in the thesis. Any contribution made to the research
by others, with whom I have worked at The University of
Faisalabad or elsewhere, is explicitly acknowledged in the
thesis.
I also declare that the intellectual content of this thesis is the
product of my own work, except for the assistance from others
in the project’s de- sign and conception or in style, presentation
and linguistics which has been acknowledged.
Author Name: Your Name Goes Here
Signature:

iii
Acknowledgment

I acknowledge with deep sense of gratitude towards the


encouragement in the form of substantial assistance provided each
and every member of my team. Firstly, we would like to thank our
supervisor Eng. Ussama Assad, for her supportive guidance and
feedbacks for completion of the project. Secondly, we would like to
thank our co-supervisor Eng. Hamza, for his support, guidance and
discussion in completion of this project. We are grateful to all other
individuals who helped in completion of this project.

iv
Table of Contents

Chapter 01
1.1 Introduction ................................................................... 1
1.2 Overview ........................................................................ 1
1.3 Existing system ………………………………………………………1

Chapter 02
2.1 Literature survey .......................................................... 2
2.1.1 Review of related literature …………………………..2
2.1.2 Review of foreign studies ………………………………2

Chapter 03 4
3.1 Classifier Training & Validation Strategy ..................... 4
2.1.3 Classifier Training ................................................ 4
2.2 Performance Evaluation ............................................... 4

3 Conclusions 7
3.1 This is the End .............................................................. 7

A Feature Extraction Walking 8

v
List of Figures

3.1 Feature rank by information gain................................... 5

vi
List of Tables

2.1 Data set of activity traces. ............................................ 3


3.1 Detailed Accuracy By Class (Na¨ıve Bayes). ................. 4
3.2 Confusion matrix (Naive Bayes). ................................. 6

vii
Chapter 1

1.1 Introduction

In the present day, home automation is becoming essential for the


purpose of improving our life condition. Home automation offers a
futuristic way of life in which an individual gets to control his entire
house using a smart phone, from turning on lights and fans; it also
offers an efficient use of energy. But to get or acquire such system
installed will cost a lot of money and that is the major reason of why
home automation has not received much demand and attention,
adding to that also the complexity of installing it and configuring it.
Thus it is essential to make it cost effective and easy to configure, if
this is granted to people then they will be willing to acquire it in their
homes, offices and schools. In other words, a system modification for
the home automation is required in order to lower the price of
applying it to houses. Also home automation offers ease of mind and
body to handicapped and/or elders in their houses by just one click to
do what they want as stated above. By implementing this system, it is
possible to explore a variety of different engineering challenges,
including software programming, PCB design, Wi-Fi, TCP/IP
protocols, Web Server logic design, and other aspects. This
automation system provides great insights to the challenges of
software and hardware design.

1
1.2 Overview of the system

A low cost and efficient smart home system is presented in this thesis.
This system has two main modules: the hardware interface module
and the software communication module. At the heart of this system
is the Arduino UNO microcontroller which is also capable of
functioning as a micro web server and the interface for all the
hardware modules. All communication and controls in this system
pass through the microcontroller. The smart home system offers
feature such as environmental monitoring using the temperature,
humidity, gas and smoke sensors. It also offers switching
functionalities to control lighting, fans/air conditioners, and other
home appliances connected to the relay system. Another feature of
this system is the intrusion detection which it offers using the motion
sensor and all these can be controlled from the Android Smartphone
app or web application.

1.3 Proposed system

Our proposed system is an arduino based home automation done with


Arduino connected to a Wi-Fi and controlled via android app or a
social media network. This system deals with the safety in home and
smart home technologies which will be cost efficient.

2
Chapter 2

Literature survey

2.1 Review of Related Literature:

When people think about home automation, most of them may


imagine living in a smart home: One remote controller for every
household appliance, cooking the rice automatically, starting air
conditioner automatically, heating water for bath automatically
and shading the window automatically when night coming. To
some extent home automation equals to smart home. They both
bring out smart living condition and make our life convenient and
fast.

There are many other projects done on home automation in


different countries. They are all different from each other in
designs; features, devices, elements and algorithm. They were
designed according to specific needs and availability of
components in the respective areas. Some of them are cheap; some
of them are very expensive. Availability of both hardware and
software is necessary to work. After a long searching, we have
found a lot of articles.

3
2.2 Review of Foreign Studies:

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). This paper
proposes hardware and software design considerations which
enable the user to access the process variables on the DCS,
remotely and effectively.

Potamitis, Georgila, Fakotakis, and Kokkinakis, 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

In the year 2006, S. M. Anamul Haque, S. M. Kamruzzaman and


Md. Ashraful Islam proposed a system entitled “A System for
Smart-Home Control of Appliances Based on Time and Speech
Interaction” that controls the home appliances using the personal
computer. This system is developed by using the Visual Basic 6.0
as programming language and Microsoft voice engine tools for
speech recognition purpose. Appliances can be either controlled by
timer or by voice command.

These are the few previous researches done on similar topic. Some
of these projects are done with Arduino, some of them are done
with Wi-Fi. The components, like sensors and shields are also of
different models. Our aim is to combine those systems together i.e.
controlling home appliances with Arduino keeping it as cheap as
possible.

4
Comparison of different communication modules

It is observed that Esp8266-01 works on 802.11 b/g/n protocol


whereas ZigBee uses 802.14.5 protocol. ZigBee consumes least
power as 3mW whereas Wi-Fi and Bluetooth consumes nearly
100mW. But if we compare speed of Esp8266 has maximum
speed up to 11mbps but ZigBee has only 250kbps. Clearly esp8266
defeat ZigBee and Bluetooth not only in cost but also in speed.

5
Chapter 3

METHODOLOGY

6
Chapter 4

Hardware

To begin with the project, let’s get the idea of all the components
that we used for the project. It is very important to know all the
information both hardware specifications. The components we
are using are as follows:

Arduino:

The Arduino Uno is a microcontroller board based on the


ATmega328 (datasheet).It has 14 digital input/output pins (of
which 6 can be used as PWM outputs), 6 analog inputs, a 16
MHz ceramic resonator, a USB connection, a power jack, an
ICSP header, and a reset button. It contains everything needed
to support the microcontroller; simply connect it to a computer
with a USB cable or power it with a AC-to-DC adapter or battery
to get started. The Uno differs from all preceding boards in that
it does not use the FTDI USB-to-serial driver chip.
Instead, it features the Atmega16U2 (Atmega8U2 up to version
R2) programmed as a USB-to-serial converter.
NodemcuESP8266:

A. What is node MCU?

Node MCU is an open source IOT platform. It includes firmware


which runs on the ESP8266Wi-FiSoCfromEspresso Systems,
and hardware which is based on the ESP-12 module. The term
“NodeMCU” by default refers to the firmware rather than the
dev kits. The firmware uses the Lua scripting language.

B. ESP8266 Arduino Core

As Arduino.cc began developing new MCU boards based on


non-AVR processors like the ARM/SAM MCU and used in the
Arduino Due, they needed to modify the Arduino IDE so that it
would be relatively easy to change the IDE to support alternate
tool chains to allow Arduino C/C++ to be compiled down to
these new processors. They did this with the introduction of the
Board Manager and the SAM Core. A “core” is the collection of
software components required by the Board Manager and the
Arduino IDE to compile an Arduino C/C++ source flew down to
the target MCU’s machine language. Some creative ESP8266
enthusiasts have developed an Arduino core for the ESP8266
WiFiSoC that is available at the GitHub ESP8266 Core
webpage. This is what is popularly called the “ESP8266 Core for
the Arduino IDE” and it has become one of the leading software
development platforms for the various ESP8266 based modules
and development boards, including NodeMCUs.ESP8266 with
NodeMCU Firmware can be configured as an
Access Point, Wi-Fi Client (Host / Station) or both as Client and
AP at the same time. It has capability work with 802.11b,
802.11band 802.11n networks.
P
Chapter 3

Implementation and Results

3.1 Classifier Training & Validation Strategy


3.1.1 Classifier Training
Machine learning algorithms are used to classify activities based on a feature
set.

3.2 Performance Evaluation


For performance evaluation we used 10-fold validation.

Table 3.1: Detailed Accuracy By Class (Na¨ıve Bayes).


Class TP Rate FP Rate Precision Recall ROC Area
Walking 0.789 0.031 0.675 0.789 0.818
Running 1.000 0.000 1.000 1.000 0.999
Climbing Stairs 0.450 0.054 0.731 0.450 0.807
Descending Stairs 0.833 0.023 0.814 0.833 0.919
Driving 0.933 0.018 0.897 0.933 0.934
Cycling 1.000 0.000 0.880 1.000 0.992
Inactive 0.933 0.000 0.996 0.933 0.961
Weighted Aver- 0.847 0.040 0.846 0.847 0.891
age

4
CHAPTER 3. IMPLEMENTATION AND RESULTS 5

Figure 3.1: Feature rank by information gain.


CHAPTER 3. IMPLEMENTATION AND RESULTS 6

Table 3.2: Confusion matrix (Naive Bayes).


a b c d e f g ← Classified As
Actual Activity ↓
59 0 6 5 1 0 0 a ← Walking
0 50 0 1 0 0 0 b ← Running
5 0 34 4 0 0 0 c ← Climbing Stairs
4 0 3 29 5 0 0 d ← Descending
Stairs
0 0 0 0 32 0 4 e ← Driving
2 0 0 1 0 20 0 f ← Cycling
0 0 0 0 5 0 30 g ← Inactive
Chapter 4

Conclusions

4.1 This is the End


In this research we reported the design and implementation of.

7
Appendix A

Feature Extraction Walking

Features plotted in Matlab.

8
Bibliography

[1] Rein Ahas, Anto Aasa, Siiri Silm, and Margus Tiru. Mobile positioning
data in tourism studies and monitoring: case study in tartu, estonia.
Information and communication technologies in tourism 2007, pages 119–
128, 2007.

[2] Matthew S Goodwin, Wayne F Velicer, and Stephen S Intille. Tele-


metric monitoring in the behavior sciences. Behavior Research Methods,
40(1):328–341, 2008.

[3] Hanna-Reetta Lajunen, Anna Keski-Rahkonen, Lea Pulkkinen, Richard J


Rose, Aila Rissanen, and Jaakko Kaprio. Are computer and cell phone
use associated with body mass index and overweight? a population study
among twin adolescents. BMC Public Health, 7(1):24, 2007.

You might also like