{"id":587,"date":"2013-10-27T20:39:12","date_gmt":"2013-10-28T00:39:12","guid":{"rendered":"http:\/\/freemansgarage.com\/blog\/?p=587"},"modified":"2020-11-07T08:26:20","modified_gmt":"2020-11-07T13:26:20","slug":"iphone-or-android-garage-door-opener","status":"publish","type":"post","link":"https:\/\/www.freemansgarage.com\/index.php\/2013\/10\/27\/iphone-or-android-garage-door-opener\/","title":{"rendered":"Smartphone Garage Door Opener"},"content":{"rendered":"<p>I had an extra <a href=\"http:\/\/www.raspberrypi.org\/\">Raspberry Pi<\/a> laying around from when I ordered two of them a few months ago.\u00a0\u00a0 I used the first one for a media center and it runs <a href=\"http:\/\/wiki.xbmc.org\/?title=Raspberry_Pi\">XBMC<\/a> flawlessly allowing me to watch downloaded movies on my television.\u00a0 I pretty much have my entire DVD collection converted to DIVX format saved on my network for easy access.\u00a0 I could not find a use for the second one until I started to read about General Purpose Input \/ Output\u00a0 (GPIO) control on the Pi. \u00a0 Basically, the Raspberry Pi has an extra pin header for GPIO that can be controlled for switching things on and off and for reading sensors.\u00a0 It&#8217;s really pretty impressive for what this thing costs.\u00a0\u00a0 I ran across a project called <a href=\"http:\/\/code.google.com\/p\/webiopi\/\">WEBIOPI<\/a> which allows control of the GPIO from the internet.\u00a0\u00a0 It is possible to control the Raspberry Pi remotely with any device connected to the internet.<br \/>\nI read about people connecting all sorts of things to their Pi.\u00a0 Everything from thermostats, lights, locks, to garage doors openers, cameras, and remote sensors.\u00a0 Some of these guys were controlling the Pi from their smartphone as well which really intrigued me.<br \/>\nI decided I wanted to control my garage door with my iPhone since my existing garage door opener is very short range and I wanted to be able to open it from the road.\u00a0 I also wanted to be able to tell if the door was left open.\u00a0 I hate it when I get 10 miles from house not remembering if I closed the garage door or not.\u00a0 There are several ways to connecting a Pi to your iPhone but I will explain how I did it with very little programming. \u00a0 I am not a programmer and have no real interest in complex programming so I avoid it when possible.\u00a0 Any smartphone will work with this setup.\u00a0 All you need is a web browser on your phone with a data plan.<br \/>\nFirst I will tell you this is not originally my idea.\u00a0 You can even buy commercial equipment from Sears that will do this for about $76 and an additional $20 yearly fee &#8211; that&#8217;s the easy way.\u00a0 I don&#8217;t know about you but I hate bills and fees and I also enjoy building my own stuff the hard way.<br \/>\n<span style=\"color: #ff6600;\">Equipment needed:<\/span><\/p>\n<ul>\n<li><span style=\"color: #ff6600;\">Raspberry Pi &#8211; $25\u00a0 (you will also need a 2Gb SD card and micro USB cell phone charger for it).<\/span><\/li>\n<li><span style=\"color: #ff6600;\"><a style=\"color: #ff6600;\" href=\"http:\/\/www.radioshack.com\/product\/index.jsp?productId=12665270\">Relay Shield from Radio Shack<\/a> &#8211; $19<\/span><\/li>\n<li><span style=\"color: #ff6600;\">Soldering equipment<\/span><\/li>\n<li><span style=\"color: #ff6600;\">50 feet of 2 conductor thermostat or door bell wire &#8211; $9<\/span><\/li>\n<li><span style=\"color: #ff6600;\">Small proto circuit board, 1 kOhm &amp; 10 kohm resistor<\/span><\/li>\n<li><span style=\"color: #ff6600;\"><a style=\"color: #ff6600;\" href=\"http:\/\/www.radioshack.com\/product\/index.jsp?productId=12825860\">Female jumper wires with header<\/a> &#8211; $6<\/span><\/li>\n<li><span style=\"color: #ff6600;\">Magnetic switch (the kind used on doors and windows by security companies).<\/span><\/li>\n<li><span style=\"color: #ff6600;\">Your own existing network connecting to the internet with a router.<\/span><\/li>\n<li><span style=\"color: #ff6600;\">Any smartphone with a web browser<\/span><\/li>\n<\/ul>\n<p>I had most of this stuff laying around already.\u00a0 I only had to buy the relay shield &amp; the 50 ft of wire.\u00a0 I am not going to explain in detail how to solder or how to setup the default operating system on the Raspberry Pi.\u00a0 There are many very well written tutorials on how to do both.\u00a0 My Raspberry Pi is running Raspbian downloaded from <a href=\"http:\/\/www.raspberrypi.org\/downloads\">Here<\/a>.<br \/>\nOnce you have a Raspberry Pi running smoothly with raspbian, there are a few software packages that you need to install to make this work correctly.<br \/>\nI use a program called <a href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html\">Putty<\/a> to connect to my raspberry Pi remotely from another computer.\u00a0\u00a0 You can also of course connect a monitor and keyboard directly to the Pi but I found this inconvenient since I had the Pi mounted by my router.<br \/>\nWebiOPi &#8211; Download <a href=\"http:\/\/code.google.com\/p\/webiopi\/downloads\/list\">here<\/a> and save to your Raspberry Pi and install it manually if you want.\u00a0 You can skip this step and watch the video below to install automatically.<br \/>\n<a href=\"http:\/\/www.youtube.com\/watch?v=6RaBz01pi4E\">http:\/\/www.youtube.com\/watch?v=6RaBz01pi4E<\/a>\u00a0\u00a0 This is a excellent video tutorial on how to install WebiOPi and configure it.\u00a0 I watched this video several times before I figured it all out.\u00a0 It&#8217;s all Linux so if you are like me and not very familiar with it, it can be challenging to use.<br \/>\nHere are the commands to get WebiOPi installed automatically.<br \/>\nType the commands one at a time and wait until each finishes before going onto the next.<\/p>\n<p><span style=\"color: #3366ff;\">wget https:\/\/webiopi.googlecode.com\/files\/WebIOPi-0.6.0.tar.gz<\/span><br \/>\n<span style=\"color: #3366ff;\">tar xvzf WebIOPi-0.6.0.tar.gz<\/span><br \/>\n<span style=\"color: #3366ff;\">cd WebIOPi-0.6.0<\/span><br \/>\n<span style=\"color: #3366ff;\">sudo .\/setup.sh<\/span><br \/>\n<span style=\"color: #3366ff;\">sudo update-rc.d webiopi defaults<\/span><\/p>\n<p>That last command adds webiopi to the start up so when you reboot, its automatically started.\u00a0 You have to login to your Pi as &#8220;root&#8221; user so you have full access.\u00a0 The command &#8220;sudo&#8221; is needed prior to most commands because that calls for &#8220;root&#8217; user privilege so you can install and configure the Pi.\u00a0 Linux is all about security so get used to it.<br \/>\nNow go to:\u00a0<a href=\"http:\/\/localhost:8000\/webiopi\/\" rel=\"nofollow\">http:\/\/localhost:8000\/webiopi\/<\/a>\u00a0 on your Pi&#8217;s browser and you will see the webpage below.<br \/>\n<strong>Default user is &#8220;webiopi&#8221; and password is &#8220;raspberry&#8221;<\/strong><br \/>\nYou should see this screen if it works properly:<br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/webiopi-start.gif\" rel=\"attachment wp-att-611\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-611 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/webiopi-start.gif\" alt=\"webiopi start\" width=\"675\" height=\"386\" \/><\/a><br \/>\nYou can also see it from any other computer on your network if you type in your Pi&#8217;s IP address into the address bar.<br \/>\nExample: <span style=\"color: #ff0000;\">http:\/\/192.168.1.10:8000\/<\/span><br \/>\nIf you watched the video, it explains how to do some simple CSS and HTML to make a simple web interface.\u00a0 I also disabled the password as explained in the video.\u00a0\u00a0 I am pretty week when it comes to this stuff so I will provide my html file for you to use or modify.\u00a0 Feel free to change it around to suit your needs.<br \/>\nI used GPIO7 as the output and GPIO18 as the input (sensor for the door).\u00a0\u00a0 You can use anyone you want.<br \/>\nHere is my file <a href=\"http:\/\/www.freemansgarage.com\/stuff\/index.txt\">Index.html<\/a>\u00a0 just right click and &#8220;save as&#8221;.\u00a0 It is just plain text.\u00a0 Save it to your working directory on your Pi.<br \/>\nSo far, you should have a working Raspberry Pi with WebIoPi running on your network.\u00a0 At this point, you can only access the web control from your local network, it will not work outside your firewall yet.\u00a0\u00a0 To get access to your Pi from anywhere on the net, you have to do a few things.\u00a0 I have to assume you have some basic network knowledge to get the next part working.\u00a0 I will explain as simply as I can but there are whole books written on this topic.<br \/>\nThe problem with home networks is that your Internet provider will change your external IP address often.\u00a0 Mine changes every week or so and I have to have some way to let the &#8220;outside internet&#8221; know what my new number is.<br \/>\n<span style=\"text-decoration: underline;\"><span style=\"color: #000000; text-decoration: underline;\"><strong>12-26-13 Update<\/strong>:<\/span><\/span><br \/>\n<span style=\"color: #00ff00;\"><span style=\"color: #ff6600;\">I no longer use<\/span> <a href=\"http:\/\/dyn.com\/dns\">http:\/\/dyn.com\/dns<\/a>.\u00a0\u00a0\u00a0<span style=\"color: #ff6600;\"> They have a 30 day login requirement which is really annoying for their free members.\u00a0 It&#8217;s a shame since I have been using them for over 10 years.\u00a0 I now use a much better free DNS Service:\u00a0 <a style=\"color: #ff6600;\" href=\"http:\/\/freedns.afraid.org\/\">http:\/\/freedns.afraid.or<\/a><a style=\"color: #ff6600;\" href=\"http:\/\/freedns.afraid.org\/\">g<\/a>\/\u00a0\u00a0 These guys are great and work perfect so far.\u00a0<\/span><\/span> <span style=\"color: #00ff00;\"><span style=\"color: #ff6600;\">I updated my instructions below to reflect the FreeDNS website.\u00a0<\/span> <\/span><br \/>\nFirst you need to sign up for a free account on\u00a0<a href=\"http:\/\/freedns.afraid.org\/\">http:\/\/freedns.afraid.org<\/a>\/ \u00a0\u00a0 Log into your new account and add a &#8220;Subdomain&#8221; from the options on the left of the website. \u00a0\u00a0\u00a0 Pick an address from their thousands of available subdomains\u00a0 to use and remember it.\u00a0\u00a0 Example:\u00a0 <span style=\"color: #ff0000;\">yourname.us.to\u00a0\u00a0<\/span> Once you picked out a subdomain, go to the &#8220;Dynamic DNS&#8221;\u00a0 on the left menu.\u00a0 You should see your domain at the bottom with a note about it that says &#8220;1 Dynamic Update Candidates!&#8221;.\u00a0\u00a0 There are several different links to the right of your domain and you want to click the &#8220;Wget script&#8221; and download this text file.\u00a0\u00a0 This file will contain the 32 character token code that you need to paste into your router.\u00a0 It&#8217;s the security code that allows you to log into FreeDNS and update your IP address (your router does this automatically for you).<br \/>\nNext, you need to setup a &#8220;Port Forward&#8221; in your router.\u00a0 Every router is different.\u00a0 You need to forward port 8000 to your raspberry Pi address.<br \/>\nFor example:\u00a0 My raspberry Pi uses 192.168.1.10\u00a0\u00a0 yours might be something else but it will be similar.\u00a0\u00a0 So I want to go into my routers port forward section and forward requests for port 8000 to 192.168.1.10.<br \/>\nBelow is what my routers port forward settings look like.\u00a0 I have many ports setup in there but the only one you need is Port 8000 which is highlighted in red.<br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/port-forward.jpg\" rel=\"attachment wp-att-606\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-606 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/port-forward.jpg\" alt=\"port forward\" width=\"643\" height=\"386\" \/><\/a><br \/>\nThe next thing you need to do is to setup your new FreeDNS account in your router.\u00a0\u00a0 This is different on every router so you will have to look up the manual on your router and look up DNS services that are supported.\u00a0 I have a section just for this and its needed so that when your routers sees a IP address change, it will tell FreeDNS to update.<br \/>\nBelow is what my router settings look like (I blacked out my own IP and Token code):<br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/freedns.jpg\" rel=\"attachment wp-att-680\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-680 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/freedns.jpg\" alt=\"freedns\" width=\"522\" height=\"396\" \/><\/a><br \/>\nEvery Linksys router I have used has this feature built in.\u00a0 I have also seen it on Netgear and Asus routers as well.\u00a0 I can&#8217;t say for sure if every router can do this but if yours can&#8217;t this will be a problem for you to access the web interface from outside.\u00a0\u00a0\u00a0 You should now be able to go to any computer including your iPhone and type in &#8220;<span style=\"color: #ff0000;\">yourname.us.to:8000&#8243;<\/span> and your WebIOPi interface should come up.<\/p>\n<p>The next section explains how to build the actual interface between your Raspberry Pi and your garage door. The GPIO header is located on the Pi below:<br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/raspberry-GPIO-header.jpg\" rel=\"attachment wp-att-621\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-621 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/raspberry-GPIO-header.jpg\" alt=\"raspberry GPIO header\" width=\"907\" height=\"616\" \/><\/a><br \/>\nThis header will be used to connect to your relay shield and to get +5v power and +3v power.<br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/GPIO-Header-pinout.png\" rel=\"attachment wp-att-623\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-623 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/GPIO-Header-pinout.png\" alt=\"GPIO Header pinout\" width=\"347\" height=\"370\" \/><\/a><br \/>\nThis is the pin out diagram which is off of the WEBioPI default page. It is extremely useful for verifying connections before you use your custom website. I pull this up on my iPhone for testing all the time. It&#8217;s called &#8220;GPIO Header&#8221; on the default WebioPi site. I setup some prototype test circuits to test the raspberry pi before I spent money on the relay shield. This step is not necessary but I wanted to understand how it all worked before I set it up.<br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0571.jpg\" rel=\"attachment wp-att-626\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-626 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0571.jpg\" alt=\"Prototype test circuit\" width=\"1632\" height=\"1224\" \/><\/a><br \/>\nI ended up using GPIO7 as the interface with the garage door. Basically all you need to do is touch the two wires that go to the garage door switch together to make the door activate. The PI will accomplish this by using a relay as a switch to short the two wires together.<br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/Relay-revised.gif\" rel=\"attachment wp-att-628\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-628 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/Relay-revised.gif\" alt=\"Relay conection\" width=\"547\" height=\"389\" \/><\/a><br \/>\nThis is the circuit I used to connect to my garage door. The screw terminals go to the two wires that connect your garage door button in the garage. You can build your own circuit if you want, but I just bought a &#8220;Relay Shield&#8221; for $20 from Radio Shack. It was nice and had 4 relays that I can use for other stuff if I want to later.<br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0572.jpg\" rel=\"attachment wp-att-633\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-633 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0572.jpg\" alt=\"Radio Shack &quot;Relay Shield&quot;\" width=\"1632\" height=\"1224\" \/><\/a><br \/>\nThis is the Relay Shield. Its awesome and will run off the +5v from the Raspberry Pi with no problems. No need to power it separately.<br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/Shield-Header.jpg\" rel=\"attachment wp-att-635\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-635 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/Shield-Header.jpg\" alt=\"Relay Shield Header\" width=\"1377\" height=\"1224\" \/><\/a><br \/>\nI soldered a header connector very similar to the Raspberry Pi to the relay shield as shown. The header connector is included with the blue jumper packet. To connect the relay shield to the raspberry pi requires these little blue jumpers also available in a pack of 10 with a header connector for $5. They are cheaper on-line but I did not want to wait. We are going to use only 3 pins (GND, +5V, D0).<br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0577.jpg\" rel=\"attachment wp-att-637\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-637 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0577.jpg\" alt=\"Jumper Wires\" width=\"1306\" height=\"980\" \/><\/a><br \/>\nThey connect by pushing them on the header pins as shown. No soldering required for the blue jumper wires. Connect &#8220;D0&#8221; to &#8220;PIN26&#8221;, &#8220;5v&#8221; to &#8220;PIN2&#8221;, and &#8220;&#8221;GND&#8221; to &#8220;PIN25&#8221;. I know my image shows 4 wires, but you only need 3. I was using the 4th to test another relay. That&#8217;s it for the relay. You should be able to press the GPIO7 button on the WEBiOPi website and your should hear the relay &#8220;click&#8221;.<br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0582.jpg\" rel=\"attachment wp-att-639\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-639 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0582.jpg\" alt=\"Raspberry connected to Relay Shield\" width=\"1959\" height=\"1469\" \/><\/a><br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0586.jpg\" rel=\"attachment wp-att-648\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-648 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0586.jpg\" alt=\"Mounted in the basement\" width=\"1306\" height=\"980\" \/><\/a><br \/>\nI ended up mounting the whole assembly very close to the my router in my basement. I ran 30ft of thermostat wire from the garage door opener to the raspberry pi. Connect the two garage door wires to &#8220;COM1&#8221; and &#8220;N01&#8221;. There is no polarity so it does not matter which way you connect them. You can see below that I connected the thermostat wire from the Pi to the same connections on the opener that my push button opener is connected to.<br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2014\/12\/IMG_2712.jpg\" rel=\"attachment wp-att-835\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-835 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2014\/12\/IMG_2712.jpg\" alt=\"Door opener Connection\" width=\"1306\" height=\"980\" \/><\/a><br \/>\nThe garage door sensor is all that is left. The sensor was a bit tricky and I did some thinking for a while on the best way to get the raspberry pi to know if the door was open or not. I needed a switch that the door would trigger when open. The perfect switch is one of those cheap little magnet switches that security companies use on doors and windows. You mount the magnet on the door, and when the door moves the magnet away from the switch, the switch will open or close depending on how you wire it up. I bought one for a few dollars from my local electrical hardware store in town.<br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0609.jpg\" rel=\"attachment wp-att-653\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-653 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0609.jpg\" alt=\"Magnet Switch\" width=\"1632\" height=\"1224\" \/><\/a><br \/>\nYou can&#8217;t just connect the magnet switch to the raspberry pi. Unfortunately, you can&#8217;t use the relay shield for this either. I had to build another circuit that would interface with the raspberry pi. The GPIO pins are very sensitive and can easily get destroyed if you apply too much voltage to them. They also have this problem of &#8220;floating&#8221; between hi and low when you set a pin to a &#8220;input&#8221;. They act all goofy so you need to ground them out with a resistor to make them behave properly.<br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0625.jpg\" rel=\"attachment wp-att-656\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-656 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0625.jpg\" alt=\"Magnet Switch Interface\" width=\"1143\" height=\"857\" \/><\/a><br \/>\nI used this circuit to connect my magnet switch to GPIO-18 or &#8220;PIN12&#8221; on the raspberry pi. Its very simple and only requires a few parts: one 10Kohm resistor, one 1Kohm resistor, a 6 pin header from your blue jumper wire kit you bought from Radio shack, and a small proto soldering board. I have a ton of old proto boards from other projects I built.<br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0603.jpg\" rel=\"attachment wp-att-660\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-660 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0603.jpg\" alt=\"Sensor Circuit close up\" width=\"1632\" height=\"1224\" \/><\/a><br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0602.jpg\" rel=\"attachment wp-att-659\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-659 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0602.jpg\" alt=\"Sensor Circuit\" width=\"1632\" height=\"1224\" \/><\/a><br \/>\nThe red and tan wires go to the magnet switch. The 3 blue jumper wires go to &#8220;GPIO-18&#8221;, &#8220;+3v&#8221;, and &#8220;Ground&#8221; on the raspberry pi.<br \/>\n<a href=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0607.jpg\" rel=\"attachment wp-att-664\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-664 size-full\" src=\"https:\/\/www.freemansgarage.com\/wp-content\/uploads\/2013\/10\/IMG_0607.jpg\" alt=\"Complete Garage Door Interface\" width=\"1632\" height=\"1224\" \/><\/a><br \/>\nHere is the complete setup. It works pretty good and has no hesitation between the phone and the garage door so far. This project is complicated but doable if you take your time.<br \/>\nThere are three main parts to this project:<br \/>\n1. Getting the Raspberry Pi setup on your network with WebIOPi working<br \/>\n2. Connecting the garage door and Relay Shield to the Pi<br \/>\n3. Connecting the door sensor.<br \/>\nI did not move onto the next phase until I got the previous one working 100%. If you try to do all three and once, you will get frustrated and kick your cat or kids if you have them.<br \/>\nI&#8217;ll make a video of the door working this week. More to come.<br \/>\nThanks for reading the super long post.<br \/>\nMike<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>I had an extra Raspberry Pi laying around from when I ordered two of them a few months ago.\u00a0\u00a0 I used the first one for <a class=\"mh-excerpt-more\" href=\"https:\/\/www.freemansgarage.com\/index.php\/2013\/10\/27\/iphone-or-android-garage-door-opener\/\" title=\"Smartphone Garage Door Opener\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":589,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-587","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-projects"],"_links":{"self":[{"href":"https:\/\/www.freemansgarage.com\/index.php\/wp-json\/wp\/v2\/posts\/587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.freemansgarage.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.freemansgarage.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.freemansgarage.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.freemansgarage.com\/index.php\/wp-json\/wp\/v2\/comments?post=587"}],"version-history":[{"count":3,"href":"https:\/\/www.freemansgarage.com\/index.php\/wp-json\/wp\/v2\/posts\/587\/revisions"}],"predecessor-version":[{"id":1473,"href":"https:\/\/www.freemansgarage.com\/index.php\/wp-json\/wp\/v2\/posts\/587\/revisions\/1473"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.freemansgarage.com\/index.php\/wp-json\/wp\/v2\/media\/589"}],"wp:attachment":[{"href":"https:\/\/www.freemansgarage.com\/index.php\/wp-json\/wp\/v2\/media?parent=587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.freemansgarage.com\/index.php\/wp-json\/wp\/v2\/categories?post=587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.freemansgarage.com\/index.php\/wp-json\/wp\/v2\/tags?post=587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}