Zero crossing detection

@taurian

Can you print out the schematic, scan it, and re-post it here. The problem is. I don't have Proteus, and I am not the only one.

@Ragnar

Hmm... Simple. But I don't feel comfy about connected 230 VAC into a opto-coupler. More protection is needed, in my opinion. The pulse output will be only 50 Hz, so I assume your code will take care of it, to sync with the AC main. My design is safer, the sync is taking care of the circuit to give me a 120 Hz pulse <-- I live in North America, and my code will take care of it.

If your code and your circuit work just nice, than I salute you. It will be nice to share your schematics and code, so others may make the same thing or use as a example.