1
$\begingroup$

So here's my situation: I'm a mechanical engineering student working on a product innovation for one of my courses. The product itself is fairly heavy into embedded programming, which I'm comfortable with. What I'm less comfortable with is the small electrical engineering bit I need to do.

Essentially, I need to be able to control (turn on or off) a high-speed (USB) data line via transistor (or SSR, if you want to be pedantic). When a high signal is sent to the (base or gate), the line is enabled, and data can flow. When there is a low present, the communication is disabled.

Because I'm dealing with very low current flow, my inclination is to use an NPN transistor, mostly because I have a few handy. Is there a better transistor or special rating I should be looking for for this application?

$\endgroup$
  • 1
    $\begingroup$ What you need here is called a Tri State logic gate. When the gate is enabled high, data passes through and when enabled low no data passes. Very simple to use, available from Digi-Key, Mouser, ect . $\endgroup$ – William Hird Apr 30 '16 at 5:26
  • $\begingroup$ Also look at MOSFETs $\endgroup$ – Russell McMahon Apr 30 '16 at 14:07
  • $\begingroup$ @WilliamHird, That's exactly what I was looking for. To be explicit, when enabled, these will allow bi-directional communication correct? $\endgroup$ – agentroadkill May 1 '16 at 3:01
  • 1
    $\begingroup$ Now you want it to be bidirectional :-) You didn't say that before, OK, what you want is a bidirectional analog switch with an enable line. Use Texas Instruments device TS3A5223, check out the data sheet to see its operating characteristics . $\endgroup$ – William Hird May 2 '16 at 0:28
1
$\begingroup$

You don't want to physically interrupt USB data lines. These have controlled impedances, are bi-directional, and differential. These issues makes "switching" the lines difficult. In addition, DC resistance is used as signalling to the host when a device is attached, and what kind of device it is.

It is unclear what "turning on and off" the data lines of USB means anyway. Are you trying to stop acting like a device at all, or just stop transferring data? If the former, then the host will have to go thru enumeration when the device is "turned on" again. Note that this can be a slow process and is highly dependent on the operating system.

I have a USB device that Windows 7 recognizes quickly, indicated by making a short noise. I don't know what the OS does, but it can take a few seconds before the device is actually available to a program. This is much faster on other machines, so it's not the device.

You should really consider doing this at the logical level, not electrically. Let whatever microcontroller that is connected to the USB shut down its USB peripheral if you want to make the device appear to completely go away. Or, depending on your system and what "on/off" really means, this micro can just ignore any new received data and not send any new data to the host.

Overall you need to think about what you are really trying to accomplish instead of asking about this "solution" someone dreamed up. Basically, that's not how USB works.

$\endgroup$
  • $\begingroup$ Thanks for the info.... I was aware of most of that, but it hadn't really come together in my head. If the impedance matching is that important, I'll interrupt the 5V line in stead. Doesn't make a huge difference for what I'm trying to do (stop a USB drive from being recognized). $\endgroup$ – agentroadkill May 1 '16 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.