Hi Tom,
Thank you for your help, the circuit is attached, I connected pin 1 of MOC3021 with pin 4 of arduinoMega and pin 2 with ground of arduinoMega, the circuit works correctly when i set pin 4 of arduinoMega on/off.
but either I connect terminals of Triac or I disconnect its terminals with MOC3021,the problem is still appearing that when I put the plug in the power socket, immediately the lamp is flickering one time.
I'm begginer in electrical & electronic subjects,so I didn't understand when you say "you have to have synch wih the AC mains.".
I get the circuit from the internet, and I don't know if there is practical solution or there is problem with Triac.
Thank you ![]()
