Main > Main Forum

Combining two analog joystick4-pin outputs to one 4-pin input

Pages: (1/2) > >>

kgold0:

Hello, I have an sj@jx switch/xbox/pc encoder with two 3D analog thumb sticks and also ordered an sj@jx analog joystick. I’ve already installed the thumb stick and want to install the analog joystick. I want to have the option of using either thumb stick or joystick. Either with a toggle to switch between the two inputs or ideally using either one at whim without toggle. The latter being much more complicated I think.

The 4-pin connection has 5v vcc, x, y, and gnd (I think). The x and y rest at 2.5V but on either extreme direction will register at 0V or 5V.  Just connecting the two together might cause unexpected results. Like if the thumb stick is at rest at 2.5V and the joystick is tilted to the right at 5V then the resulting voltage might be somewhere in between 2.5 and 5V.

Any suggestions please?  Thanks!

PL1:


--- Quote from: kgold0 on January 25, 2024, 12:18:35 pm ---I want to have the option of using either thumb stick or joystick. Either with a toggle to switch between the two inputs or ideally using either one at whim without toggle. The latter being much more complicated I think.

--- End quote ---
Do yourself a favor.  Don't waste your time trying to design an autoswitching circuit.   :banghead:   :banghead:   :banghead:

What you need is a DPDT (Double Pole, Double Throw) switch -- rocker or toggle.

Leave the 5v and ground (outer pins) on all four pots all of the time.
- This will draw twice as much current as a single stick, assuming the pots are the same resistance.  The analog encoder should be able to handle that, no problem.
- If you wanted to switch X, Y, 5v and ground, you'd need a 4PDT switch.

The part to connect to the DPDT switch is the wiper (center pin) of each pot.


Scott
EDIT: Don't forget to make sure you have the analog joystick oriented the same way as the thumbstick.
- You need to check both the X-axis and the Y-axis.
- If left on the thumbstick causes the X voltage to decrease, left on the larger stick should do the same.
- If down on the thumbstick causes the X voltage to decrease, down on the larger stick should do the same.
- If you've got the larger stick turned 90 degrees and you swapped the X- and Y-axis wires, one of the axes will move the opposite direction of the thumbstick. i.e. Up/down might be the same on both, but left/right is backward on one.

kgold0:

Thank you very much. That’s exactly what I was looking for.

So I was thinking of taking the four wires from each stick, taking the yellow and white wires (x,y) and connecting them to the dpdt switch, then connect the output to a 4-pin. Then take the remaining red and black from one joystick and also connecting them to the 4-pin.

Then I will take the other joy’s red and black and create a new 2-pin to plug into a separate 5V.

That sound right to you?

Hope I don’t blow something up!

PL1:


--- Quote from: kgold0 on January 25, 2024, 10:39:57 pm ---So I was thinking of taking the four wires from each stick, taking the yellow and white wires (x,y) and connecting them to the dpdt switch, then connect the output to a 4-pin. Then take the remaining red and black from one joystick and also connecting them to the 4-pin.

Then I will take the other joy’s red and black and create a new 2-pin to plug into a separate 5V.

That sound right to you?

--- End quote ---
I'd recommend getting 5v and ground for both sticks from the encoder's analog connection pins.
- The 5v/ground from the analog connection pins is the same 5v/ground that goes to the A/D comparator so any variation at the sticks is also at the A/D comparator.

If you get 5v and ground for a stick from a different source, you may run into slight ripple or differences in voltage that can add jitter or throw off the alignment.

The second stick should only draw a few mA -- not enough to cause a problem.


Scott

kgold0:

Wow I didn’t think of that. Is there an easy way to hook two wires into one jst pin other than soldering? I have been searching jst 1 to 2 or jst splitter but not sure I’m finding the right solutions. Is the jitter going to be really bad if the 5V port is from the same encoder, just not in the same 4-pin connection?

I actually ordered two dpdt switches so I guess I can just connect two vccs to one input and two grounds to the other input and just leave it on, at least temporarily.

Pages: (1/2) > >>

Go to full version