Está en la página 1de 40

INTRUDER ALERT SYSTEM 2019

CHAPTER-1
INTRODUCTION

1.1 ABOUT:

In this IoT based Project, we will build a Home Security System using IR Sensor and PI
Camera. This system will detect the presence of Intruder and quickly alert the user by sending
him an alert mail. This mail will also contain the Picture of the Intruder, captured by Pi camera.
Raspberry Pi is used to control the whole system. This system can be installed at the main door
of your home or office and you can monitor it from anywhere in the world using your Email over
internet.

This intruder alert system project helps the owner of a house to find out who the intruder
was when the owner is not at home. This is very helpful in banks, organizations, where high
security is needed. As the picture of the intruder is stored in our memory it can be viewed later in
order to find that person in future. With low cost you can secure your valuables.

1.2 NECESSITY:
 Protect what you love and value:

The average home has a lot of valuable items inside. These days there is plenty of
stuff worth taking, including mobile phones, televisions, games consoles, stereos, cinema -
systems, jewellery and expensive clothes. On top of this, car thieves often break into
people’s homes in order to steal their keys and then take their vehicle. Businesses can hold
valuable stock, lots of specialized equipment, and employee possessions. On top of this,
your premises could contain sensitive customer information. A break-in, even if no
personal data is taken, may cause concerns among your clients.

 Cheaper Insurance:

The more protected your items, the less likely they are to be stolen. Thieves ar e
looking for the easiest time they aren’t going to bother with a well-protected home or

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 1


INTRUDER ALERT SYSTEM 2019

business premises. Just the sight of burglar alarms can be enough to deter an otherwise
interested intruder. This means that installing an intruder alarm system in your property can
lower your insurance premiums. Your saving will depend upon your particular provider,
but you could see a significant reduction in the cost of your premiums.

 Higher home value when selling:

Intruder alarms keep your home safe, and contribute to a safer neighbourhood.
These are both desirable qualities for a house, which is reflected in the price you can ask
for it. If you are thinking about selling you home, or are simply open to the possibility in
the future, a security alarm system is a good way to boost the value of yo ur property.

 Leave your property for long periods without worrying:

Most people go on holiday to get away from their home or work life. There’s no
point ‘leaving’ your mind at home or in the workplace and spending the whole time you are
away worrying about what might happen. An intruder alarm system keeps everything
covered, deterring thieves even in your absence. That way, you can relax and enjoy your
holiday, safe in the knowledge your building and valuables will be exactly as you left them.

 Remotely monitor your home:

More advanced systems come equipped with cameras so that you can check what’s
happening in your home. This is particularly useful if you are worried about what your
teenagers might get up to when they are away, or have pets you want to kee p tabs on.
Some security systems include remote locking, so you can ensure that windows and doors
are always locked.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 2


INTRUDER ALERT SYSTEM 2019

1.3 OBJECTIVES:

 Reducing Loss:

When you install a home security system, it’ll function to deter robbers from entering the house,
which denotes that it’s also reducing the odds of losing your goods. Losing the things can be
upsetting and pricey. The alarm system you have installed will sound if a burglar tries to enter
and most times will fight them off. If it does not then assistance will be on the way right away
which denotes that they won’t have time to take anything.

 Prevent A Confrontation:

No one desires to come home just to be confronted by an intruder. By installing an alarm system,
the alarm will make noise if a burglar enters, so if you reach home and the alarm is crashing, you
acquaint not to go into the house. It is the great way to evade any confrontation with an intruder,
which can be distressing for anybody.

 Fire Detection:

Most of the alarms lately have a mode that you can link up the smoke alarms to them. That way
if a fire is perceived, the alarm sound will alert you to the hazard. It’ll also alert the security
agency to the danger so they can call for assistance for you. It could save the kid’s lives. These
are the major objectives of a house security system that you have to acquaint about. After
knowing such objectives, anybody can perceive why it’s significant to install a good security
system. Do not take chances with your kin’s safety or lives; instead, get a high-quality house
security system today to be sure they are always protected at home.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 3


INTRUDER ALERT SYSTEM 2019

 House Security Principles of Protection:

Every evening, some people and families come back home after a long day to face the horrible
finding that intruders have broke in their houses. Such a comprehension can reason a bit of fret in
your belly to form as the charges of recovering from a break-in are high. Yet deterrence can go a
long way in terms of keeping burglars away from the house. The following are few helpful
principles to remember when trying to improve house security.

 Enhance Visibility Around The House:

While a lot of intruders work throughout the day, the ones that rob nocturnally typically asIRe to
operate under the cloak of the dark. Motion-activated lights thus function to dissuade a lot of
them. An unexpected burst of bright light can be quite worrying for potential burglars trying to
burglarize. It might even frighten them to the point where they escapee as they comprehend
passersby or neighbor could have spotted them trying to rob the home. Taking steps like cutting
back trees or trimming big bushes similarly increases visibility in the daytime hours.

 Remember To Lock Up:

This suggestion may look obvious, but numerous individuals still ignore to close their house with
a key when going somewhere else. It’s mainly common for people going out to run tasks, as they
mistakenly suppose nothing will occur in the span of 15 or 20 minutes. Unluckily, a small
window of time is all it takes for a robber to burglarize, particularly when entry is so simple.
Therefore, locking up persists to be a necessary house security step.

 Become Friendly With Neighbours:

Technology that keeps individuals in front of PC screens at times begins to replace relations with
individuals who are close to where you are. However, it doesn’t need to be the event. Meeting
the families that live on your block is an excellent way to get rid of the obscurity that
characterizes a lot of city neighborhoods. Organizing affairs like parties can be quite amusing as
well. You can even make such bonds stronger by making groups on Facebook or starting an

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 4


INTRUDER ALERT SYSTEM 2019

email list. When individuals keep an eye on what occurs in their communities, it’s much harder
for break-ins to happen.

 Install Roller Barriers:

You can also install Roller Barrier in your house to make it more secure. People install different
systems to keep burglars away from their house, but such systems can injure them while they are
trying to break in. Did you know that if an intruder hurts himself while entering your home, you
can be prosecuted? Well, such barriers are the best way to keep them away without hurting them.

 Find A Trustworthy House Security Provider:

There is only a lot that individuals can do unaided when facing tough intruders. Hiring
professionals greatly boost protection because such agencies have some serious practice when it
comes to keeping homes secure. Also, when you have a house security system installed around
your home, you don’t have to be anxious throughout the day when both you and your fellow
citizens are at work. Monitored models make sure that if any burglars come close, local police
officials will be informed.

 Place A Modern House Alarm:

After you’ve decided which agency you feel most relaxed with, fitting is the next thing. A
mixture of wired and wireless technology now makes the course completely easy, and advances
such as keychain remotes make the process even simpler. When you keep deterrence in an
account, intruders will evade targeting your house.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 5


INTRUDER ALERT SYSTEM 2019

CHAPTER-2
SYSTEM MODEL

2.1 BLOCK DIAGRAM

5V / 2A RASPBERRY PI CAMERA
ADAPTOR

IR
SENSOR

Fig.1: Block Diagram

2.2 DESCRIPTION OF VARIOUS BLOCKS:

 IR sensor

A infrared sensor (IR sensor) is an electronic sensor that measures infrared (IR) light
radiating from objects in its field of view. They are most often used in IR-based motion
detectors. IR sensors are commonly used in security alarms and automatic lighting applications.
IR sensors detect general movement, but do not give information on who or what moved. For
that purpose, an active IR sensor is required.

 Raspberry Pi

The Raspberry Pi 3 Model is the latest version of the Raspberry Pi computer. The
Raspberry Pi isn't like your typical machine, in its cheapest form it doesn't have a case, and is
simply a credit-card sized electronic board -- of the type you might find inside a PC or laptop but
much smaller.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 6


INTRUDER ALERT SYSTEM 2019

HOW IS THE RASPBERRY PI 3 DIFFERENT FROM ITS PREDECESSORS?

The quad-core Raspberry Pi 3 is both faster and more capable than its predecessor, the
Raspberry Pi 2. For those interested in benchmarks, the Pi 3's CPU--the board's main processor--
has roughly 50-60 percent better performance in 32-bit more than that of the Pi 2, and is 10x
faster than the original single-core Raspberry Pi (based on a multi-threaded CPU benchmark in
Sys Bench). Compared to the original Pi, real-world applications will see a performance increase
of between 2.5 xs--for single-threaded applications--and more than 20x--when video playback is
accelerated by the chip's NEON engine.

Unlike its predecessor, the new board is capable of playing 1080p MP4 video at 60 frames per
second (with a bit rate of about 5400Kbps), boosting the Pi's media center credentials. That's not
to say, however, that all video will playback this smoothly, with performance dependent on the
source video, the player used and bit rate.

The Pi 3 also supports wireless internet out of the box, with built-in Wi-Fi and Bluetooth.The
latest board can also boot directly from a USB-attached hard drive or pen drive, as well as
supporting booting from a network-attached file system which is useful for remotely updating a
Pi and for sharing an operating system image between multiple machines.

 Camera

A camera is an optical instrument to capture still images or to record moving images,


which are stored in a physical medium such as in a digital system or on photographic film. A
camera consists of a lens which focuses light from the scene, and a camera body which holds the
image capture mechanism.

 Adapter

All models of Raspberry Pi now use the same universal power supply, which offers 5V
2.5A. This will happily power all flavours of Raspberry Pi - from original boards right through
the range to the most powerful Raspberry Pi 3.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 7


INTRUDER ALERT SYSTEM 2019

2.3 EXISTING AND PROPOSED MODEL

 Existing Model:

In existing model we have live CCTV camera or spy camera but they are visible to everyone and
stranger can easily remove it or disconnect it. This type of systems will save the data into
computer HDD (Hard disk drive ) which take lot of time and power.

 Proposed Model:

In our project we are using credit card size computer with small camera which can click photo
and send it to our Gmail account, this device is portable and you can mount anywhere in your
home or office etc.. this just needs 5V volts to works along with internet access.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 8


INTRUDER ALERT SYSTEM 2019

CHAPTER-3
HARDWARE DESCRIPTION

3.1 INTRODUCTION

This gives us the list of components, circuit diagram and information of various
components used in this project.

3.2 LIST OF COMPONENTS

 Raspberry Pi
 Pi Camera
 Adapter
 Power Cable
 IR Sensor
 SD Card
 Connecting Wires

3.3 DESCRIPTION OF COMPONENTS


 Raspberry Pi

Fig.2: Raspberry Pi

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 9


INTRUDER ALERT SYSTEM 2019

 About Raspberry Pi
The Raspberry Pi is a series of small single-board computers developed in the United
Kingdom by the Raspberry Pi Foundation to promote teaching of basic computer science in
schools and in developing countries. The original model became far more popular than
anticipated, selling outside its target market for uses such as robotics. It does not include
peripherals (such as keyboards and mice) and cases. However, some accessories have been
included in several official and unofficial bundles.

Fig.3: Internal Parts of Raspberry Pi

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 10


INTRUDER ALERT SYSTEM 2019

The current generation Raspberry Pi 3, seen above, sports the following hardware:

 1.2 GHZ ARM (Advanced RISC Machine) processor Systems-On-a-Chip with integrated
1GB RAM.
 1 HDMI port for digital audio/video output
 1 3.5 mm jack that offers both audio and composite video out (when paired with an
appropriate cable).
 4 USB 2.0 ports for connecting input devices and peripheral add-ons.
 1 microSD card reader for loading the operating system.
 1 Ethernet LAN port.
 1 Integrated Wi-Fi/Bluetooth radio antenna.
 1 microUSB power port.
 1 GPIO (General Purpose Input/Output) interface.

 Memory:
Raspberry Pi is small in size compared to Personal Computers. Whereas memory for PC
is in gigabytes, the raspberry pi board is designed with 256MB of SDRAM for model A and
512MB for model B.

 Ethernet port:
Ethernet port is the primary gateway enabling communication with other devices. It is
used for internet access by plugging the home router. During the setting up of rasp-berry pi,
however, a connection to the internet is not needed.

 CPU:

The Central Processing Unit (CPU) is the brain of a raspberry pi board where all
mathematical logic computations take place. It carries out instructions for receiving input, doing
calculations and producing output. It is also referred to as central proces-sor and uses an ARM11
series processor.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 11


INTRUDER ALERT SYSTEM 2019

 GPU:
Graphics Processing Unit (GPU), also known as a graphics processor is similar to
computer's CPU. It is designed purposely for performing complex mathematical and geometric
calculations that are essential for graphics rendering. GPU handles graphics operations at an
accelerated rate. It is usually located under a heat sink or a fan to re-duce the so much heat
generated by GPU.

 Display:
Raspberry pi board allows connections via Composite or HDMI types. HD TV monitors
and many LCDs are connected by use of an HDMI male cable in addition to a low-cost adapter.
Older TVs can be connected using composite videos.
The output of the system may be in the form of pictures, audio or video files requiring an
attachment of an HDMI cable to the monitor.
The HDMI port of raspberry allows an output of data; either video or audio, but does not support
input data.

 General Purpose Input and Output (GPIO) Pins:


The GPIO pins are useful in associating raspberry pi to other electronic boards and components.
The pins accept the input and output commands as per the programming of raspberry pi. In
surveillance, the pins can be connected to motion sensors to enable transmission of digital data
[13, 5.]

 UART
The Universal Asynchronous Receiver/ Transmitter is a serial input & output port com-
monly used on the Pi as an appropriate way to control it over the GPIO. It takes bytes of data and
sequentially transmits individual bits and can be used to transfer serial data in the form of text
[14, 13]. UART is useful for conversion of the debugging code.

 XBee Socket
XBee socket is used in a raspberry pi board for wireless communication purpose.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 12


INTRUDER ALERT SYSTEM 2019

Fig.4: Versions of Raspberry Pi

The organization behind the Raspberry Pi consists of two arms. The first two models were
developed by the Raspberry Pi Foundation. After the Pi Model B was released, the Foundation
set up Raspberry Pi Trading, with Eben Upton as CEO, to develop the third model, the B+.
Raspberry Pi Trading is responsible for developing the technology while the Foundation is an
educational charity to promote the teaching of basic computer science in schools and in
developing countries.

According to the Raspberry Pi Foundation, more than 5 million Raspberry Pis were sold
by February 2015, making it the best-selling British computer. By November 2016 they had sold
11 million units, and 12.5m by March 2017, making it the third best-selling "general purpose
computer". In July 2017, sales reached nearly 15 million. In March 2018, sales reached 19
million. Most Pins are made in a Sony factory in Pencoed, Wales; some are made in China or
Japan.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 13


INTRUDER ALERT SYSTEM 2019

 IR sensor

Fig.5: IR Sensor
An infrared sensor is an electronic device that emits in order to sense some aspects of the
surroundings. An IR sensor can measure the heat of an object as well as detects the motion.These
types of sensors measures only infrared radiation, rather than emitting it that is called as
a passive IR sensor. Usually in the infrared spectrum, all the objects radiate some form of
thermal radiations. These types of radiations are invisible to our eyes, that can be detected by an
infrared sensor.The emitter is simply an IR LED (Light Emitting Diode) and the detector is
simply an IR photodiode which is sensitive to IR light of the same wavelength as that emitted by
the IR LED. When IR light falls on the photodiode, The resistances and these output voltages,
change in proportion to the magnitude of the IR light received. An infrared sensor circuit is one
of the basic and popular sensor module in an electronic device. This sensor is analogous to
human’s visionary senses, which can be used to detect obstacles and it is one of the common
applications in real time.This circuit comprises of the following components.

 LM358 IC 2 IR transmitter and receiver pair


 Resistors of the range of kilo ohms.
 Variable resistors.
 LED (Light Emitting Diode).

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 14


INTRUDER ALERT SYSTEM 2019

 Different Types of IR Sensors and Their Applications:

IR sensors are classified into different types depending on the applications. The speed
sensor is used for synchronizing the speed of multiple motors. The temperature sensor is used for
industrial temperature control. IR sensor is used for automatic door opening system. Ultrasonic
sensor are used for distance measurement.

 IR Sensor Applications

IR sensors are used in various Sensor based projects and also in various electronic devices which
measures the temperature that are discussed in the below. The development target is to have a
low-cost security system for home applications. The system uses small IR sensor built around a
microcontroller. The microcontroller senses human motion by detecting infrared radiations from
a human body.

 Radiation Thermometers:

IR sensors are used in radiation thermometers to measure the temperature depend upon the
temperature and the material of the object and these thermometers have some of the following
features

 Measurement without direct contact with the object


 Faster response
 Easy pattern measurements

 Flame Monitors:

These types of devices are used for detecting the light emitted from the flames and to monitor
how the flames are burning. The Light emitted from flames extend from UV to IR region types.
Two-color detector, pyro electric detector are some of the commonly employed detector used in
flame monitors.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 15


INTRUDER ALERT SYSTEM 2019

 Moisture Analyzers:

Moisture analyzers use wavelengths which are absorbed by the moisture in the IR region.
Objects are irradiated with light having these wavelengths (1.1 µm, 1.4 µm, 1.9 µm, and 2.7µm)
and also with reference wavelengths. The Lights reflected from the objects depend upon the
moisture content and is detected by analyzer to measure moisture (ratio of reflected light at these
wavelengths to the reflected light at reference wavelength). In gaas PIN photodiodes, Pbs
photoconductive detectors are employed in moisture analyzer circuits.

 SD Card:

An SD Card (Secure Digital Card) is an ultra small flash memorycard designed to


provide high-capacity memory in a small size. SD cards are used in many
small portable devices such as digital video camcorders, digital cameras, handheld computers,
audio players and mobile phones. In use since 1999, SD Memory Cards are now available in
capacities between 16 Megabytes and 1 Gigabyte. An SD card typically measures 32 x 24 x 2.1
mm and weighs approximately 2grams.

Fig.6: SD Card

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 16


INTRUDER ALERT SYSTEM 2019

 Pi camera

The Raspberry Pi Camera v2 is a high quality 8 megapixel Sony IMX219 image sensor custom
designed add-on board for Raspberry Pi, featuring a fixed focus lens. It's capable of 3280 x 2464
pixel static images, and also supports 1080p30, 720p60 and 640x480p60/90 video. It attaches to
Pi by way of one of the small sockets on the board upper surface and uses the dedicated CSi
interface, designed especially for interfacing to cameras. The board itself is tiny, at around 25mm
x 23mm x 9mm. It also weighs just over 3g, making it perfect for mobile or other applications
where size and weight are important.

Fig 7: Pi camera

It connects to Raspberry Pi by way of a short ribbon cable. The high quality Sony
IMX219 image sensor itself has a native resolution of 8 megapixel, and has a fixed focus lens
on-board. In terms of still images, the camera is capable of 3280 x 2464 pixel static images, and
also supports 1080p30, 720p60 and 640x480p90 video.

Outdoor Home Security Cameras:


The outdoor security cameras are referred to as multi-camera surveillance systems. They monitor
any out-of-doors area one chooses and are available as either wired or wireless. Typical
placements include walkways, entrances, and driveways.
Outside cameras are purposely designed with a broader viewing angle to watch over large
outdoor areas. Majority of these devices come with night vision to capture video and images

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 17


INTRUDER ALERT SYSTEM 2019

during the dark. The cameras are designed to be weather resistant with durable protective
housing to shelter the electronics from moisture and rain.

The best stand-alone outdoor cameras are listed in the table below, each with resolu-tion, pros
and cons.

 Power cable

Power to the Raspberry Pi can be provided using either a micro USB lead to the micro
USB connector (recommended) or 5V can be directly fed into the 5V GPIO pin.you may find
that when powered up, your Raspberry Pi does absolutely nothing. This is because we need to
get an operating system onto it first i.e; Raspbian OS.

Fig 8: Adapter

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 18


INTRUDER ALERT SYSTEM 2019

 A case

We need a proper case to enclose it. You can pick up an acrylic/plastic case for go the more
creative route and craft your own case (as many did shortly after the Pi was released).Significant
changes to the Raspberry Pi board over the last few years, including the movement and outright
removal of certain ports, means older cases won’t fit newer models.

Fig.9: Raspberry Pi with Case

Email Notification:
The system functions in a manner that every time motion is detected, the pi camera takes a
picture and a video of the occurrence. The email algorithm obtained from the pi configuration
file enables a command on the system to send an email with the photo attached to a specified
email address. For this project, the homeowner, whose email has been specified during the
program design and implementation, receives a mail.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 19


INTRUDER ALERT SYSTEM 2019

CHAPTER-4
IMPLEMENTATION AND TESTING
This gives us the information about the hardware setup and how the code is being installed in the
Raspberry Pi using the SD card, the connections and the working of the kit.

4.1 HARDWARE DEVELOPMENT

Fig.10: Project Kit

4.1.1 HARDWARE TESTING


 Check all the components keenly for any damage or already being used earlier.
 Put them all in a safe place so that they are not damaged.
 Raspberry Pi pins must not be bended or touched even. Put that in its case so that there
won’t be any damage.
 IR sensor should be protected properly. Camera should be covered when not in use if not,
 If there are scratches on camera lens, that will definitely be a problem to the owner when
recognizing the intruder.
 Check all the connections properly so that there are no loose connections.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 20


INTRUDER ALERT SYSTEM 2019

The connections are given as follows:


1. Adapter cable to Raspberry Pi slot for power supply.
2. IR sensor to Raspberry Pi.
3. Pi camera in Raspberry Pi fixed in the camera slot.

4.2 SOFTWARE DEVELOPMENT


Step One: Choose and Download Your Operating System.

Raspbian OS
For this project, raspbian Operating System (OS) is used to run the surveillance system. It is an
essential system for the PIR- based system, since it provides an optimum performance of RPI
Additionally, raspbian OS is not purely an OS as it comes with numerous packages and pre-
combined software for ease of installation and efficiency of operations of PIR-based projects.
According to Listing codes previously demonstrated, all the operations of the system are together
run by the program, and the output is relayed to the assigned hardware and software components.
To have a video recording of an intrusion, the file for video camera should contain the codes.
When an individual presses the button for video recording, the code is activated for the period
specified. LED will light up during recording to let the user know that video recording has been
activated. The video will be saved with the current date and time as the filename once the record
is complete. The components involved in video recording include: Raspberry Pi, resistor, jumper
wires, LED and Raspberry Pi camera. IR camera file contains the codes for motion detection and
sending an email alert. Video and picture can at the same time be captured an action that
involves two buttons on the raspberry pi. A file that corresponds to the operation should contain
the codes for the procedure. The code will set GPIO pins 17 and 18 as Input with the internal
pull-up resistors.
The code will initialize a PIR (Passive Infrared) sensor that is used to detect motion. If
the PIR sensor perceives motion, the Pi camera will take a picture in the area of motion and send
an email of the photo to a specified email address. Raspbian OS needs a program that allows for
emails to be sent. Such a program is SSMTP, a program that allows the system to deliver emails
from a local computer to an email address specified. The program is ideal for this project, since it
allows the system to email notifications upon human intrusion.
MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 21
INTRUDER ALERT SYSTEM 2019

Generation and sending of email is a vital part of this design. Multipurpose Internet Mail
Extension (MIME) package is useful for the production of email attachment of the image and
video captured by the system.MIME supports characters of the non-text nature which includes
video, audio and other applications programs.The package, therefore, extends the format of an
email. A Simple Mail Transfer Protocol (SMTP) is then used in the delivery of the email from
the raspberry pi to the configured mail hub.
To send email messages with the Raspberry Pi, an account(Gmail or yahoo) is set up at the
raspberry module(smtp server).A python script is developed to implement email components for
instance receiver, subject body and attachments. The process is set such that when the PIR sensor
sends a high signal, the code runs fetch execute cycle.

Step Two: Write the OS Image to Your SD Card


Step Three: Put Your SD Card in the Pi and Start It

Once you have all the cables attached to both the Pi and their respective destinations..

After the SD card is placed firmly, insert the microUSB power cable. There is no power button
on the Pi as soon as you plug in the power cable, it will begin booting up. Enter the ID and
password as pi and raspberrypi.

Step Four: Connect the pi camera to the camera slot of Raspberry Pi.

Project Software:

A proper configuration of the software and the hardware parts of the project is paramount in the
project. Project software comprises of the codes that enable the various hardware components to
function at optimum levels.

Python instruction ‘import’ gains access to various modules that builds smooth operation
of the program. The program needs various hardware modules in the raspberry pi motherboard
for example, camera, timer, encoder and email architecture.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 22


INTRUDER ALERT SYSTEM 2019

Fig.11: Booting Window

Almost immediately, you will see the boot sequence go scrolling rapidly by—similar to the view
above. If you’re running the Pixel version of Rasbian Jessie, however, the view will quickly be
replaced by a simple splash screen:

Fig.12: Splash Screen Window

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 23


INTRUDER ALERT SYSTEM 2019

Seconds later, you’ll be kicked over to the Pixel desktop when the boot process is complete.

Fig.13: Desktop Screen

Now, you’ve successfully booted up your Pi for the first time.

Connecting to Wi-Fi

If you’re connected to your home network via Ethernet, jump to the next section “Testing the
network”. If you need to configure the wireless connection, look for the networking icon in the
upper right corner of the screen and click on it:

Fig.14: Check Network Connections

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 24


INTRUDER ALERT SYSTEM 2019

Select the wireless network you wish to connect to from the drop down menu.

Fig.15: Select the Network

Enter your Wi-Fi password in the pop up box and then confirm that the network icon changes
from the no connection icon to the Wi-Fi icon.

Fig.16: Confirm Connection

Time to double check the network connection by confirming we can connect to the web.You can
see the program file with the name intruder on the raspberry desktop as shown above . open that
file and run so that the code in the SD card of Raspberry Pi gets executed.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 25


INTRUDER ALERT SYSTEM 2019

Testing the Network

Now that you have configured the Wi-Fi connection (or jumped right to this section because
you’re using Ethernet) it’s time to test your connection. From the desktop, click on the Raspberry
Pi menu icon located in the upper left corner, then navigate to Internet > Chromium Web
Browser.

Fig 17: Testing The Network

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 26


INTRUDER ALERT SYSTEM 2019

Updating the Software

Before you start digging into your Pi, it’s a good idea to do a basic software update. We have
setup the network, we have tested the connection, and now is a perfect time to do a system-wide
software update.

Although the interface as come a long way on the Pi and Pixel is absolutely beautiful
compared to the old desktop, you still need to get your hands dirty now and then in the terminal–
and updating is one of those times. Click on the terminal icon in the upper left corner of the
screen to launch the terminal.

Fig 18: Enter ID and Password

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 27


INTRUDER ALERT SYSTEM 2019

At the terminal, enter the following command:

sudo apt-get update && sudo apt-get upgrade

This combination command instructs Raspbian to search available software repositories for
system and software updates and upgrades. As any such updates are discovered, you will be
prompted to approve or disapprove the changes with the Y and N keys.

Fig 19: Checking For Updates

Unless you have a compelling reason to skip an update (which at this point in the game we
don’t), just hit the Y key to confirm all the changes as they appear.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 28


INTRUDER ALERT SYSTEM 2019

4.3 SOURCE CODE

import os

import RPi.GPIO as gpio

import picamera

import time

import smtplib

from email.mime.multipart import MIMEMultipart

from email.mime.text import MIMEText

from email.mime.base import MIMEBase

from email import encoders

from email.mime.image import MIMEImage

fromaddr = "ruksanapravallika@gmail.com" # change the email address accordingly

toaddr = "shaikruksanasulthana97@gmail.com"

mail = MIMEMultipart()

mail['From'] = fromaddr

mail['To'] = toaddr

mail['Subject'] = "Attachment"

body = "Please find the attachment"

led=17

IR=18

HIGH=1

LOW=0

gpio.setwarnings(False)

gpio.setmode(gpio.BCM)

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 29


INTRUDER ALERT SYSTEM 2019

gpio.setup(led, gpio.OUT) # initialize GPIO Pin as outputs

gpio.setup(IR, gpio.IN) # initialize GPIO Pin as input

data=""

def sendMail(data):

mail.attach(MIMEText(body, 'plain'))

print(data)

dat='%s.jpg'%data

print(dat)

attachment = open(dat, 'rb')

image=MIMEImage(attachment.read())

attachment.close()

mail.attach(image)

server = smtplib.SMTP('smtp.gmail.com', 587)

server.starttls()

server.login(fromaddr, "ruksanapravallika")

text = mail.as_string()

server.sendmail(fromaddr, toaddr, text)

server.quit()

def capture_image():

##data= time.strftime("%d")

data= 1

camera.start_preview()

time.sleep(5)

print(data)

camera.capture('%s.jpg'%data)

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 30


INTRUDER ALERT SYSTEM 2019

camera.stop_preview()

time.sleep(1)

sendMail(data)

os.system("rm /home/pi/Desktop/1.jpg")

##os.remove(data)

gpio.output(led , 0)

camera = picamera.PiCamera()

camera.rotation=180

camera.awb_mode= 'auto'

camera.brightness=55

while 1:

if gpio.input(IR)==1:

gpio.output(led, HIGH)

capture_image()

while(gpio.input(IR)==1):

time.sleep(1)

else:

gpio.output(led, LOW)

time.sleep(0.01)

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 31


INTRUDER ALERT SYSTEM 2019

4.4 SOFTWARE TESTING

 Check whether the Raspbian OS is properly installed or not.


 Check the network connections. Both the Raspberry Pi and system should be connected
to same Network
 Place the PIR sensor facing away from you before you power ON the system.

 Check your program and see if you gave the right phone number or not.

 See if the user’s phone has enough signal strength to receive a mail.

4.5 FINAL WORDS ON WORKING OF THE PROJECT


Both the hardware and the software parts of the design are interfaced to achieve the overall
objective of home security. While the hardware part contains devices that make the surveillance
possible and achievable, the software drives the operations and en-ables the functioning of the
interconnected devices. The primary objective of the project is to assure the security of the home
while at the same time managing the costs asso-ciated with the installation of the surveillance
system. This project has therefore relied on cost-effective devices to ensure the overall cost-
effectiveness of the project.
The sensitivity of the PIR sensor is at a distance of 6 to 10 metres. A careful positioning
of the sensor enhances its operations. For example, the placement of the sensor in such a way
that an intruder walks across its field of vision improves its performance as it is likely to detect
motion as compared to the positioning such that an intruder walks straight towards the sensor.
The pi camera captures any movements within this range at the field of view of the sensor.
Raspberry pi 3 controls the programs necessary for capturing an image and sending
emails. When the PIR sensor detects motion, raspberry pi enables the Pi camera to capture the
image and store it. A video is recorded at the same time as a live-stream or to be reviewed by the
homeowner later. The system immediately converts the image captured by the pi camera to
greyscale, improves image contrast and consequently

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 32


INTRUDER ALERT SYSTEM 2019

stores it in the memory. The step is necessary to the improvement of the program's processing
speed. Haar classifier stages are useful in processing the converted image. The program
considers the image as that of a human only if the shoulder and head features are detected.
Haar-like features are one among many methods for detection of an object. It is similar to the
human detection method where the researchers using this method applied the use of shoulder and
head characteristics as Region of Interest rather than the use of the usual face detection. The
basic shape-like face in any appearance can occur on a different scale, orientation, and position.
In human detection, the task is more perplexing due to the largely variable shapes, sizes,
clothing, and posture.
The security of the home is only assured when the homeowner is aware of the happen-
ings in the house. The system designed in this case alerts the homeowner about any intrusion in
the home via an email alert to the homeowner's email address earlier on specified. The email will
inform the homeowner of an invasion and has an attachment of the picture of the intruder. At this
point, the owner of the home can take the neces-sary steps to avoid any damage to the property.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 33


INTRUDER ALERT SYSTEM 2019

4.6 FLOW CHART

start

All components are


idle

Person in front of
camera

Human
NO detected

YES

Click photo and

send to mail

Take necessary
action

end

Fig.20: Flow Chart

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 34


INTRUDER ALERT SYSTEM 2019

CHAPTER-5
OUTPUT SCREENS

Fig : Output1

Fig : Output2

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 35


INTRUDER ALERT SYSTEM 2019

CHAPTER-6
APPLICATIONS
APPLICATIONS
This intruder alert system is mainly used in

o Residential area.
o Commercial.
o Industries.
o Prisons also use security systems for control of inmates.
o Banks use this system in order to protect property against burglary (theft).
o This is also used in military areas.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 36


INTRUDER ALERT SYSTEM 2019

CHAPTER-7
CONCLUSION AND FUTURE SCOPE

7.1 CONCLUSIONS
With an improved awareness of the importance of home security, homeowners are on the
lookout for an efficient surveillance system which is cost-friendly. This design cov-ers all the
vital areas of a home security system. Detection of intrusion into the home is made possible
using passive infrared sensors. The sensor uses the infrared radiations changes as a result of
human motion across its field of movement. When movement is detected, the pi camera, with the
capabilities for taking pictures and recording videos, is enabled. The picture attachment
alongside the recorded video is then sent to a specified mail recipient, who is the homeowner.
The system designed is energy efficient and is applicable particularly in areas with low energy
supply as a result of inadequate electricity supply. The method additionally of-fers flexibility and
reliability. It enables the owner to be aware of the security situation at home provided he/she is
connected to the internet.
In this we have developed a smart intrusion alert system built with Raspberry Pi, IR sensor, pi
camera. The system has an attractive value features, including low cost, compact, easy to
customize easy to deploy and easy to maintain. For future work we recommend to create a
mobile application. So that it will be much easier to the owner to monitor the system whenever
required.

The use of CCTV in surveillance has been associated with more cost as a result of the need for a
computer, additional space required for continuous recording of occur-rences, and the necessary
manpower to monitor and detect motion or human intrusion. The system design in this project
overcomes this challenge through the use of rasp-berry pi which is cost-friendly, low power
consumption and high-resolution power. For home security, the system is efficient as since it is
applicable for surveillance of small personal areas.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 37


INTRUDER ALERT SYSTEM 2019

7.2 FUTURE SCOPE

The human factor will grow in all aspects of security. More and more human analysis,
incident-response teams and forensic crews will be involved in almost every company to
complement the traditional intrusion-detection and intrusion-prevention systems. The automotive
industry will need to incorporate defensive intrusion prevention and detection solutions into their
organizations, houses, cars, as the impact of attacks could be disastrous.The PIR-based security
system is recommended for residential properties for efficiency and effectiveness of home
surveillance. Some shortcomings of the system, however, are related to the sensitivity of the PIR
sensors. More work is required in the determina-tion of the right materials for use in the
manufacture PIR sensors to increase its ability to detect any kind of human movement across or
along its path.

Most surveillance systems require the use of power for its operations. Further studies
should be carried out on the potential use of PIR-based home surveillance system in remote areas
with no access to any source of power. For example, research should be conducted on the use of
solar powered PIR based security systems.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 38


INTRUDER ALERT SYSTEM 2019

CHAPTER-8
REFERENCES

1. Hasan M, Hossain E, Niyato D. Random access for machine-to-machine com-munication


in LTE-advanced networks: issues and approaches. IEEE communications Magazine.
2013 Jun;51(6):86-93.

2. Albert DE, inventor; Innovalarm Corporation, assignee. Enhanced fire, safety, security
and health monitoring and alarm response method, system and device.

3. Rodic A, Katie D, Mester G. Ambient intelligent robot-sensor networks for


environmental surveillance and remote sensing. In Intelligent Systems and Informatics.

4. DIVE GD. Sensing Impacts: Remote Monitoring using Sensors.

5. Bill Waters. "How Motion Sensors Work with a Security


System". theHomeSecurityAdviser.com.

6. Ramsey, Anthony Home Security.

7. Hart-Davis G. Deploying Raspberry Pi in the Classroom. Apress; 2017.

8. Dennis AK. Raspberry Pi Computer Architecture Essentials.

9. Madhuravani B, Rashmika M. Motion sensor and face recognition based sur-veillance


system Using Raspberry Pi.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 39


INTRUDER ALERT SYSTEM 2019

10. https://circuitdigest.com/microcontroller-projects/raspberry-pi-iot-intruder-alert-system

reference for the process of project to get accurate output.

11. https://www.howtogeek.com/138281/the-htg-guide-to-getting-started-with-raspberry-pi/

reference for the process of installing the OS, executing the project code.

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN Page 40

También podría gustarte