25
Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Embed Size (px)

Citation preview

Page 1: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Residential Surveillance with IR Sensor & Raspberry Pi

Maxine MajorApril 22, 2014

Page 2: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Overview

Goals (Quadsheet)DecisionsShopping ListImplementation

◦Setup◦Components◦Timeline

SecurityIssuesDemo

Page 3: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Quadsheet

Page 4: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Goals

Home Security System◦Camera◦Motion sensor

Reporting◦Short Message Service (SMS)◦Live Webcam◦Recorded images/video

Page 5: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Decisions

Type of Camera◦USB webcam◦IP camera◦“stealth” cam

Functionality◦Video & Sound◦Record in dark◦Motion detection

Webserver◦Store/serve images/video◦OS vs. Arduino

Page 6: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Decisions

Sensor◦Infrared

Passive Infrared (PIR/IR)(changes in heat)

Ultrasonic(frequency changes / microwave)

Tomography motion detection(detects through walls!)

◦Photoelectric beam (lasers)◦Hybrid

Single point of failure◦Pyroelectric

Page 7: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Decisions

Decided on:◦USB camera

Daylight recording only Video & Sound

◦Raspberry Pi Linux-based Raspbian OS

◦Passive Infrared Sensor Motion detection only Motion detection to trigger video

Page 8: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Shopping List

Raspberry Pi CanaKit◦Power supply◦HDMI Cable

(not needed)◦Breadboard &

prototyping materials◦Wi-Fi dongle◦8GB SD card

w/NOOBS◦Case◦$79.99

Page 9: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Shopping List

PIR Sensor◦Good reviews◦5V works off RPi 3.5V◦Missing jumper◦$4.99

Page 10: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Shopping List

Logitech HD 270 ◦USB Webcam◦Minimal reported issues◦Works well with motion◦$27.99

◦http://elinux.org/RPi_USB_Webcams

Page 11: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Shopping List

Raspberry Pi (Cana Kit) $79.99Logitech HD 270 $27.99PIR Sensor $4.99Powered USB Hub $35.00Keyboard, mouse, and monitor $0.00

Total Cost: ~$150.00

Page 12: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Setup

Page 13: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014
Page 14: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

IR Sensor

General Purpose Input/Output (GPIO)◦Python GPIO library

Set mode Define which pin to expect inputGPIO_PIR = 18

Motion detected when GPIO state == 0

Page 15: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

IR Sensor

Page 16: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

SMS

Short Message Service (SMS)◦Create new Gmail account◦[email protected]

server = smtplib.SMTP( "smtp.gmail.com", 587 )server.starttls()server.login( '[email protected]', ‘password' )

server.sendmail( 'Raspzilla', ‘[email protected]', 'Motion detected at home!' )

Page 17: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Video & Live Stream

Motion ◦ /etc/motion/motion.conf◦Webcam port 8081◦Control port 8080◦ framerate 10◦ffmpeg_video_codec msmpeg4◦max_mpeg_time 600

lighttpd (pronounced “lightly”)◦Webserver◦Small memory footprint

VLC Media player

Page 18: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Video & Live Stream

Initial Results

Page 19: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Storage

Default directory ◦/tmp/motion◦Cleaned on reboot

Dropbox◦Dropbox uploader script◦Authentication not on RPi

Uses Dropbox API for authentication◦Issues getting this to work

WinSCP◦Manually transfer files◦Not automated

Page 20: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Timeline

◦Setup Raspberry Pi New Out Of Box Software (NOOBS) Raspbian

◦Configure Wi-Fi Static IP

◦Install motion◦Set up PIR sensor◦python

Print message to console Short Message Service (SMS)

◦crontab run python at startup◦python initiates motion at detection

Shell commands◦Offsite storage

Page 21: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Security

Page 22: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Security

RPi Credentials◦Username: pi, Password: raspberry

default startup doesn’t ask for credentials. ssh still does.

IP Tables◦“firewall” for Linux systems

Passwords stored plaintext◦motion◦Python SMS

Page 23: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Issues

Motion daemon run at startup = bad idea◦100% resource utilization

Initially refusing to use a webserverNot understanding video formatsStream-able video vs. motion capture

videoFirefox only browser streaming videoAudio| and \ not functioning on keyboard

◦(Shift+3 #: £, “ = @,)

Page 24: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

Demo

Page 25: Residential Surveillance with IR Sensor & Raspberry Pi Maxine Major April 22, 2014

References

http://blog.pixelami.com/2012/06/uvccapture-on-raspberry-pi-debian-squeeze/ http://dataissexy.wordpress.com/2013/06/29/raspberry-pi-pir-motion-detection-and-alerting

-to-sms-raspberrypi-sms-sensors/ http://elinux.org/RPi_USB_Webcams http://jeremyblythe.blogspot.co.uk/2012/05/raspberry-pi-webcam.html http://jeremyblythe.blogspot.co.uk/2012/06/battery-powered-wireless-motion.html http://lifehacker.com/create-a-home-alarm-system-with-a-raspberry-pi-and-webc-13413578

98 http://mogshade.wordpress.com/2012/12/23/simple-home-security-with-raspberry-pi-and-d

ropbox/ http://pingbin.com/2012/12/raspberry-pi-web-cam-server-motion/ http://simonthepiman.com/how_to_setup_your_pi_for_the_internet.php http://sirlagz.net/2012/08/04/how-to-stream-a-webcam-from-the-raspberry-pi/ http://techspect.co.uk/?id=how-to-raspberry-pi-webcam-server-stream http://www.bartbania.com/index.php/iptables-security-part-ii/ http://www.extremetech.com/computing/148482-the-true-cost-of-a-raspberry-pi-is-more-th

an-you-think http://www.insentricity.com/a.cl/189/RaspberryPiHalloweenHack http://www.raspberrypi.org/help/faqs/ http://www.raspberrypi.org/help/noobs-setup/ http://www.thisismyrobot.com/2012/08/getting-logitech-c270-webcam-working-on.html

https://medium.com/random-things/2d5a2d61da3d https://github.com/andreafabrizi/Dropbox-Uploader https://learn.adafruit.com/pir-passive-infrared-proximity-motion-sensor/ https://medium.com/p/2d5a2d61da3d https://www.youtube.com/watch?v=D537dG-ndRk

http://wiki.raspberrytorte.com/index.php?title=Make_a_Spycam