Submitted below ac load management by delayed phase angle triggering to opto-coupler(U3) interfaced triac (U4) for single phase load control using Arduino nano. Proteus file and the code for simulation are available at the bottom. For video watch at down below or use this link https://youtu.be/VpHoE_2MlEo
It uses an Arduino nano which receives zero cross pulses (ZVS) at pin at Pin 2 and delayed output pulses are developed at pin 3. Control is done at A0 through a variable resistor (POT-RV1). A small step down transformer delivers 12 volt ac which is filtered by a bridge rectifier BR1 and then a blocking diode D1 and then filtered by capacitor C1 that feeds a 3 terminal regulator that gives 5 volt duly filtered again by C2 for powering the entire circuit. Function of D1 is very interesting. It separates the pulsating voltage developed by the bride rectifier from the filtered voltage. Because the unfiltered voltage is required for a comparator to generate zero cross pulses. The unfiltered 12 volt ( available at anode of D1 ) passes through a potential divider R2:R3 to a comparator inverting input pin2 of IC-U1A while its non inverting is held at referenced constant voltage of 0.6 volts being the conventional forward voltage drop of forward biased silicon diode D2 through R1. This results in developing zero cross pulses at pin1 of U1A, 2 times in each cycle of half wave of the pulsating voltage (ie 100 pulses in a second of 50 Hz waveform) which is fed at input pin2 from the potential dividerR2:R3. Using another potential divider R4:R5 , a safer pulsed voltage of less than 4 volts is made for feeding the Arduino pin2 with zero cross pulses so that program starts developing delayed trigging pulses from the start of the wave form. Had we not used the ZCS, arbitrary triggering would have caused false triggering. Variable analog voltage fed from POT RV1 to Arduino executes the program accordingly to develop delayed pulses which is in source mode to feed the opto- coupler pin 1 through R6. On the high voltage side R8,C3 forms a snubber for the triac U4 which is trigger through R7 in combination with opto side diac. Thus load , mains supply, and triac all in series desired control is achieved. Video below.
Proteus simulation file and the code