Professional Documents
Culture Documents
Presented by:
Abbas Abdul Jabbar
Ammar Samir
Waddah Ahmed
2nd Stage (Evening Study)
Introduction:
and they are also subject to monthly subscriptions since they are
Recorder (DVR) and Network Video Recorder (NVR) consoles now have
1|P a g e
shops). Recordings from these systems are normally lost due to
project incorporates all these features into one entity and adds extra
detect the presence of Intruder and quickly alert the user by sending
him a alert mail. This mail will also contain the Picture of the Intruder,
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
2|P a g e
and security systems design considerations. Tamper protection is a
who can make mistakes due to many reasons. This manual work done
both smoke and heat parameters to detect fire. However, it does not
(NVR) and Digital Video Recorder (DVR). These two solutions store
3|P a g e
surveillance records locally in a hard-drive. These records are
ins. This loss of information makes the system futile as there will be
and cohesion of information from fire and security alert systems into
alerting a remote user through email. However, the project could not
archive video uploading into the internet. It also has motion tracking
system captures images upon detection and emails them to the user.
4|P a g e
is therefore need to develop an integrated motion, surveillance
system which will result in lower maintenance cost since there is only
Hardware Components:
Pi-Camera:
5|P a g e
Passive Infrared Sensor (PIR):
devices, just the properties that render them attractive for motion
is used which basically condenses the room into small area. The lens
6|P a g e
Bread Board:
Figure 3 breadbord
Figure 4 leds
Figure 5 resistor
7|P a g e
Working Explanation:
commands to Pi camera to click the picture and save it. After it,
with recently clicked images. The mail contains a message and picture
find the attachment”, you can change it accordingly in the Code given
at the end.
Here the pictures are saved in Raspberry Pi with the name which itself
contains the time and date of entry. So that we can check the time
8|P a g e
Figure 6 example
Figure 7 example2
You can also adjust the detection range or distance of this system
Circuit Description:
the camera slot of the Raspberry Pi and PIR is connected to GPIO pin
9|P a g e
Figure 8 implementation
10 | P a g e
Raspberry Pi Configuration and Programming Explanation:
library files for run this project in Raspberry pi. After it, user needs
Enable it.
11 | P a g e
Then user needs to reboot Raspberry Pi, by issuing sudo reboot, so
that new setting can take. Now your Pi camera is ready to use.
sending the mail. Here we are using ssmtp which is an easy and good
solution for sending mail using command line or using Python Script.
After installing libraries, user needs to open ssmtp.conf file and edit
this configuration file as shown in the Picture below and then save
the file. To save and exit the file, Press ‘CTRL+x’, then ‘y’ and then
below command, you shall get the mail on the mentioned email
for email, initialize variables and define pins for PIR, LED and other
12 | P a g e
components. For sending simple email, smtplib is enough but if you
want to send mail in cleaner way with subject line, attachment etc.
intruder with time and date. Then we initialized the Picamera with
some of its settings. And now in last, we have read PIR sensor output
the mail. So this how this Raspberry Pi Security System works, you can
burglar or intruder.
13 | P a g e
CODE: mail['To'] = toaddr
import time
led=17
MIMEMultipart LOW=0
fromaddr = "user@gmail.com"
def sendMail(data):
#change the email address
accordingly mail.attach(MIMEText(body,
'plain'))
toaddr = "userr@gmail.com"
print data
dat='%s.jpg'%data
mail = MIMEMultipart()
print dat
14 | P a g e
sendMail(data)
image=MIMEImage(attachment.read(
))
gpio.output(led , 0)
attachment.close()
camera = picamera.PiCamera()
mail.attach(image)
camera.rotation=180
server =
smtplib.SMTP('smtp.gmail.com', 587) camera.awb_mode= 'auto'
server.starttls() camera.brightness=55
password") if gpio.input(pir)==1:
def capture_image():
else:
data=
gpio.output(led, LOW)
time.strftime("%d_%b_%Y|%H:%M:%S")
time.sleep(0.01)
camera.start_preview()
time.sleep(5)
print data
camera.capture('%s.jpg'%data)
camera.stop_preview()
time.sleep(1)
15 | P a g e
16 | P a g e