Garage Door Controller Gets The IoT Treatment

[TheStaticTurtle] built a custom controller for automating his garage doors. He wanted to retain the original physical button and RF remote control interfaces while adding a more modern wireless control accessible from his internet connected devices. Upgrading an old system is often a convoluted process of trial and error, and he had to discard a couple of prototype versions which didn’t pan out as planned. But luckily, the third time was the charm.

The original door-closer logic was pretty straightforward. Press a button and the door moves. If it’s not going in the desired direction, press the button once again to stop the motor, and then press it a third time to reverse direction. With help from the user manual diagrams and a bit of reverse-engineering, he was able to get a handle on how to plan out his add-on controller to interface with the old system.

There are many micro-controller options available these days when you want to add IoT to a project, but [TheStaticTurtle] decided to use the old faithful ESP8266 as the brains of his new controller. For his add-on board to work, he needed to detect the direction in which the motor was turning, and detect the limit switches when the door reached end of travel in either direction. Finally, he needed a relay contact in parallel with the activation button to send commands remotely.

To sense if the motor was moving in the “open” or “close” direction, he used a pair of back-to-back opto-couplers in parallel with the motor terminals. He connected another pair of opto-couplers across the two end-limit switches which indicated when the door was fully open or closed, and shut off the motor supply. Finally, a GPIO from the ESP8266 actuates a relay to send the door open and close commands. The boards were designed in EasyEDA and with a quick turnaround from China, he was able to assemble, test and debug his boards pretty quickly.

The code was written using the Arduino IDE and connects the ESP8266 to the MQTT server running on his home automation computer. The end result is a nice dashboard with three icons for open, close and stop, accessible from all the devices connected to his home network. A 3D printed enclosure attaches outside the original control box to keep things tidy. Using hot melt glue as light pipes for the status LED’s is a pretty nifty hack. If you are interested in taking a deeper look at the project, [TheStaticTurtle] has posted all resources on his Github repository.

23 thoughts on “Garage Door Controller Gets The IoT Treatment

  1. Nice if… you have reliable 24×7 internet, your garage is reasonably close to your router or you’re okay adding mesh, you don’t already have too many IOT devices on your LAN, your router and LAN are locked-down.

  2. Super cool. If you just want to bodge a modernized option together you can get away with some sonoff switches and their 433mhz to wifi bridge (doesn’t do rolling codes though). Managed to get our 3phase roller door on the web that way. Makes getting into work in the morning way easier. Throw in some home assistant magic and things tie together nicely.

    1. Whaaaat? MyQ? You are joking, right?

      Probably 80% of the people making garage IOT were “inspired” by the *revolting* MyQ experience. You can’t be a regular HaD reader.

      1. I have a MyQ as it may not be the best it was easy to implement. Cost was minimal. I am a regular Hackaday reader and a full time Embedded Systems Designer. Sometimes it is easier to just purchase an off the shelf version than reinvent the wheel.

  3. Not sure how much he has wrapped up in this, but almost all new openers come with WiFi built in, and the Lift Master MyQ app even syncs with Amazon for secure package delivery in your garage. The real problem with IOT, and I did try it for several years, is that, unless you can code, it’s not user friendly. Almost anything you want to control these days can now be purchased, and easily integrated with Ring, Alexa, Siri, or other reliable mainstream manufacturer.

    1. I have one of those MYQ devices, I wrote code to make it work with my custom automation setup. They don’t publish the API, you have to use wireshark to figure out the protocol. My setup worked for a while then they changed something and now i needed to reverse engineer it all over again. The MYQ is not home automation friendly. I ended up recycling it and creating something similar to the post above which allows control over MQTT. Building my own ended up costing less then the MYQ device, and works 10x better.

  4. I’d love to do this to my garage door, problem is all modern openers are wireless! Those 2 wires that where supposed to be bridged to open the door, now are used to power the wireless opener… Linus tech tips did a video about this problem and is a worth while watch.

    1. I have a new opener and even though those wires are used for power if you short them together the door will still open/close. I have a Lift Master opener (new jackshaft type).

  5. I see you use optocouplers for determining the direction of the motor. Are you able to detect a motor stall with that? As in, if it attempts to close on a child’s leg, undetected by the optical sensor, will it still reverse like a stock controller would, or will that child be trapped until the motor burns out or someone manually intervenes?
    I love home-grown solutions like this, but am wary of reinvented products that may not be aware of the hard-earned lessons that guide the complexity of a commercial solution. Part of that is industry’s fault in making existing standards difficult or costly to obtain and impossible to understand.

    1. The solution to this is not more product development, but more parenting. Teach your kids the dangers of heavy moving objects like garage doors and not to play with them.

  6. OK, I’m a LITTLE unclear here… Why is direction sensing needed at all?

    The existing momentary contact switch still works? Putting an additional switch in parallel is simple enough.

    My garage door opener (and it’s at least 10 years old) has optical obstruction sensors across the doorway built in… I think it’s been a requirement for some time now, but I could be wrong.

    It also does the open/stop/go-the-way thing all by itself when I push that momentary contact button.

    I added a magnetic reed switch attached to the bottom of the garage door. The switch is a common thing you see screwed to concrete floors in auto motive garages as a part of the alarm system… When the door isn’t closed the switch is an either open or closed state depending on how you wired it, because the magnet isn’t engaging the switch.

    This sort of feels like the elevator that only goes to two floors and has a button for each; It only needs one… “Other floor”

    1. “Other floor” — that’s one button too many! It just needs a weight sensor and a 555 timer.

      But seriously, “open” and “close” are redundant relative to “toggle”, but when you’ve just driven a mile from home and can’t remember if you closed the garage door, you’ll be stoked for the “close” button.

      It’s a conceptually simpler system, and the command is failsafe. For the price of an extra button, you gain idempotence.

      Of course, he’s hooked in the limit switches too, so you’re actually right — in my example, you’d just check the closed switch state.

      But what do you do when no switches are closed? Do you prevent unintentional double-clicking at the price of not being able to reverse the door when it’s in motion? Etc. Getting rid of the state dependence makes things simpler, at the cost of an extra button.

      (In the end, this is a philosophical/taste difference. Both systems work, but I like extra buttons. Our garage is “push to open” only, and closes after 30 seconds or whatever… that works too.)

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.