Hi,
Just that will not give you reliable dimming, you have to have synch wih the AC mains.
You haven't shown how you connected to the MOC3021 and the Arduino you are using.
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
This will help explain how to go about phase control.
https://playground.arduino.cc/Main/ACPhaseControl
Tom... ![]()