An Internet of things security camera that notifies users via SMS, WhatsApp, and/or shared network folder when it detects motion, powered by Raspberry Pi, Amazon Web Services (AWS), and Twilio.
See my blog post about this project.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Raspberry Pi
- I used a Raspberry Pi Zero W.
- Camera
- I used the Raspberry Pi Camera Module V2.
This project is built in Python 3, so use pip3 to install packages using bash:
sudo apt install python3-pip
To enable support for messaging, AWS S3 and Twilio (or a similar cloud storage platform and messaging API, respectively) are needed.
Refer to the AWS guide for S3, for a guide on how to use S3 to store the media files.
Refer to the Twilio documentation, for a guide on how to use the Twilio API to send messages.
To enable sharing on a network folder, refer to the Ubuntu mounting walkthrough, for a guide on how to mount a shared folder on a Raspberry Pi.
Clone the repository by running:
git clone https://github.com/kdutta9/Smart-Surveillance.git
I recommend using a virtual environment, using virtualenv, for the project, to ensure there are no errors with dependencies. Make sure you create in the virtual environment in the project directory.
- Installing virtualenv
sudo pip3 install virtualenv
- Creating a virtual environment of some name (i.e. venv)
cd Smart-Surveillance virtualenv venv
- Activating virtual environment
source venv/bin/activate
Then, install the required packages.
pip3 install -r requirements.txt
If needed, modify config.json with your API keys and then use the following to run the application:
python3 main.py
If you need to run the application as the root user, modify and execute the script run.sh as such:
./run.sh
- Python
- OpenCV - Object Detection
- ImUtils - Image Processing
- Amazon Web Services - Cloud Storage
- Twilio - Messaging API
- @kdutta9
- Adrian Rosebrock: I used Adrian's guide to motion detection and use of the Twilio API, linked in Acknowledgements, to guide my project.
See also the list of contributors who participated in this project.
- Inspiration for using the Twilio API: Adrian Rosebrock
- Inspiration for motion detection: Adrian Rosebrock
- Inspiration for using a network folder: Website for Students