> Does anyone know if this is how this third wire works? (ground pulses) Joe, I have a couple of 24V case fans on the bench for this time of year, and run them at 12V. Blowy but quiet anyhoo.... The sensor output is 5V and very nearly 50% duty. Possibly the sensor is a Hall Effect magnetic type > and if so does this sound correct for how to calculate the RPM? At great personal risk, great personal risk I tells ya, I stalled the fan and turned it by hand with power applied. There are two pulses per rev, ie the sensor output per rev is on/off/on/off. Yours may be similar, may not be Looking at the scope, at 12V, one rev takes about 46ms, = 21.7rps or 1300rpm. Each sensor high/low period is 10ms-ish, which is plenty of time to measure and calculate the rpm on the fly. If I were checking for fan failure, I might use the Watchdog. Unless the appearance of a transition causes a CLRWDT to be executed, the s/w would alert Measuring the rpm can be done one of several ways, depending on how often you want an update for example Use an INT pin to detect an edge and use that event to read and store a timer reading eg, set INT0 to jump to an interrupt that reads TMR1, and resets TMR1 to 0. If you want to smooth out the readings, add the read to an accumulator. After perhaps 16 reads, calculate the rpm So, for my fan, if PIC is running at 1MHz, then TMR1 will get to about 23,000 (ie 23ms) between leading edges. Add this to an accumulator (a trio of RAM registers). After 16 reads there'll be about 368,000 ( = 0x59D80) in the accumulator. Right-shift this 4 times = /16 and that will be the average, in microseconds, for the 16 reads. Shift/swap would work too for /16 Divide that average into 60,000,000 to get rpm. If the average came out to 22981, then rpm reported over * that period of sampling * would be 2610. However, because my fan puts out 2 pulses per rev, a /2 would need to be done at some stage. You can scale the period depending on what resolution you need and whether you want to or need to get into longer division. For example calculate for a 10s period (by dividing into 6,000,000, ie 24-bit rather than 32-bit) and multiply the result by 6 Multi-byte maths isn't as hard as it sounds. There are several routines here that will do the job.I've used them many times http://www.piclist.com/techref/microchip/math/div/index.htm Another way would be to simply count pulses for 1 minute. So if after 1 minute (based on a timer) there have been 2600 pulses counted, then that's 1300rpm. Or after 10s there've been 260 pulses counted, then .... It's only when you stray from 1 minute that you'll need to do some maths. I think trying out the pulse capturing and division routines would be a good academic exercise, even if it is a sledgehammer to crack a walnut and the result is perhaps over-blown for just reporting fan speed wbr -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist