12/24/24, 5:03 PM Intruder detection with Raspberry Pi using camera
Intruder detection with Raspberry Pi using camera
By Vinay Kadali August 11, 2021
Summary
Aim of the project:
The main aim of this project is to provide more security in restricted areas.
General Application of circuit:
Banks:
In banks it is mainly used in locker rooms for more security. If any motion is detected is in locker rooms it will capture the photos automatically.
Demonstrate its working:
PIR is a sensor which is used to detect any motion. If any motion is detected by PIR sensor then it will send activation message to raspberry pi. Then
raspberry pi will turn on the camera and then pi camera will capture the image.
Description:-
Block diagram:
https://www.engineersgarage.com/intruder-detection-with-raspberry-pi-using-camera/ 1/14
12/24/24, 5:03 PM Intruder detection with Raspberry Pi using camera
Fig. 1: Block Diagram of Raspberry Pi based Intruder Alarm
Ethernet :
Fig. 2: Image showing Ethernet Cable connecting PC and Raspberry Pi
It is a Family of computer networking technologies for local area networks (LANs) and metropolitan area networks (MANs). It was commercially introduced in 1980
and first standardized in 1983 as IEEE 802.3, and has since been refined to support higher bit rates and longer link distances. Over time, Ethernet has largely replaced
competing wired LAN technologies such as token ring, FDDI, and ARCNET. The primary alternative for contemporary LANs is not a wired standard, but instead a
wireless LAN standardized as IEEE 802.11 and also known as Wi-Fi.
The Ethernet standards comprise several wiring and signaling variants of the OSI physical layer in use with Ethernet. The original 10BASE5 Ethernet
used coaxial cable as a shared medium. Later the coaxial cables were replaced with twisted pair and fiber optic links in conjunction
with hubs or switches. Over the course of its history, Ethernet data transfer rates have been increased from the original 3 megabits per
second (Mbit/s) to the latest 100 gigabits per second (Gbit/s), with 400 Gbit/s expected by early 2017
Systems communicating over Ethernet divide a stream of data into shorter pieces called frames. Each frame contains source and destination addresses
and error-checking data so that damaged data can be detected and re-transmitted. As per the OSI model, Ethernet provides services up to and
including the data link layer.
https://www.engineersgarage.com/intruder-detection-with-raspberry-pi-using-camera/ 2/14
12/24/24, 5:03 PM Intruder detection with Raspberry Pi using camera
PIR sensor:-
Fig. 3: Typical Image of PIR Sensor
An individual PIR sensor detects changes in the amount of infrared radiation impinging upon it, which varies depending on the temperature and surface
characteristics of the objects in front of the sensor.] When an object, such as a human, passes in front of the background, such as a wall, the
temperature at that point in the sensor’s field of view will rise from room temperature to body temperature, and then back again. The sensor converts
the resulting change in the incoming infrared radiation into a change in the output voltage, and this triggers the detection. Moving objects of similar
temperature to the background but different surface characteristics may also have a different infrared emission pattern, and thus sometimes trigger the
detector.
PIRs come in many configurations for a wide variety of applications. The most common models have numerous Fresnel lenses or mirror segments, an
effective range of about ten meters (thirty feet), and a field of view less than 180 degrees. Models with wider fields of view, including 360 degrees, are
available—typically designed to mount on a ceiling. Some larger PIRs are made with single segment mirrors and can sense changes in infrared energy
over one hundred feet away from the PIR. There are also PIRs designed with reversible orientation mirrors which allow either broad coverage (110°
wide) or very narrow “curtain” coverage or with individually selectable segments to “shape” the coverage.
Raspberry pi:-
Fig. 4: Typical Image of Raspberry Pi 2
https://www.engineersgarage.com/intruder-detection-with-raspberry-pi-using-camera/ 3/14
12/24/24, 5:03 PM Intruder detection with Raspberry Pi using camera
The Raspberry Pi is a series of credit card-sized single-board computers developed in the UK by the Raspberry Pi Foundation with the intention of
promoting the teaching of basic computer science in schools.
The original Raspberry Pi is based on the Broadcom BCM2835 system on a chip (SoC), which includes an ARM1176JZF-S700 MHz processor, Video
Core IV GPU, and was originally shipped with 256 megabytes of RAM, later upgraded (models B and B+) to 512 MB. The system has Secure
Digital (SD) (models A and B) or Micro-SD (models A+ and B+) sockets for boot media and persistent storage. In 2014, the Raspberry Pi Foundation
the Compute Module, which packages a BCM2835 with 512 MB RAM and MMC flash chip into a module for use as a part of embedded
launched
systems.
Pi camera:-
Fig. 5: Typical Image of Rapsberry Pi Camera
The Raspberry Pi Camera Module is a custom designed add-on for Raspberry Pi. It attaches to Raspberry Pi by way of one of the two small sockets on
the board upper surface. This interface uses the dedicated CSI interface, which was designed especially for interfacing to cameras. The CSI bus is
capable of extremely high data rates, and it exclusively carries pixel data.
The board itself is tiny, at around 25mm x 20mm x 9mm. It also weighs just over 3g, making it perfect for mobile or other applications where size and
weight are important. It connects to Raspberry Pi by way of a short ribbon cable. The camera is connected to the BCM2835 processor on the Pi via the
CSI bus, a higher bandwidth link which carries pixel data from the camera back to the processor. This bus travels along the ribbon cable that attaches
the camera board to the Pi.the sensor itself has a native resolution of 5 megapixel, and has a fixed focus lens onboard. In terms of still images, the
camera is capable of 2592 x 1944 pixel static images, and also supports 1080p30, 720p60 and 640x480p60/90 video.
Working of the circuit:-
After installing the OS in the Raspberry pi connect the raspberry pi to PC through LAN cable with the help of MobeXterm software we have to open
the desktop of raspberry pi.
Before opening desktop open MobeXterm it consists of SSH click on SSH and give the IP address which IP address we have given in the installation of
OS in raspberry pi and click on that IP address and open a new window and give the command lxsession for opening the desktop of raspberry pi.The
desktop consists of so many apps like games ,python IDE and root terminal etc…open python IDE and write the code for our requirement and save it as
pirsensor.py.open root terminal and for set the path give the command cd desktop and for execute the code give the command sudo python3
pirsensor.py if any motion is detected the PIR sensor is activated and it will give the activation to the raspberry pi and the raspberry pi turn on the
camera and capture the images.
Number of components
· Raspberry pi model B+ board-1
https://www.engineersgarage.com/intruder-detection-with-raspberry-pi-using-camera/ 4/14
12/24/24, 5:03 PM Intruder detection with Raspberry Pi using camera
· Pi camera-1
· PIR sensor-1
Pin number:-
Pin description of raspberry pi:-
Fig. 6: Pin Diagram of Raspberry Pi GPIO
Connect PIR sensor output as follows
PIR 1st pin supply (+5v) (pin2).
PIR 2nd pin output (GPIO16).
PIR 3rdpin ground (pin 9)
Supply voltage values:-
· Raspberry pi – 5v
· PIR sensor – 5v
Implemented circuit image:-
https://www.engineersgarage.com/intruder-detection-with-raspberry-pi-using-camera/ 5/14
12/24/24, 5:03 PM Intruder detection with Raspberry Pi using camera
Fig. 7:
Prototype of Raspberry Pi based Intruder Alarm
You may also like:
What are the top What is the role What drone parts What are the Motion detectors What is TinyML?
development of embedded you need to sensors used in or motion
boards for AI and software in build a self-driving cars? sensors?
ML? electric vehicles? quadcopter?
Project Source Code
###
from time import sleep
import RPi.GPIO as GPIO
https://www.engineersgarage.com/intruder-detection-with-raspberry-pi-using-camera/ 6/14
12/24/24, 5:03 PM Intruder detection with Raspberry Pi using camera
import picamera
from tkinter import *
from threading import Thread
def motion():
photo = PhotoImage(file="hero.gif")
w = Label(master, image=photo)
w.photo = photo
w.pack()
mainloop()
def threadings():
GPIO.setmode(GPIO.BCM)
GPIO.setup(16, GPIO.IN)
while True:
if ( GPIO.input(16) == True ):
print ("Warning - MOTION has been detected!")
with picamera.PiCamera() as camera:
camera.start_preview()
sleep(2)
camera.capture('/home/pi/Desktop/hero.gif')
camera.stop_preview()
master = Tk()
photo = PhotoImage(file="hero.gif")
w = Label(master, image=photo)
w.photo = photo
w.pack()
https://www.engineersgarage.com/intruder-detection-with-raspberry-pi-using-camera/ 7/14
12/24/24, 5:03 PM Intruder detection with Raspberry Pi using camera
mainloop()
else:
print ("All is QUIET in RPi...")
sleep(1);
motion()
while True:
t=Thread(target=threadings)
t.start()
t.join()
###
Circuit Diagrams
Intruder-detection-with-raspberry-pi-using-camera_Circuit-Diagram
Project Video
https://www.engineersgarage.com/intruder-detection-with-raspberry-pi-using-camera/ 8/14
12/24/24, 5:03 PM Intruder detection with Raspberry Pi using camera
Intruder detection with raspberry pi using camera
Filed Under: Electronic Projects
← Previous Article Next Article →
Questions related to this article?
Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.
https://www.engineersgarage.com/intruder-detection-with-raspberry-pi-using-camera/ 9/14
12/24/24, 5:03 PM Intruder detection with Raspberry Pi using camera
EXPAND YOUR KNOWLEDGE
AND STAY CONNECTED
Get the latest info on technologies, tools
and strategies for EE professionals.
GET THE ENEWSLETTER
Search this website GO
Featured Products at
Amphenol's BoardLock family
connectors feature a compact,
durable, low-profile, and lightweight
design for wire-to-board versatility.
Learn more
Amphenol's MagnaMate ATHP
connectors are IP67 rated (mated)
and feature RADSOK contacts.
Learn more
Amphenol Sine Systems' AT Series
connectors are IP68 and IP69K rated
and contain superior environmental
seals and seal retention capabilities.
Learn more
Amphenol's DuraMate AHDM series
circular connectors are IP68 and
IP69K rated and can withstand the
harsh environments of off-road
applications.
Learn more
EE TECH TOOLBOX
Tech Toolbox: Test &
Measurement
Everything needs testing and testing
needs measurement. This Tech Toolbox
covers measurement fundamentals,
accuracy, precision, and resolution. A look
at the Smith chart, a handy tool for RF
engineers, is also reviewed.
https://www.engineersgarage.com/intruder-detection-with-raspberry-pi-using-camera/ 10/14
12/24/24, 5:03 PM Intruder detection with Raspberry Pi using camera
DOWNLOAD PDF
VIEW ALL TECH TOOLBOXES
EE LEARNING CENTER
BROWSE CLASSROOMS
BROWSE DESIGN GUIDES
EXPAND YOUR KNOWLEDGE
AND STAY CONNECTED
Get the latest info on technologies, tools
and strategies for EE professionals.
GET THE ENEWSLETTER
HAVE A QUESTION?
Have a technical question about an article or other engineering questions? Check out our engineering forums
EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!
EDA BOARD
ELECTRO-TECH-ONLINE
EDABOARD.COM DISCUSSIONS
Bottleneck of RF, Microwave, Antenna and Optics design
Proteus 8 project: On 5x7 Matrix LED Display show numbers 0-9 (up and down), with 1Hz, Counter, Multiplexer and EPROM.
Replacing lead acid battery with Lithium Ion battery
https://www.engineersgarage.com/intruder-detection-with-raspberry-pi-using-camera/ 11/14
12/24/24, 5:03 PM Intruder detection with Raspberry Pi using camera
Assuring stability with Voltage Mode TOPswitch Flybacks?
Suitable amplifier IC for headphone amplifier
ELECTRO-TECH-ONLINE.COM DISCUSSIONS
Display TFT ST7789 (OshonSoft Basic).
Breadboard and meter a circuit.
What is this compound on Orbitsound circuit board.
How does this generator work ?
LTspice How to view the RMS value of waveform for power dissipation in Waveform Viewer.
FEATURED – ARDUINO PROJECT IDEAS
Arduino audio player
How to design an Arduino-based meditation device
Arduino-based token display board controller
Non-invasive current sensor with Arduino
Arduino home security system using Sim900 Gsm module, Pir motion detector and magnetic door contact switch
Arduino uno automatic car head light on/off battery and temperature monitoring system
RECENT ARTICLES
Chiplet interconnect enables 20 Tbps/mm bandwidth density
Protect SiC MOSFET gate drivers with TVS diodes
KYOCERA releases 2.6 W resistor in 0603 package
TDK releases 0.80 mm x 0.45 mm power inductors for wearables
Microchip’s FPGA stack includes real-time Ethernet protocols
https://www.engineersgarage.com/intruder-detection-with-raspberry-pi-using-camera/ 12/14
12/24/24, 5:03 PM Intruder detection with Raspberry Pi using camera
EE ENGINEERING TRAINING DAYS
SUBMIT A GUEST POST
https://www.engineersgarage.com/intruder-detection-with-raspberry-pi-using-camera/ 13/14
12/24/24, 5:03 PM Intruder detection with Raspberry Pi using camera
ANALOG IC TIPS
CONNECTOR TIPS
BATTERY POWER TIPS
DESIGNFAST
EDABOARD FORUMS
EE WORLD ONLINE
ELECTRO-TECH-ONLINE FORUMS
EV ENGINEERING
MICROCONTROLLER TIPS
POWER ELECTRONIC TIPS
SENSOR TIPS
TEST AND MEASUREMENT TIPS
5G TECHNOLOGY WORLD
SUBSCRIBE TO OUR NEWSLETTER
ABOUT US
CONTACT US
ADVERTISE
Copyright © 2024 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH
Media
Privacy Policy
https://www.engineersgarage.com/intruder-detection-with-raspberry-pi-using-camera/ 14/14