Remote-controlled USB Switch

When [beerninja] wanted to swap his USB keyboard from one game console to another without mucking about with wires, he asked the Hack A Day forums for some help. [Meseta] (AKA [UAirLtd]) came to the rescue and built [beerninja] a remote-controlled USB switch.

After opening up a no-name USB switch, [Meseta] discovered that the switching is done with simple relays and switches. A hugely overpowered Forebrain ARM dev board was used to pull each switch low for a few hundred milliseconds to switch the output USB port.

For the infrared remote control, [Meseta] dug into Lady Ada’s IR sensor tutorial and decoded buttons 1 through 4 on a Sky TV remote. Each button from one to four corresponds to the buttons on the USB sharing switch. The ‘0’ button was also decoded as a convenience to put the Forebrain into its reprogramming mode. After drilling a small hole for the IR receiver, the finished project was stuffed back into the original steel enclosure.

Check out the video of the switch in action after the break.

[youtube=http://www.youtube.com/watch?v=2SHXNDUEl_E&w=470]

10 thoughts on “Remote-controlled USB Switch

  1. The Ken Shirriff library mentioned in the article is the much easier way to handle IR signal, IMHO. Just create an instance of the IR receiver class, and you’ve got a real simple way to retrieve and handle codes without needing to worry about pulses and pulse length.

    I built a remote control model rocket launcher with the same library. It made decoding the two dozens buttons that I needed quick and painless.

  2. This is awesome but that using a Forebrain Cortex M3 dev board is definitly a OVERKILL. You could recreate this with a small PIC micro. I would say … PIC18F14K22 which cost $2.20 at digikey

    With a custom PCB i would say about $8 USD total give or take a few bucks…

    That USB Switch cost $16
    http://www.ebay.com/itm/4-Port-USB-2-0-Printer-Scanner-Auto-Sharing-Switch-Box-/190555443405?pt=LH_DefaultDomain_0&hash=item2c5dfd50cd

    So i would say about $25 total cost for this…

  3. A cheap product uses relays, and it shows. A higher end USB KVM will emulate the host USB devices including monitor to the non selected PCs. Would not trust this with any storage devices.

  4. I did something like this a couple of years back, but fully isolated so that it could safely switch mains voltages. I must get around to documenting it.

    USB isn’t easy to isolate so instead I used RS232. My server has two serial ports as headers on the mobo. I used opto isolators for the RX and TX lines, and the ground is not connected at all. As a bonus the opto isolators do level conversion to TTL for the microcontroller, and are powered on the PC side from the serial port itself.

    A made a little command line program to control it is I can use it in scripts. I have a USB HDD that is fully disconnected from the mains and USB when not in use, so even a severe power spike from lightning wouldn’t be able to damage it. Plus it saves power when not in use by eliminating standby mode.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.