I HATE carrying a garage door remote. They're bulky, and I always have to remember to bring them inside, lest someone break into my car and gain entry to the garage. I've planned on creating a secure IOT solution that I could control with my phone for some time now, and the Azure Sphere platform made that a reality.
In just a few evenings of tinkering, I was able to control a relay board to actuate the garage opener, as well as read the door status via magnetic reed switch sensors. Azure IOT Hub made it easy to connect the Azure Sphere development board to the internet, allowing me to control it via a simple Xamarin application running on my Android phone.
Typically, you can connect a relay directly to the switch inputs on a garage door opener to control it directly. However, newer garage door openers like mine use encrypted wireless communication protocols, even for the wall mounted switches.
To account for this, I disassembled an existing remote and soldered a few twisted pair wires to piggy-back off of the physical switches and connected those to the relay board. As this still requires a battery for the remote, in the future I will probably modify the remote to be powered from the 5v supply coming into the Azure sphere module.
In order to sense the current status of the garage doors, I added a recessed magnetic reed switch (common to home security applications) to each, and fabricated some mounting brackets out of 1/8" steel plate (probably overkill for the application, but it's what I had on hand).
The door control relays are connected to GPIO0 and GPIO1 as output, and the sensors are connected to GPIO16 and GPIO17 as input.
I wrote a simple Xamarin application to run on my Android phone that uses the Microsoft Azure Device libraries to connect to an Azure IOT Hub instance. It uses Direct Methods to tell the Azure Sphere board to trigger the relays controlling the doors, and periodically queries the Device Twin to get the current open/close state of the doors. The code for both the app and the Azure Sphere module are located in the GitHub linked in the Code section below.
To finish it off, I used my 3D printer to print a mounting plate to secure the whole setup to the wall in my garage. The STL is linked below (I did my best with the hole sizes, but I ended up having to drill and tap the holes to avoid splitting).
The story editor wouldn't allow me to embed a video from Google Photos, so here is a link to a video of the opener in action.
Comments