Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Combining two analog joystick4-pin outputs to one 4-pin input  (Read 998 times)

0 Members and 1 Guest are viewing this topic.

kgold0

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:February 29, 2024, 06:09:43 pm
  • I want to build my own arcade controls!
Combining two analog joystick4-pin outputs to one 4-pin input
« on: January 25, 2024, 12:18:35 pm »
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

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9405
  • Last login:Today at 10:18:34 am
  • Designated spam hunter
Re: Combining two analog joystick4-pin outputs to one 4-pin input
« Reply #1 on: January 25, 2024, 01:53:51 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.
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.
« Last Edit: January 25, 2024, 02:37:32 pm by PL1 »

kgold0

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:February 29, 2024, 06:09:43 pm
  • I want to build my own arcade controls!
Re: Combining two analog joystick4-pin outputs to one 4-pin input
« Reply #2 on: January 25, 2024, 10:39:57 pm »
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

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9405
  • Last login:Today at 10:18:34 am
  • Designated spam hunter
Re: Combining two analog joystick4-pin outputs to one 4-pin input
« Reply #3 on: January 26, 2024, 02:38:06 am »
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?
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

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:February 29, 2024, 06:09:43 pm
  • I want to build my own arcade controls!
Re: Combining two analog joystick4-pin outputs to one 4-pin input
« Reply #4 on: January 26, 2024, 05:42:22 am »
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.
« Last Edit: January 26, 2024, 07:40:07 am by kgold0 »

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9405
  • Last login:Today at 10:18:34 am
  • Designated spam hunter
Re: Combining two analog joystick4-pin outputs to one 4-pin input
« Reply #5 on: January 26, 2024, 07:43:07 am »
Is there an easy way to hook two wires into one jst pin other than soldering?
One option is to cut/strip the middle of the wire and use euro-style terminals.  Try this if the approach below doesn't work.

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?
Jitter isn't guaranteed, it's just something to watch for.

The further apart the power sources are and the longer the wires are, the more likely it will be that the wires will pass close enough to an electromagnetic source to pick up some RFI (Radio Frequency Interference) on the unshielded wires.

If your encoder has a 5v LED connector or is an active high device (the common outer input pins are tied to 5v instead of ground), that might be good enough.  You shouldn't have to cut/strip the analog stick harness to test this setup.  Try this first with some JST or Dupont jumpers if you have them.   ;D


Scott

kgold0

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:February 29, 2024, 06:09:43 pm
  • I want to build my own arcade controls!
Re: Combining two analog joystick4-pin outputs to one 4-pin input
« Reply #6 on: January 26, 2024, 08:17:52 am »
Thank you, will try a second 5V port which is close by on the same encoder first— this thumb stick has a huge dead zone (almost acts like a dpad— on my virtual pinball device the plunger is basically fully pulled down and then fully released— but with the analog joystick I can fully control the plunger- partially pull, partially release, etc).

By the way, sorry it takes so long for me to reply. I turn notifications on but I never seem to get them!

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9405
  • Last login:Today at 10:18:34 am
  • Designated spam hunter
Re: Combining two analog joystick4-pin outputs to one 4-pin input
« Reply #7 on: January 30, 2024, 12:36:49 am »
Here's my reply to the question you asked in a PM about whether these switches are good for this application.



They would not be my first choice for this application because:

1. They are big heavy power switches rated for 15-20A.  A switch rated for less Amps like these or these might be a better choice since the analog encoder is only drawing a few mA.

BONUS ROUND: There are small 4PDT toggle switches here if you want to switch X, Y, 5v, and ground.

2. They are high profile switches.  I prefer lower profile rocker switches like the one on the back of my KADESTICK build.  YMMV.



3. They might be hard to directly mount in a wood panel, if that's what you're trying to do.

There are several workarounds like drilling a hole in an arcade button plug like these for a smaller toggle switch/rocker switch or do a custom 3d printed mount remixed from the mount here (Thingiverse post here) or one of the mount panels here, here, or here for some of the rectangular-body rocker switches or you could use something like this DPDT switch/mount combo.



One other thing to look for is if the switch is ON-ON (2 positions) or ON-OFF-ON. (3 positions)  Either one will work, but the OFF position might make it confusing.


Scott

kgold0

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:February 29, 2024, 06:09:43 pm
  • I want to build my own arcade controls!
Re: Combining two analog joystick4-pin outputs to one 4-pin input
« Reply #8 on: January 30, 2024, 04:09:37 pm »
Hey, thanks so much!

My puppy seems to be in agreement because he destroyed those switches I showed you last night- took them straight from the unopened mailer and chewed them up real good.