What type of vehicle is it? Have you really seen (on an oscilloscope, et= c)=20 that it is a square wave? I say this because most new cars use this spee= d=20 sensor for the cruise control and FI strategy, and usually use a VSS whic= h=20 puts out a sine-wave whose amplitude increases with speed. Aftermarket=20 speedometers generally have a speed sensor that puts out a 12V square wav= e. =20 Still, it is possible that you do have a square wave, but try to verify t= his=20 first. Assuming a square wave, you should be able to simply send this signal in= to a=20 transistor switch via a resistor (some tens of kohms) and have no ill=20 effects, but if you really want hi-impedance, you can use an op-amp. If = you=20 have a sine-wave, then you can use a comparator to square up the signal. Either way, you can verify that you don't have any ill effects by pulling= the=20 codes after driving some miles, as most ECUs will flag a VSS-signal probl= em. Cheers, -Neil. On Tuesday 23 September 2003 07:30, Hulatt, Jon scribbled: > Hi all, > > For my next project, I want to initiate some action when my car exceeds > approximately 10mph. The "speedo" sensor is some kind of proximity swit= ch > on the output end of the gearbox/diff. So, the output it a 12v ish squa= re > wave, of frequency proportional to speed. My multimeter measures the > frequency at about 20 Hz at 10mph. > > So, to measure this frequency, my idea is to use the CCP, in capture mo= de, > with an appropriately prescaled timer. My Capture ISR will increment a > counter each time the CCP event fires, if the timer represents a (perio= d) > shorter than 40ms (ie, faster), and, when the counter gets to an > appropriate number, perhaps 20 ish, I'll inititiate the other code. Ide= a of > using the counter is to filter out any bounces or other muck in the lin= e. > > Leading to my first question- does this plan seem like a workable idea? > I've not much experience with a) pic and b) the automotive envorinment. > > Secondly, is the question of how to interface the 12v square signal wit= h > the pic? I'd thought of using an optoisolator, but is there a better, o= r > simpler way of protecting the pic from a) getting 12v not 5v and b) any > dirty spike type things? I think I need a relatvely high impedance, bec= ause > the signal goes into the ECU, so if I steal too much of it, I may make = the > car rather ill. > > Appreciate your thoughts. > > Jon --- [This E-mail scanned for viruses] -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu