Sunday, 19 March 2017

microcontroller - Debugging a garage door opener circuit with an optocoupler and mosfet


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?


Schematic




No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...