Introduction - If you have any usage issues, please Google them yourself
Using an Arduino microcontroller with some simple circuitry, we can monitor the AC wave to determine the proper time to turn the power on and off with the TRIAC (a 10kOhm pull-up resistor is needed at the H11AA1 pin 5). The circuit I used to do this is shown below.