Sunteți pe pagina 1din 9

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/312218161

Smart Motion Detection: Security System Using Raspberry Pi.

Article · December 2016

CITATIONS READS

2 38,983

2 authors, including:

Zakaria Rada
Gyeongsang National University
1 PUBLICATION   2 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Research Project View project

All content following this page was uploaded by Zakaria Rada on 12 January 2017.

The user has requested enhancement of the downloaded file.


경상대학교 부속 공학연구원 논문집 제30집.
----------------------------------------------------------------------------------------------------------------------------------------
Journal of the Engineering Research Institute Vol. 30.

스마트 모션 감지:
라스베리 파이를 사용한 보안 시스템
Smart Motion Detection:
Security System Using Raspberry Pi

라다자카리아*
Rada Zakaria*

1 경상대학교 산업시스템공학과(School of Industrial and System Engineering, Gyeongsang National Univ.)


* Corresponding author: zakaria.rada@gnu.ac.kr.

Abstract
Nowadays surveillance security forms the most important part of our lives. As it plays very vital role to fulfill our
safety aspects as burglary and theft which was always a problem, as lately increased terrorism threats and theft of
raw materials have made the manufacturing, shipping and storing of important goods riskier and more expensive in
recent years. Industrial sites like factories, warehouses, energy (oil and gas) production, mining can benefit from the
security provided by smart surveillance. I propose this mechanism to resolve the object detection tracking problem on
the video security surveillance system. The suggested new mechanism used by Raspberry pi [1], and PIR Sensor [3],
can make intelligent detection tracking and recording for interesting objects so that make the amount of valid video
high and improve video’s quality.

Key Words: Smart motion ,Surveillance Security, Raspberry Pi, PIR Sensor,

1. Intoduction. cable, also we need a hard disk with higher capacity


for save video It reserves too much space for
A smart surveillance security camera system can
continues recording and require manpower to detect
have many benefits for industrial site, including
the unauthorized Activity. But compare to Raspberry
(Reduced theft, protect employees, building security,
Pi [1], system is much cheaper with high resolution
remote monitoring of facility from Smartphone or
and low power consumption feature. Which mean it
tablet, deter trespassers from attempting to gain
can solve many of the issues of cost that may
access to facility). The problematic for surveillance
discourage consumers from investing in remote
system or CCTV camera is costly because of the use
surveillance technology.
many expensive components like computer, camera,
경상대학교 부속 공학연구원 논문집 제30집.
----------------------------------------------------------------------------------------------------------------------------------------
Journal of the Engineering Research Institute Vol. 30.

2. Related Work
I had been created a similar system by using Visual
basic 6v, but in That methodology system followed
comparing pixel by pixel in video stream without
using sensor or raspberry Pi [1][2], so after released
Raspberry pi, it was a good opportunity to make a
new security system using sensor which means is
more developed then old system.

3. Project Goal.

In this project, we are going to be using a Figure 2: The camera module V2

Raspberry Pi (Fig:1) is a low cost, credit-card sized


computer that plugs into a computer monitor or TV, Also, we need Passive Infrared (PIR) [3], (Fig:3)
and uses a standard keyboard and mouse, it is a sensor allow you to sense motion, almost always
capable little device that enables people of all ages to used to detect whether a human has moved in or out
explore computing. of the sensors range.

Figure1: Raspberry Pi 3 board


Figure 3: PIR Sensor with a 3-pin ground/out/power pads.

And The camera module [5][6][7], V2 [8], (Fig:2)


The goal of this project is to develop a low-cost
can be used to take high-definition video, as well as
remote surveillance system using the Raspberry Pi
stills photographs. It's able to deliver clear 8MP
platform. Additional features such as monitoring the
(2592×1944 pixels) resolution image, or 1080p HD
video feed and controlling the angle of the camera
video recording Can take 2 High Definition Videos
for developed [15], and increase the capabilities of the
Small size (The board itself is tiny at around 25mmx
surveillance system.
20mmx9mm & weighs just over 3g) It’s easy to use
with raspberry pi.
3. System Specification

In this System, the Raspberry Pi executes a Python


program that starts when the Raspberry Pi is booted
and waits for motion to be detected by the PIR
sensor. When motion is detected, the Raspberry Pi
경상대학교 부속 공학연구원 논문집 제30집.
----------------------------------------------------------------------------------------------------------------------------------------
Journal of the Engineering Research Institute Vol. 30.

start records video or snaps a photo and send Temporarily record video is stored in raspberry SD
notification and to the Smartphone through application card and it will send one notification message to
via Wife. By using of Machine to Machine (M2M) user’s android device through internet same time.
communication is an advantage over the traditional
Data Acquisition System as the monitoring and 5.1.2 Hardware Equipment Lists.
controlling can be done without human intervention For implement this project we used equipment:
[14]. • The Raspberry Pi 3, Model B+, 1GB RAM.
• The camera module V2.
4.1 Advantage
• PIR sensor board.
• Raspberry Pi 7” Touchscreen Display
Featuring many properties such a system may
(Optional).
become fully automatic so the amount of error
• SD Card 32Gb.
decreases and the efficiency of the system increases. • Connector cables Female to Female and Male
It is simple circuit with higher resolution and
to Female.
cheaper, easy to implement, the operating system used
• Supply power adapter 5V 3.1A, Dual USB
here is Raspbian OS. Small size portable stand-alone 16000mAh battery.
device with its own power source, an energy efficient
portable system is proposed, that can snap pictures or
5.1.3 Platform of Raspberry Pi.
records video when the burglary happens and send
out an alert signal at the same time.
This can be useful to a project targeting security
setup which is limited to specific location to monitor
properties and assets from a separate location.

5. Project Implementation

5.1 System Overview


This system has functions of the various
components:
• Raspberry Pi 3: Model B+, 1GB RAM Wireless
Figure 4: Raspberry PI 3 model B+.
Integer used Raspbian OS.
• PIR sensor: Detect the motion in surveillance In this the surveillance system Raspberry Pi 3 is
area. the most important component, can be work same as
• PHP code: Sending notification with embedded functional desktop computer (Linux-based operating
system systems), there are a few different models but in this
The System requires 650 mA@5v power supply, to case a Raspberry Pi 3 Model B+ [1], features of the
capturing images and interfacing it will be through Model B+ include an Ethernet port, four USB 2.0
OpenCV and programming is done in python ports, audio input/output, HDMI output, and general
scripting language. Whenever PIR sensor detects any purpose input/output (GPIO) [9][10].
intrusion it will send positive signal to the raspberry
pi GPIO pin.
Pi senses the signal and send the output signal
경상대학교 부속 공학연구원 논문집 제30집.
----------------------------------------------------------------------------------------------------------------------------------------
Journal of the Engineering Research Institute Vol. 30.

must connect the PIR module[3], to the Raspberry Pi,


using three female-to-female jumper cables, we need
to connect each of the PIR sensor's connectors to the
appropriate pins on the Raspberry Pi [4], Fig:6).

Figure 5: GPIO on Raspberry Pi 3 B+ model

GPIO(fig5): One powerful feature of the Raspberry


Pi is the row of GPIO (general purpose input/output)
Figure 7: Connect the PIR Sensor with Raspberry Pi
[11], pins along the top edge of the board. These
pins are a physical interface between the Pi and the
outside world. also, we can turn on or off (input) or • Connect the one labelled VCC on the PIR sensor
that the Pi can turn on or off (output), Of the 40 to the 5V pin on the Raspberry Pi. This provide
pins, 26 are GPIO pins and the others are power or power to the PIR sensor.
ground pins plus two ID EEPROM pins. • Connect the one labelled GND to a Ground pin on
the Raspberry Pi. This completes the circuit.
• Connect the one labelled OUT to GPIO pin 4. This
pin will output a voltage when motion is detected,
that can then be received by the Raspberry Pi.

Figure 8: Connect the PIR Sensor with Pins.

The module sets a single output pin high whenever


Figure 6: GPIO From Raspberry Pi 3 B+ model it detects movement within its field of view. It holds
this pin High (3.3V) for a minimum period. If
5.2 Project Setup continuous movement is detected the output pin will
stay High. When the time has elapsed and no more
5.2.1 PIR Sensor setup movement is detected the output pin returns Low
(0V). The device has two variable resistors that you
After installing Raspbian OS with some package can adjust to tweak the performance of the module.
for camera and setting up the Raspberry Pi to be The first one (left-hand side on the photo)
ready for using and before booting Raspberry Pi we determines the sensitivity of the device.
경상대학교 부속 공학연구원 논문집 제30집.
----------------------------------------------------------------------------------------------------------------------------------------
Journal of the Engineering Research Institute Vol. 30.

Figure 9: Photo Shows Adjust on PIR Sensor.

The default setting is usually 50%. the second


control (right-hand side on the photo and usually
marked “time” on the PCB) allows you to adjust the
amount of time the output pin stays at 3V (high)
when it is triggered by movement. This can be set Figure 11: Raspberry Pi Setup with all components.
from a few seconds to 200 seconds. The default
setting is usually a few seconds. For making this Surveillance System we need
mainly parts:
5.2.2 How to Use PIR Senosr • Hard-wired: These systems use wires to connect
Output Digital the cameras, motion detectors, power supply and
LAN cable with the pi and Keyboard and mouse and
LCD Temporary until install the system.
• Remote Systems: capability to monitor and
control a security system from a location away from
the surveillance area through android device.

6. Software Setup
Now after connected all components we must
Configure the Raspberry pi, The first step in
Figure 10: Wiring Diagram preparing the Raspberry Pi is to install and configure
the Raspbian software[1][2]:
5.2.3 Connect the Raspberry Pi with All Component.
• Connect the Raspberry Pi camera to the Raspberry
This surveillance system is related to internet of Pi using the instructions that come with the camera
things (IOT), so the goal is to make a smart module (Download and load Raspbian onto a SD
surveillance system which can be monitor by owner card).
remotely through android application. • Insert the SD card into the slot on the Raspberry
Pi.
• Connect the Raspberry Pi to a display, keyboard,
mouse, LAN with access to the internet, and a 5 volt
USB power adapter as shown in the "Figure 7"
diagram.
• Boot the Raspberry Pi and perform the first-time
configuration.
경상대학교 부속 공학연구원 논문집 제30집.
----------------------------------------------------------------------------------------------------------------------------------------
Journal of the Engineering Research Institute Vol. 30.

• When configuring the Raspbian, do not configure


the graphical user interface to start automatically.
• We Make it sure to enable the camera and update.
For update Raspberry Pi we have to go menu
from a terminal or by click (CTRL+ALT+T) and type
this command line.
• $ sudo apt-get install rpi-update
• $ sudo rpi-update
And, update all packages:
• $ sudo apt-get update
• $ sudo apt-get upgrade
7. Motion Detection
It’s a free open-source motion detection
/surveillance software with many configuration
options. We need now to install Motion Detection
using the command line:
• $ sudo apt-get install motion
Some packages will be installed in the installation
process, just type "y" to proceed with the installation.
in install, will take some time so after the raspberry
pi is ready for Programing by Using PYTHON
[12][13], Programming language. In the python code,
we will control PIR sensor using GPIO through pins.

Figure 12: System Block Diagram. 7.1 Use Case Diagram

6.1 Enable Camera Access

To be able to use a hardware camera module with


Raspberry Pi, we need to enable the software first,
by go to Pi Software Config Tool menu from a
terminal [1][2]:
• $ sudo raspi-config
We will see the menu like this, We Use arrow
keys to select Enable Camera.
Figure 16: Use Case Diagram.

After, lunch the code will be ready to detect


motion and record video in the time when the object
detected, the system will send GSM [16], notification
to mobile and in the same time the video will start
to record and save in desktop under title data and
time of the OS.
경상대학교 부속 공학연구원 논문집 제30집.
----------------------------------------------------------------------------------------------------------------------------------------
Journal of the Engineering Research Institute Vol. 30.

7.2 FlowChart Diagram General System

The methodology followed in our project in motion


detection performed on the video stream received
by the cameras is described in the following diagram:

Figure 18: Flow Charts Diagram General system


after detects motion

8. Conclusion

Smart surveillance systems significantly contribute


to situation awareness in real time also it has been
aimed to design in such a way that it can use for
Figure 17: Flowcharts Diagram General system
before detects motion. many surveillance areas. Thus, we designed a smart
surveillance system capable of recording/ capturing
video to alarm notification a smart phone. it may be
used and supports many persons concerned to view
the details, Necessary action can be taken in short
time in the case of emergency conditions. For
instance, at one scenario it can be used by any
person working in industry to be aware of the
activity being happened at their own working places,
it can be used for spy purposes at bank lockers,
storage houses. military areas, smart homes, bank,
offices, industries etc.
경상대학교 부속 공학연구원 논문집 제30집.
----------------------------------------------------------------------------------------------------------------------------------------
Journal of the Engineering Research Institute Vol. 30.

9. Reference

[1] Simon Monk, Raspberry pi Cookbook, First edition,


ISBN: 978-1-449-36522-6. Pages: 1-25.
[2] 서영진 리눅스 프로그래밍 라즈베리 파
. with . .ISBN:
979-11-85890-28-9, page 4-40.
아두이노 통신프로젝트
[3] Smon Monk, , ISBN:
978-89-6088-163-1 page: 168-169.
[4] V. Persis Priyanka, K. SudhakarReddy,’PIR based
Security Home Automation System with Exclusive Video
Transmission’, International Journal of Scientific Engineering
and Technology Research, Vol.4, No.18, pp.3316-3319, 2015
이시이 모루나 에시 노히하데 자음 모두의 라즈베리
[5] , ,
파이 피이썬with , ISBN: 979-11-87345-19-0. page: 333-354.
김성우 자음 사물 인터넷의 중심에 라즈베리 파이
[6] , ,
라즈베리 파이카메라 연결 , page:314-317.
[7] Dave Jones, Picamera documentation Release 1.12
September 30.2016, pages 7-9.
[8] 서영진 리눅스 프로그래밍
. with 라즈베리 파 . .ISBN:
979-11-85890-28-9, page 440-456.
[9]Simon Monk, Raspberry pi Cookbook, First edition,
ISBN: 978-1-449-36522-6. Pages: 167-197.
[10] 서영진 리눅스 프로그래밍
. with 라즈베리 파이 . ISBN:
979-11-85890-28-9, page. 98-100.
[11]Simon Monk, Programing the Raspberry pi, second
edition, ISBN: 979-11-85890-48-7. Pages: 143-147.
[12] Simon Monk, Raspberry pi Cookbook, First edition,
ISBN: 978-1-449-36522-6. Pages: 111-135.
[13] 서영진 리눅스 프로그래밍
. with 라즈베리 파이 . ISBN:
979-11-85890-28-9, page 626-636.
[14] Simon Monk, Raspberry pi Cookbook, First edition,
ISBN: 978-1-449-36522-6. Pages: 163-164.
[15] A.N. Ansari, M. Sedky, N. Sharma, A. Tyagi,’An
Internet of Things Approach for Motion Detection using
Raspberry Pi’, International Conference on Intelligent
Computing and Internet of Things(ICIT), pp.131-134.
[16]Akash V. Bhatkule1, Ulhas B. Shinde2, Shrinivas R.
Zanwar3, International Journal of Innovative Research in
Computer and Communication Engineering,Vol. 4, Issue 9,
September 2016, ISSN(Online): 2320-9801.

View publication stats

S-ar putea să vă placă și