Hi, that's a problem that I am encountering. Actually I am using a rotary encoder with internal mechanical switches (not optical). If I do not include a debounce delay, l will have unwanted pulses which will cause the counter to increment. On the other hand, if I include debounde delay I may miss pulses.You can also connected the pin to a hardware counter in the PIC. Be sure to debounce your switch.
Not sure if above your price range, but there are AMT non-mechanical quadrature encoders that can be obtained with a resolution between 48 to 2048 p/rev.I know that the best option is to replace the mechanical encoders with optical encoders, but they are quite expensive.
That brings two questions to mind:If I do not include a debounce delay, l will have unwanted pulses which will cause the counter to increment. On the other hand, if I include debounde delay I may miss pulses.
Hi Max.The encoders I referenced are lower down to 48p/rev. But are through hole not shaft encoders.
That one is not ideal for your application, it is 24v open collector.
You ideally need a 5v TTL or RS485 differential, just ignore the /A & /B pulses.
For the majority of optical type, the lowest you may see is 100p/rev.
You may get a 32p/rev shaft encoder at US Digital, they have them for around $125.00
Or http://www.usdigital.com/products/encoders/incremental/rotary/shaft/S6
Max.
Why are open collector encoders not ideal please? Also, how do these encoders work? do they use hall sensors?DC5-24V wide voltage power supply
I am 'Going on' as you put it because the encoder the OP linked to calls for 24v which as I mentioned could be used, but the 24vdc will still be required for the internal optics circuit plus 5v for the output.I don't know why Max is going on about a 24V supply. You simply don't need it: just wire the thing up to 5V and it's all done. .
I am asking because I don't want any debouncing.Anyway, you don't need to worry about what's inside, as long as it works.