Debugging a garage door opener circuit with an optocoupler and mosfet
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.)