Wednesday, July 11, 2012

Wifi garage door opener

I took apart my last garage door opener because there's another project that needs my bluetooth antenna. I realized how much easier the garage door opener would be to make over wifi and much less work to have it tidy in a permanent enclosure. Not to mention, the ethernet shield is roughly the same price as a 2nd antenna. This assumes you have wifi in your home with access from your driveway, a spare network port in your home network for the ethernet shield, and a cell phone.

In the picture is the PCB from the inside of a traditional garage door opener is laid on top of the ethernet shield + arduino uno combo. The transistor is pushed into the heated solder points of the push button with the center pin going through a 10k resistor to the output pin of your choice.
This 2nd example in this tutorial for lighting an LED can be copied without editing to use pin 2. The tutorial also walks you through testing the local address that will trigger the button. Now you can create a shortcut or bookmark to the website on your smartphone to be able to open with one click.

While this is all you need, I've also soldered wire to replace the battery. Since this one uses a 3v battery it's going to the 3.3v and ground pins on the board.


Adding to it by opening with a text


So in the rare occurance that I'd need to open the door while away (family member locked out of the house.. just takes one time). I decided to go with sending a text. For the time being I have an older android phone as a "home phone" and this script should be easy to replace the check for new texts section with anything from checking email to checking twitter and can easily grow into a smart home station. Aside from the wifi setup as the foundation, this involved downloading the SL4A app from here. Then create a Python script with the following code:

import android
import httplib
import time
droid = android.Android()
var = 1
while (var == 1):
 smscheck = droid.smsGetMessages(True, 'inbox')
 for i in smscheck.result:
  if 'Open Sesame' in i['body']:  # The command you want to send via text
   url = '192.168.1.xxx'  # IP address of ethernet shield goes here
   uri = '/?2'  # Pin number being used should replace 2
   ES = httplib.HTTPConnection(url)
   ES.request('GET',uri)
   time.sleep(.5)
   ESreply = ES.getresponse()
   ES.close()
   print ESreply
   droid.smsDeleteMessage(i['_id'])
   time.sleep(.25)
  else:
   time.sleep(.5)

5 comments:

  1. That would be more convenient in opening a garage, especially if you have the phone at hand and you're at work. Instead of opening and closing them manually, all you got to do is to text the code, and it will do the job for you. Have you already installed and tried that smart garage door opener?


    Roxie Magnus

    ReplyDelete
    Replies
    1. Hi Roxie, I have set it up and it works well. There is about a 6 second delay when sending the text to the door opening, while the wifi option opens the door instantly. Overall, I'm happy with how it turned out.

      Delete
    2. Congratulations, Danny. I'm glad you're happy. This would definitely help make things more convenient for you, especially when you're busy doing something and someone's knocking at the garage door.

      Kerita Kantz

      Delete
  2. Great for you, Danny. A 6-second delay is fine as long as it is working properly and you’re happy with it. With that convenient feature, you wouldn't have to get out of your car to close the garage. Good job!

    Sharron Folkes

    ReplyDelete
  3. Very great idea!I wounder that your post here is nice hope so can be separate it.
    Thanks for sharing your post here!


    garage door repair towson

    ReplyDelete