Mohit Mahajan wrote: > How's this for zero detection ... > > o Vdd > | > / 4k7 > \ > / > |-----o Zero Detection > /n > 220VAC |/ > o--------/\/\/\-------o----|p BC547 > 330K | |\ > | _\/n > | | > |--|<---o > 1N4001 | > o Gnd That should work without violating any PIC specs. A few suggestions though: 1 - I would use a 1N4148 diode instead. It has a quicker reverse recovery time, is dirt cheap, and can certainly do the job. You don't need a 1A diode there. 2 - I would break up the 330Kohm resistor into two separate resistors. Compare the max voltage spec of the resistor to the max line voltage. You will probably find the voltage is too high. Even if not, two resistors in series will be much more tolerant of dirt and humidity. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body