In this project you will create an intruder detection device that will check if somebody is inside your house / room when you are out using a PIR sensor, if the PIR sensor detects somebody it will take a (set of) picture(s) of the intruder. The pictures will be sent to your telegram bot channel wherever you are. You can also add some “scare away” tactics, like trigger an alarm sound or a pre-recorded voice message.
Supplies:Raspberry Pi
SD Card
Raspberry Pi power supply
PIR sensor
Pi Camera
Speaker (optional)
Generic mobile camera lens (optional)
Configure Your Raspberry PiYou will need to setup your Raspberry Pi device with the lastest Rasberry Pi OS version with standard packages. Be sure to get the Python3 Telepot and PiCamera modules using pip3 or apt.
$ sudo apt-get update
$ sudo apt-get install python3-picamera
$ sudo pip3 install telepot
Install PiCamConnect your picam to your Rasbperry Pi using the CSI connector.
You also need to check if you have the picamera enabled on the Raspberry Pi configuration application.
Install PIR Sensor (Passive InfraRed Presence Sensor)Connect the PIR sensor to your Raspberry Pi
Setup You Telegram BotGet the telegram key and chat id from telegram BotFather bot:
https://core.telegram.org/bots
Install and Setup the Speaker (optional)Install a regular speaker to your Raspberry Pi using the audio jack. Remember to setup the audio through 3.5mm headphone jack and not HDMI output.
Install the espeak software to synthesize the audio from text
$ sudo apt-get install espeak
Set the Python Script and Basic UsageDownload the script through the git repo and set up:
- Telegram key and chat id from BotFather
- PIR pin used on your wiring setup
Basic usage instructions to run the intruder detection system:
- Edit the script with your specific data
- Start the script
- Open the telegram bot that you created before and control the script using the built-in commands
Commands:
enable pir: if PIR sensor is enabled, when PIR is triggered, the script will take a picture and send it to your bot channel
disable pir: if PIR sensor is disabled, never takes a picture automatically (when you are at home, PIR sensor must be disabled to avoid a picture flood)
show: take a real-time picture and send it to the telegram bot channel
say TEXT: read the TEXT string through the speaker
Congrats! You Got It!Now you have your own intruder detection device!!
Comments