Author Topic: Interfacing two controllers to one button  (Read 1974 times)

0 Members and 1 Guest are viewing this topic.

Offline knotlogicTopic starter

  • Regular Contributor
  • *
  • Posts: 189
  • Country: sg
Interfacing two controllers to one button
« on: May 23, 2017, 03:26:13 am »
I'm hoping to get some feedback on this circuit I've thrown together.  I'm helping a friend with an arcade stick project.  The idea is that this will be a single arcade style joystick with two interfaces, one for PC and one for a PS4.  Inside the housing are the guts of two boards, one for each interface.  They each have their own USB connector, but will be hooked up to the same set of controls (joystick and buttons).  The idea is that it can be plugged in via the respective port for the respective system.  (And obviously not both at once...)

The catch is that one of the boards uses a common ground arrangement for its buttons, and the other uses a common 1.8 V rail.  Wiring both controllers directly up to the buttons is a bad idea as that means I'd be permanently shorting the inputs on one controller to ground or vice versa.  And while only one controller is plugged in at a time, I'm probably sharing grounds on both somewhere in the nest of wires.  My current solution is to use the 5 V on the USB line as an enable signal to a bank of MOSFETS that normally keep the controls disconnected from the board.

So in my schematic, EN_A would go high when the USB for controller A is plugged in.  That allows the inputs on controller A to be pulled up to the common 1.8 V rail when the corresponding button is pressed.  At the same time, controller B is disconnected from the switch.

The two diodes are there to prevent any current from flowing backwards through the MOSFET body diodes.  I don't know that this will be an actual problem in practice, but I do have plenty of spare diodes lying around from a previous project.  I figured why not.

MOSFETS are a dual N-channel part from Toshiba, SSM6N7002KFU.  Saves me some board space and they end up cheaper than buying single FET parts.  Plus I have to implement the switches in pairs anyway.

What do you all think?  Have I missed anything, or should this work as expected?
 

Offline bobaruni

  • Regular Contributor
  • *
  • Posts: 156
  • Country: au
Re: Interfacing two controllers to one button
« Reply #1 on: May 23, 2017, 04:36:09 am »
Why not use some transistor output optoisolators:
1. Parts count will be less.
2. Switch contacts will be kept clean because a decent amount of current is required  to light the LED in the opto.
3. It will be less susceptible to static and RF.
 

Offline helius

  • Super Contributor
  • ***
  • Posts: 3677
  • Country: us
Re: Interfacing two controllers to one button
« Reply #2 on: May 23, 2017, 04:49:01 am »
The catch is that one of the boards uses a common ground arrangement for its buttons, and the other uses a common 1.8 V rail.  Wiring both controllers directly up to the buttons is a bad idea as that means I'd be permanently shorting the inputs on one controller to ground or vice versa.
I don't understand what "vice versa" is supposed to mean. If only the common-ground interface is connected, then the other interface is not getting power, or is this project internally powered? If it's not on, there is no 1.8V rail to be worried about. If only the 1.8V-common interface is connected, then the ground connection in the other interface is just floating, although you can easily run into trouble through panel connectors if the case is metal. The greatest danger is if someone connects both interfaces by accident, as the 1.8V rail in one interface will get connected to an external ground (which could be a short circuit depending on how ground is connected externally). Is the 1.8V current limited in any way?
Your solution using USB_V+ also doesn't prevent this situation, since it shorts 1.8V and gnd together when both interfaces are connected to host computers.

I don't really understand why you want to build 4xN fets to protect N control switches when a single fet to isolate the "switch common" net from external ground would be sufficient.
 

Offline knotlogicTopic starter

  • Regular Contributor
  • *
  • Posts: 189
  • Country: sg
Re: Interfacing two controllers to one button
« Reply #3 on: May 23, 2017, 05:28:19 am »
Why not use some transistor output optoisolators:
1. Parts count will be less.
2. Switch contacts will be kept clean because a decent amount of current is required  to light the LED in the opto.
3. It will be less susceptible to static and RF.

Parts count would be less and it would be an easier solution, yes, but the optoisolators I've seen so far would cost quite a bit more.



The catch is that one of the boards uses a common ground arrangement for its buttons, and the other uses a common 1.8 V rail.  Wiring both controllers directly up to the buttons is a bad idea as that means I'd be permanently shorting the inputs on one controller to ground or vice versa.
I don't understand what "vice versa" is supposed to mean. If only the common-ground interface is connected, then the other interface is not getting power, or is this project internally powered? If it's not on, there is no 1.8V rail to be worried about. If only the 1.8V-common interface is connected, then the ground connection in the other interface is just floating, although you can easily run into trouble through panel connectors if the case is metal. The greatest danger is if someone connects both interfaces by accident, as the 1.8V rail in one interface will get connected to an external ground (which could be a short circuit depending on how ground is connected externally). Is the 1.8V current limited in any way?
Your solution using USB_V+ also doesn't prevent this situation, since it shorts 1.8V and gnd together when both interfaces are connected to host computers.

I don't really understand why you want to build 4xN fets to protect N control switches when a single fet to isolate the "switch common" net from external ground would be sufficient.

If I plugged in controller B and had no FETs between the inputs, then wouldn't IN_B be connected to ground via IN_A?  Granted there should a pull down-resistor in the way somewhere, but then I'm playing off the pull-up on B vs the pull-down on A.  *If* I have controller A completely disconnected from the rest of the circuit at all other points that's not an issue, but I'm concerned that there's a chance the grounds might be connected somewhere.

I don't know if there's any current limiting on the 1.8 V rail.

I've been thinking about the case where someone might plug in both controllers at the same time, and I'm thinking an XOR gate with inputs tied to the USB +5 V lines would give me an "OK" signal I can use.
« Last Edit: May 23, 2017, 05:31:32 am by knotlogic »
 

Offline knotlogicTopic starter

  • Regular Contributor
  • *
  • Posts: 189
  • Country: sg
Re: Interfacing two controllers to one button
« Reply #4 on: May 23, 2017, 01:47:04 pm »
Why not use some transistor output optoisolators:
1. Parts count will be less.
2. Switch contacts will be kept clean because a decent amount of current is required  to light the LED in the opto.
3. It will be less susceptible to static and RF.

Parts count would be less and it would be an easier solution, yes, but the optoisolators I've seen so far would cost quite a bit more.

OK, looks like I was mistaken.  I had another trawl through the Mouser catalog and I found a whole bunch of optocouplers that will make for a cheaper solution.  Going to have to redo the circuit, but should be easier this time round.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf