0
\$\begingroup\$

I am planning on using 74HCT4066N analogue switch (datasheet) to trigger button presses on two separate gamepads at the same time. The circuit I plan looks something like this:

enter image description here

Can I use this analogue switch to control completely separate circuits? The problem, I suspect, is that these circuits each run off a separate ground, so I can't know what their voltage might end up being relative to the AA battery's ground. Is this a problem?

If I can't use this type of analogue switch for this purpose, then what should I be using to press both buttons at the same time?

Thanks, Allen

EDIT: Here is the circuit updated with DrFriedParts's suggestion of connecting the grounds... Please let me know if I got anything wrong here...

enter image description here

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Your suspicion is correct, but you can fix it... just connect all the grounds together. \$\endgroup\$ May 15, 2015 at 2:08

2 Answers 2

1
\$\begingroup\$

You need a common reference...

Your suspicion is correct, but you can fix it... just connect all the grounds together.

You may actually not need that complicated of a circuit. If you test the buttons in the controller(s), you will likely find that one side of the button-switch is already connected to ground. So all you have to do is short out the other side to ground and you are done.

Make sure that you are not driving the button when you do not intend to "press" it as this will create electrical contention and damage your output circuit.

In summary...

  1. Connect the three grounds.

  2. Determine if the controller buttons are grounded.

  3. Connect your analog switch (or microcontroller GPIO output through a big resistor) to the other side of the button.

  4. Ensure that you are switching from High-Z (GPIO in "input" mode) to Output Low (ground).

\$\endgroup\$
6
  • \$\begingroup\$ I've determined that both controllers are using grounded buttons. My Schmidt trigger is an inverter, so I don't think I need to worry about the driving it when it should be open. I've updated my OP to include a new circuit diagram with the suggested changes. Please let me now if I got anything wrong! Thanks! :) \$\endgroup\$ Jul 25, 2015 at 21:13
  • \$\begingroup\$ @Allen -- Sorry for the late reply. I can't quite follow your updated schematic. What is your goal? You want to manually press one button and have that press distributed to the two controllers? Or you want some microcontroller (Arduino, mBed, Stamp, etc...) to so the "pressing" of the button? \$\endgroup\$ Jul 28, 2015 at 11:16
  • \$\begingroup\$ Thanks for checking back! I will not be using a microcontroller. I want to manually press a button and have it distributed to the two controllers. \$\endgroup\$ Jul 28, 2015 at 15:41
  • \$\begingroup\$ @Allen -- Then you don't need any of the microchips. Just a button and two resistors. \$\endgroup\$ Aug 2, 2015 at 20:14
  • \$\begingroup\$ Ah, right, now that I understand that the grounds of each controller can actually be connected, it could be done by merging the two switches into one. Not sure where the resistors would go or how I would tell what values they should be... But that said, this simpler solution would not be pre-debounced, but would rely on the debouncing of each controller. \$\endgroup\$ Aug 3, 2015 at 4:25
1
\$\begingroup\$

You could try using opto isolators - the diodes in the opto's share a common drive circuit and the photo-transistors each connect to a different circuit. Isolation is guaranteed up to a few thousand volts normally so this should not be a problem: -

enter image description here

What you have to ensure is that the circuits that normally expect an open or closed contact provide biasing like in the arrangment above. This can be measured with a multimeter to establish the correct connections to the photo transistor.

In the event that this cannot be established or proven, use a miniature solid state relay: -

enter image description here

It has a bi-directional output and can switch AC. You can get low power versions like this one: -

enter image description here

\$\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.