I have two Logitech G27 wheels that I would like to connect to a computer as part of a simulation. I want to be able to switch which wheel is controlling the simulation with a button press. The simulation software only supports one wheel at a time, so I would like to plug both wheels into the arduino and then use the board to relay the signal to the computer.
My question is two fold.
First, would it be possible for me to plug a wheel into the arduino board and have it pass on the information? Ideally I would want the arduino to relay the information in such a way that the computer won't even know the board is there.
Second, If I plugged a second wheel into the board could I use the arduino to switch between relaying information from the first wheel to relaying information from the second wheel and vise versa?
There are USB host shields and modules, but to connect two at the same time you would have to build your own circuit.
I can see a lot of bears on the road with this.
It might be possible to do on a higher powered device that has hardware support for both host and device USB (and have it pretend to be a wheel while listening to the two wheels, and switching as appropriate) but this is a major undertaking - I would try to find a ready-made device to do this.
I think your best bet might be to modify the wheels - cut all the wires from the controls, and use a many-channel analog multiplexer to switch between them (ie, before it got to the electronics that interfaced with the USB.
A dirty way to do this would be to get a USB hub and modify it so that you can switch the 5 V power to two of the ports, using a relay to power only one or the other.
Relay boards for the Arduino are plentiful on eBay.
And here's a USB hub:
The 5V traces to the right hand two sockets are easily cut and you would just solder connections to the +5 V pins under the board. Note it has a polyfuse for overload protection.
The computer will "da-doop" however each time it switches.
I guess if you wanted to make a very 'dumb' circuit on the cheap, you could just rig up a dedicated switch that connects the 5v red wire for every PC you wanted to control and not even use a micro-controller, relays, or power. Maybe use one of those multi-positional turn switches. You would need a hub to plug your keyboard and mouse into and do your switching on the USB cable that would normally connect to the computer.
I was thinking about something along the lines Paul_B said :
I am going to try to build one this week supporting 5 PCs. I show 3 in the schematic for simplicity.
Basically use an arduino to read x inputs, control x relays and light x LEDs.
Just waiting on an order of type A & B USB jacks so I can prototype it without cutting up my cables.
I have no idea if it will work since I'm switching on the upstream cable and not power to the peripherals themselves. I might end up needing to switch on the green and white data lines and double my relays if that's the problem.
Haha OK noted. I was only going to have one LED lit at a time, ever.
Btw am I wrong for thinking I could use transistors ( or transistor arrays ) to switch USB 'clients'? Just thinking it's a lot of relays if I end up needing to switch green and white data instead of just the red power wire.
There are specialists chips designed for switching power to USB devices that contain all the safety stuff.
My worry with your proposed circuit is that you will be applying active signals to chips with no power, that is never a good idea and can result in latch up and damaging the chips.
Grumpy_Mike:
There are specialists chips designed for switching power to USB devices that contain all the safety stuff.
My worry with your proposed circuit is that you will be applying active signals to chips with no power, that is never a good idea and can result in latch up and damaging the chips.
Yes and getting feedback is the whole reason I made the schematic ( thank you! ). Obviously I don't know a lot about USB specifications yet.
I did realize that the original poster was attempting to use two peripherals with one computer, whereas I'm trying to use a single keyboard and mouse with multiple computers.
So the whole idea of switching the power on/off as Paul_B suggested to him is probably not the solution in my case. My keyboard & mouse will have independent power through the powered USB hub and will always be ON. I'm just wanting to switch which PC the hub is talking to.
Given what you've said ( I don't have a specialty chip for this ), I'm wondering if I should leave the 5V red's disconnected entirely and instead switch on either the white or green data wire ( whichever sends data TO the PC from the hub ). But again I don't know if it matters whether the hub 'hears' incoming signals from the PCs it cannot answer, maybe there is some kind of discovery packet the PC is sending intermittently.
I'd like to figure this out and build something for satisfaction of having done so rather than capitulate and buy a KVM.