I took a look at AN521 just now to refresh my memory. I'm a little puzzled about the comments of "connecting the AC line directly to the PIC". The input to the PIC is current limited through a 5 Meg resistor. I have seen this type of circuit (combined with the clipping diodes which are internal on a PIC) used in commercial applications many times. Even before PICs were common. Another variation is to use a voltage divider ahead of the current limit resistor. I think that even on a PIC running from a transformer isolated supply, that the AC line coupled via a (say 5 meg resistor) to a PIC input would still give enough signal to work. The AC "return" would be a capacitive/inductive coupling through the transformer back to AC neutral. This is somewhat along the same lines as how some touch switches work. Frank Richterkessing Experimental Methods Engineer GE Appliances FRANK.RICHTERKESSING@APPL.GE.COM