Sunday, September 29, 2013

Garage Door Part 1 - Open Door (GPIO Output)

Project Garage Door

My vision for our Garage Door is to have an automated way to open and close it from both a web interface and a proximity sensor.

It has taken me a couple of weeks to finally get everything working, but I finally have my garage door automated, with the help of the Raspberry Pi.  I will break out each of the steps it took into a different article: Open Door (GPIO Output), Monitor Door (GPIO Input), Web Interface, Vocal Notification, Proximity Sensor.

First step was to get the garage door to open.  I started with trying to determine how I could get the Raspberry Pi to trigger the garage door to open/close.  After inspecting the wired garage door button, I found a simple solution to trigger the garage door.
Garage door button
The garage door button has two wires that run all the way to the garage door motor.  I found that by simply jumping the two terminals (circled in red below) this would trigger the garage door.  (FYI: The right two terminals are used for the safety closing door sensor, which makes the center terminal a common terminal).  This made the solution fairly easily, as I would simply need to electronic switch to close the circuit, which I had already posted a working solution for in my Driving a Relay using GPIO and Automated Sprinkler System First Look (Relay Module) articles.
Garage door motor
I could have run wires all the way from the Raspberry Pi to the garage door motor, but as the garage door button was much closer, I instead ran a set of wires (20 gauge door bell wire I picked up from Home Depot for cheap) to the back of the garage door button and connected them to the screw terminals I found there (Note: these new wires can be seen as the red/white combo in the garage door button picture above).

I then connected the Raspberry Pi, with attached Wifi dongle, to a breadboard and wired up a relay (relay-diode-transistor-resistor) as described in Driving a Relay using GPIO).  A pre-built Relay Module would have been easier, but I did not have an extra one on hand at the moment.  I then placed the Raspberry Pi and breadboard into a plastic container, to keep the dust off (which I cut holes for venting).




Raspberry Pi in plastic container to protect from dust

To trigger the electronic relay switch, which will in turn close the garage door button loop, I use the following Python code.


trigger_door.py:
#!/usr/bin/env python

import RPi.GPIO as GPIO
import time

GPIO_PIN = 25

GPIO.setmode(GPIO.BCM)
GPIO.setup(GPIO_PIN, GPIO.OUT)

try:
    print "Trigger Garage Door"
    GPIO.output(GPIO_PIN, GPIO.HIGH)
    time.sleep(.5)
finally:
    print "Cleaning up..."
    GPIO.cleanup()

You may have noticed that the code makes no mention of if it will be opening or closing the door.  That is because at this point, there is no way for the code to determine the current state of the garage door.

Stay tuned, in the next article, for solution to detect the state of the garage door: Garage Door Part 2 - Monitor Door (GPIO Input)



8 comments:

  1. That's really incredible! You have done so well with your garage door! What garage door parts or operator parts have you used? I would like to buy those from AODretail because they have the best service providing accessories I ever had!

    ReplyDelete
  2. You can just tell that patching is essential if the entryways don't open without issues. A firm sound might be Clarks Garage Door & Gate Repair Reseda

    ReplyDelete
  3. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon. garage door opener repair Thousand Oaks

    ReplyDelete
  4. Superb incredible going, I cherish your work and look forward for more work from your side. I am a customary guest of this site and at this point have recommended numerous individuals. Garage Door Repair & Installation Services in Los Angeles

    ReplyDelete
  5. Hey, I discover perusing this article a delight.
    door repair toronto fast

    ReplyDelete
  6. I thought haven’t read such distinctive material anywhere else on-line. garage door repair

    San Francisco Garage Doors
    444 22nd Avenue
    San Francisco, CA 94121
    (415) 223-7600

    ReplyDelete
  7. Many incidences have already been reported concerning accidents consequently of repairs done by unskilled workers. There are even reported deaths, making garage door spring alternative to be highly suggested for skilled personnel in order to prevent such incidents. garage door services

    ReplyDelete
  8. During the repair, ensure that you check for loose hardware, and tighten them as required. For garage gate terme conseillé which have swing-up system, check the plates where the spring is mounted to ensure that the screws are tight. los angeles garage door repair

    ReplyDelete

Please be respectful.