garage door opener using raspberry pi

garage door opener using raspberry pi

garage door opener touchpad

Garage Door Opener Using Raspberry Pi

CLICK HERE TO CONTINUE




This instructable explains how I setup a Raspberry Pi to open my garage door using a smarthphone. While this has been done before, I thought I'd post my solution. This was my first hardware project and instructable ever and I'm sure I made some mistakes. So, when you find one let me know! Project Overview: What we will be doing is turning the Raspberry Pi into a small web server. When you access the webserver from your browser of choice, you will have a big button that triggers the garage door via a relay. We will wire a very basic circuit to the Pi's GPIO pins and upload a website that triggers the circuit. When the relay is triggered, it closes the circuit hooked up to the garage motor and opens the garage.Why would anyone want to do this? Well, my garage door opener was broke and this was cheaper than replacing the other system. As an added plus though, you could wire up additional sensors and be able to make sure your garage is closed remotely if your were so inclined.Shopping List: I consider myself pretty cheap, and I tried to keep the costs minimal.




All of the items are available on prime. 1.) Raspberry Pi - Model A - $32 2.) Wifi Adapter - $10 3.) PSU - $5 4.) 5v Relay - $6Total: $53.00 You will also need an sdcard >= 2GB and some wires, but I had extra of each.Step 1: Install and Optimize Rasbian (for our purposes)Show All Items This first step is to install an operating system to your rpi. I'm a bit of a debian fanboy, and had an extra 2GB sdcard, so I went with a shrunk version of Wheezy. On Ubuntu, I used gparted to format to fat32, and dd to write the img. After you install the OS, plug in a usb keyboard and hook up the raspberry pi to a monitor. Assuming you are using Wheezy, on the first boot rasp-config will automatically run. You should use this tool to stretch the parition and enable ssh (under the advanced menu on newer versions I believe). After I installed my img, I also removed the GUI to free up some space. (If you have a large SD, you can skip this.) To do this type these commands:$ sudo apt-get remove --purge x11-common$ sudo apt-get autoremove This removes all packages that depend on X11 which is pretty much all of the GUI.




Updated to match wiring diagram Garage Door Controller v1.1 Monitor and control your garage doors from the web via a Raspberry Pi. This project provides software and hardware installation instructions for monitoring and controlling your garage doors remotely (via the web or a smart phone). The software is designed to run on a Raspberry Pi, which is an inexpensive ARM-based computer, and supports: Monitoring of the state of the garage doors (indicating whether they are open, closed, opening, or closing) Remote control of the garage doors Timestamp of last state change for each door Logging of all garage door activity Micro USB charger (1.5A preferable) USB WiFi dongle (If connecting wirelessly) 8 GB micro SD Card Relay Module, 1 channel per garage door (I used SainSmart, but there are other options as well) Magnetic Contact Switch (one per garage door) Female-to-Female jumper wires (you'll need around 10, or you can just solder)




Python >2.7 (installed with Raspbian) Raspberry Pi GPIO Python libs (installed with Raspbian) Python Twisted web module Step 1: Install the magnetic contact switches: The contact switches are the sensors that the raspberry pi will use to recognize whether the garage doors are open or shut. You need to install one on each door so that the switch is closed when the garage doors are closed. Attach the end without wire hookups to the door itself, and the other end (the one that wires get attached to) to the frame of the door in such a way that they are next to each other when the garage door is shut. There can be some space between them, but they should be close and aligned properly, like this: Step 2: Install the relays: The relays are used to mimic a push button being pressed which will in turn cause your garage doors to open and shut. Each relay channel is wired to the garage door opener identically to and in parallel with the existing push button wiring.




You'll want to consult your model's manual, or experiment with paper clips, but it should be wired somewhere around here: Step 3: Wiring it all together The following diagram illustrates how to wire up a two-door controller. The program can accommodate fewer or additional garage doors (available GPIO pins permitting). Note: User @lamping7 has kindly informed me that my wiring schematic is not good. He warns that the relay should not be powered directly off of the Raspberry Pi. See his explanation and proposed solution here. That being said, I've been running my Raspberry Pi according to the above schematic for years now and I haven't yet fried anything or set fire to my house. Your milage may vary. Install Raspbian onto your Raspberry Pi Configure your WiFi adapter (if necessary). From here, you'll need to be logged into your RPi (e.g., via SSH). Install the python twisted module (used to stand up the web server): sudo apt-get install python-twisted




Install the controller application I just install it to ~/pi/garage-door-controller. You can install it anywhere you want but make sure to adapt these instructions accordingly. You can obtain the code via SVN by executing the following: sudo apt-get install subversionyou don't need to build anything. You'll need one configuration entry for each garage door. The settings are fairly obvious, but are defined as follows: name: The name for the garage door as it will appear on the controller app. relay_pin: The GPIO pin connecting the RPi to the relay for that door. state_pin: The GPIO pin conneting to the contact switch. state_pin_closed_value: The GPIO pin value (0 or 1) that indicates the door is closed. approx_time_to_close: How long the garage door typically takes to close. approx_time_to_open: How long the garage door typically takes to open. The approx_time_to_XXX options are not particularly crucial. They tell the program when to shift from the opening or closing state to the "open" or "closed" state.




You don't need to be out there with a stopwatch and you wont break anything if they are off. In the worst case, you may end up with a slightly odd behavior when closing the garage door whereby it goes from "closing" to "open" (briefly) and then to "closed" when the sensor detects that the door is actually closed. Set to launch at startup Simply add the following line to your /etc/rc.local file, just above the call to exit 0: (cd ~pi/garage-door-controller; python controller.py)& Using the Controller Web Service The garage door controller application runs directly from the Raspberry Pi as a web service running on port 8080. It can be used by directing a web browser (on a PC or mobile device) to http://[hostname-or-ip-address]:8080/. If you want to connect to the raspberry pi from outside your home network, you will need to establish port forwarding in your cable modem. When the app is open in your web browser, it should display one entry for each garage door configured in your config.json file, along with the current status and timestamp from the time the status was last changed.

Report Page