2
\$\begingroup\$

First of all I’d like to state I’m fairly new to this and ask for grace if my explanations are hard to grasp.

I’d like to know if it is possible to wire a scroll wheel encoder (the one with three points) so that when scrolling up, every increment or time it makes contact it will act as a button press and same goes for scrolling down wired to another button. I’ve read that you will need some sort of microcontroller to add logic and translate the signal from the encoder into pulses. (such as CD4013 D-type flip-flop?)

I am wondering whether I’d be able to get a simple schematic circuit for wiring the encoder to pulse to 2 separate LEDs one for scrolling up and one for scrolling down. It doesn’t necessarily have to count the amount of increments, but it does need to spam the button rather than hold it in.

The actual project is to modify a game controller to spam a button scrolling up and spam a button scrolling down. I have already bought a mod pack to tap into the buttons I will imitate with the encoder, but I know it isn't as simple as wiring the encoder straight to the mod pack.

I’ve seen a very similar question asked, but none of the answers have quite been what I need to know.

I highly appreciate any help with this.

\$\endgroup\$

2 Answers 2

5
\$\begingroup\$

To interface to a 3-terminal scrollwheel you'll need to implement some type of state machine (either in hardware or in software). Here's how these devices are wired:

Circuit diagram

The S pin is typically connected to VCC and the A and E pins (both with pull-downs to ground) are the two outputs; the opposite wiring (with S tied to ground and pull-ups on A and E) is also possible. The outputs are fed into the state machine for decoding. As the dial is turned the change in the A and E signals indicates the direction of rotation. As can be seen in the state diagram below, the switches turn on and off with a 50% duty cycle and the two switches are 90° out of phase with one-another. The transition from one state to another has only a single bit change (i.e. the values are Gray coded).

State diagram

Put into tabular form we get:

 +-----+----+----+----+--------------------+
 | Previous | Current |                    |
 |   E | A  |  E | A  | Direction          |
 +-----+----+----+----+--------------------+
 |   1 | 0  |  1 | 1  | Clockwise          |
 |   1 | 1  |  0 | 1  | Clockwise          |
 |   0 | 1  |  0 | 0  | Clockwise          |
 |   0 | 0  |  1 | 0  | Clockwise          |
 +-----+----+----+----+--------------------+
 |   1 | 0  |  0 | 0  | Counter-clockwise  |
 |   0 | 0  |  0 | 1  | Counter-clockwise  |
 |   0 | 1  |  1 | 1  | Counter-clockwise  |
 |   1 | 1  |  1 | 0  | Counter-clockwise  |
 +-----+----+----+----+--------------------+

So you'll need to keep track of the state of the two outputs. Whenever either of the outputs changes you can compare the current state to the previous state to determine which way the dial was turned.

Here's a full diagram of the required interface circuitry. You'll need to take the Signal A and Signal E outputs and feed them in to whatever state machine you implement.

Full circuit diagram

The Bit Generator is the scroll wheel. The upper 10kΩ resistors are pull-ups to have the outputs default to 1. When the switches are on they pull the output signal down to 0. The lower pair of 10kΩ resistors along with the two 0.01µF capacitors are used to debounce the output.

As described in this answer, a suitable state machine for your application could be constructed from two 74-series ICs (a 7400 and a 7474):

State machine

State machine circuit image adapted from original by EM Fields; other images adapted from this datasheet.

\$\endgroup\$
8
  • \$\begingroup\$ This is super helpful, although most of the terminology goes over my head I’m not completely lost. will I need to by a small circuit board or breadboard to make the state machine or can it be wired and soldered together. \$\endgroup\$
    – Elijah
    Commented Apr 23, 2020 at 1:25
  • \$\begingroup\$ also are you able to make a list of the retail names of these items and any specs id need to know including quantity so i can order them. thanx \$\endgroup\$
    – Elijah
    Commented Apr 23, 2020 at 1:33
  • \$\begingroup\$ Don't let the terminology put you off; you need to know it to understand the circuits but not to build them. VCC is your voltage source (e.g. a battery or other low-voltage DC power supply, typically around 3 V to 5 V). You'll want to use a breadboard or other circuit board if you're doing the state machine in hardware (as opposed to software using e.g. an Arduino) since the two chips you'd need come in DIP packages. For this application the ratings (but not the values) of the resistors and capacitors don't matter that much. More later... \$\endgroup\$ Commented Apr 23, 2020 at 1:56
  • \$\begingroup\$ For the resistors and capacitors pretty much anything will do (100k Ω rated at ⅛ W to 1 W for the resistors and 0.01 µF for the capacitors). For the 7400 you could use a CD74HC00E and for the 7474 you could use a SN74HC74N or SN74HCT74N. There are other options available; these are just what's available from Mouser. ... \$\endgroup\$ Commented Apr 23, 2020 at 4:08
  • \$\begingroup\$ ... I'd check with your local electronics shop first to see what they have. If they don't have anything then some reputable online suppliers are Mouser, Digikey, or Farnell/Newark/Element14. If you're new to electronics then it would be good to read up a bit on the subject. The book "Make: Electronics" by Charles Platt could be a good choice. \$\endgroup\$ Commented Apr 23, 2020 at 4:11
1
\$\begingroup\$

No it can't be wired differently. You need a component that is of type "rotary pulse switch", not "rotary quadrature encoder" type. Or you must use a microcontroller or other conversion device to read the quadrature type and emulate the up/down pushbuttons.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.