Intruder detection with Raspberry Pi using camera
Intruder detection with Raspberry Pi using camera
Summary
The main aim of this project is to provide more security in restricted areas.
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.
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
Ethernet :
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:-
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:-
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:-
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.
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
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:-
· Raspberry pi – 5v
· PIR sensor – 5v
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:
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
###
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
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 ):
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:
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
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
Featured Products at
EE TECH TOOLBOX
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
EE LEARNING CENTER
BROWSE CLASSROOMS
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
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.
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
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
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
DESIGNFAST
EDABOARD FORUMS
EE WORLD ONLINE
ELECTRO-TECH-ONLINE FORUMS
EV ENGINEERING
MICROCONTROLLER TIPS
SENSOR TIPS
5G TECHNOLOGY WORLD
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