rotation counter
I am trying to make some kind of counter to count how many times an axle rotates. I tried using a whisker but when the whisker is hit it counts more than 1 each time it is hit, is there a better way to do this or a way to fix this?
Comments
You may do better with an infra-red emitter detector setup which can watch for a bit of reflective tape on the axle. Or, use a Hall-effect sensor which can sense a magnet on the shaft. You could also have a disk with one or more holes in it and detect the passing of the holes by photocell or photo-transistor.
You can do a couple of things in your program which can add some debounce. For instance, if the repitition rate is low you can watch for the switch closure, jump to the count routine, but pause for some time period before going back to watch again. For fast pulse rates, you may have to use an external counter chip so as not to miss pulses.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·