Garagedoor opener / pushbutton


10 posts
by RazAquato » Sun Nov 04, 2012 7:48 pm
Hi.
This is hopefully a fairly simple project, so I'll start with the question first.
Is it possible to use part of the Rpi's GPIO as a pushbutton (no voltage, just simply close an existing circuit) ?

Over to my explanation/project:
I have a garagedoor-opener/engine that operates through a push-button.
Today it operates through a key-pad on the outside, where the key-pad itself works as a push-button if I enter the correct pin; and a simple doorbell-button on the inside
they're both wired to the engine, so closing the circuit for ~1 sec will start the engine either opening or closing the door.

Now what I want to do, is open the door without leaving my car.
I'm picturing using my smartphone to access a web-page served by the Rpi (with nothing more than a simple big button on it); so that if pushed (or even better, if web-page is accessed by my phone), the Rpi will then function as a pushbutton/switch/doorbell-button, closing the external circuit, starting the engine to open my garagedoor.

I have, however, no idea if this is possible?
Posts: 2
Joined: Fri Aug 03, 2012 6:17 pm
by BrianHanifin » Sat Nov 10, 2012 7:49 am
I only have a basic understanding of electronics, but my first thoughts lead me to believe you would require an external component to trigger the switch. Transistors or relays come to mind.

I remember reading about a guy who hooked his garage door remote up to an Arduino, soldered a jumper across the button on the remote, and activated the remote by supplying power to the remote momentarily.

Ah, here's another one... One guy used a relay which was hooked up to the wired switch in parallel (so pressing the wired button still worked).
Posts: 8
Joined: Tue Oct 30, 2012 4:30 pm
Location: San Diego, California
by arcen1k » Sat Nov 10, 2012 8:28 am
It looks very possible, and there are probably more than 1 way to go about doing it. One way if you want to go down to the path of a web service would be to have you click an online button then it runs a script on your device, the web page could literally just have a button on it that runs a Python script. Then in that script you could enable a GPIO pin wait 1 second then disable it. When it the pin is on you could have that pin connected to a relay that closes the circuit instead of the button if you want to do some soldering... That's just one way, and probably a little bit more difficult one though.
Posts: 4
Joined: Sat Nov 10, 2012 8:11 am
Location: Seattle
by RedSlayer » Sun Nov 11, 2012 10:42 pm
Hi,

Sorry, this is a long post (it does concentrate on the app logic that I'm proposing).

I'm a complete noob with both the Rpi and Android programming (although I am a software developer by trade).

Someone has already created an Android app, which (via a local pc + wifi) - opens the garage door.
Basically, his app has wifi ON continuously on his smartphone and when he get's within range - the garage opens.

By his own admission, the app is 'basic', and I was looking to produce a more polished version.
My clearest thoughts are around the requirements of the smartphone app and the Rpi details are sketchy at best (although I envisage it being relatively simple to switch the door on receipt of a wi-fi signal, although - I'll probably eat my words lol).
I'm a biker, and therefore would love to not have to stop in the pouring, freezing rain / sleet, take my gloves off and click a remote (somewhere in one of my pockets).

Smartphone App:
My main concern for an app has been with battery power conservation on the smart-phone.
Basically, leaving Wi-Fi on (or having to switch it on before you set off from work) is a no-no - too much wasted smartphone power / not convenient.
I'd like the app to be 'smarter' than that. E.g. leave it 'on' all day - with very little battery consumption.
So how to do just that?

D = actual time distance from the garage
W = time distance from home to turn on wi-fi for the garage BEFORE the smart phone get's there.
T = the time in which the app should wake and check it's own location (D - W).

Let's start some distance from home - say at work...

1) The app is 'running' all the time during the day and is simply a 'timer' that boots it's 'real' self up every T minutes.
2) T is a time variable, which is adjusted by the app itself - dependant on distance from the 'garage' minus WiFi range time.
3) W in minutes / seconds can be re-set by the user (for fine tuning / calibration - for different wi-fi ranges / GPS accuracies etc). This is the time when wi-fi must be switched on in time to not be too far or too close to switch wi-fi on (ready to be within range of the garage). Let's say that W = 2 minutes.
4) The user can also enter modes of travel (basically speed of travel - for more accurate estimation of 'time from home'), which will amend how D is calculated (although even this should be 'programmed-in' to be re-evaluated by the app - if it seems that the user has changed transport type and is travelling much faster / slower than expected).
5) At work - the app 'wakes', turns on GPS and checks the distance to the garage - 15 miles say. (Let's say that for 15 miles; D = 30 minutes).
6) It knows that it will take D minutes for the owner to get to the garage, so it set's a timer to wake and run it's check process in T minutes (D - W), turns off GPS and 'goes to sleep' (now just running an internal timer).
7) In T minutes - it calls it's check-process. The owner hasn't moved - still at work: so redo 5).
8) In T minutes - it calls it's check-process. The owner HAS moved (established by GPS) and is now 10 minutes away from home.
9) It calculates D - W (8 minutes) and resets T. It then set's a timer to wake and run it's check process in T minutes, turns off GPS and 'goes to sleep' (now just running an internal timer).
10) In T minutes - it wakes and runs the check-process - it calculates D - W (T) which is zero (or minus).
11) As T is zero (or) minus - it must be close to home; it turns WiFi on - ready for the garage Rpi to receive.
12) The garage Rpi get's the Wifi signal and boots it's own software app (checking if the door is open or closed etc) and opens the garage door (whilst the smartphone is currently 20 seconds away).
13) The garage Rpi sends a wi-fi signal to the smartphone to say that 'the garage is open as requested' and the smartphone app shuts itself down (completely - no timer etc).
14) The owner parks the vehicle in the garage and closes it via whatever means (remote fob, manually etc) - done.

In the morning:

1) The owner activates the smartphone app with a single click just before leaving the house.
2) The app 'knows' that it is well within the W (2 minute) range; so it turns on WiFi (and leaves it on; maybe the house has thick walls and the owner must be outside) - the Rpi app gets the signal and opens the garage.
3) The owner drives the vehicle out of the garage.
4) The Rpi is 'polling' for wi-fi signal, and when the smartphone wi-fi is lost - it's closes the garage.
5) The smartphone app is still running and amending T, so it shuts WiFi off and continuously calculates T and resets itself to wake in T (subsequently greater and greater times).
5) (An additional idea): If the garage doesn't close correctly - the Rpi sends an email to the smartphone owner, which activates an alarm on the smartphone (not too far away for it to be a drag to return and check the obstruction).

Remotely?
Of course this could be controlled remotely via the web quite easily (possibly your neighbour needs to get in to release a cat etc.) if the Rpi is connected to your home WWW connected network.

Here are some working garage openers:

http://bradfitz.com/garage-opener/
http://www.youtube.com/watch?v=zHDoeaImPiQ

Project Pro's:
Get's me au-fait with Android programming / Rpi.
Get's me into my garage on bike with no thought or action.
Get's me into my nice, warm house a few minutes quicker.

Project Con's:
If this is to be a generic solution for most electric garage doors, it's difficult to envisage a standard (easy) interface solution to the garage door motor with a relay etc. - unless there's someone who KNOWS garage door electronics.
I've seen 'soldered contacts' in remote fobs etc. which are fed by a relay controlled by a server (not 'clean' enough for me).
I've seen X10 controlled systems ((still messy, with an extra piece of 'dumb' hardware) that's why I'm looking at Rpi).

I'd love to create a small, standalone, boxed, 'sealed' Rpi with a relay sealed within that box, which sits between the garage opener electricity circuit (+ve / -ve) and the relay between it and that supply and the garage opener motor. 4 electricity connections and a sealed Rpi running WiFi - KISS.

Possible? Definitely.
Easy? Possibly.
Perfect? Nope, but the software app will at least get proven out - ready for a future 'generic' electronic solution (if written generically).
Too complex? Hmm, I believe that we should embed complexity in software - the above long-winded logic that took you 2 minutes to read, is processed in nano-seconds.

RazAquato - your solution requirement is a 'wireless remote fob' which you can buy with the motor, as a kit, for your garage door for perhaps $100.
I already have a remote fob garage door.
I'm talking about a generic solution that automatically opens your garage door type (and mine) - without us doing anything to activate it, apart from start an app in the morning.

If you're interested - I'm just about ready to buy an Rpi and start the project.
I'm interested in Android, but a colleague is interested in IOS (iPhone) and has just bought an Rpi for experimentation.

Drop me a line to see how I'm doing (or possibly collaborate).

Regards,

Red
Posts: 1
Joined: Sun Nov 11, 2012 10:21 pm
by BrianHanifin » Wed Nov 14, 2012 8:21 pm
Wow Red, that sounds brilliant! In fact I would love to set my dad up with that setup, he rides as well.

You are welcome to create a fork of my code garagemonitor.py to start with if you like. I have the code to handle both open, and closed buttons. However, I haven't hooked up the open button yet, so I added a setting so only a closed button is required (for this we can assume if NOT Closed then it is Open). Although ideally we would also have a closed switch so if neither are activated we can determine (after a timeout) that the door got stuck in between.

The discussion on this forum for my project is called Garage Monitor with Web Status. It has a link to my detailed blog posts about this project as well as my source code on Github. This is a stable-ish public version of the code I actually use. (In other words, I removed my SMTP passwords, and real web service addresses for saftey.)
viewtopic.php?f=41&t=22563

I might have to send you a private message. :-)
Posts: 8
Joined: Tue Oct 30, 2012 4:30 pm
Location: San Diego, California
by BrianHanifin » Wed Nov 14, 2012 10:01 pm
arcen1k wrote:... you could have that pin connected to a relay that closes the circuit instead of the button if you want to do some soldering... That's just one way, and probably a little bit more difficult one though.


Are you saying that using a Relay is complicated? What are the easier ways? We would really like to know. :)
Posts: 8
Joined: Tue Oct 30, 2012 4:30 pm
Location: San Diego, California
by RazAquato » Fri Nov 16, 2012 10:45 am
I am amazed at all the replies I've recieved.
As stated, I could always use a remote-fob to solve my problems, but where's the fun in that.
And let's face it, everything will be connected to the net eventually, so why not start with the garage-doors, dishwashers and other 'safe' equipment that won't try to take over the world ;-)

My initial thought was as stated, to have the rpi serve a simple web-page with a button, but reading Red's comment, I think I'm gonna make a bigger project out of this.

I do, however not agree with the whole wi-fi thing.
It seems like a great Idea, but first off, it requires wifi signal to be reached from the garage (or from 'down the road' if you want it to be activated a lil-bit before you reach it), also it will as stated drain battery-power.

Red's posted a great alternative, using a 'timer' for controlling the wifi antenna on the smartphone, but why not make it a lot simpler, using just the GPS antenna?

The GPS drains a lot less power than the wifi antenna, and in my eyes it's not critical that it stays on, - or one could of course use a timer to power it on once in a while to check your status, then switch totally on when you get close to home; as Red's soultion states (which seems quite elegant really :-) but I fear the programming part :-p )

My thought is therefore: have a program for the phone that tracks your GPS-location, then simply send a signal to the rPI (e.g. accessing a web-page or similar, hosted by the r-pi) to open the door; leavig the wifi totally out of it.

Then I can have the rpi not only function as a garage-door opener, but also activate oudoor lighting alongside the dark road up to my house (where i wouldn't possibly be able to recieve my wifi signal anyway), and then open the door 20 sec later or something similar.:-)

In my head, all this requires apart from the rPi itself, is 2 relays and a bunch of programming
(one relay to power the lights; and one for the garage-door). - a SIMPLE script on the rpi; but alas heavily programming on the smartphone.

I will not have time to even start looking at this until february, but from feb - april I will have quite a bit of time on my hands, so I think this project might actually happen :-)
Posts: 2
Joined: Fri Aug 03, 2012 6:17 pm
by Nosveemos2 » Mon Mar 04, 2013 9:44 am
I write just to make sure those interested in this thread aware that IOS has an APP called mydooropener and there's a web site with very detailed instructions to walk one thru the assembly of an audrino and put it on the circuit. I've been using it remotely with some rental properties and it works great, but for confidence one needs a video trained on the garage door.

THAT SAID, I'm in much worse shape than the poster, in terms of know how, imagination etc. HOWEVER: I have a wish: to combine the RPI with the coming video camera AND have it implement the instructions to some device or direct to the circuit via(?) (the audrino?) I would have no problem with that solution although the Audrino costs more than the RPI with the 2nd board that has to be added. AND BELIEVE me one needs the video for assured operation.

Now that I've said what I want and that I'm stupid, how can I help AND how can I be helped? Can anyone provide a means for one to get the RPI up and running with control to the garage door circuit? Do I ask too much?
Posts: 1
Joined: Fri Aug 10, 2012 12:43 am
by sonicj » Thu Mar 07, 2013 4:07 am
Nosveemos2 wrote:I write just to make sure those interested in this thread aware that IOS has an APP called mydooropener and there's a web site with very detailed instructions to walk one thru the assembly of an audrino and put it on the circuit. I've been using it remotely with some rental properties and it works great, but for confidence one needs a video trained on the garage door.

THAT SAID, I'm in much worse shape than the poster, in terms of know how, imagination etc. HOWEVER: I have a wish: to combine the RPI with the coming video camera AND have it implement the instructions to some device or direct to the circuit via(?) (the audrino?) I would have no problem with that solution although the Audrino costs more than the RPI with the 2nd board that has to be added. AND BELIEVE me one needs the video for assured operation.

Now that I've said what I want and that I'm stupid, how can I help AND how can I be helped? Can anyone provide a means for one to get the RPI up and running with control to the garage door circuit? Do I ask too much?


I would assume you have unused pins left on your Arduino, correct? If so, you could connect limit switches to a couple of the unused digital i/o's to be used for state detection. ie:
Code: Select all
  if (doorclosedSwitch == HIGH) {
      Serial.println("Door Closed");
  else {
   Serial.println("Door Open");
  }

Additional switches add redundancy. Just because you can't physically "see" the door doesn't mean you can't be 99.99% sure that its closed when it says it is. ;)
Posts: 2
Joined: Fri Nov 30, 2012 11:03 pm
by Go3Team » Sat Mar 09, 2013 10:41 pm
Nosveemos2 wrote:I write just to make sure those interested in this thread aware that IOS has an APP called mydooropener and there's a web site with very detailed instructions to walk one thru the assembly of an audrino and put it on the circuit. I've been using it remotely with some rental properties and it works great, but for confidence one needs a video trained on the garage door.

THAT SAID, I'm in much worse shape than the poster, in terms of know how, imagination etc. HOWEVER: I have a wish: to combine the RPI with the coming video camera AND have it implement the instructions to some device or direct to the circuit via(?) (the audrino?) I would have no problem with that solution although the Audrino costs more than the RPI with the 2nd board that has to be added. AND BELIEVE me one needs the video for assured operation.

Now that I've said what I want and that I'm stupid, how can I help AND how can I be helped? Can anyone provide a means for one to get the RPI up and running with control to the garage door circuit? Do I ask too much?


I just finished setting up my garage door opener with a Pi. I also use a camera to verify open / closed status. See my video:

http://www.youtube.com/watch?v=bI1tSBN6r4s
Posts: 4
Joined: Sat Mar 09, 2013 9:50 pm