0% found this document useful (0 votes)
92 views43 pages

IoT Smart Home Automation Project

Uploaded by

Moozo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views43 pages

IoT Smart Home Automation Project

Uploaded by

Moozo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 43

SMART HOME AUTOMATION USING THE

INTERNET OF THINGS
A major project report submitted in partial fulfillment of the
requirements for the degree of

BACHELOR OF TECHNOLOGY
in
ELECTRICAL ENGINEERING

Submitted By:

Chandan Lenka (Regd, No. - 2001320103)


Debabrata Ray (Regd, No. - 2001320099)
Phiroj Bag(Regd, No. - 2001320101)
Pabitra Kumar Ojha (Regd, No. - 2001320100)

Under the guidance of

Dr. Pratap Chandra Nayak (HOD EE)

For the academic year 2020-2024

DEPARTMENT OF ELECTRICAL ENGINEERING

ARYAN INSTITUTE OF ENGINEERING AND TECHNOLOGY,


ARYA VIHAR, BHUBANESWAR, PIN-752050

Affiliated to

BIJU PATNAIK UNIVERSITY OF TECHNOLOGY, ODISHA


DECLARATION

We hereby declare that the project entitled “Smart Home Automation Using The

Internet Of Things” was carried out by us under the guidance of Professor &

Head of the Department Dr Pratap Chandra Nayak, which is submitted to Biju

Patnaik University of Technology, Rourkela, Odisha, in the partial fulfilment of

the requirements for the award of the degree of Bachelor of Technology in

Electrical Engineering. The results embodied in this report have not been copied

from any source. The results embodied in this report have not been submitted to

any other University or Institute for the award of any other degree.

Place: AIET, Bhubaneswar Chandan Lenka (Regd. No. - 2001320103)


Date: Debabrata Roy (Regd. No. - 2001320099)
Phiroj Bag(Regd. No. - 2001320101)
Pabitra Kumar Ojha (Regd. No. - 2001320100)
CERTIFICATE

This is here to certify that the project entitled “Smart Home Automation Using
The Internet Of Things” is a bonafide record of a major project presented by
Chandan Lenka (Regd. No. - 2001320103), Debabrata Ray (Regd. No. -
2001320099), Fhiroj Bag (Regd. No. - 2001320101) and Pabitra Kumar
ojha(Regd. No. - 2001320100), under the supervision of Dr Pratap Chandra
Nayak, Head of the Department (HOD), Electrical Engineering Department.
During the academic year 2020-24 in partial fulfilment of the requirements for the
award of the Degree of Bachelor of Technology in Electrical Engineering from
Aryan Institute of Engineering and Technology, Arya Bihar, Bhubaneswar,
Khordha, Odisha, Under Biju Patnaik University of Technology, Rourkela, Odisha.

Project Guide Chandan Lenka (Regd. No. - 2001320103)


Dr P. C. Nayak Debabrata Roy (Regd. No. - 2001320099)
HOD, EE Phiroj Bag(Regd. No. - 2001320101)
Pabitra Kumar Ojha (Regd. No. - 2001320100)

Principal External Examiner


AIET, BBSR
ARYAN INSTITUTE OF ENGINEERING AND TECHNOLOGY
ARYA VIHAR, BHUBANESWAR, KHORDHA, PIN- 752050

Vision of the Institute

To become a leading Engineering institution of the state by imparting quality technical


education at affordable costs to create skilled and motivated graduates to serve the
technological requirements of society in different ways.

Mission of the Institute

• To impart contemporary technical education and skills to students of different


socio-economic backgrounds.
• To equip students with analytical learning and real life problem solving.
• To make learning a continuous endeavour compatible with market needs.
• To promote the spirit of leadership, entrepreneurship, innovation and ethics.

Vision of the Department of Electrical Engineering

To be a leader in the field of electrical engineering education and training by creating


graduates who are globally competent, successful in their chosen fields of endeavour,
engaged in innovative research and entrepreneurship, and deeply committed to social
advancement.

Mission of the Department of Electrical Engineering

• To impart the fundamentals of electrical engineering so that students may


develop new products and solutions to solve issues in the real world.
• To enable students to pursue a prosperous career in the cognitive electrical
engineering professions and to become ethical technologists.
• Through continuous improvement of faculty and lab facilities, to strive for
excellence in academics and research works by developing a rich electrical
engineering based research center for the industrial growth of the nation.
ARYAN INSTITUTE OF ENGINEERING AND TECHNOLOGY
ARYA VIHAR, BHUBANESWAR, KHORDHA, PIN -752050

Program Educational Objectives (PEOs)

Graduates will be able to:

PEO1: Establish successful careers in Electrical Engineering and related


fields by offering creative and practical solutions.

PEO2: Engage in continuous learning through cutting-edge technologies


for solving societal problems using logical and innovative approaches in
decision-making.

PEO3: Become an entrepreneur and work for a company that conducts


research and development.
ARYAN INSTITUTE OF ENGINEERING AND TECHNOLOGY,
ARYA VIHAR, BHUBANESWAR, KHORDHA, PIN -752050

Program Specific Outcomes (PSOs)

PSO1: Apply the fundamentals of science and technology to identify,


formulate, design and investigate complex engineering problems of electric
circuits, control systems, power electronics, electric drives and power
systems.

PSO2: Ability to model, simulate and assess electrical systems and


components using software and hardware tools.

PSO3: Empowering to socially acceptable technical solutions and relevant


methodologies for sustainable development to current electrical engineering
difficulties.
ACKNOWLEDGEMENT

It is our sense of gratitude to our project guide Dr Pratap Chandra Nayak,


Professor & Head of the Department of Electrical Engineering, for his wholehearted
support, suggestions, inspiration and continuous encouragement. We deeply express
our sincere thanks to our Professor & Head of the Department Dr Pratap Chandra
Nayak for providing us with all the necessary facilities for the work. The
satisfaction and euphoria that accompany the successful completion of the task
would be great but incomplete without the mention of the people who made it
possible with their constant guidance and encouragement crowns all the efforts with
success. In this context, I would like to thank all the other staff members, both
teaching and non-teaching, who have extended their timely help and eased my task.

Place: AIET, Bhubaneswar Chandan Lenka (Regd. No. - 2001320103)


Date: Debabrata Roy (Regd. No. - 2001320099)
Phiroj Bag(Regd. No. - 2001320101)
Pabitra Kumar Ojha (Regd. No. - 2001320100)
ABSTRACT

We live in an exciting time where more and more everyday items and “things”
are becoming smart! “Things” have sensors and can communicate with other
“things” and can provide control to more “things”. The Internet of Things, IoT,
hugely is upon us and people are rapidly inventing new gadgets that enhance
our lives. The price of microcontrollers with the ability to talk over a network
keeps dropping and developers can now think and build things inexpensively.
This IoT-based home automation project is done using a low-cost custom build
ESP32 WiFi Module and Raspberry Pi Zero. A system that uses a mobile app to
control basic home functions and features automatically through the internet
from anywhere around the world, an automated home is sometimes called a
smart home. It is meant to save the electric power and provide better security
service. The home automation system differs from other systems by allowing
the user to operate the system from anywhere around the world through an
internet connection without breaking any convention usability.
This project provides a significant electric power-saving solution at homes and
at offices with the help of dynamic control of electric supply over the internet
using a smart switch, and another is a low-cost wireless plug-and-use
surveillance system with live streaming over the internet connection and in-
build video storage capacity.
The project contains both hardware and software development where the
hardware program is built using C and Python language on Arduino IDE,
whereas the mobile application is built using Java language Android studio.
Contents
Page
No.
Acknowledgement
Abstract
List Of Figures
List Of Table
Chapter 1 INTRODUCTION 1
1.1 Introduction 1
1.2 Objectives of the Project 1
1.3 Project focus 1
1.4 Organization of Report 2
Chapter 2 BACKGROUND MATERIAL 3
2.1 Conceptual Overview 3
2.2 Technologies Involved 5
Chapter 3 METHODOLOGY 10
3.1 Detailed methodology that will be adopted 11
3.2 Overall project timeline 14
Chapter 4 IMPLEMENTATION 15
4.1 Modules 15
4.2 Prototype 39
Last Chapter CONCLUSION & FUTURE SCOPE 31
6.1 Conclusions 31
6.2 Future Scope of Work (at least 3 points) 31

REFERENCE 32
LIST OF TABLE
Table No. Table Title Page No.
3.1 Overall Timeline 11
3.2 IP-based Surveillance MICROPROCESSOR Timeline 12
3.3 Smart-Switch Timeline 3

LIST OF FIGURES
Figure No. Figure Title Page No.
2.1 Smart-Switch Overview 3
2.2 Switch Setup 5
2.4 ESP 32 5
2.5 ESP 32 architecture diagram 5
2.6 Android Mobile Application 6
2.7 MICROPROCESSOR Setup 7
2.8 Raspberry Pi Zero 7
2.9 Raspberry Pi Zero Architecture 7
2.10 Image sensor 8
3.1 Software Development Cycle 10
4.1 Switch circuit diagram 16
4.2 Initial case Smart-Switch 17
4.3 First case Smart-Switch 17
4.4 Second case Smart-Switch 18
4.5 Third case Smart-Switch 18
4.6 Forth case Smart-Switch 19
4.7 Last case Smart-Switch 19
4.8 Flow char of mobile application 23
4.9 MICROPROCESSOR setup 23
4.10 Surveillance Flow diagram 26
4.11 Block processes on video 27
4.12 Smart Switch prototype 25
4.13 Smart Switch mobile application 29
4.14 IP-based Surveillance MICROPROCESSOR prototype 30
Chapter 1

INTRODUCTION

1.1 Introduction

Home automation has made it possible to have what is often referred to as a "Smart
Home", a home that can detect and identify you, automatically adjust the lighting to your
predefined taste, open doors automatically, play your favorite music, water your flower in the
morning, switch on the security lights at night and switch them off in the morning, heat water
for bathe and tea, stream to you anywhere in the world via internet a live video of what is
happening in and around your premises. It make it possible to link lighting, entertainment,
security, telecommunications, heating, and air conditioning into one centrally controlled
system. This allows you to your house an active partner in managing your busy life and assist
you with efficient living.

Nowadays, you can hardly find a house without a home automation system which can
range from the remote for the television, burglar alarm and hi-tech security surveillance, to an
automated air condition system that maintain the temperature at a predefined value.
This project wants to add new devices to home which can progress towards fully
automated home and make life easier and productive.

1.2 Objectives of the Project

The objective of this project is to design and build new IoT hardware which can be
control using mobile application from anywhere around the world and that can installed at
every home and office at lowest possible cost.

1.3 Project Focus


Project has focus on two main area of home which are electricity and security, and
come up with two hardware solution:-
I. Smart Switch.
II. IP-based Surveillance MICROPROCESSOR.

1
1.4 Organization of Report

The entire Project is composed of five chapters. each covering a section of work as
summarized below:

 Chapter one gives an introduction to automation as a whole and the different types
of automation. And also define project motivation and objectives.
 Chapter two covers an extensive background overview of project working and which
technology are involved in development with establishment of standards and
protocols and benefits.
 Chapter three highlights the project methodology, giving reasons for choice of
specific platform and components, and also comprehensive details on project
development timeline.
 Chapter four is on the project design and implementation with clear practical details
of the project design, construction, testing, microcontroller coding and debugging.
Special emphasis is also made on the flexibility and scalability of the project work
with real life illustration.
 Chapter five is on the project results and analysis, that how project fill up the needs
which was analysis at initial stage.
 Last chapter is on the conclusion and recommendations based on the project work
with emphasis on the reliability, maintainability and flexibility of the design. Also,
recommendations based on the challenges encountered and further possible
development inn the project work.

2
Chapter 2
BACKGROUND MATERIAL

2.1 Conceptual Overview


Project developed two devices:-
 Smart-Switch
 IP-based Surveillance MICROPROCESSORera

2.1.1 Conceptual view of Smart-Switch

Fig 2.1 Smart-Switch overview

 Smart switch is operated by ESP32 with Wi-Fi-module hardware which control


and connect switch to internet though local Wi-Fi network.
 Mobile app can connect to smart-switch using local Wi-Fi network and also using
GSM internet or other Wi-Fi network.
 Cloud provide accessible to control switch though internet.
 Smart-Switch can be operated using manual switch and also through mobile app.
Live status of switch can be monitor from mobile app even if switch get used using
manually.

3
CIRCUIT DIAGRAM:

4
2.2 Technologies Involved

2.2.1 Technology using for Smart-Switch


Hardware used to build Smart-Switch.

 ESP32 Wi-Fi module. Type -


32-bit micro-controller
CPU -
160MHz
GPIO -16
pin Memory
- 4MB

 4 two-way switches.
 4 port electromagnet relay.
 220 Volt to 5 Volt AC to DC power
adapter. Software used to program ESP32
microcontroller

 Arduino IDE using C


language. Development of mobile
application.
 Android Studio 3.1.1 - IntelliJ platform.

ESP 32 ESP32 Wi-Fi module [1]


The ESP 32 (Node MicroController Unit) is an open source software and hardware
development environment that is built around a very inexpensive System-on-a-Chip (SoC)
called the ESP32. The ESP32, designed and manufactured by Espressif Systems, contains all
crucial elements of the modern computer: CPU, RAM, networking (Wi-Fi), and even a
modern operating system and SDK. When purchased at bulk, the ESP32 chip costs only $20
USD a piece. That makes it an excellent choice for this project.

5
Fig 2.4 ESP 32 Fig 2.5 ESP 32 architecture diagram

6
Android Mobile Application
About half of the population around the world prefers Android over another operating
systems or devices. IoT is one of the biggest areas where Android app development
technology is continuously contributing with its enormous benefits. Internet of Things is
generally recognized as the interconnectedness of different smart devices over the Internet.
The devices make use of sensors and internet connectivity, which helps them receive, collect
and transmit information. So development on android platform is the right option for this
project.
Smart-Switch application named Smart-Fox is developed on android platform with API 19
compatible which covers 90.1% android device of the total devices.
List of support used on android device to run mobile application.

 Wi-Fi.
 Internet GSM.
 Location.
 Room SQLite database.

Fig 2.6 Android Mobile Application

7
2.2.1 Technology using for IP-Based Surveillance MICROPROCESSOR

Hardware used to build Surveillance MICROPROCESSORera


 Raspberry Pi Zero W.
- 1GHz, single-core CPU
- 512MB RAM
- Mini HDMI and USB On-The-Go ports
- Micro USB power
- HAT-compatible 40-pin header
- Composite video and reset headers
- CSI MICROPROCESSORconnector

 Sony IMX219 image sensor.

Software used to build Surveillance MICROPROCESSOR


 2.7 version python platform.
 OpenCV.

Raspberry Pi Zero W [2]


The Raspberry Pi is a popular Single Board Computer (SBC) in that it is a full
computer packed into a single board. Many may already familiar with the Raspberry Pi 3 and
its predecessors, which comes in a form factor that has become as highly recognizable. The
Raspberry Pi comes in an even smaller form factor. The introduction of the Raspberry Pi
Zero allowed one to embed an entire computer in even smaller projects. This project will use
the latest version of the Zero product line, the Raspberry Pi Zero - Wireless, which has an
onboard Wi-Fi module.

Fig 2.8 Raspberry Pi Zero Fig 2.9 Raspberry Pi Zero Architecture

8
Sony IMX219 image sensor [3]
"IMX219", Type 1/4.0, approximately 8.08M effective pixels, back-illuminated
CMOS image sensor for the growing mobile market. The IMX219 satisfies the fulfillment
performance of "high sensitivity" and "high frame rate imaging" to meet the demands for
high-quality MICROPROCESSORapplications, and can be easily put on
MICROPROCESSORfronts of stylish and slim bezel devices achieved by the reduced size.
Not only the normal rate of all-8M pixels at full field of view and 30 frame/s, 4 times
faster imaging is also possible by 2 × 2 analog binning mode. Also, a LSC function*1
corrects optical unevenness to adjust during the module fabrication process, and contributes
to suppressing of system cost. Additionally, combining with a rear-end ISP supporting of
BME-HDR*2 enables future scalability of the high-dynamic-range video imaging.
Image sensor is prefect for video surveillance with low power consumption and high
quality video. This make image sensor perfect fit for this project.

Fig 2.10 Image Sensor

9
2.1.2 Programming Language used during project

Project has used three different programming languages for our project. For the
development of the application on android, we have used Java Platform. Android Software
Development kit incorporates IntelliJ software where Java programming is performed. IntelliJ
software is used to write the codes for the application under Java Platform. Raspbian OS is
used at the raspberry pi.

Java: Java is a set of several computer software products and specifications from Oracle
Corporation that provides a system for developing application software and deploying it in a
cross-platform computing environment. Java is used in a wide variety of computing platforms
from embedded devices and mobile phones on the low end, to enterprise servers and
supercomputers on the high end.
Python: Python is an interpreter, interactive, object-oriented programming language. It
incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and
classes. Python combines remarkable power with very clear syntax. It has interfaces too many
system calls and libraries, as well as to various window systems, and is extensible in C or
C++. It is also usable as an extension language for applications that need a
programmable interface. Python is a high-level general-purpose programming language
that can be applied to many different classes of problems. 5.2.3.
C: For embedded programming of ESP 32 for Smart Switch using Arduino IDE. it is a non-
object-oriented high-level programming language.
Raspbian OS: Raspbian is a free Operating System based on Debian optimized for the
raspberry pi hardware. Raspbian comes with more than 35000 packages; pre-combined
software bundled in a nice format for easy installation on Raspberry pi.

10
Chapter 3
METHODOLOGY

3.1 Detailed methodology that will be adopted


This section represent which development cycle project used and how it is implemented.

3.1.1 Software development cycle.


This project used iterative software development[4]. An iteration incorporates a
loosely sequential set of activities in business modeling, requirements, analysis and
design, implementation, test, and deployment, in various proportions depending on
where in the development cycle the iteration is located. Iterations in the inception and
elaboration phases focus on management, requirements, and design activities;
iterations in the construction phase focus on design, implementation, and test; and
iterations in the transition phase focus on test and deployment.

Fig 3.1 Software Development Cycle

Project benefits using Iterative implementation


An iterative approach is generally superior to a linear or waterfall approach for
many different reasons.
 Risks are mitigated earlier, because elements are integrated progressively.
 Changing requirements and tactics are accommodated.
 Improving and refining the product is facilitated, resulting in a more robust product.
 Organizations can learn from this approach and improve their process.
 Reusability is increased.

11
3.2 Overall Project Timeline

IP-based T
Surveillance Phase - 1 E
MIC Surveillance S T
ROPROCES MICROPROCESSOR T E
SOR I S
Development N T
G I
N
Phase - 2 G
Smart Switch
Smart
Switch 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Develop
ment

Tim
elin
e
(We
eks)

Table 3.1 Overall Timeline

Phase -1 - Development of IP-based Surveillance MICROPROCESSOR.


This development was choose at first because it required low amount of time for
research to analysis and select perfect hardware which is highly efficient and robust in design
as it was used as plug and play. Total three Iterative cycles were required to refine the device
in to perfect working condition.

MICROP
ROCESS 1
OR& Hardware Week
Research
2
Inte Weeks
r
a 2 T
c Weeks E
t S
i T
o 2 I
n Weeks N
1
D Week G
e
1 2 3 4 5 6 7 8 9
12
v
i
c
e
Cont
r
o
l

Video Processing
Algori
thm &
Backu
p

App Development

Liv
e

S
t
r
e
a
m
i
n
g

13
Timeline (weeks)

Table 3.2 IP-based Surveillance MICROPROCESSOR Timeline

14
Phase -2 - Development of Smart-Switch.
This development was choose at second because it required high amount of time to
develop due to two different platform. Total six Iterative cycles were required to refine the
device in to perfect working condition.

Hardw
are 2
selection Weeks
and
compatibi
lity 1
Week
Embe
dded
3 Weeks T
Progra
ming E
S
T
Cloud 4 Weeks I
setup N
and data G
manage 1
Week
ment

Android
App
Develop 2
ment Weeks

1 2 3 4 5 6 7 8 9 10 11 12 13 14
Communicatio
n Between
Device, App
and Cloud

Add
data
monitorin
g on
App

Tim
eline
(We
eks)

Table 3.3 Smart-Switch Timeline

15
Chapter 4
IMPLEMENTATIN

4.1 Modules
Project is divided into two development modules :-

1) Smart Switch development


1. Hardware circuit development
2. Different possible test case.
3. Embedad sudo program.
4. Web sevice format and data storage format.
5. Mobile application flow and development.

2) IP-based Surveillance MICROPROCESSOR development.

1. Hardware circuit development


2. Different test parameters.
3. Embedad sudo program.
4. Web sevice format and data storage format.
5. Mobile application flow and development

16
4.1 Smart Switch development

1) Hardware Circuit development

Fig 4.1 - Switch circuit diagram

Except bulb connect, all device and circuit with be packed in switch board. Circuit
diagram represent accurate layout of connection inside switch board. Where individual
switch are connected with ESP 32 board and operate at 5 volt and electromagnetic trigger
relay is also control by ESP 32 board. When switch is on board trigger relay to complete
240 volt circuit of bulb, result to light in bulb.

So in Smart-Switch, ESP 32 board take decision when to turn on light, when switch is
pressed manually or receive request from mobile app through Wi-Fi network over internet.

17
2) Different possible case studies.

Initial case - Smart-switch is connected to web server using local Wi-Fi network over
internet. And mobile application can be connected to switch and set server through local Wi-
Fi network or over GSM internet connect as shown in Fig 4.2.

Fig 4.2 Initial Stage

1st Case - when switch is turn on manually. Switch send request to server and update
the status, web server also update status of mobile app by sending back request to mobile
application. same process also repeat for turn off request.

Fig 4.3 First case of Smart switch

18
2nd Case - when switch is turn on from mobile app when switch is in same Wi-Fi
network. Mobile app send direct request to smart switch and update status, same request is
also sent to server.

Fig 4.4 Second case Smart Switch.

3rd Case - when switch is turn on from mobile app when connect over internet. Mobile app
sent request to web server and Switch get update from web server.

19
Fig 4.5 Forth case Smart Switch

4th Case - When Switch is turn on from mobile app when to internet services off-line and
mobile is connected to same network.

Fig 4.6 Forth case Smart-Switch

Last Case - When smart switch is off line. Even then switch can be turn on and off manually.

Fig 4.7 Last case smart-switch

20
3) Embedad sudo program.

void start()
{
get wifi credentials ()
get web server
credentials () connect to
wifi()
if(no connect)
{
Start wifi AP mode to get connected()
}
get switch
status() Start
loop()
}
void loop() {
if(connected ){
check web server status()
check mobile app status()
check manual switch
status()
}
update relay status()
check status of
switch() delay()
continue loop()
}

A general flow of code is mention above. Origenal code contain different


checks and data storage which are not mention in sudo code.
21
4) Web sevice format and data storage format.

GET and POST request and response from switch and mobile app to web

server. Check request from mobile app to web server

Request URL: https://smart-fox.info?


key=wasdhlkhasdd&switchid=14920 Request Method: GET
Status Code: 200
Remote Address:
128.30.52.100:443 Referrer
Policy: origin

Responce = 14920:true

Update request from mobile app to web server

Request URL: https://smart-


fox.info Request Method: POST
Status Code: 200
Remote Address:
128.30.52.100:443 Referrer
Policy: origin
Date: key=wasdhlkhasdd & id=14920 & stutus=true

Update request from mobile app to smart switch.

Request URL: https://192.168.43.121:5000 // local ip of smart switch


Request Method: POST
Status Code: 200
Remote Address:
128.30.52.100:443 Referrer
Policy: origin
Date: key=wasdhlkhasdd & id=14920 & stutus=true

22
Update request from switch to web server

Request URL: https://smart-


fox.info Request Method: POST

Status Code: 200


Remote Address:
128.30.52.100:443 Referrer
Policy: origin
Date: key=wasdhlkhasdd & id=14920 & stutus=true & deviceid = A400006

check request from switch to web server for all switch

Request URL: https://smart-


fox.info Request Method: POST
Status Code: 200
Remote Address:
128.30.52.100:443 Referrer
Policy: origin
Date: key=wasdhlkhasdd & deviceid = A400006

Responce = 1:true, 2:false, 3:true, 4: false

23
5) Mobile application flow and development.

Fig 4.8 Flow chart of mobile application

24
Start Screen - Inital load all the data from room SQLite database from mobile and
check varify login credentials and sync data with web server.

Login Screen - Check login credentials and redirect to Wi-Fi configuration screen.

Signup Screen - Submit new user login detail with email opt varification.

Wifi Screen - Save Wi-Fi creadentials localy, which help to device


cofiguration to connect device to local Wi-Fi network.

Home Screen - where user can control all configure switch. When connected to network.

Device Config. - Configure new switch device to app and connect switch to local Wi-Fi
network, when switch is in Wi-Fi AP mode.

Switch Config. - When new switch device is configure to app it automatically add
all device switch to app and configure at default mode. Which can edit my user as
per need.

Switch Power usage - Shows to detail utilization of power for each switch and
device in Kilo-watts hours over a time of year.

25
4.2.1 IP-based Surveillance MICROPROCESSOR development.

1) Hardware circuit development

Fig 4.9 MICROPROCESSOR Setup

Fig 4.10 Surveillance flow diagram

26
2) Different test case parameters.

 Image processing - Motion Detection, video quality enhacement.


 Video storage mangement in-build memory storage.
 Live streaming video on mobile app.
 Cloud communication.

3) Sudo program.

import opencv library


void start()
{
initial image
capturing() connect
to wifi()
start loop()
}
void loop()
{
if(wifi connected)
{
connect to cloud()
start live steaming web service()
}
if(motion detected())
{
store image frame()
}
}

27
4) Web sevice format and data storage format.

Video data flow processing

Fig 4.11 block processes on video

Selection of right stroage formate. [4]

UDP – User Datagram Protocol is a transport protocol that can deliver “datagrams”
(data with some networking metadata attached to it) from one computer to another.
The data in a datagram might be just a small chunk of the full data object being
transferred between two computers, so each datagram has a sequence number that aids
in properly reconstructing the original data object. Unlike TCP, the UDP does not
require a connection to be established and kept alive between two computers. One
computer informs another computer of its IP address and the port on which it is
expecting to receive datagrams, and as long as a socket is listening on that port the
datagrams can keep flowing in. Another difference between UDP and TCP is that the
former does not make any guarantees that datagrams will arrive in the correct order (or
arrive at all). It is the application developer’s job to deal with reassembling the data
and accommodating any missing datagrams. UDP is commonly used for applications
that do not benefit from the strong delivery guarantees of TCP, such as video
streaming where dropping an occasional video frame or two is not a noticeable

problem.

28
RTSP – Real-Time Streaming Protocol is like HTTP but it is built specifically for
setting up, configuring, and tearing down streaming media sessions, such as a video
chat session or a movie being streamed to a computer from streaming media server.
RTSP is not involved with the actual video streaming, but just managing the
streaming session. It has a set of directives like DESCRIBE, which asks the streaming
media source to list the available media types and their capabilities, and SETUP,
which is how the client app tells the server which media type it wants to consume and
gets a session ID back in the response.

RTP – Real-time Transport Protocol is the low-level protocol used to break a video
into packets that can be streamed between computers. Those packets of video data are
often put into UDP datagrams. To get a feel for the kind of processing involved with
RTP video streams, check out this high-level overview of the process on
StackOverflow.

H.264 and MJPEG – These are commonly used compression techniques for
audio/video files. Most normal humans do not ever need to know or care about how
such things work or can be decoded, since companies like Apple build support for
them into their products. iOS uses hardware acceleration to decode H.264 video (by
processing it on the GPU instead of the CPU). I’m not sure if they hardware
accelerate MPEG4 but I assume they do. For a taste of what’s involved with decoding
H.264 formatted for RTP, check out RFC 6184. The main advantage of MPEG is
high quality video at fairly low data rates , In properly equipped pcs , this is an
excellent solution , We can size/position the video anywhere on the screen in both
AVI and MPEG format .

For this project selecting MJPEG will be advenatages protocal to live stream and store
video.

29
4.2 Prototype
1) Smart Switch

Fig 4.12 Smart switch prototype

Fig 4.13 Smart switch mobile application

30
2) IP-based surveillance MICROPROCESSOR

Fig 4.14 IP-based Surveillance


MICROPROCESSORPrototype

31
Last Chapter
CONCLUSION & FUTURE
SCOPE

6.1 Conclusions
The prime objective of our project is to use the Smartphone to control the home
appliances effectively. The switch mode are used to control the home appliances. The video
feedback is received in the android app which streams the video of IP-
MICROPROCESSORera. This project is based on the Raspberry pi, Android platform Java,
ESP 32 and Python. These platforms are Free Open Source Software. So the overall
implementation cost is low and can be easily configured. User can easily interact with the
android phone/tablet. The user can send commands via the mobile application. The data are
being analyzed by the application and are sent over a network. The Raspberry pi and ESP 32
acts as a hardware, analyses the data and activates the GPIO (General Purpose Input Output)
Pins. The GPIO Pins are connected to the relays switch which activated the required home
appliances. In this way, automation process is carried out.
Both device are cost low extremely low.

Device Price

Smart-Switch 600 Rs (4 switch)

8000 Rs
IP-Based Surveillance ESP 32
MICRO PROCESSOR

6.2 Future Scope of Work


This system is designed to assist and provide support in order to fulfill the needs of
elderly and disabled in home. Household appliances can be easily controlled via a
Mobile/Tablet. Status of light, fan and other electrical appliances can be known. With the
help of IP MICROPROCESSORera, video of rooms or certain area of a house can be
recorded. This helps to provide
security.

32
REFERENCES

Conference Papers
[1] , “Home Automation”, Energy Efficient Smart Home Automation
System volume no 1, publication year 2015, Total pages 11.

Web
[1] About ESP32, www.espressif.com
[2] Raspberry Pi Zero W, www.raspberrypi.org
[3] MICROPROCESSORSensor, www.sony-semicon.co.jp
[4] Software development cycle,
www.upedu.org [5], ESP 32 , www.ESP 32
.com
[6] , Raspberry Pi Zero W setup, www.developer.ibm.com

[7] , Implementation of OpenCV using python, docs.opencv.org

[8] , Motion detection in video using python, www.technicdynamic.com

[9] , Video quality enhancement using OpenCV, www.opencv-python-

tutroals.readthedocs.io/ [10], Video storage in H.264, www.learnopencv.com

33

You might also like