Ralph:

Sorry I didn't make it clear, I guess. When using the optocoupler, the resistor would be across the two back to back LEDs inside the opto coupler. So the voltage across the resistor would only be +/- 1.7volts (the LED drop). Wattage is thus not an issue...

The series resistor of say 1Meg is INSTEAD of the opto coupler and need not carry the LED currents. It would be connected in series with the input pin of the PIC and is to limit the current through the clamping diodes provided on all I/O pins with a max current limit of +/-20mA.

With a 1 M resistor, the I/O current is safely limited to 240uA and the wattage would be about 0.06watts for the 240VAC. My concern was that Mr. Schmidt may accidentally come in contact with the live AC line with a "shocking" experience**** There might be some fire-works also.

-warrier

-warrier