>> >> ~12V in-|=2k=|--|----|-----|------PIC pin >> | | | >> Z C R >> | | | >> |----|-----|------ GND >> >> Z= 5,1V >> C= 100n >> R= 100k >OK. >I assume there is a switch there somewhere or that the AC turns off and on. >The 2K is far lower than it needs to be if you use a 100K pullup. pulldown, right? :) >Not a problem - just doesn't need to be that low. Oops :) I just found out that once again I was very unclear! :) What I meant was about 12V NOT AC 12V. My mistake! Sorry about that!!! The reason I have only 2k is becourse the 12V is comming from an serial-port, and is not always 12V and I noticed that with a laptop and 10k instead of 2k the Zener voltage was below 4.5V. Actually a do have a diode before the 2k resistor in case of negative voltage but I didn't think that was relevant here. Anyway, thanks for your help! /Andreas -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body