Phase 2 Implementation Report
Phase 2 Implementation Report
Project Phase-II
Implementaion Report
on
“A Raspberry PI based
Security Implementation for Domestic Homes”
BACHELOR OF ENGINEERING
In
COMPUTER SCIENCE & ENGINEERING
Submitted By
M Shabarish (1TJ16CS043)
Ranjith A (1TJ16CS077)
Sanjay Kumar S R (1TJ16CS086)
Vinay Kumar R (1TJ16CS116)
CERTIFICATE
GUIDE HOD
Prof. Shridevi Desai Dr. D Ramya Dorai
Assistant Professor Associate Prof. & Head
Dept. of CSE Dept. of CSE
TABLE OF CONTENTS
SL.NO. CHAPTER PAGE NO.
1 INTRODUCTION 1
2 LITERATURE REVIEW 2
2.1 PURPOSE 2
2.2 OBJECTIVE OF LITERATURE SURVEY 2
3 PROBLEM STATEMENT 6
3.1 EXISTING SYSTEM 6
3.2 PROPOSED SYSTEM 6
4 METHODOLOGY 8
5 SYSTEM DESIGN 10
5.1 HIGH LEVEL DESIGN 10
5.2 DATAFLOW DIAGRAM 11
5.3 SYSTEM ARCHITECTURE 12
5.4 LOWLEVEL DESIGN 13
5.5 USE CASE DIAGRAM 13
5.6 SEQUENCE DIAGRAM 14
5.7 DETAILED DESIGN 16
5.8 ACTIVITY DIAGRAM 17
6 REQUIREMENTS 18
6.1 FUNCTIONAL REQUIREMENTS 18
6.2 NON FUNCTIONAL REQUIREMENTS 18
6.3 SOFTWARE REQUIREMENTS 18
6.4 HARDWARE REQUIREMENTS 19
7 MODULES AND ITS DESCRIPTIONS 21
8 PSUEDO CODE 32
9 TESTING 43
9.1 INTRODUTION 43
9.2.1 UNIT TESTING 43
9.2.2 INTEGRATION TESTING 46
9.2.3 SYSTEM TESTING 47
9.2.4 VALIDATION TESTING 47
9.2.5 OUTPUT TESTING 48
9.2.7 USER ACCEPTANCE TESTING 48
9.2.8 GUI TESTING 48
10 OUTCOMES AND SCREENSHOTS 49
11 EXPECTED OUTCOME 50
12 REFERENCES 51
LIST OF FIGURES
By the virtue of blooming automation industry and wireless connectivity, all the devices
within the home can be connected. This improves the comfort, energy efficiency, indoor
security, and cost savings of the home. Small and constrained embedded devices are
used to remotely monitor the conditions within home and control the home appliances.
In such case, power consumption and network bandwidth become a major concern. We
need a low power device that transmits messages through a less verbose protocol. Owing
to the ubiquitous availability of Wi-Fi, all the appliances within home can be connected
through a common gateway. This project presents an overview of a light weight
Message Queuing Telemetry Transport (MQTT) protocol. In the prototype, we attempt
to implement MQTT on Raspberry PI, a Wi-Fi based development board. Sensors and
actuators are connected to Raspberry PI and a Mosquitto based MQTT broker is
established for remote monitoring and control.
A Raspberry PI based Security Implementation for Domestic Homes
CHAPTER 1
INTRODUCTION
System design is the process of defining the architecture, components, modules, interfaces, and
data for a system to satisfy specified requirements. System design could see it as the application
of systems theory to product development. There is some overlap with the disciplines of system
analysis, system architecture and system engineering.
If the broader topic of product development "blends the perspective of marketing, design, and
manufacturing into a single approach to product development," then design is the act of taking the
marketing information and creating the design of the product to be manufactured. System design
is therefore the process of defining and developing systems to satisfy specified requirements of the
user. Until the 1990s system design had a crucial and respected role in the data processing industry.
In the 1990s standardization of hardware and software resulted in the ability to build modular
systems. The increasing importance of software running on generic platforms has enhanced the
discipline of software engineering.
Object-oriented analysis and design methods are becoming the most widely used methods for
computer system design. The UML has become the standard language in object-oriented analysis
and design. It is widely used for modeling software systems and is increasingly used for high
designing non-software systems and organizations.
System design is one of the most important phases of software development process. The purpose
of the design is to plan the solution of a problem specified by the requirement documentation. In
other words the first step in the solution to the problem is the design of the project.
The design of the system is perhaps the most critical factor affecting the quality of the software.
The objective of the design phase is to produce overall design of the software. It aims to figure out
the modules that should be in the system to fulfill all the system requirements in an efficient
manner. The design will contain the specification of all these modules, their interaction with other
modules and the desired output from each module. The output of the design process is a description
of the software architecture.
CHAPTER 2
LITERATURE REVIEW
2.1 PURPOSE
A literature survey or a literature review in a project report shows the various analyses and research
made in the field of interest and the results already published, taking into account the various
parameters of the project and the extent of the project. A literature survey includes the following:
Literature survey describes about the existing work on the given project.
It deals with the problem associated with the existing system and also gives user a clear
knowledge on how to deal with the existing problems and how to provide solution to the existing
problems.
Concentrate on your own field of expertise even if another field uses the same words, they
usually mean completely.
It improves the quality of the literature survey to exclude side tracks Remember to explicate
what is excluded.
To monitor and control the home appliances the system is designed and implemented using Zigbee.
The device performance is record and store by network coordinators. For this the Wi-Fi network
is used, which uses the four switch port standard wireless ADSL modern router. The network SSID
and security Wi-Fi parameter are preconfigured. The message for security purpose first process by
the virtual home algorithm and when it is declared safe it is re-encrypted and forward to the real
network device of the home. Over Zigbee network, Zigbee controller sent messages to the end.
The safety and security of all messages that are received by the virtual home algorithm. To reduce
the expense of the system and the intrusiveness of respective installation of the system Zigbee
communication is helpful.
In Bluetooth based home automation system the home appliances are connected to the Arduino
BT board at input output ports using relay. The program of Arduino BT board is based on high
level interactive C language of microcontrollers; the connection is made via Bluetooth. The
password protection is provided so only authorized user is allowed to access the appliances. The
Bluetooth connection is established between Arduino BT board and phone for wireless
communication. In this system the python script is used and it can install on any of the Symbian
OS environment, it is portable. One circuit is designed and implemented for receiving the feedback
from the phone, which indicate the status of the device
Wi-Fi based home automation system mainly consist three modules, the server, the hardware
interface module, and the software package. The figure shows the system model layout. Wi-Fi
technology is used by server, and hardware Interface module to communicate with each other. The
same technology uses to login to the server web based application. The server is connected to the
internet, so remote users can access server web based application through the internet using
compatible web browser. Software of the latest home automation system is split to server
application software, and Microcontroller (Arduino) firmware. The Arduino software, built using
C language, using IDE comes with the microcontroller itself. Arduino software is culpable for
gathering events from connected sensors, then applies action to actuators and preprogramed in the
server. Another job is to report the and record the history in the server DB. The server application
software package for the proposed home automation system, is a web based application built using
asp.net. The server application software can be accessed from internal network or from internet if
the server has real IP on the internet using any internet navigator supports asp.net technology.
Server application software is culpable of, maintain the whole home automation system, setup,
and configuration. Server use database to keep log of home automation system components, we
choose to use XML files to save system log.
Because of the mobile phone and GSM technology, the GSM based home automation is lure to
research. The SMS based home automation, GPRS based home automation and dual tone multi
frequency (DTMF) based home automation, these options we considered mainly for
communication in GSM. In figure shows the logical diagram the work of A. Alheraish, it shows
how the home sensors and devices interact with the home network and communicates through
GSM and SIM (subscriber identity module). The system use transducer which convert machine
function into electrical signals which goes into microcontroller. The sensors of system convert the
physical qualities like sound, temperature and humidity into some other quantity like voltage. The
microcontroller analysis all signal and convert them into command to understand by GSM module.
Select appropriate communication method among SMS, GPRS and DTFC based on the command
which received GSM module.
The devices of home are associate to the ADK and the Connection is established between the
Android device and ADK. The devices of house are link to the input/output ports of the board
(EMBEDDED SYSTEM) and their current situation will have passed to the ADK. The
microcontroller board (Arduino ADK) is based on the ATmega2560. It has a USB host connection
to associate with Android based phones, and that is based on the MAX3421e IC. The two important
features of Android Open Accessory Protocol 2.0(AOAP) are as follows: It has audio output that
is from the Android device to the component and it also support for the component serves as one
or more Human Interface Devices (HID) to the Android device. This paper depends upon Android
and Arduino platform in which both are FOSS (Free Open Source Software). Including motion
sensors for safety systems will detect an unauthorized action and it will automatically notice the
user through cell phone or the security system.
The important goal of Home Automation System is to build a home automation system using a RF
controlled remote. Now technology is accelerating so homes are also getting smarter. Modern
homes are deliberately relocating from current l switches to centralized control system, containing
RF controlled switches. Today traditional wall switches situated in various parts of the home
makes it laborious t for the end user to go near them to control and operate. Even further it turns
into more problematic for the old persons or physically handicapped people to do so. Home
Automation using remote implements an easier solution with RF technology. In order to
accomplish this, a RF remote is combined to the microcontroller on transmitter side that sends
ON/OFF signals to the receiver where devices are connected. By operating the stated remote
switch on the transmitter, the loads can be turned ON/OFF globally using wireless technology
Home Automation using cloud based system focuses on design and implementation of home
gateway to collect data about data from home appliances and then send to the cloud-based data
server to get store on Hadoop Distributed File System, it is process using MapReduce and use to
implement a monitoring tasks to Remote user Presently home Automation System is persistently
developing its resilience by assimilating the current characteristics which gratify the rising interest
of the people. This paper presents the design and development of home automation system that
use the cloud computing as service. The current system consists of three important units: the first
part is cloud server, handle and controls the data and information of client and users and the status
of devices the hardware interface module is the second part which implement the relevant
connection to the actuators and sensing devices which give the physical service. Last part is Home
Server, which construct the hardware device and gives the user interface. This paper focus to build
the web services using cloud which is need for security and storage and availability of the data.
The current system is cost efficient, reliable and comfortable which also gives a secured home
automation system for entire family
CHAPTER 3
PROBLEM STATEMENT
3.1 Existing System
In the following papers,
the authors discussed about the existing architectures for home automation and proposed a novel
home automation architecture giving space to all the new IoT protocols, and a prototype is
designed to perform home automation through SMS. GSM network and the devices are bridged
using a micro-controller. It also focuses on the security aspects in the networking and proposes a
secure, reliable and adaptable home automation system.
Drawbacks:
The research work done proves that MQTT is better than HTTP for the nodes with constrained
resources. It has been proven that data transmission through MQTT consumes only about 0.05%
of battery/hour by using 3G for network connectivity.
A prototype of MQTT based home automation system is implemented on Raspberry PI. The
sensors and actuators connected to Raspberry PI are remotely monitored and controlled through a
common home gateway.
Thus the existing infrastructure can be used to enhance the home appliances and make them smart.
This implementation provides an intelligent, comfortable and energy efficient home automation
system. It also assists the old and differently abled persons to control the appliances in their home
in a better and easier way.
CHAPTER 4
METHODOLOGY
The flow of the complete system is given over hear in the following flow chart in figure
5. First of all we have to turn on the system while exiting the home. After starting up the
system the GPIO pins are assigned to their dedicated tasks.
There is PIR motion detection sensor placed outside the door any one comes in range of
5-6 meters and 180 angle then immediately user gets notified
Then the face recognition technique is used for unlocking the door if any intruder tries to
enter the house without authorization the user gets notification
The flame detection sensor is placed to monitor the house hold appliances to see and if
any flame Is detected user gets mail
LEDSD are placed inside the house for switching on or off in case if the user forgets to
turn off the lights and it’s an automation feature.
The temperature and humidity sensor is placed inside the house to monitor the status of
the temperature and humidity on the house.
The gas leakage sensor is placed to know the leakage of gas like CO2, LPG and other
harmful gas when it is sensed user gets a an email.
CHAPTER 5
SYSTEM DESIGN
Systems design is the process of defining the architecture, components, modules, interfaces, and
data for a system to satisfy specified requirements. Systems design could see it as the application
of systems theory to product development. There is some overlap with the disciplines of systems
analysis, systems architecture and systems engineering.
System design is one of the most important phases of software development process. The purpose
of the design is to plan the solution of a problem specified by the requirement documentation. In
other words the first step in the solution to the problem is the design of the project.
The design will contain the specification of all these modules, their interaction with other modules
and the desired output from each module. The output of the design process is a description of the
software architecture.
In the high level design, the proposed functional and nonfunctional requirements of the
software are depicted. Overall solution to the architecture is developed which can handle those
needs. This chapter involves the following consideration.
Design consideration
Data flow diagram
Design Consideration
There are several design consideration issues that need to be addressed or resolved before getting
down designing a complete solution for the system
JDK has to be installed in the machine where all the three subcomponent will be executing.
The application servers like either the JBOSS or the Apache Tomcat will have to be
supported by the host machines
There shall not be any firewall or other engines that prevents the remote requests from the
portal.
There shouldn’t be any permission related issues on any cluster. The host operating system
should take of permitting all the requests to the cluster from the interface layer.
A data flow diagram is the graphical representation of the flow of data through an
information system. DFD is very useful in understanding a system and can be efficiently
used during analysis.
A DFD shows the flow of data through a system. It view a system as a function that
transforms the inputs into desired outputs. Any complex systems will not perform this
transformation in a single step and a data will typically undergo a series of transformations
before it becomes the output.
With a data flow diagram, users are able to visualize how the system will operate that the
system will accomplish and how the system will be implemented, old system data flow
diagrams can be drawn up and compared with a new systems data flow diagram to draw
comparisons to implement a more efficient system.
Data flow diagrams can be used to provide the end user with a physical idea of where the
data they input, ultimately as an effect upon the structure of the whole system.
The below figure shows a general block diagram describing the activities performed
by this project.
The entire architecture has been implemented in nine modules which we will see in
high level design and low level design in later chapters.
During the detailed phase, the view of the application developed during the high level design is
broken down into modules and programs. Logic design is done for every program and then
documented as program specifications. For every program, a unit test plan is created.
The entry criteria for this will be the HLD document. And the exit criteria will the program
specification and unit test plan (LLD).
The external objects that interact directly with the system are called actors. Actors include
humans, external devices and other software systems. The important thing about actors is that they
are not under control of the application. In this project, user of the system is the actor.
To find use cases, for each actor, list the fundamentally different ways in which the actor uses the
system. Each of these ways is a use case.
A sequence diagram in a Unified Modeling Language (UML) is a kind of interaction diagram that
shows how processes operate with one another and in what order. It shows the participants in an
interaction and the sequence of messages among them; each participant is assigned a column in a
table.
CHAPTER 6
REQUIREMENTS
6.1 Functional Requirements
The web server module must allow only the registered users to access the web application
provided
The obstacles and intrusions must be detected and its sensitivity must be above the
accepted level.
The MQTT module must be implemented in such a way that it can be accessed by any of
the available clients in Google play store or Apple app store
The owner must be able to access the smart electrical appliances from a different
geographical location using the MQTT client applications
The temperature and humidity data must be made available over MQTT client from any
remote location
The air pollution data must be made available over MQTT
The user must be granted access to his/her home only after the Face Recognition
component is a Pass
Processor Intel Core i5 or AMD FX 8 core series with clock speed of 2.4 GHz or
above
RAM 2GB or above
Hard disk 40 GB or above
Input device Keyboard or mouse or compatible pointing devices
Display XGA (1024*768 pixels) or higher resolution monitor with 32 bit color
settings
Miscellaneous USB Interface, Power adapter, etc
Other hardwares
• Raspberry PI 3 model B+
• Power adaptor
• Micro SD card
• Card Reader
• Bread board
• LEDs
• WIFI Connect
CHAPTER 7
This module provides the users of our project with a user interface to get access to our
project. A user can create an account after which he will be able to access his/her account. Other
operations an user can perform on his account are Login, Logout, Edit profile, Delete profile,
change password, and retrieve password in case he/she forgotten. Only the admins of the project
whom we consider as the owners of the SQLiID portal will be performing this operation.
The user then will be able to perform the configuration of MQTT. The end user will be
provided with an interface where he/she can enter the IP address (host name) and port number of
the mosquito server. Then portal then sends the request to the servlet layer to establish a TCP
connection with the mosquito server, which will be running on the Raspberry PI.
Here the end user will be able to monitor for any movements/motion of any intruders or
unexpected objects in their home when they (owners) are in a different geographical location. PIR
sensors allow you to sense motion, usually used to detect whether a human has moved in or out of
the sensors range.
They are small, inexpensive, low power, easy to use and do not wear out. For that reason, they
are commonly found in appliances and gadgets used in homes or businesses. They are often
referred to as PIR, "Passive Infrared", "Pyroelectric", or "IR motion" sensors. PIRs are basically
made of a pyroelectric sensor (which you can see below as the round metal can with a rectangular
crystal in the center), which can detect levels of infrared radiation.
Everything emits some low level radiation, and the hotter something is, the more radiation is
emitted. The sensor in a motion detector is actually split in two halves. The reason for that is that
we are looking to detect motion (change) not average IR levels. The two halves are wired up so
that they cancel each other out. If one-half sees more or less IR radiation than the other, the output
will swing high or low. Along with the pyroelectric sensor is a bunch of supporting circuitry,
resistors and capacitors. It seems that most small hobbyist sensors use the BISS0001 ("Micro
Power PIR Motion Detector IC"), undoubtedly a very inexpensive chip. This chip takes the output
of the sensor and does some minor processing on it to emit a digital output pulse from the analog
sensor.
This module enables the owners of the home to control the smart electrical appliances of their
home from a remote location (ideally a different geographical area). The end user will be provided
with a couple of MQTT client applications to do this.
The first one being the web application, which will be developed from the scratch as part of
this project research, and the second one will be the mobile application named ‘MyMQTT’.
There are several other readily available MQTT client applications for both android and IOS,
which can be readily incorporated by the owners of the home to control the electrical appliances.
As part of this project research is considered, we will enable the owners to perform the turn ON
and turn OFF functionalities of the electrical appliances, which can further be extended to various
other features in the future work.
Here the end user will be able to perform the monitoring operation of the room temperature
and the humidity data. The customer first have to configure the MQTT server. After that, the
temperature and the humidity sensor (DHT22) will be reading the data from the user’s room and
then sends that information to the mosquito server.
The mosquito server will then send the information to the web server, which will eventually
get displayed on a web interface. The DHT22 is a basic, low-cost digital temperature and humidity
sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and
spits out a digital signal on the data pin (no analog input pins needed). It is fairly simple to use,
but requires careful timing to grab data.
The only real downside of this sensor is you can only get new data from it once every 2 seconds,
so when using the library, sensor readings can be up to 2 seconds old. Simply connect the first pin
on the left to 3-5V power, the second pin to your data input pin and the rightmost pin to ground.
Although it uses a single-wire to send data, it is not Dallas One Wire compatible! If you want
multiple sensors, each one must have its own data pin.
Here the end user will be able to perform the monitoring operation of any flames/ fire in his/her
room. The customer first have to configure the MQTT server. After that, the flame sensor will be
reading the data from the user’s room and then sends that information to the mosquito server.
The mosquito server will then send the information to the web server which will eventually
gets displayed on a web interface. Flame Sensor can be used to detect fire source or other light
sources of the wavelength in the range of 760nm - 1100 nm. It is based on the YG1006 sensor
which is a high speed and high sensitive NPN silicon phototransistor. Due to its black epoxy, the
sensor is sensitive to infrared radiation. In fire fighting robot game, the sensor plays a very
important role, it can be used as a robot eyes to find the fire source
In this portal, the user will be able to monitor the quality of the air in terms of pollution
levels of Carbon dioxide, Smoke, and LPG at the configured geographical area. We use MQ-2 gas
sensor for finding out the Air quality index. The MQ-2 Gas sensor can detect or measure gasses
like LPG, Alcohol, Propane, Hydrogen, CO and even methane.
The module version of this sensor comes with a Digital Pin which makes this sensor to
operate even without a microcontroller and that comes in handy when you are only trying to detect
one particular gas. When it comes to measuring the gas in ppm the analog pin has to be used, the
analog pin also TTL driven and works on 5V and hence can be used with most common
microcontrollers. So if you are looking for a sensor to detect or measure gasses like LPG, Alcohol,
Propane, Hydrogen, CO and even methane with or without a microcontroller then this sensor might
be the right choice for you. Using an MQ sensor it detects a gas is very easy.
You can use either the digital pin or the analog pin to accomplish this. Simply power the
module with 5V and you should notice the power LED on the module to glow and when no gas it
detected the output LED will remain turned off meaning the digital output pin will be 0V.
Remember that these sensors have to be kept on for pre-heating time (mentioned in features above)
before you can actually work with it.
Now, introduce the sensor to the gas you want to detect and you should see the output LED
to go high along with the digital pin, if not use the potentiometer until the output gets high. Now
every time your sensor gets introduced to this gas at this concentration the digital pin will go high
(5V) else will remain low (0V).
You can also use the analog pin to achieve the same thing. Read the analog values (0-5V) using
a microcontroller, this value will be directly proportional to the concentration of the gas to which
the sensor detects. You can experiment with this values and check how the sensor reacts to
different concentration of gas and develop your program accordingly.
The Face Recognition based authentication requires the user to register his/her facial
features during the registration phase and which has to be provided again during the login phase
to get access to the system. The user does not get to choose the email ID in this module. The email
ID for the user will be provided by the master MFA application.
We use Python's face-recognition API to capture and verify the user's facial features during
the registration and the login phase respectively. This library is proven to be 99.4% accurate and
it’s comparatively faster than other libraries in the market.
CHAPTER 8
PSUEDO CODE
Below shows the pseudo code for this project.
This contains several folders that make up to an entire plugin. Each folder has a specific function
that helps in the functioning of the plugin.
The files written under the folder named ‘Java Resources’ constitutes the back end logic. The files
written under the folder named ‘WebContent’ constitutes the front-end logic. The mapping from
front-end request to the backend servlet will be written inside web.xml
FlameListener.java
@Override
public void messageArrived(String topic, MqttMessage msg) throws
Exception
{
System.out.println("Message Arrived from " + topic);
System.out.println(new String(msg.getPayload()));
GasListener.java
@Override
public void messageArrived(String topic, MqttMessage msg) throws
Exception
{
System.out.println("Message Arrived from " + topic);
System.out.println(new String(msg.getPayload()));
PIRListener.java
@Override
public void messageArrived(String topic, MqttMessage msg) throws
Exception
{
System.out.println("Message Arrived from " + topic);
System.out.println(new String(msg.getPayload()));
TemperatureListener.java
@Override
public void messageArrived(String topic, MqttMessage msg) throws
Exception
{
System.out.println("Message Arrived from " + topic);
System.out.println(new String(msg.getPayload()));
MQTT.java
{
try
{
connect();
MqttMessage message = new MqttMessage(str.getBytes());
message.setQos(qos);
sampleClient.publish(topic, message);
System.out.println("Message published");
}
catch (MqttException e)
{
e.printStackTrace();
}
}
MQTTConnectorThread.java
@Override
public void run()
{
MQTT mqtt = new MQTT(topic, broker, clientID);
if (attributeName.equals("tempMQTT"))
{
mqtt.subscribe(new TemperatureListener((String)
session.getAttribute("email"), (String)
session.getAttribute("mobile")));
}
else if (attributeName.contentEquals("pirMQTT"))
{
mqtt.subscribe(new PIRListener((String)
session.getAttribute("email"), (String)
session.getAttribute("mobile")));
}
else if (attributeName.equals("flameMQTT"))
{
mqtt.subscribe(new FlameListener((String)
session.getAttribute("email"), (String)
session.getAttribute("mobile")));
}
else if (attributeName.contentEquals("gasMQTT"))
{
mqtt.subscribe(new GasListener((String)
session.getAttribute("email"), (String)
session.getAttribute("mobile")));
}
session.setAttribute(attributeName, mqtt);
}
SubscriberThread.java
Thread t;
MqttClient sampleClient;
IMqttMessageListener listener;
String topic;
boolean stop = false;
@Override
public void run()
{
try
{
sampleClient.subscribe(topic, listener);
}
catch (MqttException e)
{
e.printStackTrace();
}
while (true)
{
try
{
Thread.sleep(2000);
}
catch (Exception e)
{
if (!stop)
{
break;
}
}
}
CHAPTER 9
TESTING
9.1 Introduction
The purpose of testing is to discover errors. Testing is the process of trying to discover
every conceivable fault or weakness in a work product. It provides a way to check the functionality
of components, sub-assemblies, assemblies and/or a finished product. It is the process of exercising
software with the intent of ensuring that the software system meets its requirements and user
expectations and does not fail in an unacceptable manner. The system has been verified and
validated by running the test data and live data.
Unit testing is a 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. Intuitively, one can view a unit as the
smallest testable part of an application. In object-oriented programming a unit is often an entire
interface, such as a class, but could be an individual method.
For unit testing first we adopted the code testing strategy, which examined the logic of
program. During the development process itself all the syntax errors etc. got rooted out. For this
developed test case that result in executing every instruction in the program or module i.e. every
path through program was tested. Test cases are data chosen at random to check every possible
branch after all the loops.
Test cases
Step 5 Verify if you have been taken to welcome Page Yes. It took us to the welcome
page
Step 6 Click on Temperature and Humidity Temperature and Humidity Page
loaded successfully
Step 7 Verify if the Temperature and Humidity values Yes the data shown are accurate
are reflecting accurately as seen in the hardware and correctly reflecting
console
Step 8 Click on Delete All and verify if all the Yes all the values are cleared
Temperature and Humidity values are cleared
Step 9 Click on PIR PIR Page loaded successfully
Step 10 Verify if the PIR values are reflecting accurately Yes the data shown are accurate
as seen in the hardware console and correctly reflecting
Step 11 Click on Delete All and verify if all the PIR Yes all the values are cleared
values are cleared
Step 12 Click on Gas Sensor Gas Sensor Page loaded
successfully
Step 13 Verify if the Gas Sensor values are reflecting Yes the data shown are accurate
accurately as seen in the hardware console and correctly reflecting
Step 14 Click on Delete All and verify if all the Gas Yes all the values are cleared
Sensor values are cleared
Step 15 Click on Flame Sensor Flame Sensor Page loaded
successfully
Step 16 Verify if the Flame Sensor values are reflecting Yes the data shown are accurate
accurately as seen in the hardware console and correctly reflecting
Step 17 Click on Delete All and verify if all the Flame Yes all the values are cleared
Sensor values are cleared
Step 18 Click on LED LED appliances page loaded
Step 21 Click on Face Recognition and check the facial Yes its not captured
features must not be captured for the first time
users
Step 22 Click on the Hyper link provided to register the Facial features registration done
facial features
Step 23 Now click on Face Recognition again and check Yes its registered
the facial features must be registered
Step 24 Click on the hyper link provided and verify the Facial features verification
facial features successful
User will be inputting all the data from using a web browser.
In this system, we have tried to handle all the errors that occurred while running the application.
the common errors we saw were reading a tuple with an attribute set to null and database
connection getting lost.
For Testing we used Top-Down design a decomposition process which focuses as the flow of
control, at latter strategies concern itself with code production. The first step is to study the overall
aspects of the tasks at hand and break it into a number of independent modules. The second step
is to break one of these modules further into independent sub modules. One of the important
features is that each level the details at lower levels are hidden. So unit testing was performed first
and then system testing.
Data can be lost across an interface, one module can have an adverse effect on the other
sub function, when combined may not produce the desired functions. Integrated testing is the
systematic testing to uncover the errors with an interface. This testing is done with simple data and
developed system has run successfully with this simple data. The need for integrated system is to
find the overall system performance.
Ultimately, software is included with other system components and the set of system
validation and integration tests are performed. System testing is a series of different tests whose
main aim is to fully exercise the computer-based system. Although each test has a different role
all work should verify that all system elements are properly integrated and formed allocated
functions.
After performing validation testing, the next step is output testing of the proposed system.
Since the system cannot be useful if it does not produce the required output. Asking the user about
the format in which the system is required tests the output displayed or generated by the system is
required tests the output displayed or generated by the system under consideration. The output
format is considered in two ways, one is on screen format and the other is printed format. The
output format on the screen is found to be corrected as the format was designated in the system
has according to the user needs. As for the hard copy the output comes according to the
specification requested by the user. The output testing does not result in any correction in the
system.
Taking various kind soft data plays a vital role in system testing. After preparing the test
data system under study is tested using the test data. While testing, errors are again uncovered and
corrected by using the above steps and corrections are also noted for future use.
User acceptance testing of the system is the key factor for the success of the system. A system
under consideration is tested for user acceptance by constantly keeping in touch with the
prospective system at the time of development and making change whenever required. This is done
with regard to the input screen design and output screen design.
GUI testing is use to ensure the visual clarity of the system, flexibility of the system, user
friendliness of the system. The various components which are to be tested are:
Relative layout
Various Links and Buttons
CHAPTER 10
CHAPTER 11
EXPECTED OUTCOMES
MQTT is thus a light weight protocol that occupies low bandwidth and consumes less power.
Considering the ease of wireless internet access through Wi-Fi, MQTT client application is built
on Raspberry PI. A prototype of MQTT based home automation system is implemented on
Raspberry PI. The sensors and actuators connected to Raspberry PI are remotely monitored and
controlled through a common home gateway. Thus the existing infrastructure can be used to
enhance the home appliances and make them smart. This implementation provides an intelligent,
comfortable and energy efficient home security and automation system. It also assists the old and
differently abled persons to control the appliances in their home in a better and easier way.
The speed and accuracy measured is faster when compared to the previous versions accurate results
are obtained processing speed if much faster, Power consumption is very less.
CHAPTER 12
REFERENCES
[1] Mqtt v3.1 protocol specification. [Online]. Available:
[2] http://public.dhe. ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html
[3] Hivemq. [Online]. Available: http://www.hivemq.com/blog/ mqtt-essentials-part-1-introducing-
mqtt
[4] Mqtt version 3.1.1 becomes an oasis standard. [Online]. Available: https://www.oasis-
open.org/news/announcements/ mqtt-version-3-1-1-becomes-an-oasis-standard
[5] Oasis mqtt version 3.1.1. [Online]. Available: http://docs.oasis-open.
org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html
[6] (2014, October) Mqtt version 3.1.1 oasis standard. [Online]. Available: http://docs.oasis-
open.org/mqtt/mqtt/v3.1.1/mqtt-v3.1.1.html
[7] S. Nasrin and P. J. Radcliffe, “Novel protocol enables diy home automation,” in
Telecommunication Networks and Applications Conference (ATNAC), 2014 Australasian, Nov
2014, pp. 212–216.
[8] H. ElKamchouchi and A. ElShafee, “Design and prototype implementation of sms based home
automation system,” in Electronics Design, Systems and Applications (ICEDSA), 2012 IEEE
International Conference on, Nov 2012, pp. 162–167.
[9] A. Kumar and S. Johari, “Push notification as a business enhancement technique for e-
commerce,” in 2015 Third International Conference on Image Information Processing (ICIIP),
Dec 2015, pp. 450–454.
[10] Nodemcu – an open-source firmware based on esp8266 wifi-soc. [Online]. Available:
http://nodemcu.com/index en.html/
[11] Eclipse. Mosquitto an open source mqtt v3.1/v3.1.1 broker. [Online]. Available:
http://mosquitto.org/
[12] Mqttlens - chrome web store. [Online]. Available:
https://chrome.google.com/webstore/detail/mqttlens/
hemojaaeigabkbcookmlgmdigohjobjm?hl=en
[13] An article available on: https: //www.simple.m.wikipedia.org >Raspberry Pi 3.