Ok since i am new at electronics i decided to go through the circuit so i understand it. I then decided to post it here so perhaps others can learn
So first lets look at what we want o accomplish (i may not be correct looking for others input on my rudementary understanding)
We have a hobby router and want to be able to control the Router. I have a small rigid router.
on Digital Pin 4 the arduino is sending a signal to an octocoupler
Octocouplers are used for "Galvanic seperation" In laymen terms it keeps the low voltage microcontroller side of things seperated from the live 110 or 220 volts
An octocouple works in this manner.
It has an led in it that flashes or turns on a steady brihgness that is picked up by a phototransister. Like the lights you may have on your house that detect motion but this detects light. Think of it like driving into your driveway at night with the headlights off and pulling up to your garage. Your garage has a light sensor. when u turn your headlights on it pens the garage door. You want the sensor to do it instead of hooking 110v to the body of your car and dying.
so the arduino flashes the LED in the optocoupler which creates a circuit allowing voltage to flow through a TRIAC.
The TRIAC is basically a relay. It can hanlde more amperage than the optocoupler.
So the 3volts from Arduino turns on the Optocoupler switch , which then turns on the Triac switch. allowing 110v to flow and turn your router on.
Then there is zero crossing detection. which i am reading about now .......................