Garage Door Hacking

Warning! Mains Voltage! This article in no way implies any endorsement of the following methods. Safety and fitness is not guaranteed or even suggested. I do not claim or imply that these instructions are in conformance with electrical or building codes of any jurisdiction.

Between a neighbor of mine and Vivint soliciting with a demo service, I have officially contracted the home automation bug. And somehow I got it in my mind that a garage door opener and sensor was the most important first step.

Well, not quite, I first needed a “system”, or software services that do things with and to the smart things. I tried OpenHab and HomeAssistant, and decided to go with the latter. But in the meantime I had already begun plotting and scheming for the garage door. Starting with checking out the opener itself.

Before opening the case of the opener, I unplugged it. Again, we’re talking about mains voltages here. I identified several components that might be useful, power supplies, rectifiers, where the mains are, etc. But the most important piece was the endstops! I didn’t take a picture of mine, so here’s a stock photo. The two screws on either side are what you adjust from the outside of the opener, to set the travel limits. Note again that the inside of the case contains MAINS VOLTAGES. The case is not intended to be opened, and the mains circuitry and wires are not protected once inside the case. It is not recommended to add stuff like this!

I could not find a very obvious and accessible source of 5V power rail, so I set out on a circuit that would be powered entirely by the new interface. I probed and prodded, and determined that the center contact (black in this photo) was a direct ground connection (vss or common) and the red and blue each have a 10kOhm resistance to +5V, or a pullup. See Figure 1. What this means is that the blue or red wire is HIGH (+5V) unless the travel has reached that limit and the center contact is touching it and then it is driven LOW. I decided to use standard switch transistors to “read out” these levels for my own selfish purposes, at first NPN transistors as diagrammed in Figure 2. When I finally got my circuit connected up for testing, I quickly found that the gate current was sufficient to pull the blue and red wires LOW, which the garage opener machine definitely noticed. It refused to go anywhere. So a quick mod to the design and a few transistors later, I had instead PNP transistors as diagrammed in Figure 3. This of course inverts the logic which was actually better for the LEDs. This configuration now worked without side effects on the machine. Yes!

As you can see I planned to use some CAT5/5e/6 cable to run my signals, which I soon had connected up to my LittleWire. At the time I only had a single PNP transistor so I could only detect one endstop on the LittleWire, but that one was working! Alas, when I drove the command pin HIGH on the LittleWire, the garage opener would respond, but the LittleWire or the USB bus would then immediately reset, which was not super useful. My theory now is that the capacitance in the cable was drawing too much current from the LittleWire, which hit me when I was reading an excellent tl;dr on protecting Raspberry PI pins (“Don’t drive capacitive loads!” Do’h). And yes, I migrated to a Raspi for the final piece of the project.

This is getting long, and the above was, IMO, the more interesting aspects of the project. On the raspi I used pi-mqtt-gpio from github to bridge the signals into HomeAssistant, another breadboard for buffering the raspi gpio (including a current resistor to the cable for sending the close signal), and an awesome idea to zip tie the raspi to cardboard for mounting.  Here’s the rest of the pictures to wrap it up!

Breadboard Friendly Dual OneWire, Easy

I’ve decided to start blogging about the random, small, and probably insignificant ideas and timesavers I come up with.

So for this one, a while ago I had put some temp probes into an IDC connector. Seems simple enough, and I just plugged jumper wires into the IDC socket and then a breadboard.

I went to use them again this week and I thought,

Interleaved

well if I could just put a 2×3 header in here and straight into the breadboard… they would just need to be interleaved. I’d have probably made a 4x temp probe connector if I had any 2×6 IDC, but 2×5 is all I have right now.

 

So I undid the IDC and rearranged the leads (be very gentle undoing an IDC connector, or have a spare handy, or both really).

Gently press pins to center

Then you just need a standard piece of 2×3 breakaway header. Use some pliers to grip the long end of a pin and the header body. One by one, gently slide the pins so they’re centered on the header body.

Fantastic! To the arduino to measure a temperature differential between a heated chamber and ambient.

And here’s all the pics.