Hi,
You need a current limit resistor between the output of the Aduino and the opto-coupler.

From data, Vf = 1.2V put 30mA through it.
R = V /I = (5 - 1.2) / .03 = 126R so 120R or 180R will do the trick.
The setup you have will let you turn the lamp ON and OFF, but will not allow dimming.
Tom.. ![]()
