How to make a security system using Raspberry Pi board

How to make a security system using Raspberry Pi board

Hello and welcome back. In this project, we will learn how to make a security system using a Raspberry Pi board. For that, I mainly used the PIR motion sensor, and using this sensor we can detect movements. I think this project is best for our home, shop, office, etc. Also, I assembled this project on a breadboard. But you can make a PCB (Printed Circuit Board) for this project. Then, we can use this project as a professional system.

Also, motions can be detected within 10m and 160 degrees through this sensor and it can be changed according to our needs. For that, you can use preset in the sensor. That’s a good feature of this sensor. Also, we can change the input delay time using another preset. Ok, let’s go ahead.

If you want to do it with Arduino, please use this link.

OK, let’s do this project step by step. The required components are given below.

Disclosure: These Amazon links are Affiliate links. As an Amazon Associate, I earn from qualifying purchases.

Step 1

Firstly, identify these components.

Step 2

Secondly, place the LED and Buzzer on the breadboard. And then, connect these components to the Raspberry Pi board.

Step 3

Thirdly, connect the PIR sensor to the Raspberry Pi board. For that, use the circuit diagram above.

Step 4

Now, connect the mouse, keyboard, monitor, and SD card(OS installed) to the Raspberry Pi board.

Step 5

Finally, connect the power supply to the Raspberry Pi board. And then, copy and paste the following script on the Thonny IDE.

  • Full details of this project — Download
#include the library
from gpiozero import MotionSensor,Buzzer,LED

# include the PIR sensor pin
pirSensor = MotionSensor(22)
# Include the buzzer pin
buzzer = Buzzer(27)
# Include the LED bulb pin
led = LED(17) 


while True:
    pirSensor.wait_for_motion()# Detect the motion
    buzzer.on()# Turn on the buzzer
    led.on() # Turn on the LED bulb
    print("Motion")
    pirSensor.wait_for_no_motion()# Detect the no motion
    print("No motion")
    buzzer.off()#Turn off the buzzer
    led.off()# Turn off the LED bulb

Step 6

Now, save this code and click the run button.

OK, enjoy this project. The full video guide is below. So, see you in the next project or tutorial.

How to make a security system using Raspberry Pi board

Similar Posts

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *