Build | Fix | Re-use

Raspberry Pi Garage Door Controller

Check out this awesome project by hipfan75 over at imgur. Tired of forgetting to close the garage doors at night he decided to build this rather ingenuous Raspberry powered garage door controller.


Raspberry Pi Breakout Board with STM32F030 Arm Microcontroller

One of the breakout boards, partially completed. More details here:


Garage Door Sensors

Standard RJ-45 jack and cable strung between the garage door and the Pi. (Approximately 25 feet).


Garage Door Sensor Detail

Standard magnetic door/window switch, with the magnet creatively mounted to the door. I have since found neodymium magnets with countersunk holes on E-Bay.


Original Garage Door Switch

Tapped into the original switches, maintaining their ability to work as before. Ran about 15 feet of 18/5 (solid, “thermostat wire”) to the Pi. It was the (available) wire most closely matching the 20 gauge (solid) wire of the original switches. I probably could have gotten away with thinner/cheaper wire, but given the choices available at the time of purchase, the 18/5 was the best value.


Control Center Overview

Lots of room for adding more stuff.


Power and Garage Door Sensor Input

5V/2A supply for the Pi, and the included 5V wall wart for the Ethernet-to-Wifi Bridge. At some point, I may consolidate them. Also shown is the RJ-45 jack leading to the garage door sensors.


The Raspberry Pi with Breakout Board and Ethernet-to-WiFi Bridge

I got tired of fighting with lag and dropped connections using various USB-to-Wifi interfaces, so I replaced them with a (Netgear) Ethernet-to-WiFi Bridge I had laying around.


Raspberry Pi Close Up

Right now, all of the sensors and actuators are connected to Raspberry Pi GPIOs. At some point I may move them to the STM32. I have disabled I2C on the PI and use the SDA/SCL pins as GPIO, reusing the external pull-up resistors on those lines for my sensor pullups. (Sensors are active-low) GPIO 17, 27, 22, 23 (outputs) are used for the light and door toggles for the two garage doors.


Breakout Board Close Up


Relay Boards 1

Upper relay module toggles the doors. Lower relay module toggles the lights on the garage door opener. After initially setting the system up with door sensor and toggle only, I learned that you can toggle the lights on the Garage Door opener by shorting the switch wires via a 1uF capacitor. Obviously, I used what I had on hand (those are 0805’s). I also read that if you use a 100uF capacitor instead, you can toggle “Lock Mode” which prevents the doors from being opened by any (standard, RF) remote.


Relay Boards 2


The Web Cam

Added a Web Cam on an adjustable arm for garage door status verification


The Web Dashboard

Used mjpeg-streamer for the webcam images. Buttons and status use an XMLHttpRequest to Apache/PHP then calls a back-end server I wrote in C++ (via TCP) . Server uses epoll() on the sysfs files for the sensor input GPIOs to detect interrupts. cron job checks the door status every half-hour after 10pm and sends an email if either is open (with a link to this web page) Only available on my local network and via VPN (not directly exposed to the internet)


Leave a Reply