0% found this document useful (0 votes)
170 views37 pages

Portable Surveillance Camera With Motion Capture Using Raspberry Pi

This document discusses the use of IoT and Raspberry Pi cameras for surveillance applications. It begins by introducing how surveillance cameras are commonly used but have limitations in terms of cost, portability and customization. It then introduces how the IoT and Raspberry Pi can address these limitations by allowing for cheaper, customizable and portable smart camera solutions. Finally, it provides an overview of several research papers on using IoT and wireless technologies for real-time video surveillance applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
170 views37 pages

Portable Surveillance Camera With Motion Capture Using Raspberry Pi

This document discusses the use of IoT and Raspberry Pi cameras for surveillance applications. It begins by introducing how surveillance cameras are commonly used but have limitations in terms of cost, portability and customization. It then introduces how the IoT and Raspberry Pi can address these limitations by allowing for cheaper, customizable and portable smart camera solutions. Finally, it provides an overview of several research papers on using IoT and wireless technologies for real-time video surveillance applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Chapter -1

Introduction
Surveillance Cameras play an important role in our day to day lives, they help
us verify evidence and catch criminals. Although only a handful of people use a
surveillance or security cameras inside their homes. Such cameras have become
increasingly popular to be used in public spaces and in some cases, they are also
used inside building societies. However, getting a traditional camera with
proprietary hardware and software can be quite expensive and there is not a lot
of changes you can make to the camera’s software to fine tune it’s
functionalities. Moreover, the security cameras these days have to be connected
to a power outlet or a computer for it to function properly, thus, making them
not so portable and while there are portable security cameras, they are pretty
expensive. This is where the use of IoT in the form of Raspberry Pi comes in.
The Internet of Things (IoT) is the network of physical devices, vehicles, home
appliances and other items embedded with electronics, software, sensors,
actuators, and connectivity which enables these objects to connect and exchange
data. Each thing is uniquely identifiable through its embedded computing
system but is able to inter-operate within the existing Internet infrastructure.
The Raspberry Pi is a small single board computer which can be loaded with a
Linux based OS for the Raspberry Pi and different modules and sensors can be
connected to it and programmed, in order to make the device IoT ready,
including cameras. The IoT is expanding at a rapid rate and is expected to grow
over the coming years at a pace which makes previous technology adoptions
look insignificant. The IoT promises to connect everything from CCTV
cameras, medical devices, smart home products to smart enabled vehicles and
many more devices. Raspberry Pi makes it possible to make simple systems all
by ourselves and provide cheaper alternatives to existing systems as they use
open source softwares rather than that of the proprietary kind.
1
Chapter – 2

Literature Review
1)Kokkonis, George, et al. "Real-time wireless multisensory smart
surveillance with 3D-HEVC streams for internet-of-things (IoT)." The
Journal of Supercomputing 73.3 (2017): 1044-1062.

The last few years, significant advances which improve healthcare have been
done in Internet of Things, in cloud computing, in video coding, and in mobile
devices. This paper provides an overview of these advances. Also, we propose
an IoT-based surveillance system for ubiquitous healthcare monitoring. The
system consists of sensors, actuators, and cameras. Mesh topology was decided
to be used as it provides important advantages. Moreover, the Constrained
Application Protocol (CoAP) is used for the data compression and transferring,
and the Scalable High-Efficiency Video Coding (SHVC) is used for the video
compression and transferring. The SHVC can deliver the same video quality in
half of the bit rate than the High-Efficiency Video Coding (HEVC).
Furthermore, cloud services are provided, such as storage and real-time
monitoring. Finally, we made a comparative analysis between our proposed
system architecture and two other approaches. From this analysis, we can say
that our system architecture has some benefits instead of other similar
architectures. Also, we made an analysis of the bandwidth and the network
throughput. The results are significant since the bandwidth required for the
transmission of data and video is reduced.

2) Motlagh, Naser Hossein, Miloud Bagaa, and Tarik Taleb. "UAV-based


IoT platform: A crowd surveillance use case." IEEE Communications
Magazine 55.2 (2017): 128-134.

Unmanned aerial vehicles are gaining a lot of popularity among an ever


growing community of amateurs as well as service providers. Emerging
2
technologies, such as LTE 4G/5G networks and mobile edge computing, will
widen the use case scenarios of UAVs. In this article, we discuss the potential of
UAVs, equipped with IoT devices, in delivering IoT services from great
heights. A high-level view of a UAV-based integrative IoT platform for the
delivery of IoT services from large height, along with the overall system
orchestrator, is presented in this article. As an envisioned use case of the
platform, the article demonstrates how UAVs can be used for crowd
surveillance based on face recognition. To evaluate the use case, we study the
offloading of video data processing to a MEC node compared to the local
processing of video data onboard UAVs. For this, we developed a testbed
consisting of a local processing node and one MEC node. To perform face
recognition, the Local Binary Pattern Histogram method from the Open Source
Computer Vision is used. The obtained results demonstrate the efficiency of the
MEC-based offloading approach in saving the scarce energy of UAVs, reducing
the processing time of recognition, and promptly detecting suspicious persons.

3) Kokkonis, George, et al. "Real-time wireless multisensory smart


surveillance with 3D-HEVC streams for internet-of-things (IoT)." The
Journal of Supercomputing 73.3 (2017): 1044-1062.

This paper presents the design of a novel, real-time, wireless, multisensory,


smart surveillance system with 3D-HEVC features. The proposed high-level
system architecture of the surveillance system is analyzed. The advantages of
HEVC encoding are presented. Methods for synchronization between multiple
streams are presented. Available wireless standards are presented and
compared. A network-adaptive transmission protocol for a reliable, real-time,
multisensory surveillance system is proposed. Adaptive packet frame grouping
(APFG) and adaptive quantization are deployed to maximize the quality-of-
experience (QoE). Measurements of the proposed protocol have been shown to
provide superior results compared to existing transport protocols.

3
4) Alsmirat, Mohammad A., et al. "Internet of surveillance: a cloud
supported large-scale wireless surveillance system." The Journal of
Supercomputing 73.3 (2017): 973-992.

Large-scale video surveillance systems are among the necessities for securing
our life these days. The high bandwidth demand and the large storage
requirements are the main challenges in such systems. To face these challenges,
the system can be deployed as a multi-tier framework that utilizes different
technologies. In such a framework, technologies proposed under the umbrella of
the Internet of Things (IoT) can play a significant rule in facing the challenges.
In video surveillance, the cameras can be considered as “the things” that are
streaming videos to a central processing and storage server (the cloud) through
the Internet. Wireless technologies can be used to connect wireless cameras to
the surveillance system more conveniently than wired cameras. Unfortunately,
wireless communication in general tend to have limited bandwidth that needs
careful management to achieve scalability. In this paper, we design and evaluate
a reliable IoT-based wireless video surveillance system that provides an optimal
bandwidth distribution and allocation to minimize the overall surveillance video
distortion. We evaluate our system using NS-3 simulation. The results show that
the proposed framework fully utilizes the available cloud bandwidth budget and
achieves high scalability.

5) Memos, Vasileios A., et al. "An efficient algorithm for media-based


surveillance system (EAMSuS) in IoT smart city framework." Future
Generation Computer Systems (2017).

Internet of Things (IoT) is the new technological revolution that aspires to


connect all the everyday physical objects to the Internet, making a huge global
network of uniquely things which can share information amongst each other and
complete scheduled tasks, bringing significant benefits to users and companies
of a Smart City (SC). A Smart City represents a new future framework, which

4
integrates multiple information and communication technology (ICT) and
Internet of Things (IoT) solutions, so as to improve the quality life of its
citizens. However, there are many security and privacy issues which must be
taken into account before the official launching of this new technological
concept. Many methods which focus on media security of wireless sensor
networks have been proposed and can be adopted in the new expandable
network of IoT. In this paper, we describe the upcoming IoT network
architecture and its security challenges and analyze the most important
researches on media security and privacy in wireless sensor networks (WSNs).
Subsequently, we propose an Efficient Algorithm for Media-based Surveillance
System (EAMSuS) in IoT network for Smart City Framework, which merges
two algorithms introduced by other researchers for WSN packet routing and
security, while it reclaims the new media compression standard, High
Efficiency Video Coding (HEVC). Experimental analysis shows the efficacy of
our proposed scheme in terms of users’ privacy, media security, and sensor
node memory requirements. This scheme can be successfully integrated into the
IoT network of the upcoming Smart City concept.

6) Gubbi, Jayavardhana, et al. "Internet of Things (IoT): A vision,


architectural elements, and future directions." Future generation computer
systems 29.7 (2013): 1645-1660.

Ubiquitous sensing enabled by Wireless Sensor Network (WSN) technologies


cuts across many areas of modern day living. This offers the ability to measure,
infer and understand environmental indicators, from delicate ecologies and
natural resources to urban environments. The proliferation of these devices in a
communicating–actuating network creates the Internet of Things (IoT), wherein
sensors and actuators blend seamlessly with the environment around us, and the
information is shared across platforms in order to develop a common operating
picture (COP). Fueled by the recent adaptation of a variety of enabling wireless

5
technologies such as RFID tags and embedded sensor and actuator nodes, the
IoT has stepped out of its infancy and is the next revolutionary technology in
transforming the Internet into a fully integrated Future Internet. As we move
from www (static pages web) to web2 (social networking web) to web3
(ubiquitous computing web), the need for data-on-demand using sophisticated
intuitive queries increases significantly. This paper presents a Cloud centric
vision for worldwide implementation of Internet of Things. The key enabling
technologies and application domains that are likely to drive IoT research in the
near future are discussed. A Cloud implementation using Aneka, which is based
on interaction of private and public Clouds is presented. We conclude our IoT
vision by expanding on the need for convergence of WSN, the Internet and
distributed computing directed at technological research community.

7) Jyothi, S. Naga, and K. Vijaya Vardhan. "Design and implementation of


real time security surveillance system using IoT." Communication and
Electronics Systems (ICCES), International Conference on. IEEE, 2016.

In recent years, there has been an increase in video surveillance systems in


public and private environments due to a heightened sense of security like,
CCTV and RFID. There are several defects in the video surveillance systems
such as picture is indistinct, complex structure, Poor stability, lot of storage
space is needed to save the surveillance information and prices remain relatively
high. This paper proposes the real time security surveillance system using IoT.
The system design uses Motion Detection algorithm written in Python as a
default programming environment. This significantly decreases the storage
usage and save investment cost. The algorithm for Motion Detection is being
implemented on low processing power chip Raspberry pi 2 and Pi camera,
which enables live video streaming with detection of moving objects and get
alarm when motion is detected and sends photos, videos to a cloud server
directly using pi camera. When cloud is not available then the data is stored

6
locally on raspberry pi and sent when the connection resumes. The camera is
mounted on the motor and its movement (Left/Right) is controlled through IoT
webpage by the user, thus providing user with enhanced view of the
surroundings.

8) Ali, Afiq Muzakkir Mat, Nazrul Muhaimin Ahmad, and Anang Hudaya
Muhamad Amin. "Cloudlet-based cyber foraging framework for
distributed video surveillance provisioning." Information and
Communication Technologies (WICT), 2014 Fourth World Congress on.
IEEE, 2014.

Continuous monitoring activities in surveillance system generate massive


amount of data to be transferred from Internet-of-Things (IoT) devices (i.e.,
cameras and sensors) to a centralized processing unit for analysis. However,
several issues need to be addressed, including data migration over bandwidth
limited and high latency communication networks, and the heterogeneous
nature of data obtained from the surveillance system. The aim of this paper is to
develop a scalable and lightweight intelligent distributed surveillance system
that make use of an integrated framework of Internet-of-Things (IoT) and cloud
computing. It leverages on the pervasiveness in IoT and ubiquitous property of
cloud computing technology. This paper introduces the concept of bringing
cloud closer to the IoT in order to address the resource poverty of IoT and the
dependency for massive data transmission to distant cloud. For providing real-
time on-site object detection, this paper instantiates a cloudlet on resource-rich
nearby infrastructure which is connected to the IoT devices for distributed
retrieval and processing of critical and sensitive data.

7
Chapter – 3

System Analysis
3.1 Existing System

Analog surveillance systems:

Most security cameras on the market today are standard analog security cameras
connected directly to a digital video recorder. The cameras is this type of system
consist of a lens, DSP chip (digital signal processing chip) and a housing. The
cameras are simply the window used by the DVR (digital video recorder) to see.
The cameras are connected to the DVR using transmission cables. There are
many types of cables, but they will all have a connection directly to the DVR.
The DVR is the heart of this system. The security digital video recorder receives
the video from the camera, compresses it and stores it on a hard drive to be
retrieved later. Most DVRs also convert the analog video to digital format and
are able to stream that video over the internet using a built in webserver. In this
scenario, the DVR is responsible for compression, conversion, storage and
streaming of all the video that comes from each camera. addittionaly, the DVR
is the inteligence behind the cameras and is responsible for all the motion
detection, schedules, notifications, alarm inputs and more.In the end, this type
of surveillance system is usually less expensive because the cameras are simply
cameras and there is only one unit that does all the grunt work, the DVR.

IP Surveillance systems:

IP or network security camera systems are very different from analog systems
because each camera does the job of the DVR. Essentially, an IP camera is a
standard security camera that can also compress video, convert the video to
digital format and stream it over ethernet. So each camera is esentially its own

8
DVR. Some IP cameras also have SD card slots so that they can store video
directly onto an SD card. IP cameras are sometimes connected to an NVR
(network video recorder) instead of a DVR. Since the video is compressed and
converted to digital at the camera, the camera can stream the video over a
network to a PC or NVR that will record the compressed video. The benefit of
IP cameras is that it is easy to add additional cameras to the network and there
are higher resolutions available than in standard analog surveillance systems.

Disadvantages:-

1)They are not portable systems as they need to be connected to a PC or a


power outlet at all times to function properly.

2)The few portable cameras that are out there are pretty expensive

3)The configurations that are setup for the camera are pretty much fixed and not
a whole lot of changes can be made as the software used in proprietary.

3.2 Proposed System

The proposed system uses a Raspberry Pi for the computations and open source
software to gather data, which helps us drive down the costs.The open source
software that will be used for motion detection, live stream and the mail alert
trigger will be ‘Motion’ and the mail client used is SSMTP along with mailutils.
A usb webcam will be attached to the Raspberry Pi.The Pi will power up the
camera while the software that will make this camera IoT ready will be the
Motion software.When motion is detected, the motion software commands the
camera to start clicking pictures as well as record short videos.All of these
media files will be locally stored in the Pi.Whenever motion is started up, the
camera immediately starts livestreaming the footage it captures over a

9
network.This livestream can be viewed by typing in the IP address of the Pi in
the browser while the device you are trying to view the livestream on is
connected to the same network the Pi is connected to.Along with clicking
pictures and recording videos when motion is detected, the motion software is
configured to send an email with the latest picture it clicked as an attachment to
your mail.In order for this to work, the SSMTP mail client as well as mailutils
needs to be installed and setup by providing your mail details in the
configuration files.Motion then works with SSMTP in order to send the
email.Each picture it clicks will have a timestamp on it.The motion software is
configured to run in the background as soon as the Raspberry Pi boots up
removing the need to start the motion software manually.In order to make the
whole system truly portable and independent of other systems, the Pi is
connected to a dongle at all times in order for the Pi to get constant internet
connection for the livestream to function.As for power, a power bank is
connected to the Pi using a micro usb cable which powers the Pi and the Pi will
provide power to the usb camera connected to it.Keep in mind that this system
is not supposed to completely replace your home surveillance system but rather
be a temporary and portable solution to fulfil your security needs and can be
setup anywhere you want.Given below is the architecture of the system:-

10
3.2.1 Advantages of Proposed System:-

 The system is portable and can be used without the need for any kind of
setup.
 It is a cheaper alternative to the more expensive cameras out there.
 Since the software used is open source, it is possible to fine tune the
configurations to your liking.

3.3 Feasibility Study

A feasibility study aims to objectively and rationally uncover the strengths and
weaknesses of an existing business or proposed venture, opportunities and
threats present in the natural environment, the resources required to carry
through, and ultimately the prospects for success.In its simplest terms, the two
criteria to judge feasibility are cost required and value to be attained.A well-
designed feasibility study should provide a historical background of the
business or project, a description of the product or service, accounting
statements, details of the operations and management, marketing research and
policies, financial data, legal requirements and tax obligations.[1] Generally,
feasibility studies precede technical development and project implementation.A
feasibility study evaluates the project's potential for success; therefore,
perceived objectivity is an important factor in the credibility of the study for
potential investors and lending institutions.It must therefore be conducted with
an objective, unbiased approach to provide information upon which decisions
can be based.

3.3.1 Economical Feasibility

This study is carried out to check the economic impact of the proposed system
on the organization.The amount of money that a company can invest in an idea
is limited and thus, the expenditures must be justified. Thus it was possible to
develop the system well within a budget because most of the technologies used

11
is freely available( Eg:Motion software is an open source). By analyzing the
parameters such as Hardware cost since all the software used is free, Total
estimated cost of the project, Financing of the project by equal sharing between
our team members, Cost-benefit analysis. Projected cash flow and profitability,
we conclude that our project is economically feasible.

3.3.2 Technical Feasibility

Technical feasibility study is carried out to check the technical feasibility, that
is, the technical requirements of the system. Any system developed must not
have a high demand on the available technical resources. This will lead to high
demands being placed on the client. The developed system must have a modest
requirement, as only minimal or null changes are required for implementing this
system.With respect to technical feasibility, we analyzed various technical
considerations that include Software available, Platforms available, Protocols
available for network communication, Interoperability factors and also our
knowledge level and expertization with the tools available to implement our
project and thus, we have concluded that out project is technically feasible.

3.3.3 Operational Feasibility

Operational feasibility is the measure of how well a proposed system solves the
problems, and takes advantage of the opportunities identified during scope
definition and how it satisfies the requirements identified in the requirements
analysis phase of system development.The operational feasibility assessment
focuses on the degree to which the proposed development project fits in with
the existing business environment and objectives with regard to development
schedule, delivery date, corporate culture and existing business processes.To
ensure success, desired operational outcomes must be imparted during design
and development. These include such design-dependent parameters as
reliability, maintainability, supportability, usability, producibility, disposability,

12
sustainability, affordability and others. These parameters are required to be
considered at the early stages of design if desired operational behaviours are to
be realised. A system design and development requires appropriate and timely
application of engineering and management efforts to meet the previously
mentioned parameters. A system may serve its intended purpose most
effectively when its technical and operating characteristics are engineered into
the design. Therefore, operational feasibility is a critical aspect of systems
engineering that needs to be an integral part of the early design phases.Thus, all
the parameters of reliability, maintainability, supportability, usuability,
producibility and disposability have been analysed for our system and we have
concluded that our project is operationally feasible.

13
Chapter – 4

System Requirements

4.1 Hardware Requirements

 Raspberry Pi 3 Model B(Any model will do)


 USB camera
 Power bank(A 20,000 mah power bank was used here)
 A micro SD card(a 32 gb card was used here)
4.2 Software Requirements
 Raspian OS
 Motion
 SSMTP
 Mailutils
 mpack

14
Chapter – 5

Software Description
5.1 Raspian OS

Raspbian is a Debian-based computer operating system for Raspberry Pi. There


are several versions of Raspbian including Raspbian Stretch and Raspbian
Jessie. Since 2015 it has been officially provided by the Raspberry Pi
Foundation as the primary operating system for the family of Raspberry Pi
single-board computers.Raspbian was created by Mike Thompson and Peter
Green as an independent project.The initial build was completed in June 2012.
The operating system is still under active development. Raspbian is highly
optimized for the Raspberry Pi line's low-performance ARM CPUs.Raspbian
uses PIXEL, Pi Improved Xwindows Environment, Lightweight as its main
desktop environment as of the latest update. It is composed of a modified LXDE
desktop environment and the Openbox stacking window manager with a new
theme and few other changes. The distribution is shipped with a copy of
computer algebra program Mathematica and a version of Minecraft called
Minecraft Pi as well as a lightweight version of Chromium as of the latest
version.

5.2 Motion

Motion, a software motion detector, is a free, open source CCTV software


application developed for Linux.It can monitor video signal from one or more
cameras and is able to detect if a significant part of the picture has changed
saving away video when it detects that motion is occurring (it can also do time
lapse videos, et al.).The program is written in C and is made for Linux
(exploiting video4linux interface). Motion is a command line-based tool whose
output can be either jpeg, netpbm files or mpeg video sequences. It is strictly
command line driven and can run as a daemon with a rather small footprint and
15
low CPU usage.It is operated mainly via config files, though the end video
streams can be viewed from a web browser. It can also call to user configurable
"triggers" when certain events occur.

5.3 SSMTP

SSMTP is a program which delivers email from a local computer to a


configured mailhost (mailhub). It is not a mail server (like feature-rich mail
server sendmail) and does not receive mail, expand aliases or manage a queue.
One of its primary uses is for forwarding automated email (like system alerts)
off your machine and to an external email address.

5.4 Mailtutils

Mailutils is a collection of programs for managing, viewing and processing


electronic mail. It contains both utilities and server daemons and all operate in a
protocol-agnostic way. The underlying libraries are also available, simplifying
the addition of mail capabilities to new software.

5.5 mpack

The mpack program encodes the the named file in one or more MIME
messages. The resulting messages are mailed to one or more recipients, written
to a named file or set of files, or posted to a set of newsgroups.

16
Chapter – 6

Project Description
6.1 Problem Definition

The surveillance and security cameras used these days are fixed to a ceratin
point and the system cannot be moved around easily once it is set up.There may
arise certain situations where one might want to have some security at hand so
that they can setup a security camera even though it is to be used for only a few
hours or so.Like in a hotel room or in an exhibition where an already setup
security camera might come in handy.While there are a few portable
surveillance cameras out there, they are quite expensive and cannot be
customised beyond a certain limit.The main aim of our project is to provide a
portable surveillance system that is independent of any other system, is
affordable and can be customised to your needs.

6.2 Overview of the Project

The ultimate aim of the project is to make the surveillance system as portable as
possible and also encourage the use of IoT for personal use.The portability of
the system comes with the use of Power bank and operating the Raspberry Pi in
headless mode.Motion taking place in front of the connected camera is detected
by the Motion software and the pictures clicked and videos recorded are saved
locally.Livestream is also enabled when the camera is turned on.The installed
mail client will be used to send an email of the latest picture clicked as an
attachment using SSMTP,Mailutils and mpack.

6.3 Modules identified

1. The Security Camera Module


2. Power Module
3. Email Alert System Module

17
Prerequisites:-

 Before any of the modules are implemented, it is important that these


prerequisites are present.
 The Raspian OS must be already installed in your Pi
 It must be either installed manually using a micro SD card or Pi models
with Raspian OS preinstalled are available in the market.

6.4 Module Description:-

6.4.1 The Security Camera Module

Motion needs to be installed in the Pi in order to configure its config file and
enable the livestream, local storage of media files and motion detection features
with the help of the connected camera.Motion can be installed and configured in
the following way in order to get the mentioned features up and running.

Step 1: First run the below command to update the Raspbian OS on Raspberry
Pi:

sudo apt-get update

Step 2: Then install ‘Motion’ Library by using below command:

sudo apt-get install motion

Step 3: Now set Motion daemon to yes by editing the file: /etc/default/motion so
that it will be always running. Edit this file using ‘nano’ editor with ‘sudo’ like
given below:

sudo nano /etc/default/motion

Step 4: Now we need to set the permission for the Target Directory
(/var/lib/motion/), in which Motion saves all the Video recordings and picture
files. We need to set ‘Motion’ as owner of this directory by issuing below
command:

18
sudo chown motion:motion /var/lib/motion/

Step 5: Now we are almost done, only we need to change one config option in
Motion configuration file (/etc/motion/motion.conf) which is stream_localhost
off. We have to turn off this local host streaming, otherwise we will not be able
to access the Video feed on our network and it will be only accessible from the
Raspberry Pi itself. To doing so, edit the Motion Configuration file with ‘nano’
editor and turn it off, like shown in screenshot 1

sudo nano /etc/motion/motion.conf

 Now we are done and ready to get our live feed from the USB web
camera connected to Pi. Just start the Motion service using below
command and open your Raspberry Pi’s IP, with port 8081, in your
browser (like 192.168.1.103:8081):

sudo /etc/init.d/motion start

 You can always start, stop, restart and get status of Motion service using
below four commands:

sudo /etc/init.d/motion start

sudo /etc/init.d/motion stop

sudo service motion restart

sudo service motion status

or you can reboot the Raspberry Pi as a troubleshooting step when necessary:

sudo reboot

19
6.4.2 Power Module

 A power bank of 20,000 mah is connected to the Pi.


 The moment the power bank is connected, the Pi starts up and the
security camera module starts running immediately
 The Pi will in turn power the camera
 The camera will capture the images and record videos and send the data
back to the Pi.
 It is important to keep the Pi connected to the power bank as long as you
want the system to run.
 The power usage of the Pi is very low and hence the system can last for a
very long amount of time on a fully charged power bank.

6.4.3 Email Alert System Module

 This module will send an email of the latest snap captured to the mail
account mentioned whenever motion is detected by the system.
 A mail client needs to be installed in order for this to work.
 A number of tools are to be installed to install a mail client.
 Once this is done,Motion needs to be configured to send an email with
the picture recently saved in the local storage as an attachment.
 Installation of tools and the configuration of Motion can be done in the
following way:-

Installing a Mail Client:-

For this solution you'll need a throwaway Gmail account, as you are going to
specify your Gmail password in a configuration file.

Start by installing the tools you'll be using to send emails:

sudo apt-get install ssmtp

sudo apt-get install mailutils


20
sudo apt-get install mpack

Next, run:

sudo nano /etc/ssmtp/ssmtp.conf

and ensure that file contains the following configuration parameters, making
sure that your Gmail account credentials are in place:

root=postmaster

mailhub=smtp.gmail.com:587

hostname=raspberrypi

[email protected]

AuthPass=yourgmailpassword

FromLineOverride=YES

UseSTARTTLS=YES

Finally send a test email with an attachment from the target_dir directory:

mpack -s "Test Email" [target_dir/filename] [recipientEmailAddress]

If this mail arrives you are good to go to the next step.

Configuring Motion to send Email:-

Here you'll need to make a small change to your Motion configuration file.

sudo nano etc/motion/motion.conf

You'll be updating the on_picture_save parameter. Uncomment it and change


it's value as follows (updating the recipientEmailAddress to the email at which
you want to receive alerts):

mpack -s "Your Security Camera has detected Motion!" %f


[recipientEmailAddress]

21
What happens here is that Motion will call this command each time a new
image snapshot is saved to the target_dir directory. The %f variable contains the
full path to the file.Save the configuration file, restart Motion and voila! You
should now be receiving email notifications each time Motion detects a motion
event.

 Note:Ctrl+W can be used in order to search for terms in the conf file.

22
Chapter – 7

System Testing
7.1 Introduction

System testing of software or hardware is testing conducted on a complete,


integrated system to evaluate the system's compliance with its specified
requirements. System testing falls within the scope of black-box testing, and as
such, should require no knowledge of the inner design of the code or logic.As a
rule, system testing takes, as its input, all of the "integrated" software
components that have passed integration testing and also the software system
itself integrated with any applicable hardware system(s). The purpose of
integration testing is to detect any inconsistencies between the software units
that are integrated together (called assemblages) or between any of the
assemblages and the hardware. System testing is a more limited type of testing;
it seeks to detect defects both within the "inter-assemblages" and also within the
system as a whole. System testing is performed on the entire system in the
context of a Functional Requirement Specification(s) (FRS) and/or a System
Requirement Specification (SRS). System testing tests not only the design, but
also the behaviour and even the believed expectations of the customer. It is also
intended to test up to and beyond the bounds defined in the software/hardware
requirements specification(s).

7.2 TYPES OF TESTING

7.2.1 Unit Testing

This is the first level of testing. The different modules are tested against the
specifications produced during the integration. This is done to test the internal
logic of each module. Those resulting from the interaction between modules are
initially avoided. The input received and output generated is also tested to see

23
whether it falls in the expected range of values. Unit testing is performed from
the bottom up, starting with the smallest and lowest modules and proceeding
one at a time.

7.2.2 Integration Testing

In integration testing, the tested modules are combined into sub-systems, which
are then tested. The goal of integration testing to check whether the modules can
be integrated properly emphasizing on the interfaces between modules. The
different modules were linked together and integration testing done on them.

7.2.3 Validation Testing

The objective of the validation test is to tell the user about the validity and
reliability of the system. It verifies whether the system operates as specified
and the integrity of important data is maintained. User motivation is very
important for the successful performance of the system.

7.2.4 System Testing

The integration of each module in the system is checked during this level of
testing. The objective of system testing is to check if the software meets its
requirements. System testing is done to uncover errors that were not found in
earlier tests. This includes forced system failures and validation of total system
as the user in the operational environment implements it.

7.3 Test Cases

A test case is a set of conditions under which the tester will determine whether
the system is working or not.

TC 1:The mail will not be sent if the filename is not written properly in the
on_picture save parameter

24
TC 2:Checking the status of the battery of the power bank leads to rebooting of
the motion software

TC 3:The battery has not dropped from 75% even after over 2 hours of usage
implying that the system can last for a long time

TC 4:The mail alert system does not affect the performance of the security
camera module

TC 5:There is a small amount of delay on receiving the mail after the picture is
clicked.

25
Chapter – 8

Implementation
8.1 Introduction

Implementation is the realization of an application, or execution of a plan, idea,


model, design, specification, standard, algorithm, or policy. Implementation is
the very important phase and it converts conceptual ideas into actions, whereas
analysis and other steps are not visible .A successful Implementation makes the
system powerful.

8.2 Overview of the Implementation

The power bank is powers up the Pi which in turn powers the camera.After the
installation of motion, motion is configured by making changes to various
parameters such as stream_localhost, image width, image height, stream quality,
etc. in order to get the livestream up and running as well as make the camera
capture images and record videos at regular intervals when motion is
detected.SSMTP,Mailutils and mpack are the tools that are installed which
install the mail client needed for the email alert system.The ssmtp is configured
with the user details entered in the AuthEmail and AuthPassword.This is
necessary in order to set the mail account throught which the mail will be
sent.The receipient email is also supposed to be entered in the config file.After
this is done,motion is configured to send the email by uncommenting the
on_picture_save parameter and using mpack –s “Subject” %f [recipient_email]
where %f is the full path along with the filename.Once this is done, the mail
alert system is ready to use.

26
Chapter – 9

Conclusion and Future Enhancements


9.1 Conclusion

The novelty and significance of this work is that by introducing the idea of an
affordable portable surveillance system using open source software is that a
portable and ready to use security camera system will be available for the
general public to use which can come in handy quite often.This surveillance
system is not supposed to replace the stationary security camera systems but
rather provide a temporary solutions for your quick home security needs and
provide a cheaper alternative to the expensive options out there.The success of
this project wil encourage the general public to dabble in IoT and create IoT
systems for their personal use by themselves making the private companies to
work harder to deliver more quality products and thereby increasing healthy
competition between brands that compete in the same market, thereby
increasing the no. of quality products in the market which are more affordable.

9.2 Future Enhancements

Short term future enhancements:-

The livestream can be viewed on any device with an internet connection on a


network different from the one the Pi is connected by enabling Port Forwarding
on the connected dongle.

Long term future enhancements:-

The whole system can be fixed in a case so that the whole system can be carried
around as 1 component rather than carrying around 3 components all the
time.As of now, the livestream that is broadcasted over the network has no
sound so the inclusion of a microphone module to the Pi and integrating it with
the system could broadcast the livestream with sound as well.
27
Appendix - 1

SCREEN SHOTS
Configuration of Motion

28
29
30
31
32
33
Livestream

Email Alert

34
Storage of Photos and Videos

35
Appendix – 2

References
1)

https://circuitdigest.com/microcontroller-projects/raspberry-pi-surveillance-
camera

2)

https://www.bouvet.no/bouvet-deler/utbrudd/building-a-motion-activated-
security-camera-with-the-raspberry-pi-zero

3)

https://wiki.archlinux.org/index.php/SSMTP

4)

https://directory.fsf.org/wiki/Mailutils

5)

https://linux.die.net/man/1/mpack

6)

https://en.wikipedia.org/wiki/MIME

36
7)

https://en.wikipedia.org/wiki/Motion_(surveillance_software)

8)

https://en.wikipedia.org/wiki/Raspbian

37

You might also like