USB switch for both data and power

3

1

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.

hello

Posted 2015-07-09T08:31:50.370

Reputation: 33

In order to answer this question, it would be helpful to know the model of the microscope. – MariusMatutiae – 2015-07-09T08:34:56.150

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 – 2015-07-09T09:08:16.960

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 – 2015-07-09T11:08:27.057

http://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 – 2015-07-09T12:46:07.260

or just get a USB hub with a built in switch. That switch looks likes its meant for mains. – Journeyman Geek – 2015-07-10T00:20:13.773

@JourneymanGeek Most self-powered USB hubs continue to operate even when switched off. They then source power from the USB connection itself. – misha256 – 2015-07-10T00:24:54.463

I have one with a switch per socket. Pretty handy thing. – Journeyman Geek – 2015-07-10T01:01:59.067

Answers

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.

misha256

Posted 2015-07-09T08:31:50.370

Reputation: 10 292

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 – 2015-07-10T13:04:04.077

@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 – 2015-07-10T23:16:37.200