There seem to be many related questions, but I can't quite find the answer I'm looking for. I've got a garage door opener switch. There's 16V across the wires, and when you short them, the garage door opens. I used my multimeter to short the wires in ammeter mode, and it read about 20mA.

I tried hooking the wires from the garage door directly to the transistor of the 4N25 optocoupler, and when that didn't work, I tried using the circuit from this answer: How to drive a MOSFET with an optocoupler?. The result is in the schematic below. JP1 goes to the two wires coming from the opener, and the XBEE is a small radio and microcontroller that runs on 3.3v. You can ignore JP2, that's a different sensor and it's working fine.

I tested the circuit with an LED, hooking up a 9V battery, and LED, and an appropriate resistor to the other side of JP1. It works (with either just the 4n25 or the circuit below with the MOSFET). How do I go about debugging the circuit, or is there something obvious I'm doing wrong?


  • 1
    \$\begingroup\$ Doesn't "It works" means it works? If it doesn't work then nobody I know on stack exchange is a mind-reader with the capability of understanding what is wrong i.e. what the symptoms are. \$\endgroup\$ – Andy aka Mar 30 '14 at 20:23
  • \$\begingroup\$ Your post reminded me of this arduino solution lowpowerlab.com/garagemote there are schematics and additional info in the forum which may address a similar challenge. Good luck. \$\endgroup\$ – Stan Smith Mar 30 '14 at 20:35
  • \$\begingroup\$ Is the voltage on the garage door opener control circuit AC or DC? \$\endgroup\$ – Dave Tweed Mar 30 '14 at 20:37
  • \$\begingroup\$ @Andyaka the LED works, the garage doesn't. To clarify: I want to control the garage door, but it doesn't work. To test out the circuit to see if it was working, I hooked up the battery and LED on the theory that if the LED blinked, the garage door would open as well. That turned out not to be the case. \$\endgroup\$ – Emoses Mar 31 '14 at 0:45
  • \$\begingroup\$ @DaveTweed It's DC \$\endgroup\$ – Emoses Mar 31 '14 at 0:46

The way it's hooked up now it looks like at best the gate of the FET will be at half the drain voltage. If there's enough voltage on the drain it might get into a linear region where there's some drain current flowing, but it's not going to fully enhance the FET. You really want to hook the side of R2 that's attached to the drain to an independent supply voltage that can give you enough Vgs to turn the FET on fully. (For example to the + side of the 9V battery, not the drain of the FET.)

  • \$\begingroup\$ Good point, but that doesn't explain why the bare 4N25 didn't work. \$\endgroup\$ – Dave Tweed Mar 31 '14 at 0:10
  • \$\begingroup\$ @DaveTweed Also a good point. Presumably we're not talking about large amounts of current, so it should have worked. I guess though depending on what's on the other side of JP1 there might not have been sufficient CTR or drive on the 4N25 to pull the load to ground. Hard to tell with insufficient information. \$\endgroup\$ – John D Mar 31 '14 at 0:33
  • \$\begingroup\$ My EE knowledge is minimal, so please correct me if I'm wrong, but I thought that this FET only needed logic-level voltages at the gate in order to turn on fully. In case it's not clear on the schematic, it's an FQP 30N06L. \$\endgroup\$ – Emoses Mar 31 '14 at 0:52
  • \$\begingroup\$ @Emoses Well, it may be a logic level FET, but if you want the FET to be on, the drain will be at ground, or close to the source voltage right? So your gate will be at the drain voltage/2 due to your voltage divider. How many volts does that give you on the gate? Of course the drain will never get near the source because you will start to starve the gate voltage as the drain voltage drops. \$\endgroup\$ – John D Mar 31 '14 at 2:29
  • \$\begingroup\$ @johnD I think I understand. I put R2 in because I was copying the schematic in the linked question, where he needed to reduce the gate voltage for the FET he was using. But I don't need to do that here with this FET, right? So I could short past R2 to increase the gate voltage. But it sounds like you're saying that's not enough, because once the gate is high and the pins are essentially shorted together, the voltage will drop to the gate and the FET will be off again. Do I have that right? Is there any way to do this without adding another power supply or swapping out for a relay? \$\endgroup\$ – Emoses Mar 31 '14 at 6:11

I never quite figured out the MOSFET circuit. Instead, I replaced the 4N25 with a 4N33, an optocoupler with a much higher current transfer ratio, and got rid of the MOSFET entirely. Pins 4 and 5 of the 4N33 just hook straight to the garage door circut.

  • \$\begingroup\$ Does the 4n33 make your garage door go up and down? \$\endgroup\$ – davidcary Nov 30 '14 at 14:23
  • \$\begingroup\$ Yes, the 4N33 worked. The problem with the 4N25 was that, because of its low current transfer ratio, even when there was 3.3v across its LED, it wouldn't allow very much current through its transistor, and that low current wasn't enough to trip the garage door. The 4N33 has a much higher CTR (500% vs 20%), which allows enough current through the garage door wires to trip the motor switch. \$\endgroup\$ – Emoses Dec 1 '14 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.