Pir Sensor & Camera Room Security Email Alerts

About the project

Using a PIR sensor with a camera for the raspberry pi, you can create a room security system. The PIR sensor can detect motion and will then activate the camera to take a snapchat photo. The python code will then email the snapshot as an attachment to your own email address.

Project info

Difficulty: Easy

Platforms: Raspberry Pi

Estimated time: 1 hour

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

Raspberry Pi 3 Raspberry Pi 3 x 1
Webcam - USB  USB Webcam - USB USB x 1
Picamera Picamera x 1
PIR (Motion) Sensor PIR (Motion) Sensor x 1
Raspberry pi cover Raspberry pi cover x 1
Jumper Wire - 0.1\", 2-pin, 12\"  0.1\", 2-pin, 12\" Jumper Wire - 0.1\", 2-pin, 12\" 0.1\", 2-pin, 12\" x 3

Software apps and online services

Raspbian OS Raspbian OS


Using a PIR motion sensor with a usb webcam or a picamera for the raspberry pi, you too can turn your raspberry pi device in a home security system which will send email alerts when someone enters your room.

The PIR sensor will detect motion, example someone enters or walks up to your desk. This is then activate the webcam or picamera and take a snapshot of who entered.

The image will then be sent as an attachment to your own email address.

So image your out and your annoying younger brother or sister tries to steal something from for room This device will then modify with a snapshot and time-stamp which can be received on your phone, proving they entered and the times when they did.

Schematics, diagrams and documents

PIR sensor diagram


The Python Code needed for this project

Just change your own email address and password.


Leave your feedback...