# Thread: Quadrature Decoder

1. ## Quadrature Decoder

Okay, so, I have bought one of the ALPS encoders, and I'm working with it to build a controller for my car PC.

The problem I'm having is, the rotary part of the ALPS encoder puts out a "quadrature" signal (yes, I know most of you already know this), but I need a more-or-less binary signal. I.E. Encoder has moved one position forward or Encoder has moved one position backward.

I know a lot of you are using scroll mice to accomplish this, but I'd really like to use it with another device I picked up from a gaming site.

Is there an IC out there that will translate the quadrature signal from the encoder, and just output pulses on one of two pins? Or should I just abandon that idea, and just use a mouse like everyone else?

I've found lots of stuff online relating to this, but nothing that seems to solve the problem directly. One link in particular that might answer the question is this.

Unfortunately, being a software engineer, and not a hardware/electrical engineer, I'm having a hard time understanding what's being said there.

Any thoughts/help?

Thanks!

2. First thought was that you could use a PIC (or similar micro) to perform the translation.

While that would certainly work, the link you provided seems much simpler. The little D/Q boxes are flip flops - The Q (the output) latches to D's (the input) logic state on a clock signal. The arrow-ish symbols or XOR gates. If you're a programmer, at this point you can probably work your way though the logic

You should be able to build the whole thing with 2 ICs (one for the flip flops and one for the XOR gates).

3. Okay, I think it's starting to make some sense.

Using that circuit then, the "counter_direction" would be high for one direction, and low for another, and the "counter_enable" would pulse with each phase change of the encoder?

I suppose I could cobble together a breadboard and try this myself, but I'd like to try to understand it first. :-)

4. Originally Posted by cherrybomb
Using that circuit then, the "counter_direction" would be high for one direction, and low for another, and the "counter_enable" would pulse with each phase change of the encoder?
That's what it looks like.

Originally Posted by cherrybomb
I suppose I could cobble together a breadboard and try this myself, but I'd like to try to understand it first. :-)
Bah, build first ask questions later! (well, ok, I wouldn't normally advocate that, but given the components involved here is probably about \$3 total, you might as well)

5. Originally Posted by mushin
Bah, build first ask questions later! (well, ok, I wouldn't normally advocate that, but given the components involved here is probably about \$3 total, you might as well)
That's what I'm thinking

I'll go pick up some parts tomorrow and let you know how it turns out!

Thanks for the second opinion.

6. Try these out:
http://www.usdigital.com/products/ls7183-ls7184/

I've used the LS7183 before and it was very easy to work with... fairly cheap too. The LS7183 pulses seperate UP and DOWN pins. Or, the LS7184 pulses a CLOCK line with a separate UP/^DOWN (direction) pin. Another plus is you can configure it to pulse once per full cycle, half cycle, or quarter cycle. You can also set the pulse width.

When I wired up my encoder (originally... I use a hacked mouse now), I wired the output to a quad analog switch (MM74HC4316N). I connect two of these "switches" to my keyboard matrix so they would register as keypresses. Of course, you are free to whatever with the outputs.

7. Originally Posted by TheLlama
Try these out:
http://www.usdigital.com/products/ls7183-ls7184/

I've used the LS7183 before and it was very easy to work with... fairly cheap too. The LS7183 pulses seperate UP and DOWN pins. Or, the LS7184 pulses a CLOCK line with a separate UP/^DOWN (direction) pin. Another plus is you can configure it to pulse once per full cycle, half cycle, or quarter cycle. You can also set the pulse width.

When I wired up my encoder (originally... I use a hacked mouse now), I wired the output to a quad analog switch (MM74HC4316N). I connect two of these "switches" to my keyboard matrix so they would register as keypresses. Of course, you are free to whatever with the outputs.
Excellent!

This looks like EXACTLY what I'm after.

It looks like I'll only be able to order this directly from them?

I don't see the IC available at radioshack, or marvac, which are the only local shops.

Trying to put together a component list for all of this.

Thanks VERY much for the pointer. :-D

8. Originally Posted by cherrybomb
Excellent!

This looks like EXACTLY what I'm after.

It looks like I'll only be able to order this directly from them?

I don't see the IC available at radioshack, or marvac, which are the only local shops.

Trying to put together a component list for all of this.

Thanks VERY much for the pointer. :-D
I forget where I got mine, I think I purchased it direct. If not, I got it from mouser electronics. I have a spare chip (the LS7183), I suppose I could sell it to you. PM me if you are interested.

9. Originally Posted by TheLlama
I forget where I got mine, I think I purchased it direct. If not, I got it from mouser electronics. I have a spare chip (the LS7183), I suppose I could sell it to you. PM me if you are interested.
Not a problem, I just ordered up a couple direct. Looks like that's the only place you can get them. Mouser didn't carry them.

10. That looks nice, I'll have to remember it if (when ) I need something like that.

I always forget how many special purpose ICs are out there. God bless the electronics industry

Page 1 of 2 12 Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•