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

THE UNIVERSITY OF BAMENDA

NATIONAL HIGHER DEPARTMENT OF


POLYTECHNIC COMPUTER
INSTITUTE ENGINEERING

REAL TIME CAMERA SECURITY SURVEY SYSTEM

A project Submitted to the Department of Computer Engineering of the National Higher


Polytechnic Institute of the University of Bamenda in Partial Fulfilment for the Requirements for
the Award of a Bachelor of Engineering degree in Computer Engineering

BY:

TAYO IVO ENCHO BARSEH

REGISTRATION NUMBER: UBa17E0041

SUPERVISORS:

DR. NDUKUM PASCALINE MR. TCHASSO SERGE PAULIN

OCTOBER 2021
THE UNIVERSITY OF BAMENDA

NATIONAL HIGHER DEPARTMENT OF


POLYTECHNIC COMPUTER
INSTITUTE ENGINEERING

REAL TIME CAMERA SECURITY SURVEY SYSTEM

A project Submitted to the Department of Computer Engineering of the National Higher


Polytechnic Institute of the University of Bamenda in Partial Fulfilment for the Requirements for
the Award of a Bachelor of Engineering degree in Computer Engineering

BY:

TAYO IVO ENCHO BARSEH

REGISTRATION NUMBER: UBa17E0041

SUPERVISORS:

DR. NDUKUM PASCALINE MR. TCHASSO SERGE PAULIN

OCTOBER 2021
©Copyright by ……TAYO IVO ENCHO BARSEH……., 2021
All rights reserved

i
DECLARATION OF ORIGINALITY OF STUDY

I, TAYO IVO ENCHO BARSEH, registration N◦: UBa17E0041, in the Department of


Computer Engineering, National Higher Polytechnic Institute, The University of Bamenda
hereby declare that, this work titled “REAL TIME CAMERA SECURITY SURVEY
SYSTEM” is my original work. It has not been presented in any application for a degree or any
academic pursuit. I have acknowledged all borrowed ideas nationally and internationally
through citations.

Date: ___________________ Signature of author ________________

ii
CERTIFICATION OF CORRECTIONS AFTER DEFENSE

This is to certify that this project titled “REAL TIME CAMERA SECURITY SURVEY
SYSTEM” is the original work of TAYO IVO ENCHO BARSEH. This work is submitted
in partial fulfilment of the requirements for the award of a Bachelor of Engineering Degree in
Computer Engineering in the National Higher Polytechnic Institute of The University of
Bamenda, Cameroon.

Supervisor: Dr. NDUKUM PASCALINE


Mr. TCHASSO SERGE PAULIN

The Head of Department: Dr. NDUKUM PASCALINE

The Director: Prof. FIDELIS CHO-NGWA

iii
ASTRACT
In our society today, the priority of people is their security in or out of their houses no matter
the time of the day. This security could be against thieves, it could be against fire outbreaks
around the place, it could also be someone crying for help for whatever has happened. In most
developed countries, camera survey systems have been put in place in nearly all streets, houses,
offices, market places, stadiums and even forest to monitor wild life. In this research, we are
going to build such systems but this time with some little advancements like implementing
Artificial Intelligence to detect fire scenes and also identify someone crying for help. The
realisation of this project will be divided into two major parts, software and hardware. The
features extraction part was executed on the hardware device and the output part was executed
on the software. This configuration will allow us to attain a real time processing system with a
good detection of the motion during our survey.

iv
RESUME
Dans notre société d'aujourd'hui, la priorité des personnes est leur sécurité à l'intérieur ou à
l'extérieur de leur maison, peu importe l'heure de la journée. Cette sécurité pourrait être contre
les voleurs, cela pourrait être contre les incendies autour de l'endroit, cela pourrait aussi être
quelqu'un qui crie à l'aide pour tout ce qui s'est passé. Dans la plupart des pays développés, des
systèmes de surveillance par caméra ont été mis en place dans presque toutes les rues, maisons,
bureaux, places de marché, stades et même forêts pour surveiller la vie sauvage. Dans cette
recherche, nous allons construire de tels systèmes, mais cette fois avec quelques petites
avancées comme la mise en œuvre de l'intelligence artificielle pour détecter les scènes
d'incendie et également identifier quelqu'un qui appelle à l'aide. La réalisation de ce projet sera
divisée en deux grandes parties, logicielles et matérielles. La partie extraction des
caractéristiques a été exécutée sur le périphérique matériel et la partie de sortie a été exécutée
sur le logiciel. Cette configuration nous permettra d'atteindre un système de traitement en temps
réel avec une bonne détection du mouvement lors de notre relevé.

v
DEDICATION
This research is dedicated to the TAYO’S family

vi
ACKNOWLEDGEMENT
I would like to offer a hand of applause for the success of this work or research would not have
been possible without the following people.

The first would be my supervisor Dr. NDUKUM PASCALINE and my co-supervisor Mr.
TCHASSO SERGE PAULINE for their immense support, encouragement and being there for
me with endless motivation to hard work which led to the completion of this project.

A big thank you goes to the staff of (N.A.H.P.I) Bambili who guided and made sure the
completion of this project was success.

I will also like to express my level of gratitude to my family who supported and encouraged
me to go through this study. My sincere appreciation for your love, care and sacrifice for
moulding me into a better person.

Additionally, I would like give a shout out to my class mates for the company through the stress
of a better tomorrow. I am happy because seeing you work gave me even more motivation than
I could ever possibly imagine.
I thank the father lord almighty for his endless grace which always gave me the power and
strength to always take a step ahead of my past work.

vii
TABLE OF CONTENT

CERTIFICATION OF CORRECTIONS AFTER DEFENSE ................................................ iii

ASTRACT ................................................................................................................................ iv

RESUME ................................................................................................................................... v

DEDICATION .......................................................................................................................... vi

ACKNOWLEDGEMENT .......................................................................................................vii

TABLE OF CONTENT ..................................................................................................... viii

LIST OF FIGURES .............................................................................................................. xi

LIST OF ABBREVIATIONS ............................................................................................ xiii

1.2. PROBLEM STATEMENT ......................................................................................... 2

1.3. RATIONALE .............................................................................................................. 2

1.3.1. MOTIVATIONS ..................................................................................................... 2

1.3.2. SIGNIFICANCE ..................................................................................................... 3

1.4. RESEARCH QUESTION ........................................................................................... 3

1.5. RESEACH OBJECTIVES .......................................................................................... 3

1.6. SCOPE AND DELITATTIONS OF STUDY ............................................................. 4

1.6.1. SCOPE AND STUDY ............................................................................................. 4

1.6.2. DELIMITATIONS OF THE STUDY ..................................................................... 4

1.7. DEFINITION OF SOME TERMS .............................................................................. 4

1.7.1. VIDEO SURVEILLANCE...................................................................................... 4

1.7.2. REMOTE ACCESS ................................................................................................. 5

1.7.3. SENSORS................................................................................................................ 5

1.7.4. IMAGE AND VIDEO PROCESSING.................................................................... 5

1.7.5. DIGITAL CAMERA ............................................................................................... 6

1.7.6. ILLUMINATION .................................................................................................... 6

1.8. PROJECT OVERVIEW .............................................................................................. 6

viii
1.9. PARTIAL CONCLUSION ......................................................................................... 7

CHAPTER 2: LITERATURE REVIEW ................................................................................... 8

2.1. INTRODUCTION ....................................................................................................... 8

2.2. RELATED WORKS ................................................................................................... 8

2.3. GENERALITIES ........................................................................................................ 9

2.3.1 RASPBERRY PI ..................................................................................................... 9

2.3.1.1. SOME COMPONENTS OF THE RASPBERRY PI 4 ..................................... 10

2.3.2. WEBCAM ............................................................................................................. 12

2.3.3. BUZZER ................................................................................................................ 13

2.3.4. PASSIVE INFRARED SENSOR ............................................................................. 13

CHAPTER 3: MATERIALS AND METHODS ..................................................................... 15

3.1. INTRODUCTION ..................................................................................................... 15

3.2. AREA OF STUDY ...................................................................................................... 15

3.3. MATERIALS USED .................................................................................................... 16

3.3.1. THE RASPBERRY PI ............................................................................................... 16

3.3.2. THE DIGITAL CAMERA ........................................................................................ 18

3.3.3. THE BUZZER ........................................................................................................... 19

3.3.4. THE PASSIVE INFRARED SENSOR ..................................................................... 20

3.3.5. THE LIGHT DEPENDENT RESISTOR .................................................................. 20

3.4. METHODS ................................................................................................................... 22

3.4.1. MOTION DETECTION ............................................................................................ 22

3.4.2. THE ALARM SYSTEM............................................................................................ 22

3.4.3. THE CAMERA SYSTEM ......................................................................................... 23

3.4.4. NIGHT VISION......................................................................................................... 25

3.4.5. RECORDING VIDEOS AND TAKING PICTURES ............................................... 27

3.4.6. REMOTE ACCESS ................................................................................................... 30

3.4.6. CONFIGURATION FILES FOR RASPBERRY PI FOUR WEBCAM SERVER .. 33

ix
3.4.6. FLOW CHART OF THE SYSTEM ......................................................................... 36

CHAPTER 4: RESULTS AND DISCUSSIONS .................................................................... 45

4.1. INTRODUCTION ........................................................................................................ 45

4.2. DETECT MOTION ...................................................................................................... 45

4.3. THE ALARM SYSTEM............................................................................................... 46

4.4. NIGHT VISION............................................................................................................ 46

4.5. CAPTURING VIDEO .................................................................................................. 47

4.6. CAPTURING PHOTOS ............................................................................................... 47

4.7. THE LIGHTING SYSTEM .......................................................................................... 48

CHAPTER 5: CONCLUSION PERSPECTIVE AND RECOMMENDATIONS .................. 52

5.1. CONCLUSION ............................................................................................................. 52

5.2. PERSPECTIVES .......................................................................................................... 52

5.3. RECOMMENDATION ................................................................................................ 53

REFERENCES ........................................................................................................................ 54

x
LIST OF FIGURES
Figure 2. 1 Image of raspberry pi 4............................................................................................ 9
Figure 2. 2 Micro USB port ..................................................................................................... 10
Figure 2. 3 USB ports .............................................................................................................. 11
Figure 2. 4 Ethernet port .......................................................................................................... 11
Figure 2. 5 HDMI ports .......................................................................................................... 12
Figure 2. 6 Camera .................................................................................................................. 12
Figure 2. 7 Buzzer .................................................................................................................... 13
Figure 2. 8 PIR sensor .............................................................................................................. 14
Figure 3. 1 Map of Africa on the left and Map of Cameroon on the right .............................. 15
Figure 3. 2 Map of Tubah ........................................................................................................ 16
Figure 3. 3 The Raspberry Pi showing labelled parts .............................................................. 17
Figure 3. 4 Raspberry Pi Pins .................................................................................................. 17
Figure 3. 5 Buzzer circuit......................................................................................................... 19
Figure 3. 6 PIR circuit .............................................................................................................. 20
Figure 3. 7 LM35 ..................................................................................................................... 21
Figure 3. 8 LM35 light Variation ............................................................................................. 21
Figure 3. 9 Motion Detection ................................................................................................... 22
Figure 3. 10 Code for the Alarm System ................................................................................. 23
Figure 3. 11 Code for Camera System ..................................................................................... 25
Figure 3. 12 Code for night Vision system .............................................................................. 26
Figure 3. 13 Light Variation values ......................................................................................... 27
Figure 3. 14 Code to Capture Pictures .................................................................................... 28
Figure 3. 15 Code for Video Capture System .......................................................................... 29
Figure 3. 16 Remote Access Configuration ............................................................................. 31
Figure 3. 17 Putty Configuration ............................................................................................. 32
Figure 3. 18 Remote Access configuration .............................................................................. 34
Figure 3. 19 Configuration for USB camera ............................................................................ 34
Figure 3. 20 More USB configuration ..................................................................................... 35

xi
Figure 3. 21 Flow Chart for Buzzer ......................................................................................... 37
Figure 3. 22 Flow Chart LED .................................................................................................. 38
Figure 3. 23 Flowchart for Motion Detection .......................................................................... 39
Figure 3. 24 Flowchart for Light Sensing System ................................................................... 40
Figure 3. 25 Flow chart for Capturing Photo .......................................................................... 41
Figure 3. 26 Flow Chart for Recording Video ........................................................................ 41
Figure 3. 27 Photo Security ..................................................................................................... 42
Figure 3. 28 Video Security Process ........................................................................................ 42
Figure 3. 29 Flow Chart of the entire system........................................................................... 43
Figure 4. 1 Results of Motion Detection ................................................................................. 45
Figure 4. 2 Result of Alarm System......................................................................................... 46
Figure 4. 3 Results showing a video captured by the system when motion is detected .......... 47
Figure 4. 4 Result showing Captured Photo ............................................................................ 47
Figure 4. 5 Result of lighting System ..................................................................................... 48
Figure 4. 6 Project Skeleton ..................................................................................................... 49
Figure 4. 7 Project Skeleton with green lighting ..................................................................... 50
Figure 4. 8 Project skeleton with blue lighting ........................................................................ 51

xii
LIST OF ABBREVIATIONS
CPU: Central Processing Unit
GB: Gigabyte

HDMI: High Definition Multimedia Interface

PIR: Passive Infrared Sensor

Pi 4: Raspberry Pi 4

RAM: Random Access Memory

RJ-45: Registered Jack 45

SD-Card: Secure Digital Memory Card

USB: Universal Serial Bus

xiii
CHAPTER 1: INTRODUCTION
1.1. BACKGROUND OF STUDY

Over the past years, we have seen in Cameroon the existence of camera surveillance in retail
shops, companies, banks and schools. These systems were put in place to report suspicious
activities by recording videos or taking pictures of these scenes. This method of security was
conceived because of the in-ability of the human being to keep watch 24/7 and report truly and
in detail the action of suspicious scenes. Not only were these systems capable of working all
day but they were more efficient and cost less with more productivity as they could keep good
records of activities carried out in a certain location at a particular time.

Camera based surveillance system using the Raspberry pi 4 is mainly beneficial for determining
crime scenes, it monitors scenarios and activities, helps to gather information and evidences
from a crime scene, it is also very useful as the advanced systems can detect and report natural
disasters such as earth quakes, the system is built to monitor homes, offices, remote areas. The
system is designed to report fully and in detail crime scenes by taking pictures and videos of
what exactly happened in a particular place at a particular time. The system uses the raspberry
pi 4 as the central processing unit with a pair of USB cameras for the pictures and videos, also
with PIR sensor for detecting and reporting motion to the processing unit, with the aid of a light
dependent resistor to detect the changes in light intensity and report to the raspberry for further
processing of the images. The cameras are equipped with infrared light emitting diodes which
will improve the vision of the system under low lighting conditions. Finally, the system can be
equipped with internet services to enable access to the cameras from remote locations.

The system constantly monitors the environment for motion and the input is fed to the processor
for corresponding actions. The PIR input is processed by the raspberry and the decision on
taking a picture or a video is decided by the pi. When motion is detected by the system, it
records a video while the motion is happening and the video is stored in the primary storage of
the raspberry pi on a location that is to be accessed by the end user.

1
1.2. PROBLEM STATEMENT
In our society today there is a lot of insecurity, people get to commit crimes and most times
than not, get away with it, the aim of this thesis is to design a camera security survey system
for a building which could be a house or an organisation that is capable of monitoring the
movement of different objects, take videos and pictures of suspicious scenes like a man holding
a gun, someone with the face all covered by a mask, fire scenes and stores them in a database,
and more over be able to send the videos over a network and not all that but be able to see live
videos of the surrounding. The main problem here is, most people now do not want to work to
earn their money, because of this they have to think of other ways of making a living and most
of them turn to engage in illegal practices to make money. This illegal practices can be physical
human harassment, breaking into people’s houses to steal, kidnap and also harm people with
weapons, breaking into public places like banks, “Njangi houses”, small business organisations
like retail shops. Some even go to the level of practicing social engineering attacks (this is a
case where someone uses the identity of another to request useful information or money or
passwords or location of vitals with the use of the victim identity like the phone number, email
address or even a social media account). Most of the time when this act is taking place, there
is little or no security to intervene and so the people who commit such crimes get to go un-
punished.

The project with title “Real time camera security survey system” will use the raspberry pi
computer which is a low cost, credit card sized computer that plugs into a computer monitor,
keyboard and mouse to write interesting programs that can be used to control hardware and the
python programming language pre-installed in the raspberry pi to control a set of cameras to
show a live preview of the environment and also a PIR (Passive Infrared Sensor) sensor which
is capable of detecting motion of different objects to process the images, sound and videos
from the camera to achieve task such as identifying suspicious scenes, identifying unwanted
people in some environment, detect and record motion of moving objects, alert the security.

1.3. RATIONALE
1.3.1. MOTIVATIONS
 This is to work to reduce insecurity in our society
 This will help me work to improve on the technology in our society.
 It is a challenge to think and research more on new security ideas which can
better improve security of an environment.

2
 It is a start of specialisation in the computer world.

1.3.2. SIGNIFICANCE
The research in this study is to help reduce the level of insecurity in our society taking into
consideration the fact there are a lot of thieves around, a lot of people practicing human
trafficking, a lot of people into kidnapping and asking for ransom payment before the release
of the individual. This implementation is not to catch the people involved in such practices but
to help the investigation department with the use the footages captured by the camera of that
scene identify and have leads as to where their focus on investigation should be. It can help
them identify people in scene, it can help with videos and pictures of what actually happened
during the scene. In cases of theft, you can be able to identify the thief before he even breaks
into the house or organisation and take special precautions.

1.4. RESEARCH QUESTION


Main Question

What should be done to ensure the security in our society

Specific Research Questions

 How can we identify thieves?


 What should be taken note of when watching videos of a scene?
 How can we detect someone in an unwanted area?
 What security measures are taken when someone is detected?
 In cases of fire scenes, what backup measures do we take in order not loss vital data
that can be used for investigation?
 How well will our system perform in the night when there is poor lighting to identify
the different objects and humans in motion.

1.5. RESEACH OBJECTIVES


Main Research Objective

This research is to investigate crime scenes so as to reduce insecurity in the society

3
Specific Research Objectives

 Install cameras that can record videos or take pictures


 To install a motion detector which is able to detect and report motion around the
environment.
 Will install a light dependent resistor to sense the changes in light intensity and report
it so that the images can be well processed in different conditions.
 A buzzer will be installed to imitate an alarm system, which means a sound will be
produced when motion is detected.
 Different lighting systems will be installed to give the user a better understanding of
the system at all times of the day.

1.6. SCOPE AND DELIMITATIONS OF STUDY


1.6.1. SCOPE AND STUDY
This project will lead to the creation of a security system where people who are fun of
committing atrocities in the society will be caught and justice served to them, others which are
not yet caught will now do their illegal activities in the hiding. The system will use a Raspberry
pi as a central processing unit to process the input from the other hardware, a camera system
to take live preview of the environment, a PIR (Passive Infrared Sensor) to detect motion of
different objects and alert the system for some security measures to be taken. But this project
will have some limitations.

1.6.2. DELIMITATIONS OF THE STUDY


The purpose of this research is to reduce is to reduce crime scenes by putting in place camera
security systems that would record video and take pictures of crimes scenes an report them to
the end user of the system. This research will focus on out-door security.

1.7. DEFINITION OF SOME TERMS


1.7.1. VIDEO SURVEILLANCE
Video surveillance is the act of observing a scene or many scenes with the aim of noticing
specific behaviours that are improper or may indicate the emergence or existence of an
improper behaviour. Common uses of video surveillance include observing the public at entry
sports events, public transportation (train, platforms, airports, etc) and around the perimeter of
secure facilities especially those that are directly bounded by community places. The video

4
surveillance process involves the identification of areas of concern and the identification of
specific cameras or group of cameras that may be able to view those areas.

1.7.2. REMOTE ACCESS


Remote access is the ability for an authorized person to access a computer or network from a
geographical distance through a network connection. Remote access enables users to connect
to the systems they need when they are physically far away. This is very important for
employees who work at branch offices or are travelling or need to telecommute to work.
Remote access enables remote users to access files and files and other system resources on
devices or servers are connected to the network at any time, increasing employee productivity
and enabling them to better collaboration with colleagues around the world. It also gives
organizations the flexibility to hire the best talent regardless of location.

1.7.3. SENSORS
A sensor is a device that detects the change in the environment and responds to some output
on the other system. A sensor converts a physical phenomenon into a measurable analogue
voltage converted to some human-readable display or transmitted for reading or further
processing. There are basically two types of sensors, PASSIVE and ACTIVE SENSORS.

 active sensors require an external source of power that provides the majority of the
output of the signal. Some examples of the active sensor based technology include the
scanning electron microscope, the LiDAR, radar, GPS, X-ray, sona, infrared and
seismic.
 Passive sensors output power is almost entirely provided by the measured signal
without an excitation voltage. Some examples of the passive sensors include Passive
Infrared sensor used for detecting and reporting motion, film photography, Infrared,
charge-coupled devices and radiometers.

1.7.4. IMAGE AND VIDEO PROCESSING


Image processing is a method of performing some mathematical operations on an image in
order to get better good looking images or to extract information from it while video processing
are those mathematical functions and operations performed on a video in order to extract
information or simply making the videos look better.

5
1.7.5. DIGITAL CAMERA
A digital camera is a camera that captures photographs in digital memory, however, unlike film
cameras, digital cameras can display images on a screen immediately after being recorded and
also store and delete them from memory. Also many cameras can record video with sound
capture included in its functionalities. (Britanica, 2021)

1.7.6. ILLUMINATION
When a light source is poured on an object, they reflect light so that they can be perceived by
the human eyes. What illumination means is the act of using a light source. The same idea is
used in photography to capture images. (Colbor, 2021)

1.8. PROJECT OVERVIEW


This work or study is going to be structured into five chapters

Chapter 1 is titled “Introduction” is where I will present the background of study, the problem
statement, some research questions and also the objectives of our study. We will also look at
the significance of the study and also the scope with the delimitations if the research. Then we
will end this chapter with definition of some terms used in this context of surveillance systems.

Chapter 2 is titled “Literature Review”. Here we are going to look at some related works, the
generalities involved.

Chapter 3 titled “Material and Methods”. This is where we will see in details the materials
used together with the steps involved in putting together the various hardware components to
function as a single standalone system.

Chapter 4 is titled “Results and Discussions”. This is the stage where we are going to evaluate
the results of the project in every scenario obtained at the end together with some screenshots
of the functionality of the project.

Chapter 5 titled “Conclusion Recommendations and perspectives”. At this final stage, we will
take a look at the summary of the results. We will also have some recommendations for possible
future researchers who will carry out similar research or study. Furthermore, we will present
the difficulties we have encountered throughout the study and implementation of this work.
Then finally we will look at the references used in our main work.

6
1.9. PARTIAL CONCLUSION
This chapter was aimed at introducing the background of study. After taking a look at the
problem statement, we head to evaluating the possible solutions to that problem created. Then
we continue to look at the research questions and also the objectives we have to meet when
designing the system. We also took a glance at the scope and delimitations of the work.

7
CHAPTER 2: LITERATURE REVIEW
2.1. INTRODUCTION
Presently, video surveillance systems are implemented both in public and private areas such as
airports, railway stations, highways, subways, parking lots, plaza stores, shopping malls,
offices, schools, universities and homes. Video surveillance systems have become a part of
modern safety management of public and private sectors and the installation of this systems is
showing no sign of stopping.

2.2. RELATED WORKS


The first video surveillance system was installed in 1942 in Nazi occupied in Germany in order
to observe the launch of long guided ballistic missiles. Shortly after the systems became
available in the USA as the government entities and commercial users who wished to keep to
keep eye on their business (Orwell, 2016)

A proposed camera security system consisted of an open video equipment, a read image frame
buffer, a video capture, the microcontroller and a PIR sensor to design a video surveillance
system based on a 3G wireless mobile internet access. The database in the video control sever
to automatically store selected frames of the video stream data. A high speed video monitoring
system using the 802.11 in our surveillance system is also recognised. (Shivprased, student,
computer department, Savitribai Phule Pune University, Maharashtra, India)

Another proposed solution on video camera security used the pipeline method where the
processes follow each other. The method starts with the process of Observation Input. This is
where the input from the various sensors are captured and analysed. The second process is the
Object Detection, here the various objects found in the scene are collected and analysed for
detection, after this process follows the Object Recognition which is the stage where the
different objects that were detected are now analysed to recognise them. After this step, Object
Tracking takes place, here the object which is recognised is now tracked, that is follows its
movement. When the tracking is done, the next step is Event Analysis which is the stage where
the activities of the tracked object are analysed. Then follows the Database Archiving which is
where the important data is stored. When all of this processes have taken place, the Alarm
system now comes on based on the input that has been gotten from the other processes.

8
2.3. GENERALITIES
In this project, we will implement a real time camera security survey where cameras will be
placed at sensitive parts of a building, being it a house or a company, with the aim of detecting
and monitoring all moving objects. The system will use a Raspberry pi computer equipped with
the Raspberry Operating system, a set of cameras for photos and video capture, a PIR sensor
for detecting motion of different objects to realise the whole hardware of the security system.
The system will use the following components.

2.3.1 RASPBERRY PI
Raspberry pi is small single-board computer. The Raspberry Pi is a very small computer the
size of a credit card, but it is quite powerful and it can run a lot of applications (halfacree,
2018). With this small size computer as it goes it has a slot to connect your SD card which will
act as the non-volatile memory. It also has four (4) port for connecting mouse or keyboard, a
slot for power supply, for its camera module

Figure 2. 1 Image of raspberry pi 4

(source: Pi Australia, 2021)

9
2.3.1.1. SOME COMPONENTS OF THE RASPBERRY PI 4
a. MICRO USB POWER PORT

The micro USB port is the port used to connect the raspberry pi to power source. Normally a
standard charger will power the PI but when the raspberry pi has soo much work to do like
controlling circuits a motors the standard chargers turns to provide low current. For the best
results, it is good to buy the official PI USB power supply. It will supply a current of 5volts
and 3 Amperes.

Figure 2. 2 Micro USB port

(source: Pi Australia, 2021)

b) RASPBERRY PI USB PORTS

The standard PI 4b comes with more redefined USB ports. This time it comes equipped with
four USB ports all of them compatible with input peripherals like the USB keyboard, USB
mouse, USB web camera and so much more. Not only are compatible with most input
peripherals but two of the ports come with USB 3.0 technology equipped which allows for
faster data transfer speeds for up to one hundred megabytes per second. This makes the
raspberry pi four very flexible. Below is a picture of the various USB ports

10
Figure 2. 3 USB ports

(source: Pi Australia, 2021)

c) ETHERNET PORT

This is also known as the network port. It is useful when we want to use a wired connection to
connect the raspberry pi to the internet or to other devices that can share data through the rj45
cable connector. There are two lights at the bottom of the port which is there to indicate the
status of the network.

Figure 2. 4 Ethernet port

(source: MagPi magazine, 2021)

d) HDMI PORT

HDMI is acronym for High Definition Multimedia Interface. This port is used to transmit video
signals to and external display. Just as the name implies, we can tell that the video output is

11
very high and it carries both sound and video in one medium. It can transmit video for up to
4K resolution. This cable can be used to connect the raspberry pi to external display systems
like a TV monitor, a computer monitor, a projector with HDMI support system or a dedicated
monitor.

Figure 2. 5 HDMI ports

(source: MagPi magazine, 2021)

2.3.2. WEBCAM
WEBCAM is acronym for Web Camera which is a camera that is used for taking videos in real
time when on an internet call or making a video for local use. The raspberry pi computer has
two ways to which the web camera can be connected to it. Firstly, we can use the standard USB
port to connect the USB web camera to and lastly the raspberry pi computer comes with another
standard slot for connecting the pi camera to it. All of this cameras function the same way.

Figure 2. 6 Camera

12
2.3.3. BUZZER
This is an electroacoustic transducer which is a device that converts electrical audio signal into
its corresponding sound. It can be used to produce alerts for different scenarios in the video
capture scene. It has two terminals one positive and the other one negative, the positive one
supplies current to the Buzzer while the other is connected to and input terminal.

Figure 2. 7 Buzzer

(Source: Codevele, 2021)

2.3.4. PASSIVE INFRARED SENSOR


The passive infrared sensors are electronic devices which are used in some security alarm
systems to detect motion of an infrared emitting source, usually a human body. The passive
infrared sensor on the figure below has three pins, with the right most pin being the voltage pin
which accepts five volts into the system, the middle pin being the output pin which sends and
output of logic one when motion is detected and a logic zero when the when the passive infrared
sensor senses no motion, and the last pin being the ground pin, this is to be connected to the
ground of any device that the passive infrared sensor is supposed to be used with. On the other
side of the passive infrared sensor has tuners, from the view below, the right tune is for the
delay, meaning when motion is sensed, how much time does the system wait before it emits its
infrared rays to detect motion. The left tuner is for sensitivity, when tuned to the maximum
level, the sensor can sense motion six meters away with a wide view of one hundred and eighty
degrees.

13
Figure 2. 8 PIR sensor

14
CHAPTER 3: MATERIALS AND METHODS

3.1. INTRODUCTION
When doing a research or study, Methods is a systematic way of solving a problem. A research
method is the method used to carry out the study, the reasons for that study an also how that
study helps the economy or the society. Chapter three involves describing in detail the various
steps involved in the research, how you gather the requirements, the coding, the design,
methods, simulation and implementation. At the end of this chapter, we will describe all the
materials used in the research. This chapter will show in depth the heart of our work, with the
fact that it shows the methods used, methods in collection of data, the materials used for the
purpose of this research.

3.2. AREA OF STUDY


This work was carried out in Bamenda in the Tubah sub-division, Bambili in the North-West
region of the republic of Cameroon.

(source: Nations Online Project, 2020) Source: Nations Online Project, 2020)

Figure 3. 1 Map of Africa on the left and Map of Cameroon on the right

15
Figure 3. 2 Map of Tubah

3.3. MATERIALS USED


There are basically two types of materials used in this project, Software materials, Hardware
materials. For each material named, we will take a look at the software and the hardware
components.

3.3.1. THE RASPBERRY PI


Now we will take a look at the raspberry pi features in depth. But the parts named above will
not be elaborated on again. Now we will take a look at the software components of the raspberry
pi 4.

The raspberry pi is a mini computer with the size of a credit card with capabilities like that of
a normal desktop computer system but what makes the difference is that the raspberry pi is
mostly used to build embedded systems with its large range of peripheral devices. The
raspberry pi comes with its hardware dormant until a compatible operating system or a
compatible Raspbian image is flashed into a storage device like a memory card and inserted
into it, then all its hardware components now come on live ready to be used as input and output
devices. The latest version of the Raspbian image is the raspberry pi operating system with

16
kernel version 5.10 released on May 7th 2021 with size of 2867 megabytes.(raspberrypi.org on
August 17th 2021)

Figure 3. 3 The Raspberry Pi showing labelled parts

(Source: Seeed Studio, 2021)

To continue with the hardware components of the raspberry pi, it comes equipped with general
purpose input and output pins which are used to send data into and out of the raspberry pi
system. The general purpose input and output pins are generally called GPIO pins which is an
acronym. Below is a figure of the general purpose input and output pins and their numbering.

Figure 3. 4 Raspberry Pi Pins

(Source: Seeed Studio, 2021)

17
The general purpose input and output pins are accessed with cables which are called Jumper
wires. The jumper wires are of three types depending on the architecture of the how the both
ends look like. The first one is the male to male which has two male head pins, the second is
the male to female with one end equipped with a female port. The last time is female to female
connector with the both ends having female ports.

The raspberry pi also comes equipped with a port called the CSI Camera port which is acronym,
for Camera Serial Interface port dedicated for the raspberry pi. The Camera Serial Interface is
a specification of a mobile industry interface (MIPI) Alliance which define and interface
between a camera and a host processor.

Furthermore, the DSI display port is a port which comes pre-installed with the raspberry. DSI
is acronym for Display Serial Interface which defines a high speed serial interface host between
a processor and a display module. This module is widely used in mobile phones, laptops,
wearables and other embedded systems.

CPU, GPU and Memory are components that must be present with all computer devices. The
CPU is acronym for the Central Processing Unit and just as its name sounds, it is the part of
the computer that takes care of all the instructions to be processed in the system. The GPU
which stands for Graphic Processing System is a part of the computer which takes care of all
the processing that has to do with graphics. Then the memory is available to store data
temporally while all the processing is done by the processor.

Bluetooth is a short range wireless technology standard used for exchanging data between fixed
and mobile devices over a short range. The Bluetooth 4.1 is a technology currently featuring in
headphones such as MEE x7 plus earbuds that can better manage their power and that of the
device they are paired to by automatically powering up and down based on a power plan. This
module comes installed in the pi.

Audio and Video is the module responsible for the transmission of audio and video signals into
and out of the raspberry pi.

3.3.2. THE DIGITAL CAMERA


The digital camera is a camera that captures photographs in digital memory, however unlike
film cameras, digital cameras can display images on a screen immediately after being recorded
and store and delete images from the memory. Many digital cameras can also record moving
videos with sound. A digital camera takes light and focuses it via a lens onto a sensor made out

18
of silicon. It is made up of a grid of tiny photosites that are sensitive to light. Each photo site
is usually called a pixel which is a contraction of picture element. There are millions if these
individual pixels in the sensor of the camera.

3.3.3. THE BUZZER


The buzzer or beeper is an audio signalling device which may be mechanical or electrical or
piezoelectric. We typically use buzzers or beepers as alarm systems, timers, confirmation of
user input such as mouse clicks or keystroke. A buzzer consists of an outside case with two
pins to attach it to the power and the ground. When current is applied to the buzzer, it causes
the ceramic to contract or expand. This changes causes the surrounding disk to vibrate which
in turns produces the sound we hear. Now we will take a look at the circuit diagram of a buzzer
NE555

Figure 3. 5 Buzzer circuit

(Source: Circuits DIY, 2021)

The NE555 integrated circuit produces accurate oscillation or time delays. Moreover, the
interval timing can be controlled or set by using a resistor and a capacitor network in the mono-
stable mode or operation. Furthermore, the stable mode operation of the IC involves the
changing of the frequency and duty cycles with the help of a capacitor and a variable network.
The circuit with all the values of its resistor and capacitor set, when supplied with 9 volts of
battery, it produces a buzzer sound. This IC NE555 drive an eight ohm to twenty-five-ohm
loudspeaker producing the audible square wave tone. In addition to this, a siren or 555 tone
generators can be interchangeably used as a buzzer. (Fried, 2021)

19
3.3.4. THE PASSIVE INFRARED SENSOR
A passive infrared sensor with acronym PIR are electronic devices which are used in some
security alarm systems to detect motion of an infrared emitting source, usually a human body.
The radiation is invisible to the human eye but can be detected by electronic devices designed
for that purpose. The passive infrared sensor uses a pair of pyroelectric sensors to detect heat
energy in the surrounding environment. These two sensors sit beside each other and when the
signal differential between the two sensors changes (if a person enters the room for example)
the sensor will engage, this means it triggers an alarm which notifies the security. The infrared
radiation focuses on each of the two pyroelectric sensors using a series of lenses constructed
as the sensor’s housing (Cook, 2021)

Figure 3. 6 PIR circuit

(Source: ELProCus, 2021

The PIR sensor circuit is used in numerous electronic projects which are used to discover
human being entering and leaving a particular area or room. The passive infrared sensor has
three pins, ground, signal and the power. Generally, the PIR power is up to 5v but the larger
the size of the PIR the higher the input voltage. The output of a PIR is a logic gate of either 1
or zero.

3.3.5. THE LIGHT DEPENDENT RESISTOR


Light dependent resistors are variable resistors that are controlled by light. They are also known
as photo-resistors or photo-conductive cells and are usually used in light or dark-activate

20
switching circuits. They are mostly used in circuits which are required to sense light. Below is
a picture of the light dependent resistor.

Figure 3. 7 LM35

This resistor works on the principle of photo conductivity. When light falls on its surface, the
material conductivity reduces and also the electrons in the valence band of the device are
excited to the conduction band. There photons in the incident light must have energy greater
than the gap of the semi-conductor material. This makes the electrons to jump from the valence
band to conduction. To give a brief summary of how this device works, when light touches the
surface of the resistor or when the light intensity in an environment increases, the resistance on
the light dependent resistor decreases and when the light intensity in an environment is
decreasing, the resistance increases, so they have an inverse proportionality where one quantity
increases while the other decreases and vice versa. Below is a graph showing the inverse
proportionality or the variation of light intensity with the conductivity of the light dependent
resistor (light dependent resistor ldr with:applications, 2021)

Figure 3. 8 LM35 light Variation

(Source: watelectronics, 2021

21
3.4. METHODS
3.4.1. MOTION DETECTION
Motion detection involves determining motion of a human being in an area where there is not
supposed to be one. The passive infrared sensor is responsible for doing this. The PIR sensor
has two slots each made up of a special material that can detect or are very sensitive to IR. It
has a lens which makes sure the sensor can sense past some reasonable distance. When the
sensor is idle, both slots detect the same amount of IR and then the ambient amount radiated
from the room or walls. On the other hand, when a warm body like a human being passes, it
first intercepts one half of the sensor which causes a potential difference between the two
halves. When the warm body leaves the area, the reverse happens. (lady ada, 2020)

Figure 3. 9 Motion Detection

(Source: Learn, 2021)

3.4.2. THE ALARM SYSTEM.


After the inputs and output of the passive infrared sensor are processed, the alarm system comes
to play a very important rule. The system is built in such a way that, when motion is detected,
the alarm system comes on and makes some noise so much so that the security can be alert and

22
take the usual security measures. Now we are going to take a look at the software components
of the buzzer.

Figure 3. 10 Code for the Alarm System

Line one imports the general input and output system which is necessary for the functioning of
the buzzer. Next we have to import the time module to control the timing of the sound. After
this, we have to define a variable that will hold the buzzer pin. To continue, we have to use a
while loop to decide how long we want the sound to be produced. On line eight, we print the
“beep” when the sound is produced, and a “no beep” when no sound is produced to test the
proper functioning of the buzzer.

3.4.3. THE CAMERA SYSTEM


Then concerning the video, the system is designed to put on the camera and take a video while
the motion is being detected. That is, immediately motion is detected, the camera immediately
comes on and starts recording a video and then immediately the motion stops or when the input
from the passive infrared sensor is low, the video stops recording. After the video is recorded,
it is saved in the local storage of the raspberry pi for later access. Now we are going to take a

23
look at how to put on the camera with software and we are going to be us using python
programming language for this.

import cv2

#Capture video from webcam

vid_capture = cv2.VideoCapture(0)

vid_cod = cv2.VideoWriter_fourcc(*'XVID')

output = cv2.VideoWriter("videos/cam_videeo.mp4", vid_cod, 20.0, (640,480))

while(True):

# Capture each frame of webcam video

ret,frame = vid_capture.read()

cv2.imshow("My cam video", frame)

output.write(frame)

# Close and break the loop after pressing "x" key

if cv2.waitKey(1) &0XFF == ord('x'):

break

# close the already opened camera

vid_capture.release()

# close the already opened file

output.release()

# close the window and de-allocate any associated memory usage

cv2.destroyAllWindows()

24
Figure 3. 11 Code for Camera System

Now let us see exactly how the code works. The first line imports the necessary library to work
with pictures and videos which is Opencv. Then line two defines the function to put camera
on. On line 4, we use the library to open an instance of the camera system and name it cap.
This is followed by defining the width and height of the video footage. On the next line, we
define a variable to hold to the video format to which the video is going to be converted and
stored on. Now we have to create a while loop to keep the camera on to take a live preview of
the environment. On the next line which is 17, we define the camera frame rate. Which is the
measure of how quickly a number of frames appears within a second. Next is to define a button
to quit the live preview session. After that we have to call the function to so that it can execute
the lines of code inside the function.

3.4.4. NIGHT VISION


To archive better video results under low lighting or complete darkness, the cameras are
equipped with infrared light emitting diodes (IR LED) which is a light source not visible to the
necked human eye but can produce some great video footage under low lighting or complete
darkness. To improve on the efficiency of our system, we will include a light dependent resistor
to our system which is a sensor that can be used to sense the changes in light intensity. This
sensor will help us make decision as to whether the lighting condition around the environment
is good enough for the cameras or the lighting conditions needs more aid from the infrared light
emitting diodes to have better vision or to produce better video footages. Now we are going to
take a look at the code that controls the light dependent resistor.

25
Figure 3. 12 Code for night Vision system

The above code will be to test the proper functioning of the device. To begin we have to import
the necessary libraries and modules that are necessary for the proper functioning of the device.
First the OS module that is imported first provides functions for interacting with the operating
system, secondly the date time module is necessary to work with dates and time in
programming to help in decision making during some hours of the day, next is the RPI and the
GPIO which is necessary for the general purpose input and output of the whole system. Line
six shows the general purpose pin to which we are connecting the light dependent resistor to
and we commence to define our function. This function is designed to setup the GPIO pins and
also set the pins up to output a low state from the very beginning of our program. The next
section sets up a loop to continuously take the readings from the light dependent resistor. We
have here three things that we have to measure, we have to measure the time in seconds,
resistance in Ohms and lastly the capacitance in Farads. The resistance here is the light
dependent resistor, that is the lighter we pass through it the lower the resistance and the quicker
the voltage that passes through it. So here we have to measure how long ti takes for the circuit
to reach a voltage that is great enough to register a HIGH in the general purpose input an output
system of the raspberry pi. So we are going to use the date time module to record the date and
time and stores it into a variable called GetDateTime and then we have another function which
changes the date and time to the desired function that we want as shown above on the code.

26
Now we are going to take a look at the results of the light dependent resistor. It is going to
output analogue light intensity signals as digital output.

Figure 3. 13 Light Variation values

Above are the values of the light dependent resistor as per the lighting conditions of that
environment at that particular time.

3.4.5. RECORDING VIDEOS AND TAKING PICTURES


The quality of videos or images that can be gotten from this system solely depends on the
capabilities or the quality of camera system you are using. Here we will see a brief explanation
of how an image is formed and together how a video footage can be recorded. In a digital
camera, a charge-coupled device array of sensors is used for the image formation, it is an image
sensor that senses the values and converts them into an electric signal. when this process
happens, an image is formed. A video is just a series of pictures taken within a period of time
and is played at some desired speed called frames per second. Nowadays, our video is mostly
recorded in the range 30 to 60 frames per second which is fit for the human eye to appreciate.
30 frames per second means that the lenses of the camera is capable of taking thirty pictures
per second to produce very good and clean video footages. Now we will continue to look at the
code to capture videos and pictures in python programming language. We will begin with the
picture.

27
Figure 3. 14 Code to Capture Pictures

To begin we will start by importing the necessary libraries for this to work which are cv2 and
os, then we go furthermore to define a function to capture a picture of a scene with the name
capPic. The camera variable is to invoke an object of the cv2 library which will open a camera
preview, next we will use a while loop to check and assign names or identifiers to the pictures
we want to take, the while loop is responsible for checking the filename and if any repetition it
is incremented to the next number so as to avoid overwriting the previous photo that is captured.
Then the return value of the function captures the image followed by a filename assigned to it
below. Then a function of the cv2 library now comes in to take the filename and the image and
match them together before writing to memory. Then finally the camera live preview is
destroyed at the end with del(camera). Now we need to see how a video is captured in code.

28
Figure 3. 15 Code for Video Capture System

29
Capturing a video with coding is a little bit more complex than just taking pictures. We will
begin with our normal routine of importing the libraries that are necessary for this package. We
will continue our program to define a function capVid. Next on line 8 and 9 we will define the
duration that we want to take the video footage for. Followed by initialising the camera with
the cv2 function. On line 11 and 12, we call a function to check if the camera that is connected
to the system is properly connected and if not we print a message to the screen to alert the user
that the camera connected has a problem. After this is done we will define the width and height
of the video we want to capture. Next we will define a while loop to take care of naming of the
video footages captured. Since a video is a series of pictures captured we will define another
while loop to continuously take pictures with the desired frame rate. After that we will define
a button to exit the video recording when we want to stop the recording before the time elapses.
Finally, we destroy sessions of the camera and the video is stored the root storage of the device
to which the camera is connected.

3.4.6. REMOTE ACCESS


Remote access is the ability for an authorised person to access a computer or network from a
geographical distance through a network connection. There are two types of remote access
implemented in this project which are;

 LOCAL REMOTE ACCESS: This is the ability of a person to access a network or a


computer from a geographical distance through the use of a local network or network
that is not connected to the internet. In our case, we will use a local Wi-Fi connection
to access the system of the raspberry pi. We will continue to see the process of how this
local network system is possible. On your windows or Mac operating system, we are
going to download a software called PUTTY. Putty is a free and open source terminal
emulator, serial console and network file transfer application that supports many
network protocols. After this software is installed on the windows computer for my
case, we now head to the raspberry pi. We have taken its memory card where the
operating system is installed, connect to the computer, access its boot’s partition, and
create two files in it. The first file is called ssh which is a file that will enable wifi
connection on the raspberry pi, the second file is called “wpa_supplicant.conf” which
contains the Wi-Fi configurations of the WI-FI modem we are supposed to use. In that
configuration contains the Modem Id also known as the SSID of the modem and the
password of the modem. The figure below shows the configuration of the
“wpa_supplicant.conf” file.

30
Figure 3. 16 Remote Access Configuration

After this is done, the memory card is inserted back to the raspberry pi and then all three
devices powered on. When the Pi boots, it immediately connects to the Wi-Fi network
as per the configuration settings that was inputted at the configurations above. When
this happens, we launch our PUTTY software and immediately we will see a text box
prompting us to input the IP (internet protocol address) of the device that we want to

31
access. We can get the IP addresses of all devices connected to that modem from the
configuration settings.

Figure 3. 17 Putty Configuration

This address is now inputted into the PUTTY software and immediately, a terminal
window opens for us to input the login details of the raspberry pi. The default username
and password of the raspberry pi system is pi, raspberry respectively. After logging into
the system, we will be presented with a terminal window an cannot access a remote
desktop interface where we can click to install and run programs. For this to be possible,
we have to install a package called XRDP which will help us access the desktop of the
pi. XRDP is a free open source implementation of Microsoft Remote Desktop Protocol
server that enables the operating systems of other devices. To archive this, we run the
command “pip install xrdp” and then the package installs with the help of an active
internet connection. Then on the windows machine, we launch another in-built
application called “remote desktop” which is used to access other computer systems on
a network. Immediately this application comes live, it opens a window to input the IP
address of the raspberry pi. In my case is 192.168.1.134. when this is done, another
window opens asking us for the login details which are the username and password of
the remote system we want to access. Below are some figures to demonstrate the local
remote access.

32
 ONLINE REMOTE ACCESS: This is the ability of a person to access a network or
a computer from a geographical distance through the use of a local network or network
with the use of the internet services. To achieve this, there are three connections that
need to be made, first is the connection of the raspberry pi to the internet services,
secondly we need a server where we will connect the raspberry pi to and then followed
by the connection of the computer or laptop to the internet and to that same server where
our raspberry pi is registered on. There is a company called REMOTE IT which
provides remote services to devices and operating systems such as that of the raspberry
pi. To begin with REMOTE IT, we have to sign up to use her services with a Google
mail. After the registration is complete, we will be prompted with a window asking us
for service we want. When all this is done we will click on the register button and then
it will connect to the raspberry pi and check all the credentials, if all correct then we
will get a confirmation that the process is successful. To access the pi now using the
internet services, put on the raspberry pi, let it boot, connect it to the internet services.
On your other computer where you installed the application remote it, Windows for my
case, connect the laptop to the internet services as well. Launch the application
REMOTE IT and then login with your email credentials and then you will be presented
with a window as such below.

3.4.6. CONFIGURATION FILES FOR RASPBERRY PI FOUR WEBCAM


SERVER
Talking about using the Raspberry pi as a webcam server means we can be able to use the
minicomputer to be able to send images and video footages over a network. For us to be able
to achieve this we have a few number of software that we need to install. To begin we need to
open and login to a software called putty as mentioned above. After the login session, we need
to run some commands to get the system up to date. To do this we need to run the command
“sudo apt-get update” this will get the latest system software installed into the system.

33
Figure 3. 18 Remote Access configuration

After the update has been processed by the pi, we need to continue with the installation of a
software called “motion” which will enable us make the raspberry pi become a webcam server.
To do this, we need to run the command “sudo apt-get install motion” it is about 5KB of data
and the installed package will take about 5MB of hard disk space. After the package has been
installed, we need to connect our webcam to the raspberry pi. To confirm that the camera is
connected correctly, we need to run some code in the terminal which is “lsusb”. This command
on the terminal will list all the USB devices connected to the raspberry.

Figure 3. 19 Configuration for USB camera

34
The highlighted device shows that our USB webcam has been recognised successfully. If the
camera is connected well and it does not appear here, then it might simply mean that the
connected device is not compatible with the version of raspberry we are using. Now we have
to head over to the editor of motion to configure some camera properties that are necessary. To
do this we need to write the following code to the terminal, “sudo nano /etc/motion.conf”. this
command will open the main configuration file.

Figure 3. 20 More USB configuration

The configuration file opens up as shown above with information on it such as the version and
the developer options available. Firstly, we need to make sure that the Demon tool is put on, to
do this we need to edit the file and replace the Demon off to demon On. Now since the file is
too large and we just need a few configuration files, we need to be able to search the commands,
to do this we need to use a short cut on the keyboard which is Control plus w. this will open up
a label and give you the opportunity to search items on the file. The first configuration that we
are going to search is the frame rate. Frame rate is a unit for measuring how many photos are
taken per camera circle. So we are going to edit the frame rate and put 1500 frames per second.
If the frame rate is higher than what your camera can capture, then there will be an error when
viewing the live footage. Secondly we need to search for another configuration which is the
live stream server section, below this, we will find a stream port which will be used to access
the camera using a web browser. We have to note this port or change it to a port we desire and

35
cannot forget. We will set this to 8080. The next file we have to access is the stream quality
and for this we will assign the value 50 and finally under the stream services, we have to access
the part called stream_localhost and assign its value to on. This will enable us access the camera
of the raspberry remotely using a browser. Next we have to head on to “HTTP control” and set
the local host to off

3.4.6. SYSTEM DESIGN


This is a proposed system design, here we are going to see the block diagram and see the
general functioning of the system.

The power The lighting


system system
Wireless control
system

The processor Motion


detector

The camera The Alarm


system

3.4.7. FLOW CHART OF THE SYSTEM


Because we are working with many modules, we are going to have a flowchart for the different
modules before we have a main flowchart that will consist of all the other modules to make up
a complete system.

 THE BUZZER
The buzzer here will act as the alarm system, it comes on and makes a buzzling noise
when motion is detected and stops when there is no motion. This is the way the buzzer
acts as an alarm system

Start
36
Figure 3. 21 Flow Chart for Buzzer

 THE LED SYSTEM

This is how the lighting system will be controlled. The Red LED comes on when there is motion
and goes off when there is no motion, the blue LED comes on when there is no motion and
goes off when motion if detected

37
Start

While

Motion=True

LED.on()

End

Figure 3. 22 Flow Chart LED

 MOTION DETECTION SYSTEM

This is how the motion detector system works, it senses the environment and when motion is
detected, it send back a signal to the processing system where other actions such as the lighting
systems are put in place.

38
Start

If(motion = 0 Print(“no motion”)


detected)
1

Print(“motion detected”)

End

Figure 3. 23 Flowchart for Motion Detection

39
 LIGHT SENSING SYSTEM
The light dependent resistor works as follows. I was able to convert the light intensity
analogue signals to digital signals. When the values went above 1000, a high signal was
sent to the processor meaning there is low lighting in the system.

start

If(1light >=
Print(“low lighting”)
1000)

Print(“good lighting”)

end

Figure 3. 24 Flowchart for Light Sensing System

40
 CAPTURING PHOTO

The flowchart for taking a picture is very simple and straight. When motion is detected, a photo
of the subject is taken and stored for later viewing by the user or the administrator.

start

Camera.capPhoto()

end

Figure 3. 25 Flow chart for Capturing Photo


 CAPTURING VIDEO

Just like the photo, video is captured for 20 seconds and stored for later viewing by the user or
the administrator of the system.

start

Time = 20 seconds

Camera.capVIdeo(20)

end

Figure 3. 26 Flow Chart for Recording Video

41
 THE MAIN

Designing the main is still a little bit complex, representing all those blocks in a single page
will crowd the page with so much information that may reduce the readability and the ease
with which the code can be understood. For this effect, we are going to define some other
processes and give them names.

Capture photo

Put on buzzer
The photo security
process

Put on red LED

Put off green LED

Put on infrared if low


light

Figure 3. 27 Photo Security

Put on red LED

Put off green LED


The video security
process

Camera.capVIdeo(20)

Put on buzzer

Put on infrared if low


light

Figure 3. 28 Video Security Process


42
Start

Choice=Press 1 to
record video and 0 to
take pictures

While While
0 If(choice=1) 1
Motion = True Motion = True

The photo security


The video security
process
process

End

43
The main flowchart is a combination of all the other small units or components of the system.
It combines the functionalities of all the other systems, the buzzer, the lighting system, the
photo and video processes, the motion detection system.

44
CHAPTER 4: RESULTS AND DISCUSSIONS
4.1. INTRODUCTION
In this chapter, we will be showing the results of our research, discuss the difficulties
encountered throughout this study. The main objective of this system is to be able to detect
motion in a certain environment and take pictures or videos when necessary and stored in a
database where they can be later viewed. To achieve this, we have divided the task into small
parts which will be handled individually and then combined to form a whole working system.
The various parts will be, detecting motion, detecting light intensity, setting up the alarm
system, setting up the lighting system, recording videos and finally remote access.

4.2. DETECT MOTION


The main part of this part of the work is to use a motion sensor to detect or sense the presence
of a moving object. We will use a passive infrared sensor which senses motion by emitting a
pair of infrared rays and continuously calculating the potential difference between the two rays
to help detect motion. We will take a look at the results

Figure 4. 1 Results of Motion Detection

45
When motion is detected, a message is printed on the screen and the system waits five seconds
before emitting rays again to detect motion.

4.3. THE ALARM SYSTEM


Our aim here is to create an alert when motion is detected in the system. For this we will use
an active buzzer to make a buzzing sound to alert whoever is taking watch or looking at the
system at that particular time when motion is detected.

Figure 4. 2 Result of Alarm System

The code is designed to print to the screen for testing purposes of the actions it is taking while
doing the actions. So when a beep sound is produced, it waits for one second of silence and
then produces another beep sound.

4.4. NIGHT VISION


While cameras can’t see in the night, we have to develop a way to either remedy this situation
or to try to improve the vision of the system under low lighting. To achieve this, we will have
the cameras equipped with infrared cameras which are to come on in low lighting conditions
to help the camera have a better vision of the environment. Also we will use a light dependent
resistor to sense or detect the changes in light intensity so as to alert the system and know when
we have to put on the infrared lighting system

46
4.5. CAPTURING VIDEO
The quality of videos that can be captured is solely dependent on the quality of the camera you
are using, now we will take a look at a screenshot of a video that was captured with the USB
camera of the raspberry pi 4

Figure 4. 3 Results showing a video captured by the system when motion is detected

This video is captured and stored with the filename “captured_vid2” which has been
incremented from the previously saved video with filename “captured_vid1”. When this video
is captured, it is saved in the directory where the code is stored.

4.6. CAPTURING PHOTOS


After having seen the code above to capture pictures with the raspberry pi and python
programming, we are going to see some result of the photos that were taken.

Figure 4. 4 Result showing Captured Photo

47
4.7. THE LIGHTING SYSTEM
The code is designed to print also a message to the screen for tests to make sure all is working
well

Figure 4. 5 Result of lighting System

The lighting system is just here for guidance; the red LED comes on when system detects
motion.

48
Figure 4. 6 Project Skeleton

The green LED comes on when the system is normal and no motion.

49
Figure 4. 7 Project Skeleton with green lighting

The Blue LED comes on to signify that the lighting condition around the area is not the best
and so the infrared lighting system has been activated.

50
Figure 4. 8 Project skeleton with blue lighting

The results gotten from a light dependent resistor are as follows.

51
CHAPTER 5: CONCLUSION PERSPECTIVE AND
RECOMMENDATIONS
5.1. CONCLUSION
The thesis of the research carried out above is aimed at designing a security system where by
cameras are placed at strategic positions of a organization we wish to secure, the cameras are
equipped with motion sensors which are able to detect motion and report it to the CPU, also
with the help of a light dependent resistor to sense the changes in light intensity and report back
to the central processing unit so as to sense low lighting conditions and put on the infrared LED
to enable better vision of the system. With the help of internet services, the cameras of the
system can be accessed from a remote location with active and fast internet services.

Talking about the lighting system, we have made provision for different color of light emitting
diodes to represent different conditions in the system. There will be a green LED which will
signify that the system is idle and no motion is detected, there is a red LED to signify that the
system has detected motion and is currently taking a picture or recording a video. The system
also is limited in the night due to low lighting

When the system is installed in a specific location, the user is given the choice on whether the
security action to be taken will be taking pictures or recording videos. This choice will be made
available to the user once and it is the first time the system installed. The pictures or videos are
stored in the root access of the system where the user can access at any time. Talking about the
general security of the system, there will be a root password enabled which is to be decided by
the user to remove the fear of unauthorized access.

5.2. PERSPECTIVES
There are limitations to every project carried out there. Talking of this one, the quality of videos
or the quality of the pictures taken solely depends on the quality of the camera used, and though
we have made provision for a night vision system, the images and videos taken from such low
lighting conditions will not be crystal clear compared to the videos or pictures taken during the
day or under bright and good lighting conditions. Talking about remote access, the quality of
the live stream that can be gotten from the camera solely depends on the network system
available at that particular location as data packets are to be transferred in real time. The best
network or the recommended network which is suitable for this system is a stable 4G LTE

52
network. During days with bad weather like rain and storm, the rain droplets will shield the
perfect vision of the system and also, the system can also detect motion when there actually is
no motion occurring.

5.3. RECOMMENDATION
For proper and effective functioning of the system,

 The end user should at least check the root storage once a month to see if it is full, if
not the system will crash when there is no place to store taken videos or pictures
 There should be made provision of good network services so that the online or remote
access is smooth
 The system’s functionality will greatly improve when cameras of higher resolution are
used.
 The passive infrared sensor used in this project has a range of 6meters, for more
sensitivity, a better version can be used.

53
REFERENCES
Britanica. (2021, August 19). www.britannica.com. Retrieved from britannica:
https://www.britannica.com/technology/information-processing/Dissemination-of-
information

Colbor. (2021, August 21). /www.colborlight.com/blogs. Retrieved from


www.colborlight.com: https://www.colborlight.com/blogs/articles/what-does-
illumination-means-in-photography

Cook, J. S. (2021, August 18). Home: Articles and Videos . Retrieved from Arrow:
https://www.arrow.com/en/research-and-events/articles/understanding-active-and-
passive-infrared-sensors

Fried, L. L. (2021, August 18). Adafruit. Retrieved from learn.adafruit.com:


https://learn.adafruit.com/portable-mini-timelapse-camera/circuit-diagram

halfacree, G. (2018). The official Raspberry Pi Beginner’s Guide. How to use your new
computer. Cambridge: Raspberry Pi Trading Ltd, Station Road, Cambridge, CB1 2JH.

lady ada, T. D. (2020, august 18). Learn. Retrieved from learn.adafruit.com:


https://learn.adafruit.com/pir-passive-infrared-proximity-motion-sensor/how-pirs-
work

light-dependent-resistor-ldr-with-applications. (2021, 08 24). Retrieved from


wateelectronics.com: https://www.watelectronics.com/light-dependent-resistor-ldr-
with-applications/

Norman, T. L. (2017). Effective Physical Security (Fifth Edition). In Effective Physical


Security (Fifth Edition).

Orwell, G. (2016, December 30). https://www.condortech.com/security-camera-systems-


washington-dc/a-brief-history-of-the-security-camera-system/. Retrieved from
condortech.com: https://www.condortech.com/security-camera-systems-washington-
dc/a-brief-history-of-the-security-camera-system/

Resonance, L. (2021, August 18). https://searchsecurity.techtarget.com/definition/remote-


access. Retrieved from searchsecurity.techtarget.com:
https://searchsecurity.techtarget.com/definition/remote-access

54
YAN, W. Q. (2018). Introduction To Intelligent Surveillance,. In Surveillance Data Capture,
Transmission and Analytics, Third Edition.

Yiqiu, W. L. (2017). A Wireless Video Surveillance System based on 3G Network. In S. X.


Yiqiu, Conference on Environmental Science and Information Application Technology.

55

You might also like