Tell us about yourself!

Complete Your Profile
  • tulsa_jerm commented on quartarian's instructable Raspberry Pi Garage Door Opener1 year ago
    Raspberry Pi Garage Door Opener

    Your best bet is finding two terminals at the opener that are for a normal open button. There's no telling what they are sending down the wires to any kind of fancy wall button control module- it could even be some kind of data and not a simple open/short operation. If your model just doesn't have any other easy way to attach a normal button, your next best option (and this is a tricky one) is to figure out on the inside of the opener which relay is flipping to cause the motor to go. The rest of it (open vs close, stop when you hit the top or bottom) should be mechanically controlled-- between the fancy controller parts and the mechanical up/down/stop/start parts should be a single relay (maybe two) that kick off the open or close procedure. If you can find those (look for relays, measu...

    see more »

    Your best bet is finding two terminals at the opener that are for a normal open button. There's no telling what they are sending down the wires to any kind of fancy wall button control module- it could even be some kind of data and not a simple open/short operation. If your model just doesn't have any other easy way to attach a normal button, your next best option (and this is a tricky one) is to figure out on the inside of the opener which relay is flipping to cause the motor to go. The rest of it (open vs close, stop when you hit the top or bottom) should be mechanically controlled-- between the fancy controller parts and the mechanical up/down/stop/start parts should be a single relay (maybe two) that kick off the open or close procedure. If you can find those (look for relays, measure their input voltage when the system is doing different things) and if you can control power to those externally (note that they likely are 120v coils so please don't kill yourself) then you can control the up/down. This will void your warranty. Don't operate appliances of any kind with covers removed. 120 volts is enough to kill you if it hits you the right way. And remember kids, have fun!!

    Here's the thing about GPIO ports on a pi, or an arduino, or just about anything that has a GPIO port. They [typically always] start up as INPUT, not OUTPUT, which means they are waiting for you to ask if they are "high" or "low" (3 volts or 0 volts, or 5 volts or 0 volts usually, this depends on what system. High and low can mean a lot of different things here, but low is almost always zero volts referenced to the other voltage.) Let's say that for the purposes of explanation our system uses +3 to mean high and 0 volts to mean low. Since the pins are just sitting there waiting for you to ask if it's high or low, they don't have 0 volts on them and they don't have +3 volts on them either, they are what we call "floating". Now sometimes, it will be closer to...

    see more »

    Here's the thing about GPIO ports on a pi, or an arduino, or just about anything that has a GPIO port. They [typically always] start up as INPUT, not OUTPUT, which means they are waiting for you to ask if they are "high" or "low" (3 volts or 0 volts, or 5 volts or 0 volts usually, this depends on what system. High and low can mean a lot of different things here, but low is almost always zero volts referenced to the other voltage.) Let's say that for the purposes of explanation our system uses +3 to mean high and 0 volts to mean low. Since the pins are just sitting there waiting for you to ask if it's high or low, they don't have 0 volts on them and they don't have +3 volts on them either, they are what we call "floating". Now sometimes, it will be closer to high and sometimes it will be closer to low, but there are a lot of variables that can affect this (like static in the air even!) so if your relay knows to turn itself "on" when it sees 0 volts (low) and "off" when it sees +3 volts (high) and your pin is "somewhere between 0 and +3" then it might be close enough to one end to turn it on or close enough to the other end to turn it off. So it doesn't matter if you use the NC or the NO, even if you reverse the logic in the software to make one way on and the other way off, you're still going to have this "I'm not in an output mode yet so I'm somewhere between high and low" problem and you're not really going to know for sure if the relay is going to be on or off. For our purposes though, we really should have it set up so that the relay is off *most* of the time, and just clicks on to "press the button" as it were.The way we fix this, in electronics terms, is to "pull it down" or "pull it up" with a resistor. That's the fancy term, usually a "pull-up resistor". It sounds complicated, but the reality is, you just connect the pin over to 0 or to +3 with a resistor. Just about any resistor will do. The resistor will drag that pin "high" or "low" (depending on if you connected the other end to high (+3) or low(0) when the pin would otherwise be in a floating mode. A lot of relays have a pull-up resistor built in, a lot of systems with GPIO pins have a way to "turn on" a pull-up resistor built into the hardware so that you don't even have to physically wire one in. But what about if the resistor is pulling your output pin to +3 and you need it to go to 0? That's easy, when you "write" to the pin and tell it to go to 0, that 0 has a resistance that is much much less (like, about 0 ohms) than whatever resistor you've put in so your resistor basically does nothing. It's like you trying to whisper to someone at a rock concert. (your whisper is the pull up resistor and the concert is the near zero-resistance connection that the system made when you said to go LOW.) Then when you write to the pin and tell it to go to +3 that resistance is also much much less than whatever resistor you've put in so it ignores the resistor then too. So the only time your pull up resistor does anything really is when the pin is in a state where it isn't high and it isn't low (remember, when it's "floating?") so that resistor prevents the float.In the author's case, it seems like most of the time (enough of the time) his float is in a certain direction so he's just counting on that to not change. But you really need a pull-up (or down) resistor (or a way to enable one built into the pi?) to make for sure you know if that pin is high (+3) or low (0). On another note- if you're going to try this, you really need some basic security on the web server running on the pi. I guess if your home wifi is secured with something real (not WEP!) then that's a good start but you're basically giving access to your garage door to anyone with your home wifi password. Or anyone who plugs into your home wifi... which would probably be someone inside your house already... but this really should have an extra layer of security. I'm not a pi wiz or an apache wiz but since we're talking ethernet and mac addresses there's probably a not-too-complicated way to tell the pi not to talk to anyone except your known devices, by mac address. (mac addresses can be spoofed, but that takes more work than anyone who wants access to your garage is going to do unless you're keeping gold bars in there?)If the pi uses 5 volts on it's GPIO (but I think it is 3) then change every +3 above to +5! :)

    I think, but don't quote me, if you used Pi GPIO pin 5 (wiring pin 9) instead of GPIO pin 7 (wiring pin 7) you wouldn't ever have the issue at all, because that pin has a fixed 1.8 KOhm pull up resistor on board.

    This system needs a pull up resistor between the output pin(s) and pin 1 on the pi (3v3) to pull that pin high when the pi is starting up. That will fix the problem. Your step 6 will probably work about half the time. (if it works every time for you, there's someone else in the world that will find it works none of the times.)

    View Instructable »