Rotary Encoder - Illuminated (RGB) (COM-15141)

Mmm
Interesting discussion at Purchased my first Rotary Encoders. faulty or not? - #10 by system - General Electronics - Arduino Forum
Encoders were behaving like the one I have described above - ie at each detent both switches open circuit but making brief contact between detents - these appear to follow a Gray Code sequence between detents but are open circuit at “rest” - presumably to save pullup current
I have another encoder bought from Jaycar
In this case I have the opposite problem - with each detent both pins change state together!
I just want an encoder that will follow a Gray code sequence with each detent. (Grrr)

So all decoders are not created equal. We have quite a lot of variants which will be traps for young players :slight_smile:
(and no I am not a young player - have designed and built a lot of electronics over the years - thanks for all the help but I know what I am doing!)
Without fairly sophisticated test gear and knowledge a noob will not be able to work all this out
Variants
(1) Different Pinouts
(2) Transient make/break between detents
(3) Both pins changing state between detents - they do seem to follow a Gray code in between - a half step per detent (the JayCar decoder)
(4) Encoders generating pulses rather than a true “Gray Code” sequence as in the ones above
As I said above it appears you detect direction by the relative time of the B line transition vs the A
But this is not a Gray Code as both lines change together at the start or the end of the pulse. These are not “Quadrature Encoders”. So techniques to debounce them using state machines will not work. The datasheet with this device is clearly wrong - might I suggest that Core Electronics has a look at this?
All in all rather more complicated than I expected - a couple of days of hacking…

I still havent managed to find an encoder as described in all the sketches :slight_smile:

2 Likes