Summary
Project's goal:
The main objective of this project is to provide more security in restricted areas.
General Circuit Application:
Banks:
On banks it is mainly used in changing rooms for greater security. If any movement is detected in the locker rooms, photos will be automatically captured.
Demonstrate its operation:
PIR is a sensor used to detect any movement. If any movement is detected by the PIR sensor, it will send a wake-up message to the Raspberry Pi. Then the Raspberry Pi will turn on the camera and the pi camera will capture the image.
Description:-
Block diagram:
Fig. 1: Block diagram of Raspberry Pi-based intrusion alarm
Ethernet :
Fig. 2: Image showing the Ethernet cable connecting the PC and Raspberry Pi
It is a family of computer networking technologies for local area networks (LAN) and metropolitan area networks (MAN). 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 plug ring , FDD EU , and ARCNET . The main alternative for contemporary LANs is not a wired standard, but rather a wireless LAN standardized as IEEE 802.11 and also known as Wi-Fi .
Ethernet standards comprise several variants of OSI physical layer wiring and signaling in use with Ethernet. The original 10BASE5 Ethernet used coaxial cable as the shared medium. Later, coaxial cables were replaced by twisted pairs and fiber optic links in conjunction with hubs or switches. Over its history, Ethernet data transfer rates have 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 that communicate over Ethernet divide a stream of data into shorter chunks called frames. Each frame contains source and destination addresses and error checking data so that corrupt data can be detected and retransmitted. According to the OSI model, Ethernet provides services up to and including the data link layer.
PIR sensor: –
Figure 3: Typical PIR sensor image
An individual PIR sensor detects changes in the amount of infrared radiation falling on it, which varies depending on the temperature and surface characteristics of 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 incoming infrared radiation into a change in output voltage and this triggers detection. Moving objects with a similar temperature to the background but different surface characteristics can also have a different infrared emission pattern and therefore 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 of less than 180 degrees. Models with wider fields of view, including 360 degrees, are available – typically designed for ceiling mounting. Some larger PIRs are made with single-segment mirrors and can detect changes in infrared energy more than thirty meters away from the PIR. There are also PIRs designed with reversible orientation mirrors that allow for wide 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
The Raspberry Pi is a series of credit card-sized single-board computers developed in the United Kingdom 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 (B and B+ models) 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 released the Compute Module, which packages a BCM2835 with 512 MB of RAM and MMC flash chip into a module for use as part of embedded systems.
Pi Camera: –
Fig. 5: Typical Rapsberry Pi camera image
The Raspberry Pi Camera Module is a custom add-on for Raspberry Pi. It connects to the Raspberry Pi via one of two small sockets on the board's top surface. This interface uses the dedicated CSI interface, which was designed especially for interfacing with cameras. The CSI bus is capable of extremely high data rates and exclusively carries pixel data.
The board itself is tiny, about 25mm x 20mm x 9mm. It also weighs just over 3g, making it perfect for mobile devices or other applications where size and weight are important. It connects to the Raspberry Pi via a small ribbon cable. The camera is connected to the BCM2835 processor in the Pi via the CSI bus, a higher bandwidth link that carries pixel data from the camera back to the processor. This bus travels along the ribbon cable that connects the camera board to the Pi. The sensor itself has a native resolution of 5 megapixels and an integrated fixed focus lens. In terms of still images, the camera is capable of producing 2592 x 1944 pixel still images and also supports 1080p30, 720p60 and 640x480p60/90 video.
Circuit functioning: –
After installing operating system on Raspberry pi, connect raspberry pi to PC via LAN cable with the help of MobeXterm software, we have to open raspberry pi desktop.
Before opening the desktop open MobeXterm it consists of SSH click on SSH and provide the IP address which IP address we provided in OS installation on raspberry pi and click on that IP address and open a new window and give the command lxsession to open the desktop raspberry pi.The desktop consists of many applications like games, python IDE and root terminal etc... open the python IDE and write the code for our requirements and save it as root terminal pirsensor.py.open and to set the path provide the command cd desktop and to execute the code give the command sudo python3 pirsensor.py if any movement is detected the PIR sensor is activated and will activate the raspberry pi and the raspberry pi turns on the camera and captures the images.
Number of components
· Raspberry pi model B+ board-1
Pi-1 Camera
· PIR-1 sensor
PIN Number:-
Raspberry Pi PIN Description: –
Figure 6: Raspberry Pi GPIO pin diagram
Connect the PIR sensor output as follows
PIR 1 st pin power supply (+5v) (pin2).
PIR 2 and pin output (GPIO16).
PI 3 third ground pin (pin 9)
Supply voltage values: –
· Raspberry pi – 5v
· PIR sensor – 5v
Image of the implemented circuit: –
Figure 7:
Raspberry Pi-based intrusion alarm prototype
Project source code
###
from time import sleep
import RPi.GPIO as GPIO
import picamera
from tkinter import *
from threading import Thread
defmotion:
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)
whileTrue:
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
mainloop
else:
print("All is QUIET in RPi...")
sleep(1);
movement
whileTrue:
t=Thread(target=threadings)
t.start
t.join
###
Circuit diagrams
Intrusion detection with raspberry pi using camera_Circuit diagram | ![]() |