User avatar
DeckerEgo
Posts: 19
Joined: Sun Oct 27, 2013 2:08 pm
Contact: Website

Completely Wireless Garage Door Opener / Security Cam

Tue Nov 05, 2013 11:02 pm

First off, I had no idea this many people habitually worried about the state of their garage doors. I don't know how people manage without an amateur knowledge of electronics, programming and Linux administration. They must turn around a billion times before driving to the airport.

I wanted to better understand GPIO development while feeding my neurosis, so I decided to pair a Raspberry Pi with a Chamberlain universal garage door opener. The goal was to keep component count and cost low, remove any need for root access and re-use stuff I had laying around.

Instead of using relays on a wired installation, I was able to simulate a button press on the remote using a MOSFET. After tearing off the outer casing, I pried off the button and re-soldered on some pins of my own. A MOSFET and a pull-down resistor bridged the former button's circuit when the gate received a high voltage from a GPIO pin.

Image Image

After the remote was wired up, I found a cheap webcam and installed http://www.lavrsen.dk/foswiki/bin/view/Motion for the security feed and motion detection. Motion has been a fantastic project to work with. The motion capture parameters are very tweakable, which helps avoid false positives for alerts and reduce storage needed for footage. The HP HD-3110 webcam I used worked out-of-the box with the Pi, so no hardware issues to speak of.

Before I wrote a webapp to control the remote, I wanted to ensure the Apache configs were tightened up and there was no need for root permissions or access to /dev/mem. Using Gordon Henderson's WiringPi GPIO utility, I was able to provision the GPIO pins for userspace access and grant www-data access to write values. This allowed me to construct a quick REST endpoint using Bottle and allow a JavaScript client to send commands to the garage door remote (see https://github.com/deckerego/GarageSecurity).

Once the distro was tightened up, the webapp was written and the remote was wired up I took an old WD My Book and use the shell as an enclosure for the whole thing. Any metal backplates had to be removed otherwise the wireless signal completely died; but otherwise some double-sided tape made everything a great fit.

Image Image

So far the entire thing works well - security cam lets me know the state of the garage, and the GPIO pins let me trigger the garage door to open/close, all without wiring anything into the opener itself. Total build cost is around $108 and 12 hours of work, but by re-using stuff I had around the actual hardware cost was closer to $70.

A more detailed write-up is available at http://deckerego.blogspot.com/search/la ... age%20door

PiBoi
Posts: 13
Joined: Sun Oct 20, 2013 11:53 pm

Re: Completely Wireless Garage Door Opener / Security Cam

Sat Nov 09, 2013 10:11 am

Nice, have you thought about adding reed switches to indicate the door position. You could then use the door position for emailing door status
I'm presuming motion doesn't know what the door is actually doing, only that it's moving. Using reed switches you could get notification the door is open, closed, opening or closing. But that would change your wireless installation to wired, having to run cable to the reed switch locations

Does the same power supply power the RPI, web cam and garage door remote?

User avatar
DeckerEgo
Posts: 19
Joined: Sun Oct 27, 2013 2:08 pm
Contact: Website

Re: Completely Wireless Garage Door Opener / Security Cam

Sat Nov 09, 2013 7:44 pm

PiBoi wrote:Nice, have you thought about adding reed switches to indicate the door position.
<snip/>
Does the same power supply power the RPI, web cam and garage door remote?
I have thought about adding reed switches... it would be a simple I/O task and would let you definitively know what the current state of the door is without having to look. However you're exactly right - it would require additional wiring. I was also thinking about using light sensing to indicate state... you could have a reflector at the top of the door that would be easy to note when doing image parsing via Motion, and of course that reflector won't be visible if the door is even slightly raised. Currently the external commands within Motion have been more than sufficient, so I haven't been tempted to try the switch or the reflector yet, but it's definitely on my mind.

The single, microUSB 5V power supply does power both the Pi and the webcam. The remote is powered by a 2V lithium coin cell, so it could easy be powered from a 2.2V GPIO pin as well. That is on my list of things to experiment with... I'd like to see if I could use the single GPIO pin to both power the remote as well as signal the MOSFET. In theory it should work... in fact you could possibly even just use a jumper to permanently connect the "button" pins, and then activating the remote would just be sending it power.

PiBoi
Posts: 13
Joined: Sun Oct 20, 2013 11:53 pm

Re: Completely Wireless Garage Door Opener / Security Cam

Sun Nov 10, 2013 11:27 am

The light senor idea sounds good, but I guess you'd need to somehow sense both closed and open
I haven't used motion but If motion could determine if the garage door is open or closed your problems would be over ?
Which I suppose would be more difficult with the possibility of vehicles, other objects etc. either being in the garage or not

Nice idea powering the garage door remote from the rpi, can the gpio handle the current?

I suppose the only thing that's missing is IR so you can check on the garage door at night.... and some sort of plan for world domination :D

User avatar
DeckerEgo
Posts: 19
Joined: Sun Oct 27, 2013 2:08 pm
Contact: Website

Re: Completely Wireless Garage Door Opener / Security Cam

Sun Nov 10, 2013 7:20 pm

PiBoi wrote:I haven't used motion but If motion could determine if the garage door is open or closed your problems would be over ?
Nice idea powering the garage door remote from the rpi, can the gpio handle the current?
I suppose the only thing that's missing is IR so you can check on the garage door at night
Motion should be able to detect state... actually, it can detect motion events, and then pipe the resulting images out to an external application, which in turn can determine door state. Motion has the concept of monitoring specific regions, then piping the frames of motion out to an external program. If that external program could determine door state (which might be possible from a reflector or decal being missing or present), then you could determine door state. Of course, you would have to be able to "see" the reflector in the dark, which brings up your NoIR camera point...

I am interested in using a NoIR camera... the current webcam was kinda a cheap way to get moving. Next up would be developing an IR LED ring that would illuminate when the exterior is dark. Should be pretty straightforward with GPIO pins and a photoresistor.

I believe that the Pi should be able to handle the current draw from the remote, but I need to test that more carefully. As of right now I'm living off the coin cell, and I don't need to steal the coin cell for anything else at the moment ;)

PiBoi
Posts: 13
Joined: Sun Oct 20, 2013 11:53 pm

Re: Completely Wireless Garage Door Opener / Security Cam

Mon Nov 11, 2013 3:07 pm

Motion decal/reflector, IR sounds promising
I suppose you might be able to expand it a bit more and use opencv facial recognition to open the door. Integrate TTS for a sort of a DIY hal 9000
rather like the magic mirror http://www.raspberrypi.org/archives/4207, or voicecommand http://stevenhickson.blogspot.com/2013/ ... results=16

Although it might soon get a bit tiresome arguing with the pi to open the garage door !

living on the edge with the button battery ...love it :D

User avatar
DeckerEgo
Posts: 19
Joined: Sun Oct 27, 2013 2:08 pm
Contact: Website

Re: Completely Wireless Garage Door Opener / Security Cam

Tue Dec 30, 2014 3:24 am

Now posted to HackADay at http://hackaday.io/project/2049-garage-security. I've modified the project to include a heads-up UI, alerts silencing and temperature/humidity readouts.

Return to “Automation, sensing and robotics”