hello,
I hope this forum is the right place to ask.
Project:
I am currently building an arcade machine, with multiple systems under the hood (currently 1 raspberry with arcade games, 1 Nintendo Switch and 1 PS4).
There will be 4 players with each having 1 joystick (= 4 inputs), and ~ 12 buttons each (12 more inputs).
Maybe a couple more buttons for other purposes. All those inputs are digital and behave like a witch closing a circuit (that's actually what they are). There can be some other type of controls like gas pedal, steering wheel, which would be analog.
I want to have one button per console on the dashboard that will:
change the TV HDMI input to the correct console (I will do that with rasperry and cec commands)
make the joystick and buttons send their input to the right system
there are multiple controller boards on the market where one can connect joysticks and buttons. Those boards then send the information formatted for the right console(whether digital or analog). they also take care of special buttons (Nitendo Switch Home/PS button). I intend to use those boards.
(for instance: http://www.brookaccessory.com/detail/09922855/)
What I was thinking:
My simple mind thought of having and Arduino with 20buttonsx4players=80 pins and 20buttonsx4playersx3systems=240 output pins. I am not even sure that's even possible with expanders.
An this would only conver digital input. it would have to be more intelligent to grab and forward analog inputs.
All I want to achieve is very simple in fact;
Think of a railroad switch that will just route the player's inputs to the right controller board. In this case I don't have to care about what information goes through, it is just forwarded.
I want it to be as open as possible. So if I need to add more console, it is just about getting the right controller boards added.
All those buttons will be pressed by humans.
In summary, i want to build the Switcher in the below diagram:
thanks dave-in-nj.
You are absolutely right, no need to have all 4 players on the same circuit. it actually makes more sense to build for one player.
Number of buttons: ~ 20
Number of analog: up to 3
Your suggestion about letting the signals go to all consoles was one of my first thought, but there can be undesirable effects if one gets unlucky with the sequence. For instance a game could be deleted from the Ps4, or worse the sequence could lead to the menu to disconnect the controller. For this reason I want to stop unintended signals.
can you delete an game with only analog movements ? that is a particularly scary thought.
since digital and analog are generally different animals in our world, we treat them separately.
I asked about having the analog bits only.
the digital bits are easier to handle with a digital de-multiplexor
a rotary switch , if you are old enough.. "A" would have your VHS go to your TV or "B" would have your DVD go to your TV.
you want this, but in spades !
a multiplexor might have 4 inputs go to one output. say, 4 switches to one input pin.
you select one of the 4 channels and you can monitor that one pin, ignoring all the rest.
what you want is reverse, one button in, to go to one of 4 outputs.
there is a whole world of these chips. finding the one(s) for your application to allows for your power levels, speed, quantities, etc is your task. DigiKey has a neat search function to help you find what will work.
the good news is that there is a specific chip or family of chips that will make this project come to life.
Seems to me what you need is a "KVM Switch". I expect modern ones have HDMI and USB ports. You may need a small USB hub also. You can make your own USB controllers, for the extra buttons, using Arduino Pro Micro.
@Paul,
a USB KVM would work if the consoles were all simple inputs. That's true for the Raspberry where the controller board emulates a usb key board ( buttons -> controller board -> usb -> raspberry).
Unfortunately modern consoles (like PS4) expect more than that. the "PS" button is needed evertyime you want to start a session and is complex to generate. This is very well done by some manufacturer who provide enhanced controller boards for this specific purpose. I am not planning to reinvent the wheel and just use what they have done.
regarding the HDMI control, I have an HDMI switch that I wil control with a raspberry / this is not only to switch the HDMI source but also to control the screen on/off to limit kids playtime. [If you are interested to know more, I have a coin acceptor that will connect to a raspberry which will set a timer based on the amount of coins/tokens that are inserted and then will power off the screen with CEC commands. I did not want to fiddle with sending IR to the TV or the HDMI Switch]. But as i said this part is sorted, it is just the players input routing that needs to be figured out.
@Dave,
I looked into the multiplexer and that looks very good. only downside is that I would need to have many of them. If I am not mistaken a 16 channel would catter for 2 inputs / 4 consoles (2 bits for console choice and the other 2 for the 2 controls).
Correct me if I am wrong:
I would then need 10 of those to achieve 20 inputs for one player. While doable, is there any other multiplexer you can think of that could do better? I looked online but anything with more that 16 channel is starting to get pricey. Also, with that mux I would limit myself to 4 consoles. I am pretty sure I will add one more one day... :-(. So to be safe, i would need 20 of those instead. (1 mux / button). The 16 outputs would be a bit wasted but give room up to 16 consoles. a bit overkill.
@ Dave again.
I did not get the "A/ B/ C/ D paralparallel port printer switches". how would you implement this, I am not familiar with it
lolnsw:
I realise that for analog, I would need one mux per input anyway. So may have to go the route of 1mux/1input?
I think you missed the point of my question.
if you move the joysticks of a controller, just the joysticks, can you erase, delete, of corrupt a game if the console was switched off ?
if you look at a MUX/DEMUX you can have 4 switches feed into the MUX and then be output onto one channel.
or, you can have one switch into a DEMUX and then, depending on how the DEMUX was set, the input would be sent to one of 4 outputs. ie one of 4 consoles.
it is easy to find a devcie that has 4 sets of inputs (16 switches) with groups of four
I
also, it is easy to find a device that does that with digital signals, the off/on of a switch
and it is easy to find a device that does that with analog signals,
the analog versions are often more expensive, and would pass digital signals with ease.
spend some time researching them and you should find that all the Arduino would do is to switch them and not much else.
As PaulRB mentioned, you can buy a device that switches signals. the KVM does that.
in the old days of bear skin rugs and stone knives, we used parallel ports for printers and an A/B or A/B/C/D switch would switch all the pins of a Centronics parallel cable.
@Dave
there are 2 types of joysticks. The classic old ones that are actually just 4 buttons up/down/left/right. Those are digital. Then new consoles also include analog joysticks (as well as the classic ones).
Other analog inputs could be gas/break pedals or steering wheels.
Depending of what the controller board does, it could well interpret the gas pedal as a digital input, etc... Very edge case I agree, but if i embark on this i would like things to be as clean as possible.
To answer you question about the console being off. As long as the PS4 is connected to main, you can wake it up with the "PS" button on the controller. So yes you could end up in this case. I don't want to cut the main either. The console takes its own sweet time to boot, so when I switch to that console I do not want to wait what feels like an eternity.
Lastly, to comeback to USB KVM. note that all the controls are individually wired to the controller board. the USB plug on those boards is just to connect to the console. and that board is specific to the console. Also, some board are wireless and do not need that physical connection. it just bluetooth to the console. Now, that wireless link was optional to my design.... until the recent announcement of Apple and its Apple Arcade TV. Sticking an AppleTV under the cabinet, will mean wireless connection only to the Apple TV. So the need for those boards.
As you could guess, electronics is not my area. Would you mind pointing me towards the best type of devices doing this? not a specific model, but I could narrow my research towards the best architecture?
I see i could use relays to power on/off the controller boards,
or use demux as you mentioned
or transistors placed before each input of each controller boards - but that's well over my capabilities. I guess that's what demux do more or less?
or something else i don't even know exist
Update: At the moment, the simplest approach to me is to stick a 1:8 demux (digital/analog) for each input
based on the idea that a switch is a switch is a switch....
a button switch could be to 'fire' or 'jump' where as another could be for some other thing....
if each console has specific interface requirements for the controller, then controllers are not comparable and there is no need to switch them, just pick up the matching controller.
if you have a controller that has a dozen switches, and two joysticks. one would expect a dozen wires plus whatever the joysticks need, however the plugs appear to have much fewer wires, making it seem like the signals are not just an off and on, but actually some form of digital protocol. If that is the case, then the one controller type per console may be required.
More depth of understanding of what the signals are, is in order.
Switching them can be done, but the information being carried may need to have an interface if you want one universal controller.
you are 100% right.... and that's not what I am trying to achieve here.
As you rightly mentioned, there aren't that many inputs into the console, and that's what the controller boards are doing.
Here is an example of a simple controller board that takes joysticks and buttons and connect to a computer and pretending to be a keyboard:
Some other controller boards are more elaborate to emulate a modern controller, connecting to the console via usb:
Finally, some are even more elaborate and resemble the previous one except that they can also connect wirelessly to the console:
All those boards are solving the issue you mention about the right button mapping and sending it to the console in the right digital protocol.
My goal is to use those boards to handle the communication with the console. The difference is that the button will not be directly connected to those boards, but to the switcher. My current thought process leads me to have each button connected to a 1:8 demux. An Arduino will also be connected to the demux to decide where to send the signal to.
With this design, I don't care about the digital protocol used to send the information to the console. That's handled by the existing controller boards. That's why i was trying to explain in my first post, maybe I was not clear.
so:
Arduino
|
Jump button --- DEMUX ----- 1 of 8 possible controller boards for that player --- Console
So for 1 player/4 consoles set-up:
20 buttons
20 demux
4 controller boards (1 per console)
Considering all of this, do you think the demux is the best approach for this?
I would suggest that you draw out the project in crude block form, but show the lines.
it would seem you will need a lot of the demux chips for the project.
two choices are to buy them on boards or custom make your own board.
in my view, the simplicity of this project is screaming for a custom board.
much easier than you might think if you have never done such a thing.
lots and lots and lots of soldering.
I wonder if JCPL Assembly process JLCPCB would be advantageous to you ?
yes I think i will go the way of the custom board. Lots of soldering, but should be achievable and I will get the opportunity to improve on that front.
I may ask someone to create the pcb design though, unless I find the time to dive into those software.
I looked at the assembly option, the cost is not that appealing. But maybe I will go that way after I finish soldering player 1!
Thanks for all your suggestions, much appreciated.