Smart security is a central pillar of the growing smart home universe, with many brands trying to bring the most complete and innovative products on the market (Nest, Netatmo, Withings, etc.). Those products offer a very complete protection against intrusions but also offer prevention to in-home accidents or house monitoring, and the current success of such products underline the significant importance customers give to such services.
Unfortunately, those products are very often expensive (more than $100, up to $300 for complete solutions) and for the vast majority include hidden costs (mandatory service subscriptions, necessary complementary product, blocked ecosystem, etc.).
We offer you today to find a way to do a completely DIY smart security system with either old components and devices you can find at home or very cheap material, in order to create the most complete yet inexpensive system to protect and remotely monitor your home for less than $50!
- House owners who want to secure their house but cannot afford expensive systems
- Tech enthusiasts who want to discover home automation and learn more about smart devices and DIY tech
- DIY passionates who know nothing about tech but are enthusiastic to challenge their DIY skills into a new undiscovered world
We base our projects on three simple rules:
- No tech skills needed - we will guide you in all steps to make sure you don’t feel lost
- No big expense needed - depending on what you have at home, this system can be done for less than $50!
- Everything can be done in one hour
- Two smart cameras connected to monitor efficiently your house
- Smart hub that alerts you of suspect behavior
- Smart hub that sends you snapshots of your house when you request a situation report
- Remotely start an alarm when intruders have been spotted in the house
This project is meant to be very adaptable so that you can improve it with further equipment or resources.
Step 1: NECESSARY COMPONENTS
- Raspberry Pi (v2 or v3)
- 16Gb SD card
- An old camera
- PIR or laser sensor + jumper wires
- An old unused smartphone
Step 2: SET UP YOUR PROTA PI SMART HUB
You first need to build the smart hub that will control the automation of your ring bell and connect all devices together. Prota OS for Raspberry Pi is our free smart hub OS which is very easy to install. In no time you will turn your Raspberry Pi into a smart home automation hub!
Alternatively, you can check this Instructables.
Step 3: SET UP YOUR PIR SENSOR
As you can see, next to your sensor’s pins are small indications on what each pin is made for:
- D is for Data
- + is for the current connection
- - is for the ground connection
Simply connect as in the picture below to set properly.
For the quick explanation, the RED cable is connected to a 5V pin (PIN02), the BLACK cable is connected to a ground pin (PIN 14) and the BLUE cable is connected to GPIO18 (PIN 12).
You can look at the map below if you need any direction.
- Now let’s open Prota Space.
- If you haven’t done it yet, download the GPIO app in App Libraries.
- In GPIO app, click on GPIO18. Select “Interrupt” and “Pull down”. Click on “set”.
The sensor is now set up.
Move your hand around, you should see notifications of “rising interrupt” on the GPIO app page.
Step 4: SET UP YOUR WEBCAM AND TELEGRAM BOT
- Plug-in the camera’s USB cable to your Raspberry Pi
- Download the Webcam app on your Prota Pi (in App Libraries)
- Open the app to check that the camera is now working (it should start to automatically take screenshots in case of any motion).
A Telegram bot is a virtual assistant that you can create on Telegram messenger app. If you want to learn more about Telegram bots, don’t hesitate to read this previous Instructables.
- Download Telegram app on your smartphone and create an account
- Download Telegram app on your Prota Pi (in App Libraries)
- Open the Telegram app on Prota and click on “Request Authorization”
- Set a name and username for your bot, then click on "Create"
Step 5: TURN YOUR OLD SMARTPHONE IN a WEBCAM WITH MANYTHING
ManyThings is a web service that allows you to turn any smartphone or tablet into a smart camera by simply adding their app. You can also see a live stream and record particular moments when motion is detected, and since it is free for one camera, it’s a perfect service for our project!
Any phone that let you install this app can be used, and if it even has a frontal camera, you can make it film both sides, which is a great way to recycle your old smartphone!
- Download the app on iOS or PlayStore depending on the smartphone you will use as a webcam.
- Sign up and choose “Camera” to put it in Webcam mode (Viewer is the mode to use on the device from which you want to monitor).
Your phone will switch to camera mode and as soon as you press the red button it will start recording and live streaming.
- Go to manything.com or open the app on another device to monitor what is happening
- Have a look at the settings to define the threshold of motion (from 1 to 10), the notification and recording parameters and the detection area.
Manything is connected to IFTTT so it will allow us to automate this camera’s use.
Step 6: CREATE AND CONNECT YOUR IFTTT ACCOUNT
We now need to use IFTTT, the platform that connects smart devices and web services together, to connect our old smartphone and telegram app with your Prota.
- Download the IFTTT app from your Prota’s App Libraries (this app has no interface, it allows connection between your Prota and IFTTT)
- Go to IFTTT.com or on the IFTTT app, create an IFTTT account and search for the “Prota” channel. Click on connect and select your Prota (you need to have granted access to your Prota Space to the device you’re using)
- Search for the “Manything” channel and connect your Manything account to it
- Search for the “Telegram” channel and connect your Telegram account to it
Step 7: WRITE DOWN STORIES AND APPLETS TO CREATE AUTOMATION
The central part of home automation is writing the right automation rule that will fit perfectly your needs and all possible situations. Prota OS provide a very flexible and intuitive tool with Stories app. Combined with IFTTT, it allows you to connect to hundreds of services and devices together in a very specific way
We will create the following automations:
- When PIR sensor sense motion before 7PM, send a notification to my Telegram account with a snapshot of the room (camera #1)
- When my smartphone camera detects motion (camera #2), send me a notification to my Telegram account with a link to the video
- When I send “Report” to my Telegram Bot, send me a snapshot of camera #1
- Use Telegram Bot to control camera #2 with simple messages
- Use Telegram Bot to trigger an alarm when intruders have been detected
1. When PIR sensor sense motion before 7PM, send a notification to my Telegram account with a snapshot of the room (camera #1)
- Open Stories app
- Click on + and on “When” to start writing your storyline
- Select “GPIO detects rising interrupt on PIN GPIO18” as sensor event
- Add an “And” field, select the sensor by “Scheduler - the clock is on ?” and set the time to for instance <=19:30 on weekdays (if you’re not back home before 7:30PM)
- Select “Webcam takes a snapshot” as action
- Click on “then” and add “Telegram Bot sends a text message” with “Unusual motion detected”
- Click on “then” and add “Telegram bot sends a photo”. Select the snapshot file and yourself as recipient
2. When my smartphone camera detects motion (camera #2), send me a notification to my Telegram account with a link to the video
- Open IFTTT and start a new applet
- Search Manything and select “Motion detected”. Select your device.
- Search Telegram and select “Send a message”. The default message will provide all necessary information, but you can edit it if you want.
- Click on finish
3. When I send “Report” to my Telegram Bot, send me a snapshot of camera #1
- Open Stories App
- Click on + and on When
- Select “When Telegram Bot receive message text ‘Report’” as event
- Select “Webcam takes a snapshot” as action
- Click on “Then” and add “Telegram Bot sends a photo” as second action
4. Use Telegram Bot to control camera #2 with simple messages
There is a many things you can tell your old smartphone’s camera to do via an IFTTT applet. The most important ones are start and stop recording, use front facing camera, turn on sound and motion emails, turn camera flashlight on. You can decide to create an automation to trigger those settings with a simple Telegram message to your IFTTT bot.
We will use here applets for start and stop recording (send message “Video start” and “Video stop”) and for the flashlight to be turned on (“Flash on”).
5. Use Telegram Bot to trigger an alarm when intruders have been detected
Let’s assume the worst! You look at your snapshots or live stream and realize intruders have gotten into your house. A good way to frighten them could be either to play a recorded message to make them think someone is here, or to play an alarm sound. Well with IFTTT, you can remotely trigger your phone to play such sound!
You can find many alarm sounds for free with a quick research. We recommend you this high pitch sound, highly disturbing! You can edit it to make it last a long time, or to add a vocal message.
Download it and put it on the old smartphone that will be used as camera. Make sure its name is recognizable, such as “High Pitch Alarm”.
Now let’s automate the alarm:
- Open IFTTT and start a new applet
- Select Telegram - “New message” and set the trigger message as “Alert”
- Select Android Device - “Play a specific song” and write down the exact name of your track (for us it will be “High Pitch Alarm”)
Test it! Remember that you will have to set your smartphone on high level of media sound in order for the alarm to be efficient.
Step 8: INSTALLATION AND TESTING
You now only have to install your two cameras and the PIR sensor to start using your smart security system.
You can install each camera in a different zone of your house to complement their use, keeping in mind their specific characteristics:
- your smartcam #1 will be attached to your Raspberry Pi and is great for facing key motion areas like doors or windows
- your smartcam #2 will have to stay plugged to a source of power but can be remotely started, so is perfect for angles
This project is meant to be adaptable, depending on what you have at home and what use you’re expecting. You can for instance:
- Use a laser sensor instead of the PIR sensor
- Integrate a smart smoke detector to your system
- With a Philips Hue at your desk at the office, get alerted by a flash that motion is detected at home, so that you get enough time to react
We hope you enjoyed this Instructables. Don’t forget to support us by “favoriting” it and following us on both Instructables and Twitter.
If you have any question, please use our forum!
You like Prota OS and want to test our newest apps before their release?
Subscribe your email address here to enroll or get further information on our Beta program.