MOSFET Relay (G3VM-21AR/DR) connected to Arduino Digital Pin
Add a resistor in series with the LED, which is inside of the solid state relay (SSR).

More importantly, however, the sketch in the O.P. is a bit backwards sideways.  Control signal is between pins 1 &amp; 2.  High current path is between pins 3 &amp; 4.