Zero crossing detection

@Ragnar

I also did a dimmer using the Arduino. I use the same schematic <-- the zero level , but I rectify in full mode to produce positive pulse only, not positive and cut for 1/2 of 60 Hz. It produce two positive pulse from the 60 Hz, a full wave rectifier. I use the comparator to cut close to the zero to produce a 120 Hz very short pulse, and it is going into an digital / interrupt pin. And from it, it produce a PWM pulse, depending of the reading of the potentiometer, and send a turn off into the opto coupler, and the rest a turn on, the other side , opto and traic take care of the AC wave being cut properly and time right.

Here the tread. http://arduino.cc/forum/index.php/topic,91274.15.html