retrolefty:
Why not small inexpensive reed relays with 240 vac coils. The arduino would just read the relay contact status so fully isolated from the mains voltage.
I am fascinated by this.
Can you give me a link to a reed relay with a 240VAC coil?
Can I interest you in a discussion about some frisky angels and a pin?
If you run a simulation that is sufficiently clever as to factor in the threshold voltage of the LED and the resistor, clearly the current will not peak until there is enough voltage across these two components; we are not talking about a capacitor and a short circuit.
This is however, absolutely irrelevant to the discussion here. A current surge will occur if the circuit is connected while the AC voltage is non-zero and this will be greatest if connected at the peak of the waveform. It will be even more if the capacitor should happen to have a residual voltage in the opposite direction and given a 1k resistor, it is quite easy to calculate the possible peak values. It is equally possible to calculate the time constant of this current surge as 100µs and that the current will drop back to the rated current of the optocoupler within 300µs worst case, so you can make your determinations as to how likely this is to cause damage, accordingly.
Finally, if you are going to count cycles, or merely to determine the presence of the mains, a half wave sensing is just fine.