Andreas wrote: > >> > >> ~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. Is this being fed from the serial port TX line? Have you measured the voltage on the that pin or is the 12V a guess? The 100n capacitor seems large unless the baud rate is very low. David... -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body