raschemmel:
Let load = 4N25 optocoupler led==> 20mA at 1.3V dc
Let AC voltage = 230vac
Dropping resistor Rdropping=(Vin-Vload)/Iload=[230vac x SQRT(2)]/0.02==>(460Vac-1.3Vdc)=458.7Vac/0.02A=22935 k ===>30k230 x sqrt(2) = 325.26 V if you consider rectification the you have to subtact additional 0.7 V or 0.14 V depending upon half wave rectifier or bridge rectifier.