3

I would like to make a switch for my USB cable.

It's a microscope, so its data is important.

Question is, in the "off" state, after disconnecting the two power cables, do I have to disconnect both D- and D+ (purple and white cable) in the USB cable or do I just have to disconnect one of them? If so, which one?

Sorry, I'm new at this.

Many thanks.

7
  • In order to answer this question, it would be helpful to know the model of the microscope. – MariusMatutiae Jul 9 '15 at 8:34
  • Honestly, I have no idea. I was handed to me by a senior who have since left. But it's usb powered using a usb 2.0 port. Like a regular mouse/keyboard. Hope it helps. – hello Jul 9 '15 at 9:08
  • why not try each with test data? it's messing with data not power so I don't see risk. And i'm wondering if perhaps this is ok for the electronics.stackexchange.com site. It's also not clear at all to me what you are talking about. And generally it can help to take some pictures. Why are you disconnecting wires how about asking about reconnecting.. And what device if any, are you adding when you disconnect and reconnect. What kind of switch. You should provide all the info that you can. Put pics on imgur and link to them – barlop Jul 9 '15 at 11:08
  • imgur.com/eUC9aWa Image shows the rocker switch I'm trying to get the the usb to disconnect and connect both power and data in the off and on state. The risk is, I do not want to cut the data cable if I do not have to, and if indeed I do need to cut both data cables, I'll need 3 switches instead of the 2 connection rocker switch I have in the picture. I'm not adding any device, just a switch to power off the and cut off data to and fro the microscope. I hope this clarifies things. – hello Jul 9 '15 at 12:46
  • or just get a USB hub with a built in switch. That switch looks likes its meant for mains. – Journeyman Geek Jul 10 '15 at 0:20
3

1. Easy Way

Given that your device is USB-powered, you can use a simple switch to cut only the VCC (+5V) line, and leave D-, D+, and GND connected.

Simple, effective, and your USB controller won't mind at all.

2. Easier Way

Don't waste your time with a switch at all. Buy a short USB extension cable and plug/unplug your microscope into that as required.

This is my preferred method ;-)

3. Proper (Hard) Way

Emulate the way USB plugs work in real life. So your switch needs to turn things OFF in this order:

  • Disconnect D- and D+
  • Disconnect VCC
  • Disconnect GND

And vice-versa when turning ON:

  • Connect GND
  • Connect VCC
  • Connect D- and D+

This is surely going over the top. Someone has made something similar already and provides good information. You could modify this project to suit.

2
  • Many thanks! I still have a qns, for the 1st option, which is what I'm hoping to do, will it mean that the D- and D+ cables are still transmitting data? – hello Jul 10 '15 at 13:04
  • @hello Data transmission will stop. Because your microscope requires USB power to operate, when VCC is cut there won't be power for it to operate its circuits. – misha256 Jul 10 '15 at 23:16

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.