Electronic – Designing a simple automatic USB switch

designmosfetusb

I'm trying to come up with a simple way of sharing a USB peripheral between two USB hosts (computers) so that the host that is currently turned on controls the peripheral. I'm targeting low-speed USB1.1 devices. Full-speed devices would be nice. High-speed (USB2) devices are not really needed.

My first stab is the circuit below, made up of two diodes and some MOSFETs. I only show Vcc and D+ for clarity. D- gets the same treatment as D+, and the grounds are connected together. You can play with the circuit using the falstad simulator applet. I added two 10k loads to make sure the outputs don't float. When the circuit is part of a USB connection, the resistors in the host and in the device should take care of that.

USB Switch Circuit

Questions

  1. Is the basic idea of switching USB signals with MOSFETs sound? I understand that the channel in saturation mode behaves like a resistor, and that the resistance can (depending on gate voltage and device) be in the order of milliohms. Is this correct?
  2. The output Vcc will be a full diode drop lower than the input Vcc. I think this will put me outside the tollerances of the USB standard even if the input Vcc is 5.00V. What can I do to prevent/lessen this drop?
  3. In this circuit, if both PCs are switched on, the results are all messed up. Specifically, if both Vccs are high and one D+ is high while the other is low we get into a short circuit situation. Is there an easy way (with little additional circuitry) to shut everything down if both Vccs are high? Should I just bite the bullet and put in a small micro-controller to act as a gatekeeper?

Best Answer

There are actually IC's available that do this sort of thing, essentially analog switches but designed specifically for USB 2.0 such as the FSUSB42MUX -- IC USB switch DPDT. Only $1.70 in single quantities from Digi-Key.

enter image description here

They appear to only be available in SMT packages, such as 10-MSOP, but these can be soldered by hand easily enough, and even placed on a breakout board for prototyping.

enter image description here