I would only like to add that I would use a zenner diode instead of an ordinary diode as this will limit the the max voltage as well as clipping the negative spikes Peter Cousens London UK > -----Original Message----- > From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU] > On Behalf Of Olin Lathrop > Sent: 27 April 2002 13:41 > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [EE]: How do I condition a high voltage pulse for a PIC to > read > Make a resistor divider chain with three resistors. > The > top end is connected to the pulse signal and the bottom end to ground. > The > top two (R1 and R2) resistors are 500ohm 1/2W and the bottom one (R3) is > 1Kohm 1/4W. Put a diode from ground to the top tap. This will clip > negative spikes (yes, there will be negative spikes). I would also add a > cap accross the diode, but the value depends on the minimum pulse width > and > height which we don't know. I'm thinking about 1nF, but that could be way > off. The purpose of the cap is to filter out some of the high frequency > crap, like pulse bounces and the like, but to not filter out whole pulses. > Next connect the base of a small signal NPN transistor to the lower > divider > tap, the emitter to ground, and the collector to +5V thru a 1Kohm > resistor. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads