help connecting Arduino UNO to n-ch MOSFET via Optocoupler

Put the opto-coupler where R3 is, and parallel it with a zener (or a Esaki diode).