I have googled a little bit, but the codes I found so far are not clear to me. I have no schematics either. Can anyone help me out?
If someone has a code how to use values received from a regular 10K analog potentiometer on the input of the Arduino for the Triac's gate - then I can figure out the rest for my own purpose.
The amount of dimming you get from a triac is based on the time after the zero-crossing event occurs that you trigger the output. Short time == little dimming. Long time == lots of dimming.
Check out this instructable:http://www.instructables.com/id/Arduino-controlled-light-dimmer-The-circuit/Note the safety warnings. There MUST be an optoisolator in the circuit.
You'll also need to isolate your phase detection (zero crossing) circuit. For that, you can use a "regular" optoisolator, or a transformer. (In my circuit, I used the same transformer that was powering my microcontroller.)