> Optical is never a good idea IMHO for something like this > because it will get dirty (just one puddle would be enough) > and stop working. I agree. The optos from mice are pretty good - I use them in IR links (heck, I'll try and recycle anything) - but dirt will be a problem. For movement detection a magnet and coil is better, as Olin suggests. This is what my cycle computer uses. It's also a very old method for pulse driving in timepieces. A magnet on the pendulum passes by a coil which activates a power driver which in turn sends a repulsing current to the coil, thus driving the pendulum back towards the coil on the other side of its swing. The major advantage of this pulse-processing method is very low quiescent current, unlike Hall Effect or opto. For a PIC application this would mean no power required for the sensor and mostly only sleep current for the PIC -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist