[go: up one dir, main page]

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

VISVESVARAYATECHNOLOGICALUNIVERSI

TY
“JNANASANGAMA”,BELAGAVI-590018

Technical Seminar Report On

“An Improvement to Chirp Spread Spectrum Technology


and
Anti-Theft Monitoring for a Smart Home using
collaboration of IOT and WSN”
SUBMITTED IN PARTIALFULFILLMENT FOR THE AWARD OF DEGREE OF
BACHELOR OF ENGINEERING
IN
INFORMATION SCIENCE AND ENGINEERING
SUBMITTEDBY

SURAKSHA H R
1JB20IS074

Under the Guidance of


V.Kiran Kumar
Assistant Professor,
Dept.of ISE,

DEPARTMENT OF INFORMATION SCIENCE AND ENGINEERING


SJB INSTITUTE OF TECHNOLOGY
BGSHEALTHANDEDUCATIONCITY,KENGERI,BENGALURU-560060
KARNATAKA,INDIA.

2023 -2024
|| Jai Sri Gurudev ||
Sri Adichunchanagiri Shikshana Trust ®
SJB INSTITUTE OF TECHNOLOGY
BGS Health & Education City, Kengeri, Bengaluru – 560 060

Department of Information Science & Engineering

CERTIFICATE

Certified that the Technical Seminar entitled “An Improvement to Chirp Spread Spectrum
Technology and Anti-Theft Monitoring for a Smart Home using collaboration of IOT and
WSN” carried out by Ms. Suraksha H R bearing USN 1JB20IS074 is a bonafide student of SJB
INSTITUTE OF TECHNOLOGY in partial fulfilment for the award of BACHELOR OF
ENGINEERING in INFORMATIONSCIENCE AND ENGINEERING of the Visvesvaraya
Technological University, Belagavi during the academic year 2023-24. It is certified that all
corrections/suggestions indicated for Internal Assessment have been incorporated in the report
and deposited in the departmental library. The Technical report has been approved as it satisfies
the academic requirements in respect of technical seminar prescribed for the said degree.

Signature of Guide Signature of HOD

V.Kiran Kumar Dr. Shashidhara H R


Assistant Professor Professor & Head
Dept.Of ISE
ACKNOWLEDGEMENT

I would like to express my profound grateful to His Divine Soul Padmabhushana Sri Sri Sri
Dr. Balagangadharanath MahaSwamiji and His Holiness Sri Sri Sri Dr. Nirmalanandanatha
MahaSwamiji for providing me an opportunity to complete my academics in this esteemed
institution.

I would also like to express my profound thanks to Revered Sri Sri Dr. Prakashnatha Swamiji,
Managing Director, SJB Institute of Technology, for his continuous support in providing
amenities to carry out this technical seminar presentation in this admirable institution.

I express my gratitude to Dr.K.V Mahendra Prashanth, Principal, SJB Institute of Technology,


for providing me an excellent facilities and academic ambience which have helped me in
satisfactory completion of technical seminar.

I extend my sincere thanks to Dr. Shashidhara H R, Professor & Head, Department of Information
Science and Engineering for providing me an invaluable support throughout the period of my
technical seminar.

I express my truthful thanks to, Technical Seminar Coordinator, Mrs.Poornima M, Assistant


Professor Department of Information Science and Engineering, for her valuable support.

I wish to express my heartfelt gratitude to our guide, V.Kiran Kumar, Assistant Professor
Department of Information Science and Engineering for his valuable guidance, suggestions and
cheerful encouragement during the entire period of my technical seminar.

Finally, I take this opportunity to extend my earnest gratitude and respect to my parents, Teaching
&Non-teaching staff of the department, and all my friends, who have directly or indirectly
supported me during the period of my project work.

Regards,
Suraksha H R(1JB20IS074)
ABSTRACT
Recently, smart home technologies and Internet of Things (IoT) have made it easy to control,
monitor and secure properties, specially; while being away. In this context, several security
and alarm systems have been proposed over the last decade. However, most of these systems
lack any intelligent components, which make the alarm system generalize beyond the strictly,
user predefined actions; therefore minimize false and nuisance alarms. Home security
systems work on the principle of securing entry points such as doors and windows and
interior spaces containing various valuables and essentials. A typical home security system
includes interior and exterior motion sensors, control panel, wired or wireless security
cameras, and high decibel sirens or an alarm. In this paper, an intelligent alarm system is
proposed, which utilizes machine learning techniques to intelligently detect threats based on
the environment data collected by different sensors and Arduino microcontroller; and then
notify the owner by email message on real time basis. Therefore it achieves high
performance.

The Long Range (CSSS) technology was first developed by SimTech Company. CSSS is a
wireless technology developed for long-range, low-power, low-bit rate and chirp spread spectrum
(CSS) radio modulation technology, it also provides the ability to connect to sensors more than 15-30
miles away in rural areas. In this study, we present the CSSS system architecture with the functionality
of each component and several typical application scenarios of CSSS network. CSSS is widely used
into many applications, such as smart metering, factory monitoring and it can be used to provide sensor
information to communities to provide disaster alerts. CSSS networks allow for very long wireless
links that can connect villages and towns. CSSS network is emerging as one of the most promising
Low Power Wide Area networks (LPWAN). LPWANs represent a new trend in the evolution of the
wireless communication designed to enable broad range of Internet of Things (IoT) applications.

The Internet of Things (IoT) field is fast growing and already reaching and impacting the industry and consumer
market. One of the main necessities for an IoT device is the network capability - a wireless network. As the
requirements for wireless IoT networks are different and poses new challenges, a new class of wireless network
was developed: the Low-Power Wide Area Networks (LPWANs). The offered data rate is significantly less
compared to traditional networks, like cellular or Wi-Fi, as LPWANs focus on a lower power consumption while
maintaining a long range

i
TABLE OF CONTENTS

Acknowledgement i

Abstract ii

List of Tables iv

List of Figures v

CHAPTERS PAGE NO

1 Introduction 1
2 Literature Review 3
3 Proposed Work 5
3.1 Complement Naive Bayes
3.2 Ripper Rule Learning
3.3 Precision-Recall Curves
4 Experimental Setup 14
4.1 Hardware Interactions
4.2 The Circuit Design
4.3 The Data Set
4.4 Machine Learning Algorithms and Evaluation Methods
4.5 The Training Procedures
4.6 Firing Alarm and Sending Email
4.7 Hardware Components
4.8 Results and Discussions
4.9 Application of Chirp Spread spectrum Technology 20
5 Conclusion 22

6 References 23

ii
LIST OF TABLES

Table No. Description Page No.

Table 3.1 Accuracy, TPR and FPR for complement naive bayes 7

Table 3.2 Accuracy, TPR and FPR for Ripper Rule Learner 8

Table 4.1 Confusion Matrix 13

iii
CHAPTER 1
INTRODUCTION
The concept of home automation has been around since the late 1970’s. But with the advancement
of technology and services, people’s expectation of what a home should do or how the services
should be provided and accessed at home has changed a lot during the course of time, and so has
the idea of home automation system. If we look for different automation systems over time, they
have always tried to provide efficient, convenient, and safe ways for home inhabitants to access
their homes. Irrespective of the change in user expectation, advancement of technology, or change
of time, the role of home automation system has remained the same.

Internet of Things (or IoT) is a new IT concept that has emerged in recent years and is growing
very quickly. 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.

Recently, smart home technologies and Internet of Things (IoT) have made it easy to control,
monitor and secure properties; especially while being away. In addition, the international crime
level have increased, which necessitates using non-traditional, and smart ways to secure and
monitor homes. Several automated alarm and security systems have been proposed, using
different wireless connected sensors, which detect intruders and notify home owners regarding
potential threats through mobile applications or text messages. The detection of threats is based on
the readings collected by different sensors, and the notification is sent according a predefined set
of actions by the home owner, who can then act upon. In general, the sensors are connected to
microcontrollers, which are then connected to the owner’s mobile phone or website.

However, most of those systems are not intelligent enough to work beyond the strictly defined
procedures, or limit the false alarms received. The problem of plenty of false alarms (alarm
flooding) makes the owner lose trust in the alarm system, which causes “cry wolf” effect, or even
not to pay any attention to real threats.

In this work, an intelligent alarm system to protect small and valuable items is proposed; like
jewellery and other expensive, small size properties. This system utilizes machine learning
techniques to intelligently detect threats, based on the environment data collected by different
sensors and Arduino microcontroller, and then notify the owner by email message on real time
1
CSSS and ATMFSH Introduction

basis. When received on the mobile phone, the email activates a unique notification alarm, so the
user knows immediately about the threat. In addition to the intelligent threat identification, the
proposed system aims at reducing the false and nuisance (true, redundant) alarms.

Several studies have investigated the use of security and surveillance systems as part of smart
homes. Most of these studies used different types of motion sensors, smoke, gas, and light
detectors, in addition to motion activated lights and video cameras. Those sensors are connected
together using microcontrollers, which are in turn connected to the internet and/ or the intended
user through WIFI or GSM modules.

Minimizing energy consumption and prolonging network lifetime have become primal design
goals of next-generation wireless networks, merely due to limited power resources of wireless
devices. Figure 1.1 shows smart alarm system that consists of tiny hungry energy sensor nodes, it
is a difficult process to maintain the energy level of these nodes for a long period of time.

The wireless sensor networks consist of small sensors used to monitor or detect data. Because of
their small size, power supply is provided by a small battery, which, when deployed in a ‘not-
easily reachable’ place, cannot be replaced or recharged frequently. Energy efficiency is therefore
one of the principal constraints of the wireless sensor network.

The most widely used protocols in applications such as environmental monitoring, consist of
ZigBee (IEEE 802.15.4) , Wi-Fi (based on IEEE 802.11) , and Bluetooth (IEEE 802.15.1) . Being
based on IEEE 802.15.4, a standard that offers low costs and low power at low data rates, ZigBee
is extensively used in a wide range of monitoring and control application that require wireless
connectivity.

These solutions require additional hardware for packaging data and for transmitting them to the
Internet. Wi-Fi is a popular networking technology based on the IEEE 802.11 set of standards that
offers higher transmission range and throughput compared to IEEE 802.15.4, with the cost of
higher energy consumption.

Figure 1.1 Smart Alarm System

VIII SEM, Dept. of ISE, SJBIT 2023-24 2


CHAPTER 2
LITERATURE REVIEW
The literature has reported a great number of research efforts to achieve monitoring applications
using wireless sensors.

Security System using Arduino - In the context of smart homes, different studies proposed
controlling and monitoring homes remotely using smart phones, which communicate with a
microcontroller installed at those homes[1]. In these cases, Arduino have been utilized. The main
components include different sensors like Passive Infrared sensor (PIR) to detect motion,
temperature sensors, relays for each electronic device, and wireless module to connect with, and
control the Arduino circuit remotely using Android smart phones. Other studies have used the
same components in, with additional sensors for more sophisticated home security. Humidity
sensor, gas sensor, liquid crystal display and real time clock module, GSM module, camera, and
SD card have been utilized. Based on the signals arriving to the Arduino from the PIR, flame,
temperature or gas sensor, it sends a message to the mobile of the home owner on real-time basis,
through the GSM module. The camera also stores the images for the detected threat on the SD
card. However, no alarm or actions are initiated to deal with any threats in place.

Security Systems Based on Intelligent Algorithms -As can be seen from the section above, the
home security systems proposed did not use any intelligent components to improve performance
and threats detection. However, few studies have addressed this idea. Artificial Neural Networks
has been utilized in, to minimize false alarms and improve the accuracy of intrusion detection.
The authors described the three stages for training, testing and validating the neural network
model. In the training and cross-validation processes; the sensors’ readings constitute neural
network inputs, while the output is either intrusion detected or no intrusion. Back-propagation has
been used to adjust the network weights. The obtained accuracy of the network reached 80%.

So the system will be able to obtain 100% accuracy. Under this intelligent alarm system, we have
the hardware components, circuit design, data set, machine learning algorithms and evaluation
methods utilized, the training procedures and firing alarm and sending E mail.

The hardware components that used include, Arduino Mega, 3 ultrasonic sensors, an infra-red
sensor, Microphone, led, buzzer, and WIFI module. The data set is nothing but the information
collected by the ultrasonic sensors. The algorithms include Complement Naïve Bayes algorithm
or Ripper rule learner or Precision -Recall curves. To fire the alarm,we have a buzzer and the wifi
module in the arduino sends an E mail to the owner.
3
CSSS and ATMFSH Literature Review

The literature has reported a great number of research efforts to achieve monitoring applications
using wireless sensors. This paper analyzes the significant differences and similarities between
three different IoT-based wireless sensors for home monitoring one using Wi-Fi communications
based on the User Datagram Protocol (UDP), one via the Wi - Fi and Hypertext Transfer Protocol
(HTTP) and one using Bluetooth Smart.

The existing security system consists of LASER sensor, Pyro Electric Sensor along with CCTV.
In this security system there are more disadvantages such as

1. High cost
2. Synchronization of LASER light fails at most of the times
3. IR sensor is purely based on heat detection from the object.

4. High complexity
To overcome the drawbacks of this system, a new advancement technique is used in the project.
Here, IP CCTV and ultrasonic RADAR are being used in shops and banks, IP CCTV or IP camera
is a digital video camera employed for surveillance. The first centralized IP camera was axis Net
eye 200 in 1996. The camera is connected to an IP network using an ETHERNET connection,
CAT-5 cable. They have built in web servers so that the surveillance video transmits, can be
viewed directly from the camera over the internet using the web browser. So that, any abnormal
actions at home can be viewed by the owner from anywhere.

CSSS is a wireless modulation technique or physical layer that allows low-power enddevices to communicate
over long range. Lora WAN—a wireless networking protocol that acts as a media-access-control (MAC)
layer—is implemented on top of the LoRa physical layer. The Lora WAN specification details the
communication protocol and network architecture and is meant to provide secure communication of end-
devices and interoperability within the network.
End points: The endpoints are the elements of the LoRa network where the sensing or control is undertaken.
They are normally remotely located. A Lora WAN end device can be a sensor, an actuator, or both. They are
often battery operated. These end devices are wirelessly connected to the Lora WAN network through
gateways using LoRa RF modulation. The following figure shows an end device that consists of sensors like
temperature, humidity, and fall detection.
• LoRa gateway: The gateway receives the communications from the LoRa endpoints and then transfers them
onto the backhaul system. The gateways are connected to the network server using standard IP connections.
On this way the data uses a standard protocol, it can be connected to any telecommunications network,
whether public or private. Each gateway is registered (using configuration settings) to a CSSS WAN network
server.

VIII SEM, Dept. of ISE, SJBIT 2023-24 4


CHAPTER 3
PROPOSED WORK
3.1 Complement Naive Bayes
This algorithm was designed to correct the “severe assumptions” made by the standard
multinomial Naive Bayes classifier. It is particularly suited for imbalanced data sets are known to
work well in case of skewed class distribution in the training data set. It was designed to
overcome one of the problems of Multinominal Naïve Bayes (MNB). That problems in is that if
one class has more data than the other (skewed class distribution), poor weights are selected for
defining the decision boundary. Complement Naïve Bayes deal with this problem by estimating
the probability of the class with the smaller number of data vectors; using the parameters of all
other classes, excluding that required class.

Suppose you are a product manager, you want to classify customer reviews in positive and
negative classes. Or As a loan manager, you want to identify which loan applicants are safe or
risky? As a healthcare analyst, you want to predict which patients can suffer from diabetes
disease. All the examples have the same kind of problem to classify reviews, loan applicants, and
patients.

Naive Bayes is the most straightforward and fast classification algorithm, which is suitable for a
large chunk of data. Naive Bayes classifier is successfully used in various applications such as
spam filtering, text classification, sentiment analysis, and recommender systems. It uses Bayes
theorem of probability for prediction of unknown class.

Whenever you perform classification, the first step is to understand the problem and identify
potential features and label. Features are those characteristics or attributes which affect the results
of the label. For example, in the case of a loan distribution, bank manager's identify customer’s
occupation, income, age, location, previous loan history, transaction history, and credit score.
These characteristics are known as features which help the model classify customers.

The classification has two phases, a learning phase, and the evaluation phase. In the learning
phase, classifier trains its model on a given dataset and in the evaluation phase, it tests the
classifier performance. Performance is evaluated on the basis of various parameters such as
accuracy, error, precision, and recall.

5
CSSS and ATMFSH Proposed Work

Figure 3.1 Data Sets of IR sensor

Naive Bayes is a statistical classification technique based on Bayes Theorem. It is one of the
simplest supervised learning algorithms. Naive Bayes classifier is the fast, accurate and reliable
algorithm. Naive Bayes classifiers have high accuracy and speed on large datasets.

Naive Bayes classifier assumes that the effect of a particular feature in a class is independent of
other features. For example, a loan applicant is desirable or not depending on his/her income,
previous loan and transaction history, age, and location. Even if these features are interdependent,
these features are still considered independently. This assumption simplifies computation, and
that's why it is considered as naive. This assumption is called class conditional independence.

(1)

In equation (1),

P(h): the probability of hypothesis h being true (regardless of the data). This is known as the prior
probability of h.

P(D): the probability of the data (regardless of the hypothesis). This is known as the prior
probability.

P(h|D): the probability of hypothesis h given the data D. This is known as posterior probability.

P(D|h): the probability of data d given that the hypothesis h was true. This is known as posterior
probability.

VIII SEM, Dept. of ISE, SJBIT 2023-24 6


CSSS and ATMFSH Experimental Settup

Table 3.1 shows the results of 10 fold cross validation training for the first stage of the model,
using complement naïve bayes algorithm. From this table, it can be seen that a TPR rate of 1 has
been achieved, but with very high FPR and moderate accuracy.

Table 3.1 Accuracy, TPR and FPR for complement naive bayes

Accuracy TPR FPR


Complement Naive Bayes 0.66 1 0.45

End points: The endpoints are the elements of the Chirp Spread Spectrum Technology network where
the sensing or control is undertaken. They are normally remotely located. A Chirp Spread Spectrum
Technology WAN end device can be a sensor, an actuator, or both. They are often battery operated.
These end devices are wirelessly connected to the Chirp Spread Spectrum Technology WAN network
through gateways using Chirp Spread Spectrum Technology RF modulation. The following figure
shows an end device that consists of sensors like temperature, humidity, and fall detection.

• Chirp Spread Spectrum Technology gateway: The gateway receives the communications from the
Chirp Spread Spectrum Technology endpoints and then transfers them onto the backhaul system. The
gateways are connected to the network server using standard IP connections. On this way the data
uses a standard protocol, it can be connected to any telecommunications network, whether public or
private. Each gateway is registered (using configuration settings) to a Chirp Spread Spectrum
Technology WAN network server. A gateway receives Chirp Spread Spectrum Technology messages
from end devices and simply forwards them to the Chirp Spread Spectrum Technology WAN
network server. Gateways are connected to the Network Server using a backhaul like Cellular
(3G/4G/5G), Wi-Fi, Ethernet, fiberoptic, or 2.4 GHz radio links
• Chirp Spread Spectrum Technology Network Server: The Chirp Spread Spectrum Technology
network server manages the network and as part of its function it acts to eliminate duplicate packets,
schedules acknowledgement, and adapts data rates. In view of the way in which it can be deployed
and connected, makes it very easy to deploy a Chirp Spread Spectrum Technology network.

VIII SEM, Dept. of ISE, SJBIT 2023-24 9


CSSS and ATMFSH Proposed Work

3.2 Ripper Rule Learning


It’s a rule based learner that builds a set of rules that identifies the classes while minimizing the
amount of error. The error is defined by the number of training examples misclassified by the
rules. An inductive algorithm learns what a malicious executable is given a set of training
examples.

RIPPER learns rules directly from data employing sequential covering algorithm. RIPPER learns
rules to cover the minority class, while the majority class is considered as a default. The FOIL
information gain measure is used to select the best attribute to be added to rule antecedent.

The outcome of this first stage constitutes the input to the second stage, to differentiate the TPs
(real threats) from FPs (false alarms), and achieve low rate of FPs. The output of the first stage
was a data set of 292 true positive examples, and 404 negative examples (which were the false
positives). This data set has been used to train Ripper rule learning, and get the “If- Then” rules
for the true positive class; to be then deployed back on the Arduino. Table 3.2 shows the accuracy,
true positive rate, which represents true alarm, and false positive rate, which represents false
alarm, for the final stage. From this table, it can be seen that the proposed methodology is
effective in reducing the false alarms, while maintaining high level of true positives; and
therefore, low false negative rate (FNR); which represents missed alarms. It can also be seen that
the use of complement naïve bayes algorithm was beneficial for maximizing TPR. The proposed
methodology has reduced the FPR (false alarms) from 45% to 18 %. This can be of good value to
the designer of alarm systems; which will help reducing the “cry wolf” effect. Furthermore,
deploying the obtained rule sets on the Arduino will help the alarm system to be more accurate,
and able to generalize beyond any specific, predefined rules.

VIII SEM, Dept. of ISE, SJBIT 2023-24 10


CSSS and ATMFSH Experimental Settup

Table 3.2 Accuracy, TPR and FPR for Ripper Rule Learner

Accuracy TPR FPR

Ripper 0.83 0.85 0.18

3.3 Precision-Recall Curves


The precision recall curve shows the trade-off between precision and recall for different threshold.
A high area under the curve represents both high recall and high precision, where high precision
relates to a low false positive rate, and high recall relates to a low false negative rate. Curves have
become a common method for assessing classification performance, and as an alternative to
Receiver Operator Characteristic (ROC) curves.

Precision-recall curves can better compare the performance of two algorithms, as they can show
differences in PR space, which may not apparent in their ROC space. In PR curves, recall (TPR)
is plotted against precision, (the fraction of true positives in relation to all positive predictions),
which is also known as the positive predictive value (PPV).

A system with high recalls but low precision returns many results, but most of its predicted labels
are incorrect when compared to the training labels. A system with high precision but low recall is
just the opposite, returning very few results, but most of its predicted labels are correct when
compared to the training labels. An ideal system with high precision and high recall will return
many results, with all results labelled correctly. Precision (P) is defined as the number of true
positives (Tp) over the number of true positives plus the number of false positives (Fp).
P=Tp/(Tp+Fp) Recall (R) is defined as the number of true positives (Tp) over the number of true
positivesplus the number of false negatives (Fn). R=Tp/(Tp+Fn) . These quantities are also related
to the (F1) score, which is defined as the harmonic mean of precision and recall.
F1=2P×(p*r/p+r). The definition of precision (Tp/Tp+Fp) shows that lowering the threshold of a
classifier may increase the denominator, by increasing the number of results returned. If the
threshold was previously set too high, the new results may all be true positives, which will
increase precision. If the previous threshold was about right or too low, further lowering the
threshold will introduce false positives, decreasing precision.

Recall is defined as Tp/Tp+Fn, where Tp+Fn does not depend on the classifier threshold.This
means that lowering the classifier threshold may increase recall, by increasing the number of true

VIII SEM, Dept. of ISE, SJBIT 2023-24 9


CSSS and ATMFSH Proposed Work

positive results. It is also possible that lowering the threshold may leave recall unchanged, while
the precision fluctuates.

The relationship between recall and precision can be observed in the stair step area of the plot - at
the edges of these steps a small change in the threshold considerably reduces precision, with only
a minor gain in recall.

Average precision (AP) summarizes such a plot as the weighted mean of precisions achieved at
each threshold, with the increase in recall from the previous threshold used as the weight:
AP=∑n(Rn−Rn−1)Pn where Pn and Rn are the precision and recall at the nth threshold. A pair
(Rk,Pk) is referred to as an operating point.

Precision-recall curves are typically used in binary classification to study the output of a classifier.
In order to extend the precision-recall curve and average precision to multi-class or multi-label
classification, it is necessary to binaries the output. One curve can be drawn per label, but one can
also draw a precision-recall curve by considering each element of the label indicator matrix as a
binary prediction (micro-averaging).

Last step, the performance of ripper has been compared with C5 decision tree learner [13], to see
if better results can be obtained. Precision – Recall (PR) curves have been plotted for each
algorithm under different operating points obtained by varying the misclassification costs. Figure
3 shows the obtained PR curves for both Ripper and C5. The two curves were manually connected
to (1,0) & (0,1) for recall and precision respectively. The areas under the PR curves were
calculated, where C5 obtained 0.826 and Ripper had an area of 0.845. From those curves, it can be
seen that Ripper had better performance; therefore, it is more appropriate for our task.

Figure 3.2 Precision-Recall curves for Ripper and C5 algorithms

VIII SEM, Dept. of ISE, SJBIT 2023-24 10


CSSS and ATMFSH Experimental Setup

Chapter 4

EXPERIMENTAL SETUP

4.1 Hardware Interactions


The hardware components include Arduino Mega, 3 ultrasonic sensors, an infra-red sensor,
Microphone, led, buzzer, and WIFI module. The sensors include analog sensors to get the exact
distance between the sensor and any moving object. Digital sensors are also used to identify small
range threats. Different sensors combinations have been considered when firing a threat alarm.
The data set collected by the sensors is then used to train the machine learning algorithms as
described in the upcoming section. The detailed description of the architecture is shown below.

Figure 4.1 Detailed description for alarm system components

4.2 The Circuit Design


To help good coverage of the alarm system, and to improve intrusion detection and minimize false
alarms; sensors have been distributed with different orientations and positions. The front part of
the alarm unit had two sensors; the infra-red and one of the ultra-sonic sensors, with appropriate
ranges. The right side of the alarm unit had one ultra-sonic sensor that is used to detect any threat
VIII SEM, Dept. of ISE, SJBIT 2023-24 9
CSSS and ATMFSH Experimental Setup
that is coming from the right. The left side of the unit contains another ultra-sonic sensor, to detect
any threat that comes from the left side. The microphone is placed in front part. It should be noted

here that this design and / or the ranges of sensors can be changed based on individual user
needs/situations.

4.3 The Data Set


As shown in the previous section, sensors have been installed in the target location and their
readings have been recorded for the normal situation; during different times of the week days and
nights. Risky situations (threats) have been simulated, and sensors readings have been recorded as
well. This constituted the initial data set. After collecting the data sets for both situations, it was
required to analyze the data set, and notice which individual sensors and / or sensor’s
combinations contributed to detect threats. Based on the analysis, ranges of the sensors have been
fine-tuned, and further sensors combinations have been considered. After that, additional records
have been collected, and some others were defined by the user and added to the data set.

Figure 4.2 IR Sensor readings

Figure 4.3 Data sets of IR Sensor

VIII SEM, Dept. of ISE, SJBIT 2023-24 10


CSSS and ATMFSH Experimental Setup
After removing duplicates, we ended up with 1190 records, 25% positive (for high threats), and
75% negative (no threat). In order to program the Arduino to fire alarms in risky situations, rule

VIII SEM, Dept. of ISE, SJBIT 2023-24 9


CSSS and ATMFSH Experimental Setup

sets were required to detect the threats, based on the readings from different sensor and their
combinations. Machine learning algorithms have been used for this task, to obtain comprehensible
and accurate rules, with minimum false positive cases. A hybrid model has been utilized, which is
composed of a Complement Naïve Bayes [2], to be able to deal with skewed class distribution in
the data set, and a rule learning algorithm [1], to obtain comprehensible rule sets, which are then
deployed to the Arduino. The Precision- Recall curves is also utilized to evaluate the performance
of the rule sets obtain and take the best one. Brief descriptions of the algorithms and performance
evaluation metrics utilized and the training procedures are described further.

4.4 Machine Learning Algorithms and Evaluation Methods


Machine learning algorithms are able to detect patterns in data and learn from them, in order to
make their own predictions. Here Complement Naive Bayes algorithm and Ripper rule learner is
used for training the alarm system.

4.4.1 Complement Naïve Bayes algorithm

Complement Naïve Bayes algorithm is known to work well in case of skewed class distribution in
the training data set. It was designed to overcome one of the problems of Multinominal Naïve
Bayes (MNB). That problems in is that if one class has more data than the other (skewed class
distribution), poor weights are selected for defining the decision boundary. Complement Naïve
Bayes deal with this problem by estimating the probability of the class with the smaller number of
data vectors; using the parameters of all other classes, excluding that required class; i.e. “learning
the weights for a class using all training data not in that class” [1].

4.4.2 Ripper rule learner

RIPPER learns rules directly from data employing sequential covering algorithm. RIPPER learns
rules to cover the minority class, while the majority class is considered as a default. The FOIL
information gain measure is used to select the best attribute to be added to rule antecedent [2].

4.4.3 Precision -Recall curves

The Precision-Recall (PR) curves have become a common method for assessing classification
performance, and as an alternative to Receiver Operator Characteristic (ROC) curves. Precision-
recall curves can better compare the performance of two algorithms, as they can show differences
in PR space, which may not apparent in their ROC space . In PR curves, recall (TPR) is plotted
against precision, (the fraction of true positives in relation to all positive predictions), which is

VIII SEM, Dept. of ISE, SJBIT 2023-24 13


CSSS and ATMFSH Experimental Setup

also known as the positive predictive value (PPV). Table 4.1 shows the confusion matrix, which
define the terms TP, FP, TN, FN; while TPR, FPR and Precision are given by (1), (2), (3).

Table 4.1 Confusion Matrix

Positive P Negative N

Positive P True Positive TP False Positive FP

Negative N False Negative FN True Negative TN

True Positive Rate TPR (Recall) = TP/P (1)


False Positive Rate (FPR) = FP/N (2)
Precision =TP/ (TP+FP) (3)

4.5 The Training Procedures


Due to the skewed class distribution, which is typical in our case, we had to find a machine
learning technique that can deal with this situation. The objective was not to maximize accuracy,
but to maximize the true positive rate to avoid missing any threats; and minimize false positive
rate, to avoid “cry wolf” effect. This actually is a hard task, and it has been thought of as a hybrid
model; where each stage in that model deals with one of these requirements; one at a time. To
deal with the requirement to achieve high TPR, Complement Naïve Bayes [1], which is suitable in
this situation have been utilized. In the second stage of the hybrid model, the objective was to
distinguish between the TP and FP cases. The data set for this stage was the outcome of 10fold
C.V, where TPs are considered as the positive class, while FP (false alarm) represents the negative
class. Ripper rule learner has been used to obtain rule set for the TP class, which represent a real
threat. In addition, precision-recall curves is used to evaluate the performance of the rule set
obtained, by plotting the curve with Recall and Precision obtained under different
misclassification costs.

VIII SEM, Dept. of ISE, SJBIT 2023-24 14


CSSS and ATMFSH Experimental Setup

Figure 4.4 False Alarm

4.6 Firing Alarm and Sending Email


The Arduino was then programmed with rule sets obtained under equal misclassification costs, as
described is Section E; as rules for high threats, and rules for no threat, based on the sensor’s
readings. If high threat is detected, the Arduino then sends an email to the owner (using the WIFI
unit), and activate a buzzer. This is achieved by reading the serial monitor of the Arduino, if the
keyword ‘high’ is found, an email will be sent to the owner. When the email arrives at the owner’s
mobile phone, it activates a notification with alarming sound, which differentiates that email from
others received, and attracts the owner attention. The data set collected is updated every two
months to cope for any environmental changes in the place, and the training process is repeated
and the rule sets are updated.

Figure 4.5 Firing Alarm and Sending Email

VIII SEM, Dept. of ISE, SJBIT 2023-24 19


CSSS and ATMFSH Experimental Setup

4.7 HARDWARE COMPONENTS


4.7.1 ARDUINO MEGA

The Arduino Mega is a microcontroller board based on the ATmega2560. It has 54 digital
input/output pins of which 14 can be used as PWM outputs, 16 analog inputs,4 UARTs a 16 MHz
crystal oscillator , a USB connection, a power jack, an ICSP header, and a reset button. This
arduino is designed for project that requires more I/O lines, more sketch memory and more RAM.
With 54 digital I/O pins, 16 analog inputs and a larger space for the sketch it is the recommended
board for 3D printers and robotics projects.

The Arduino Mega 2560 is programmed using the Arduino Software (IDE), our Integrated
Development Environment common to all our boards and running both online and offline. The
USB connection with the PC is necessary to program the board and not just to power it up. The
Mega2560 automatically draw power from either the USB or an external power supply. Connect
the board to your computer using the USB cable. The green power LED (labeled PWR) should
goon. COM1 and COM2 are usually reserved for hardware serial ports.

Figure 4.6 Arduino Mega

4.7.2 ULTRASONIC SENSOR

Ultrasonic sensor is an electronic device that measures the distance of a target object by emitting
ultrasonic sound waves, and converts the reflected sound into an electrical signal. Ultrasonic
waves travel faster than the speed of audible sound. It works by emitting sound waves at a
frequency too high for humans to hear. They then wait for the sound to be reflected back,
calculating the distance based on time required to travel back. This is similar to how radar
measures the time it takes a radio wave to return after hitting an object. These sensors can be used
for many applications, Including precise detection of objects and contactless monitoring to fill
levels. They generate high frequency sound waves and evaluate the echo which is received back
by sensor. There are four pins that would use to interface with sensor: VCC, Trig (signal output

VIII SEM, Dept. of ISE, SJBIT 2023-24 20


CSSS and ATMFSH Experimental Setup

pin), Echo (signal input pin) and GND. Each of the four pins are connected to the arduino: VCC
to 5v, Trig to a digital pi, Echo to a digital pin and GND to GND.

Figure 4.7 Ultrasonic sensor

4.7.3 INFRARED SENSOR

An Infrared sensor is an electronic instrument that is used to sense certain characteristics of its
surroundings. It does this by either emitting or detecting infrared radiation. Infrared sensors are
also capable of measuring the heat being emitted by an object and detecting motion. Active
infrared sensors both emit and detect infrared radiation. Active IR sensors have two parts: a light
emitting diode (LED) and a receiver. When an object comes close to the sensor, the infrared light
from the LED reflects off of the object and is detected by the receiver. It has three pins, VCC,
GND and output pins.

Figure 4.8 IR sensor

4.7.4 MICROPHONE

It is an instrument that coverts the sound waves into electrical energy variations which may then
be amplified, transmitted, or recorded. The sound waves hit the diaphragm that vibrates, moving a
magnet near a coil. In some designs, the coil moves within a magnet, microphones such as
condenser microphone works on the principle of capacitance.

VIII SEM, Dept. of ISE, SJBIT 2023-24 19


CSSS and ATMFSH Experimental Setup

Figure 4.9 Microphone

4.7.5 LED

It stands for Light Emitting Diode. It is capable of generating light because of the arrangements of
the two semiconductor materials located between its electrodes.

Figure 4.10 LED

4.7.6 BUZZER

A buzzer or beeper is ansudio signaling device, which may be mechanical, electromechanical, or


piezoelectric. Typical uses of buzzers and beepers include alarm devices, timers and confirmation
of user input such as a mouse click or keystroke.

Figure 4.11 Buzzer

4.7.7 ESP8266WIFI MODULE

It’s a self contained SOC with integrated TCP/IP protocol stack that can give any microcontroller
access to your wifi network. The ESP8266 is capable of either hosting an application or
offloading all wifi network functions from another application processor.

VIII SEM, Dept. of ISE, SJBIT 2023-24 20


CSSS and ATMFSH Experimental Setup

Figure 4.12 ESP8266 wifi module

4.8 RESULTS AND DISCUSSION


The proposed system achieved very good performance results. The results of 10 fold cross
validation training for the first stage of the model, using complement naïve bayes algorithm.
From this table, it can be seen that a TPR rate of 1 has been achieved, but with very high FPR
and moderate accuracy.
The outcome of this first stage constitutes the input to the second stage, to differentiate the TPs
(real threats) from FPs (false alarms), and achieve low rate of FPs. The output of the first stage
was a data set of 292 true positive examples, and 404 negative examples (which were the false
positives). This data set has been used to train Ripper rule learning, and get the “If- Then”
rules for the true positive class; to be then deployed back on the Arduino. It shows the
accuracy, true positive rate, which represents true alarm, and false positive rate, which
represents false alarm, for the final stage. From this table, it can be seen that the proposed
methodology is effective in reducing the false alarms, while maintaining high level of true
positives; and therefore, low false negative rate (FNR); which represents missed alarms. It can
also be seen that the use of complement naïve bayes algorithm was beneficial for maximizing
TPR.
The methodology has reduced the FPR (false alarms) from 45% to 18 %. This can be of good
value to the designer of alarm systems; which will help reducing the “cry wolf” effect.
Furthermore, deploying the obtained rule sets on the Arduino will help the alarmsystem to be
more accurate, and able to generalize beyond any specific, predefined rules.

4.9 APPLICATIONS OF CHIRP SPREAD SPECTRUM


TECHNOLOGY
CATTLE TRACKING AND HEALTH The Farm Life smart agriculture service and its Chirp Spread
Spectrum Technology-enabled sensors detect cattle estrus, drive improved nutrition, and predict the onset of
disease to help ranchers better monitor their herd. According to ITK, Chirp Spread Spectrum Technology
devices’ flexibility in deployment makes a key difference for connecting animals and offers the potential for a

VIII SEM, Dept. of ISE, SJBIT 2023-24 19


CSSS and ATMFSH Experimental Setup
significant return on investment (ROI). ITK’s solution provides ranchers with tangible, actionable data on the
health of their herd to remove variables from ranching and create

productive, efficient, and profitable ranches. In addition to the 300,000 cows already monitored in Europe,
approximately 20 ranches have deployed ITK’s Farm Life platform in North America, connecting cows to the
Cloud through network connectivity from X-TELIA, a leading Canadian network provider.

Smart waste management is one of the most important services in smart cities. An efficient waste collection
system based on IoT technologies allows having the streets clean and reducing resource consumption by
optimizing garbage collecting trucks’ routes. In this situation, the present work proposes a smart management
system based on Chirp Spread Spectrum Technology WAN. This solution seeks to mitigate the presence of
containers that are at their maximum storage capacity. This solution will contribute to mitigate the spread of
diseases due to it avoids having waste in the open air. Different tests of the proposed solution (i.e.,
communication distance, speed, and energy consumption) were performed to determinate the possibility of
real implementations.

Cold storage monitoring and tracking system built upon a Chirp Spread Spectrum Technology network. The
architecture comprises an end node with a monitoring system, a Chirp Spread Spectrum Technology WAN
Gateway, LORIOT network server and the user application. The end node has built-in temperature, pressure,
and humidity sensors. Force-Sensitive-Resistors and a GPS module are interfaced to the module. The
monitoring system can thereby measure the parameters inside the chamber as well as track the chamber in real
time. Further, the presence of vaccines is detected using the force-sensitive-sensors.

Sensors used in tank level monitoring are used to identify the levels of tank for a variety of liquids. It allows
different users to track the tank levels remotely without any physical human efforts like manual meter reading
and assessments. Tank level monitoring provides a greater insight for tank depletion rates and helps in
increasing the efficiency of inventory management. Manual inspection of tank level is time consuming, error
prone, expensive, unsafe, inaccurate. So, there is a high demand for remotely accessing of the tank levels for
monitoring the levels of tank in less time.

VIII SEM, Dept. of ISE, SJBIT 2023-24 20


CSSS and ATMFSH Experimental Setup

CONCLUSION
An intelligent alarm system is proposed, which has high performance in detecting threats,
and also emails the user about these threats on real time basis. The proposed system fires
alarm based on intelligent rules obtained by utilizing machine learning techniques. The
threats are predicted based on the rules, upon reading the values of different sensors.

The main objective was to minimize false alarms and detect threats beyond any predefined
rules by the user. As the environment of each place could be unique, we collected the data for
normal situations as well as simulated threats to train the machine learning algorithms.

This process is periodically repeated to cope with any changes in the environment considered.
A possible extension of this work is to integrate a clock, a camera, and additional sensors
with the hardware to help detecting different patterns in different times. Another possible
extension is to allow monitoring and controlling the alarm system remotely using mobile
applications.

22
REFERENCES
[1] J. Chandramohan, R. Nagarajan, K. Satheeshkumar, et al., "Intelligent Smart Home
Automation and Security System Using Arduino and Wi-fi," International Journal of
Engineering and Computer Science, vol. 6 pp. 20694-20698, 2017.

[2] A. Daramas, S. Pattarakitsophon, K. Eiumtraku, et al., "HIVE: Home Automation


System for Intrusion Detection," presented at Fifth ICT International Student Project
Conference (ICT- ISPC), Thailand, 2016.

[3] S. Kumar and S. R. Lee, "Android Based Smart Home System with Control via
Bluetooth and Internet Connectivity," presented at The 18th IEEE International
Symposium on Consumer Electronics, South Korea, 2014.

[4]C. C. Teoh and C. E. Tan, "A Neural Network Approach towards Reinforcing Smart
Home Security," presented at 8th Asia -Pasific Symposium on Information and
Telecommunication Technologies, 2010

[5]I. Izadi, S. L. Shah, D. S. Shook, et al., "An Introduction to Alarm Analysis and
Design," presented at The 7th IFAC Symposium on Fault Detection, Supervision and
Safety of Technical Processes, Barcelona, Spain, 2009.

[6] Angel Perles a, Eva Pérez-Marín, Ricardo Mercado, J. Damian Segrelles, Ignacio Blanquer,
Manuel Zarzo, Fernando J. GarciaDiego, “An energy-efficient internet of things (IoT) architecture
for preventive conservation of cultural heritage”, The International Journal of eScience, Universitat
Politècnica de València, Spain, 27 June 2017.

[7] M. Shafq, Z. Tian, Y. Sun, X. Du, and M. Guizani, “Selection of efective machine learning
algorithm and Bot-IoT attacks trafc identifcation for internet of things in smart city,” Future
Generation Computer Systems, vol. 107, pp. 433–442, 2020.

[8] F. Flammini, A. Gaglione, D. Tokody, and D. Dobrilovic, ´ “Virtualization technology for


LoRaWAN roaming simulation in smart cities,” Studies in Computational Intelligence, vol. 971,
pp. 251–265, 2021.

[9] S. Idris, T. Karunathilake, and A. F¨orster, “Survey and comparative study of LoRa-enabled
simulators for internet of things and wireless sensor networks,” Sensors, vol. 22, no. 15, pp. 5535–
5646, 2022.

[10] U. N. B. Fi, “Collaborating for self-reliance – co-creating iot connectivity solutions,” Akgec

22
International Journal of Technology, vol. 11, 2022

[11] C. K. Liaskos, L. Mamatas, S. Ioannidis, and A. Pitsillides, “Software-Defned Reconfgurable


Intelligent Surfaces : From Teory to End-To-End Implementation,” Proceedings of the IEEE, vol.
110, 2022.

[12] A. D. Boursianis, M. S. Papadopoulou, A. Gotsis et al., “Smart irrigation system for precision
agriculture - the ARETOU5A IoT platform,” IEEE Sensors Journal, vol. 21, no. 16, Article ID
17539, 2021.

[13] L. Parri, S. Parrino, G. Peruzzi, and A. Pozzebon, “A LoRaWAN network infrastructure for the
remote monitoring of ofshore sea farms,” in Proceedings of the 2020 IEEE International
Instrumentation and Measurement Technology Conference (I2MTC), pp. 1–6, Dubrovnik, Croatia,
May 2020

[14] M. A. Ahmed, J. L. Gallardo, M. D. Zuniga et al., “LoRa based IoTplatform for remote
monitoring of large-scale agriculture farms in Chile,” Sensors, vol. 22, no. 8, p. 2824, 2022

23

You might also like