I'm using a Optek sensor OPB745, and its appliction is counting cycles based on a wheel that has alternating dark and light markings. Rotational speed is about 25RPM and it can detect the difference between black and white by using the analog port of a 16F818 but now and then it seems to get a glitch and counts twice inside a dark section. I tried a simple filter to try and eliminate those glitches, but it runs the chance it then delays the detect of the light area. The other key to this is a another wheel is in sync (same shaft) with another sensor where its detecting an object on it based on the dark/light distinction of the first sensor (where is the object in relation to the start of the wheel) so the filter as mentioned above can end up missing when the object is presnt and thus not putting it to the right slot. So the problem is....detecting the dark to light....light to dark transitions because its not a clear cut...you have voltage A and then immidiatly voltage B...there is a ramping that occurs as the colors change under the sensor, along with the glitch, I assumed analog detection is the right way to go.....or is it? What are the robotic guys doing or maybe the clear cut distinction between light and dark isn't as important to them as it is for this. --------------------------------- Looking for last minute shopping deals? Find them fast with Yahoo! Search. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist