Original idea and source via Instructables
There are a lot of options to open your garage door using your phone. But many of these options don’t offer comprehensive features such as video logging, email notifications, and access to control lists. Wouldn’t it be great if you could build your very own Raspberry Pi SMS garage door butler with such features?
It’s fun and easy to implement. And most importantly, it can help you secure your home with just a few bucks. If you are already familiar with other Raspberry Pi garage openers, then this tutorial should be a walk in the park.
So let’s get into it.
Raspberry Pi SMS garage door Butler- Feature list
Here’s what you will get after spending an hour or so on this little gadget:
⦁ A 100% secure SMS garage door functioning with control lists that allow you to monitor who can and cannot open the garage door.
⦁ Ability to control your garage from anywhere in the world via a website.
⦁ Capture a full video of who enters through your garage. This video will be safely uploaded to the website for later use.
⦁ Ability to remotely terminate the opening process in case of abuse or malfunction.
⦁ Receive email notifications when someone enters or leaves
The system uses standard Linux code that you can easily set up. It is also portable to platforms like BeagleBone and will be easily portable to any future Linux technology.
Building Raspberry Pi SMS garage door butler
Step 1: Gather the components
The project requires:
⦁ A Raspberry Pi with basic configuration
⦁ A compatible camera such as Picam
⦁ A relay board. You could use a 5V 2-Channel solid relay board or something similar
⦁ Poster putty for PiCam
⦁ A website
⦁ Wire for creating access to the garage opener
Step 2: Install the required libraries
Get yourself a Twilio account to get a Twilio phone number, and add some credit into your account. After you are done setting up the phone, you can install the necessary libraries into your Raspberry Pi using the code below:
sudo apt-get install -y python-pip mysqlL-server python-dev libmysqlclient-dev sudo pip install MySQL-python twilio
Create two separate directories as shown below:
Step 3: Create databases, permissions, and users
Now login to your MySQL localhost server and create databases and users as you see fit. See the code below. Remember to add +1 before you add your phone number.
mysql -pYourSQLPassword -u root -h localhost create database GarageDoor; use GarageDoor; create table Door(sSid CHAR(40)); create table Authorized(sPhone CHAR(20)); create table Log(sPhone CHAR(20), sAction CHAR(10), dDate datetime); -- put your phone number, with a +1 before it if you're inside the USA insert into Authorized (sPhone) values ('+12145551212'); CREATE USER 'garage'@'localhost' IDENTIFIED BY 'garagepassword'; GRANT ALL PRIVILEGES ON * . * TO 'garage'@'localhost'; FLUSH PRIVILEGES; exit;
Step 4: Connect the relay with the garage door opener
Here, you need to connect your Raspberry Pi’s GPIO pin 23, which is physical pin 16, to the relay. You can connect the relay directly to the opener or use a spare garage door remote.
After that, connect all the wires from Raspberry Pi to the Relay so that pin 2 connects to 5v, pin 6 connects to the ground, and pin 16 manages the relay.
Next, check if the relay is active LOW. This would mean that HIGH signal would open the door. See the image below to get a good understanding of how to connect the components.
Step 5: Attach the camera to the unit
If you are using PiCam, a little bit of stiff wire and poster putty would do the job. You can either mount the camera near the surface where your device will sit or directly to the Raspberry Pi. You could also house all of it inside a 3D printed case.
Step 6: Fetch the SMS Butler code for installation
Fetch your code from here.
Copy it to any directory of the Raspberry Pi. Make sure to change the variables so you have your Twilio phone number and your phone number. Obtain authentication codes from here: https://www.twilio.com
Then run the following code:
sudo chmod 755 garage_sms_butler.py python garage_sms_butler.py
Next, send a text to your Twilio phone with the word “status” or “update” without any quotation marks. You should receive an update message informing you about the last time the door was open and who opened it.
Step 7: Test it
Here are some commands you can use to test your Raspberry Pi SMS garage door Butler
OPEN: This command will send the HIGH signal to the relay module activating the garage door to open. The signal will last for about 0.5 seconds. The program will upload the video of the person who’s entering the garage on your website.
STATUS OR UPDATE: This command will upload a jpg of anyone who opened the garage door. You can enable or disable this service.
DISABLE: This command will stop listening to commands.
ENABLE: This command will restart the application, ready to listen to the commands.
KILL OR STOP: This command will exit the application and it won’t take further commands unless you enable it.
You could use Motion to capture video, but that is far more technical and requires a lot of configuration. You just want to see who opened the garage door and you don’t need more than 60 seconds to see that (unless you want to make a vlog about garage activities).
Uploading files to a website is a convenient way to access them from anywhere. You could also use Google Drive, DropBox, or any other free service. But the website will give you easy access to logs.
You could use other SMS devices, but the problem is they don’t come cheap. Twilio is cheaper and why would you want to spend a lot of money just to get updates about your garage door? If you are a fan of open ports, you can use WebGPIO.
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.
Source via Instructables