Using Arduino with high voltages

I have the same need and plan to use an optocoupler to protect the arduino. One will need to poll the input often otherwise if unlucky you detect at a zerocrossing. Some kind of filter or delayed off on the input would work as well.