Author Topic: Enable/Disable USB port using MOSFETs  (Read 4571 times)

0 Members and 1 Guest are viewing this topic.

Offline Niall MurphyTopic starter

  • Newbie
  • Posts: 2
Enable/Disable USB port using MOSFETs
« on: March 08, 2014, 07:48:02 pm »

I need to simulate plugging and unplugging a USB device. So instead of physically disconnecting the USB cable I want to use something to open the four lines. It miht be sufficient to do the 2 signal lines - I am not sure.

I will be using a GPIO pin from a Raspberry Pi to enable/disable

My first thought is that the control line could drive the gate of a MOSFET and the source of the MOSFET is one of the pins of the USB port.

I have seen optoisolator boards and I could try using one of those, but they seem pricey and I do not need the optoisolation - Apart from my circuit to turn the USB off, the other device connected is an off-the-shelf headset and I do not exect that to damage the USB port.

Is there some other component I could consider here. If MOSFETs are the way to go any tips on selecting the specific MOSFET that would work would be appreciated. The USB traffic will be fast but the gate only gets switched every few seconds.
   
  regards,
           Niall Murphy
 

Offline abyrvalg

  • Frequent Contributor
  • **
  • Posts: 824
  • Country: es
Re: Enable/Disable USB port using MOSFETs
« Reply #1 on: March 08, 2014, 08:41:00 pm »
What kind of device is it? In most cases it will be enough to switch VBUS line only (an easy task - single MOSFET), but for some kinds of self powered devices w/o VBUS detection it can be a bit tricky.
 

Offline mazurov

  • Frequent Contributor
  • **
  • Posts: 524
  • Country: us
Re: Enable/Disable USB port using MOSFETs
« Reply #2 on: March 09, 2014, 02:08:26 am »
You can use a single P-type MOSFET, look here for details -> https://www.circuitsathome.com/camera-control/simulating-cable-disconnect-on-usb-host-shield-2-0  However, it is better to use a dedicated switch, look here for details -> https://www.circuitsathome.com/mcu/vbus-power-control-on-usb-host-shield

With sufficient thrust, pigs fly just fine - RFC1925
 

Offline Niall MurphyTopic starter

  • Newbie
  • Posts: 2
Re: Enable/Disable USB port using MOSFETs
« Reply #3 on: March 09, 2014, 01:32:02 pm »
The devices are headsets, so they are not self powered, so it sounds like controlling VBUS with a MOSFET will be sufficient. The links in the second post were very useful. Thank you mazurov.

Now I just need to get soldering!
   Niall
 

Offline sacherjj

  • Frequent Contributor
  • **
  • Posts: 993
  • Country: us
Re: Enable/Disable USB port using MOSFETs
« Reply #4 on: March 09, 2014, 01:49:53 pm »
Also be aware that there are dedicated USB switching chips for low loss enabling and disabling of USB power, if you have trouble with a dedicated PMOS setup.  Do a search for high side power switch.
 

Offline mazurov

  • Frequent Contributor
  • **
  • Posts: 524
  • Country: us
Re: Enable/Disable USB port using MOSFETs
« Reply #5 on: March 10, 2014, 01:31:20 am »
The MIC2004 has very useful feature - when turned off it shorts the output to the ground draining whatever decoupling capacitors may be present on the VBUS on either side of the USB connector. Other "dedicated USB" switches are not that different from P-MOSFETs.
With sufficient thrust, pigs fly just fine - RFC1925
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf