Professional Documents
Culture Documents
Gaurav Pro
Gaurav Pro
PROJECT REPORT ON
SUBMITTED BY
TO
UNIVERSITY OF MUMBAI
SUBMITTED IN PARTIAL FULFILLMENT OF REQUIREMENT
FOR QUALIFYING
B.Sc(C.S.) (SEM V) EXAMINATION
ACADAMIC YEAR 2019-20
1
Chembur-Trombay Education Society’s
N.G Acharya& D. K. Marathe College
Of Arts, Commerce, Science & Professional Courses
N.G AcharyaMarg, Chembur (E), Mumbai-400071
CERTIFICATE
This is to certify that the project entitled
“Iot Based Surveillance Robot using Raspberry Pi”
Under the guidance of Mrs.Sunita Koli is successfully completed by Gaurav
Dineshsingh Mehta. College Roll No.CS19, Seat No:………………. During the
period of 2019-20, as per the syllabus and fulfilment for the completion of the
BSc-CS of University of Mumbai. This certifies that this is the original work of
the Candidate done during the academic year 2019-20.
DATE:
2
Acknowledgement
“An act of gratitude is that which acknowledges the blessings
of well-wishers and supporting guidance of their rich experience,
which enlighten, inspires and motivates to do something valuable.”
I would like to and acknowledge kind support, facilities
specially made available to us by management of our institute
N.G.ACHARYA& D.K. MARATHE COLLEGE. We would not have
completed it without their whole hearted support.
I would like to thank our Honourable Principal -
Dr.Vidyaguari Lele for granting us different facilities to do the
project under the guidance of our faculty. Due to their indeed
support this project was possible.
I sincerely acknowledge with deep sense of gratitude and
indebtedness the support given by our HOD – Ms. Archana Jadhav,
for her kind hearted cooperation, guidelines and various suggestions.
Last but not the least, I would also like to thank all the Faculty
members of the Computer Science Department for their generous
support and all the Lab Attendants for all their timely help.
3
Iot based surveillance robot Using
Raspberry Pi
4
INDEX
5
PRELIMINARY INVESTIGATION
6
1.1 INTRODUCTION
IoT Based Surveillance Robot
Raspberry Pi 3B+ is a card sized computer. It functions almost same as a
computer. There are different types of surveillance systems available such as
camera, CCTV etc., In these types of surveillance systems, the person who is
stationary and is located in that particular area can only able to view what is
happening in that place. Whereas, here, even if the user is moving from one
place to another, he/she can keep track of what is happening in that particular
place at exact time. Also, another advantage is that it offers privacy on both
sides since it is being viewed by only one person. The other big advantage is
that, it is a easy and simple circuit for understanding and designing. The
operating system used here is Raspbian OS. Raspbian OS has to be installed so
that the image can be transmitted to the smart phone Closed circuit television
monitoring system has now become an indispensable device in today’s society.
Robots have found an drastically increasing demand for different range of work
in our life. Their use in army and other security sector increases day by day.
Our project includes one such instance of how a robot can be of use to human
race in general. In this project, we use the internet to establish communication
between the user and a robotic vehicle. This is a dependable connection and a
continuous video feedback is available to control the robotic vehicle. Due to
the use of the web, there is no limitation on range or distance between the user
and the robotic vehicle. It is proposed to address the lower side at cost, efficient,
high-speed processing & control hardware for the self-navigating robotics
application. Design and Implementation of a Robotic Vehicle with Real-Time
Video Feedback Control via Internet/web paper illustrate on an approach to
control a robotic vehicle using the internet as the communication medium
between the user and robotic vehicle.
Raspbian OS has to be installed so that the image and videos can be seen to the
smart phone directly. Closed circuit television monitoring system has now
become an indispensable device in today’s society. There are afferent places
such as school, supermarkets, society security where we are having their own
CCTV system for 24/7 monitoring.
7
1.2 OBJECTIVE
This is the internet of things (IOT) based project, where we are particularly
using the Raspberry Pi 3B+, Pi camera and two DC motor with Robot chassis
to build this Robotic car setup.
It has a web camera mounted over it, through which we will get live video feed
and the interesting part here is that we can control and move this robot from a
web browser over the internet. As it can be controlled using webpage, means it
can also be controlled by using the other smart devices where we can control
through the webpage.
We built a webpage in HTML which has Left, Right Forward Backward links,
clicking on which we can move the robot in any direction. Here we use the term
“Motion” for getting live Video information from USB camera and used
“Flask” for sending commands from webpage to Raspberry Pi using python
script to move the Robot.
The webcam will capture live data with regards to its surroundings and then
send it to a desired device through internet.
The user will be observing this data on the monitor at the user end. According
to the desired movement, the user will control the robotic vehicle through the
webpage available at the user end.
8
1.3 PROPOSED SYSTEM
Our proposed System Consists Of a Raspberry pi 3B+ board along with a
Raspberry Pi camera connected to the Raspberry pi 3B+ board which will
provide us a live Video Feed on a web browser.
This setup would be fitted on to a root chassis which would contain two dc
motors and would enable us to move the surveillance camera (Pi Camera) in all
directions.
To control the motors we would be using a l298 Motor Driver Which would
provide data output and external power to the motors.
Motion Software to provide video feed on thee web browser from Raspberry Pi
3B+.
Flask Software to Send commands from the browser to the Raspberry Pi 3B+
and then to the l298 Motor Driver.
9
1.4 SCOPE
Here in this project, one can control the robot from remote end say mobile or
laptop with the use of Wi-Fi as well as Internet and also, we can get the live
streaming of video from the robot for the purpose of surveillance, this video is
obtained on web browser of the remote device from where we are operating the
device also we are able to control the robotic movement.
DC motors are being used for the movement of robotic wheels and stepper
motor is used for camera movement. Raspberry Pi 3B+ is used for video
processing and sending the processed video to user PC with the help of Wi-Fi
as well as internet the robotic unit consists of Wi-Fi dongle, a USB web cam, a
PCB consisting motor driven IC and voltage regulator circuitry.
The User unit consists of a PC within the Wi-Fi range. HTML page is designed
having options of controlling the dc motors and stepper motors. It shows the
live video streaming of the environment
10
SYSTEM ANALYSIS
11
2.1 EXISTING SYSTEM
In the existing system we have seen wall mounted CCTV(Closed-circuit
television) cameras which consume more power, are costly to set up and require
a standalone DVR to store the CCTV footage which ultimately ends up in an
increased cost. Another main limitation of installing a CCTV camera is that,
once fitted in a direction they can only monitor a specific area.
These CCTV cameras need wired connection which increases the cost of setting
up the surveillance cameras.
While Recording a CCTV Footage a Single CCTV camera can create video
data which can result in GB’s.
The Output from the CCTV Footage Was Visible only from a single Monitor.
If there is a electricity-cutoff the CCTV cameras wont work and hence won’t
give 100% video footage guarantee.
12
2.2 REQUIREMENT ANALYSIS
➢Requirements Determination
➢Requirement Analysis
The primary goal of this phase was to create a detailed functional specification
defining the full set of system capabilities to be implemented, along with
accompanying data and process model. Illustrating the information to be
managed and the processes to be supported by the new system. It involved
examination of the collected data. Models such as Data Flow Diagrams (DFD)
and Entity Relationship (ERD’s) were used to model individual processes and
data respectively. Under here requirements were classified as functional and
nonfunctional requirements, the determination and analysis of requirements
helped the researcher to achieve his/her objective.
13
2.3 FEASIBLITY STUDY
Feasibility studies to check the visibility of the project under the consideration
the theoretical project various types of feasibility are conducted but below are
important represent explain
1) Economic feasibility:
With manual system the operation cost of this system is about 60 lacks for
annual this cost comprises salary of Swiss 25 people’s stationary, building rent,
electricity water telephone etc. but with a new system this offering cost comes
out to be about 20 lacks for renewal and the new system is economically
feasible.
2) Technical feasibility:
Technical Feasibility determines whether the work for the project can be done
with the existing equipment’s software technology and available personals
technical feasibility is concerned with the specified equipment and software that
will satisfy the user requirement this project is feasible on technical remark also
as the proposed system is beneficiary in term of having a soundproof system
with new technical equipment’s install on the system that proposed system can
run on any machine supporting window and work on the best software and
hardware that had been used while designing the system so it would be visible
in all technical term of feasibility.
3) Operational feasibility:
The new solution is possible in all sense but operationally is not the new
system demands the explosion of at least 15 people from the company it creates
an environment of joblessness and fear among the employees it can lead to
indefinite Strike in the company also, so the management must take corrective
action prior in advance to start further proceeding.
14
2.4 HARDWARE REQUIREMENT
1- RASPBERRY PI 3B+
Raspberry Pi is used for making robot wireless and web based.ge Raspberry Pi
and then the videos are transmitted wirelessly from the robot to the user’s
monitor, from where the user can conveniently control the robotic vehicle’s
movement and also the robotic arm movement.
It operates at 700M Hz. We use python or embedded C to write code into the
raspberry pi. It has a strong processing capability due to the ARM11
architecture and Linux-based system.
In terms of interface and control, it has 1 SPI, 1 UART, 1 I2C and 8 GPIO,
which basically meet the control requirement .There are easy to use open source
peripheral driver libraries.
Raspberry PI 3B+
15
2- MOTOR DRIVER IC L298N
The L298N H-bridge module can be used with motors which have a voltage
range of between 5 and 35V DC. With the help of L298N H-bridge module, it is
quite easy to control one or two DC motors. First, connect each motor to the A
and B connections on the L298N module.
Ensure that the polarity of the motors is the same on both inputs if you are using
two motors for a robot or anything. Otherwise, you may need to exchange them
over when both motors are set to forward and one goes backward.
Next, connect the power supply to pin number 4 on the L298N module and
negative/GND to pin number 5 of the L298N module. In this project, we have
two DC motors, therefore digital pins D9, D8, D7 and D6 will be connected to
pins IN1, IN2, IN3 and IN4 respectively.
Then connect D10 to pin number 7 on the module (remove the jumper first) and
D5 to pin number 5 of the module (again, remove the jumper). The direction of
the DC motor is controlled by sending a HIGH or LOW signal to the drive for
each of the motors. For example, for motor one, a HIGH signal to IN1 and a
LOW signal to IN2 so that motor will be turning one direction, and a LOW
signal to IN1 and HIGH signal to IN2 will move the motor in other direction.
However, the motors will not move until a HIGH signal is set to the enable pin
(7 for motor one, 12 for motor two). And they can be turned off when the LOW
signal is set to the same pin. However, if you need to control the speed of the
motors, the PWM signal from the digital pin connected to the enable pin.
16
3- Pi CAMERA MODULE
This interface uses the dedicated CSI interface, which was designed especially
for interfacing to cameras.
The Raspberry Pi Camera Module is a 5MP CMOS camera with a fixed focus
lens that is capable of capturing still images as well as high definition video.
Stills are captured at a resolution of 2592 x 1944, while video is supported at
1080p at 30 FPS, 720p at 60 FPS and 640x480 at 60 or 90 FPS.
PI CAMERA V2.1
17
2.5 SOFTWARE REQUIREMENT
1- MOTION
2- FLASK
Here, we have created a web server using Flask, which provides a way to send
the commands from webpage to Raspberry Pi to control the Robot over the
network. Flask allows us to run our python scripts through a webpage and we
can send & receive data from Raspberry Pi to web browser and vice versa.
Flask is a micro framework for Python. This tool is Unicode based having
built-in development server and debugger, integrated unit testing support,
support for secure cookies and it’s easy to use, these things make it useful for
the hobbyist.
3- RASPBIAN OS
18
4- VNC VIEWER
5- HTML
19
2.6 GANTT CHART
Since the initial introduction of Gantt charts, they have become an industry
standard as a key project management tool for representing the phases, tasks
and activities that are scheduled as a part of a Project Work Breakdown
Structure or timeline of activities.
20
21
SYSTEM DESIGN
22
3.1 USECASE DIAGRAM
23
IoT Based Surveillance Robot Use Case Diagram
24
3.2 ACTIVITY DIAGRAM
Activity diagrams are graphical representations of workflows of stepwise
activities and actions with support for choice, iteration and concurrency. In the
Unified Modeling Language, activity diagrams are intended to model both
computational and organizational processes (i.e., workflows), as well as the data
flows intersecting with the related activities.
Although activity diagrams primarily show the overall flow of control, they can
also include elements showing the flow of data between activities through one
or more data stores Activity diagrams can be regarded as a form of a structured
flowchart combined with a traditional data flow diagram.
Typical flowchart techniques lack constructs for expressing concurrency.
However, the join and split symbols in activity diagrams only resolve this for
simple cases; the meaning of the model is not clear when they are arbitrarily
combined with decisions or loops.
While in UML 1.x, activity diagrams were a specialized form of state diagrams,
in UML 2.x, the activity diagrams were reformalized to be based on Petri net-
like semantics, increasing the scope of situations that can be modeled using
activity diagrams.
These changes cause many UML 1.x activity diagrams to be interpreted
differently in UML 2.x.UML activity diagrams in version 2.x can be used in
various domains, e.g. in design of embedded systems. It is possible to verify
such a specification using model checking technique.
25
IoT Based Surveillance Robot Activity Diagram
26
3.3 SEQUENCE DIAGRAM
A sequence diagram shows object interactions arranged in time sequence. It
depicts the objects and classes involved in the scenario and the sequence of
messages exchanged between the objects needed to carry out the functionality
of the scenario. Sequence diagrams are typically associated with use case
realizations in the Logical View of the system under development. Sequence
diagrams are sometimes called event diagrams or event scenarios.
A sequence diagram shows, as parallel vertical lines, different processes or
objects that live simultaneously, and, as horizontal arrows, the messages
exchanged between them, in the order in which they occur. This allows the
specification of simple runtime scenarios in a graphical manner.
If the lifeline is that of an object, it demonstrates a role. Leaving the instance
name blank can represent anonymous and unnamed instances .Messages,
written with horizontal arrows with the message name written above them,
display interaction. Solid arrow heads represent synchronous calls, open arrow
heads represent asynchronous messages, and dashed lines represent reply
messages. If a caller sends a synchronous message, it must wait until the
message is done, such as invoking a subroutine.
If a caller sends an asynchronous message, it can continue processing and
doesn’t have to wait for a response. Asynchronous calls are present in
multithreaded applications, event- driven applications and in message-oriented
middleware. Activation boxes, or method-call boxes, are opaque rectangles
drawn on top of lifelines to represent that processes are being performed in
response to the message (Execution Specifications in UML).
27
Sequence Diagram For Interaction Of Camera
28
Sequence Diagram For Forward Movement Of The Robot
29
Sequence Diagram For Movement of Robot In The Right Direction
30
Sequence Diagram For Movement Of Robot In The Left Direction
31
SYSTEM LAYOUT
AND
SYSTEM CODING
32
4.1 SYSTEM LAYOUT
33
VNC Viewer ScreenShot
34
Configuring and Enabling Motion Module
35
4.2 SYSTEM CODING
Project.py
import time
app = Flask(__name__)
m11=18
m12=23
m21=24
m22=25
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(m11, GPIO.OUT)
GPIO.setup(m12, GPIO.OUT)
GPIO.setup(m21, GPIO.OUT)
GPIO.setup(m22, GPIO.OUT)
GPIO.output(m11 , 0)
36
GPIO.output(m12 , 0)
GPIO.output(m21, 0)
GPIO.output(m22, 0)
a=1
@app.route("/")
def index():
return render_template('robot.html')
@app.route('/left_side')
def left_side():
data1="LEFT"
GPIO.output(m11 , 0)
GPIO.output(m12 , 0)
GPIO.output(m21 , 1)
GPIO.output(m22 , 0)
return 'true'
@app.route('/right_side')
def right_side():
data1="RIGHT"
37
GPIO.output(m11 , 1)
GPIO.output(m12 , 0)
GPIO.output(m21 , 0)
GPIO.output(m22 , 0)
return 'true'
@app.route('/up_side')
def up_side():
data1="FORWARD"
GPIO.output(m11 , 1)
GPIO.output(m12 , 0)
GPIO.output(m21 , 1)
GPIO.output(m22 , 0)
return 'true'
@app.route('/down_side')
def down_side():
data1="BACK"
GPIO.output(m11 , 0)
GPIO.output(m12 , 1)
GPIO.output(m21 , 0)
38
GPIO.output(m22 , 1)
return 'true'
@app.route('/stop')
def stop():
data1="STOP"
GPIO.output(m11 , 0)
GPIO.output(m12 , 0)
GPIO.output(m21 , 0)
GPIO.output(m22 , 0)
return 'true'
if __name__ == "__main__":
app.run(host='192.168.0.108',port=5010)
39
HTML Code View
robot.html
<html>
<head>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>
<body>
<img src="http://192.168.0.108:8081"/>
<div style="float:right">
</div>
<center>
<h1><span style="color:#5C5C5C;">Welcome</span><span
style="color:#139442"> User</span></h1>
40
<a href="#" id="left" style="font-size:30px;text-decoration:none;">
🢀🢀Left</a> &n
bsp;
</div>
<script>
$( document ).ready(function(){
$("#down").on("mousedown", function() {
$.get('/down_side');
}).on('mouseup', function() {
$.get('/stop');
});
$("#up").on("mousedown", function() {
$.get('/up_side');
}).on('mouseup', function() {
$.get('/stop');
});
$("#left").on("mousedown", function() {
41
$.get('/left_side');
}).on('mouseup', function() {
$.get('/stop');
});
$("#right").on("mousedown", function() {
$.get('/right_side');
}).on('mouseup', function() {
$.get('/stop');
});
});
</script>
</body>
</html>
42
IMPLEMENTATION
43
5.1 TESTING APPROACH
Software Testing is evaluation of the software against requirements gathered
from users and system specifications. Testing is conducted at the phase level
in software development life cycle or at module level in program code.
Software testing comprises of Validation and Verification.
Unit Testing
While coding, the programmer performs some tests on that unit of program to
know if it is error free. Testing is performed under white-box testing approach.
Unit testing helps developers decide that individual units of the program are
working as per requirement and are error free.
Integration Testing
Even if the units of software are working fine individually, there is a need to
find out if the units if integrated together would also work without errors. For
example, argument passes and data updating etc.
System Testing
Performance testing-This test proves how efficient the software is. It tests
the effectiveness and average time taken by the software to do desired
task. Performance testing is done by means of load testing and stress
testing where the software is put under high user and data load under
various environment conditions.
Acceptance Testing-When the software is ready to hand over to the
customer it must go through last phase of testing where it is tested for
user-interaction and response. This is important because even if the
software matches all user requirements and if user does not like the way it
appears or works, it may be rejected.
44
Alpha testing
The team of developer themselves perform alpha testing by using the system as
if it is being used in work environment. They try to find out how user would react
to some action in software and how the system should respond to inputs.
Beta testing
After the software is tested internally, it is handed over to the users to use it
under their production environment only for testing purpose. This is not yet the
delivered product. Developers expect that users at this stage will bring minute
problems, which were skipped to attend.
45
5.2 TEST CASES, TEST DATA AND RESULTS
Test Module Test Steps/ Expected Actual Pass/
Case /Sub Condition Prerequisit procedur output Output Fail
ID Module e e
Name
T01 Robot To check If Flask Press On The Robot The Robot Pass
Movement the robot Configured Forward moves in moves in
Forward moves in and Button Forward Forward
forward Running And Wait Direction Direction
direction For
Response
T02 Robot To check if Flask Press On The Robot The Robot Pass
Movement the robot Configured Backward moves in moves in
Backward moves in and Button Forward Backward
backward Running And Wait Direction Direction
direction For
Response
T03 Robot To check if Flask Press On The Robot The Robot Pass
Movement the Robot Configured Right moves in moves in
Right moves in and Button Right Right
Right Running And Wait Direction Direction
Direction For
Response
T04 Robot To check if Flask Press On The Robot The Robot Pass
Movement the Robot Configured Left moves in moves in
Left Moves in and Button Left Left
Left Running And Wait Direction Direction
Direction For
Response
46
5.3 MAINTENANCE
Maintenance is an enigma of the system development. It holds the software
industry captive. Analysts spend more time in maintaining programs than
coding them. Software maintenance denotes any changes made to the
software product after it has been delivered to the customer. Most products
need maintenance due to the wear and tear of the product. Software
Maintenance can be divided into following types:
Corrective Maintenance: It is necessary to rectify the bugs observed while
the system is in use. Security Master needs this maintenance for any
removing flaws that can arise while loading data or for correcting the logical
bugs that might have been left unchecked as they appear only in real time.
Adaptive Maintenance: Software might need this type of maintenance when
the customers need the product to run on new platforms, on new operating
systems, or when they need the product to interface with new hardware or
software. . Security Master needs this type of maintenance for adapting to
the new Browser and Server Configurations that may be required in future.
47
CONCLUSION
Using this robotic system a remote area can be monitored easily from remote
end. One can easily monitor as well as control the activity of the robotic
unit. This system can be used any conditions and areas where it is difficult
for the security forces to reach it can monitor the areas.
As the communication is done with the help of internet so limitation of range
of operation does not arise and thus we can monitor any remote areas.
If this robot is within the Wi-Fi range there is no need of internet too.
We control the robot using the Wi-Fi as a medium.
In this project we used raspberry pi zero w working on Raspbian OS. As the
communication is done with the help of internet so limitation of range of
operation does not arise and thus we can monitor any remote areas.
One can easily monitor as well as control the activity of the robotic unit.
48
LIMITATIONS
If the wireless network is not properly configured, there would be
interference from access points operating in the same channel (From internal
and neighboring AP’s) which would reduce the quality of the Wi-Fi network.
The most commonly used Wi-Fi network band – 2.4 Ghz has only three non-
overlapping channels and is always over-crowded. Besides, non Wi-Fi
devices like Microwave Owens, Bluetooth devices, etc can interfere with
Wireless networks.
For long-haul backbone wireless networks, Line of Sight might be required.
Even for WiFi access networks (that don’t require a Line of Sight), the
signal strength and signal quality might be affected due to interfering objects
like Glass, Trees, Elevators, Metallic Racks, etc.
Wireless networks offer sufficient bandwidth when IP Surveillance Cameras
are placed near the Wireless Access Points. But the bandwidth decreases
with increasing distance.
IEEE 802.11n is the latest wireless standard that offers more bandwidth +
increased wireless coverage distance. But many Wireless IP Surveillance
Cameras do not support this standard and even if they do, they might support
a reduced MIMO configuration
49
FUTURE SCOPE
There are lots of improvements that can be made on the current design and
technology and lots of additional feature scan be added.
We can use different types of sensor so that we can use robot in different
field i.e. Temperature Sensor, Pressure Sensor, Heat Sensor, Position Sensor,
Proximity Sensor.
A multipurpose robot can be made by wireless network, ranging from
surveillance and home security to industrial applications where the user need
not be present at the work place in person but can do it from his home itself.
We can use this system for military applications installing suitable sensors.
Just by changing the robotic unit design we can use it in hospitals for patient
monitoring.With reduced time delay we can have faster operation and quick
response to any illegal activities in the monitored area.
Also it can be used as a spy robot.
The robot is very economical.
50
BIBLIOGRAPHY
www.electronicsforu.com
International general of
Computer Applications –
March 2015
51