I'm designing a digital phase-controlled light dimmer, and I need a zero-crossing detector circuit. From what I've read, it's a bad idea to wire the AC main directly to the microcontroller through a resistor, and folks have suggested using optoisolation instead. However, I don't know how the circuit actually falls together.
It would seem elegant to me if the zero cross circiut's output is a 5V logic pulse for use as a rising-edge interrupt. But I'm not married to that idea if some other output is easier to use.
Input: 120V AC @ 60 Hz
Output: 5V pulse at zero crossing
Interesting related post, with not enough detail for me: detecting zero cross in ac?