Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

USB Diverter

Status
Not open for further replies.
KeepItSimpleStupid You asked about the connectors so that I can connect my USB devices right? Or was there any other reason.

I have these handy. I have got 3 of such connectors. One for the USB keyboard and the other two for the two PCs. I also have two USB to USB wires so that I connect them to the PCs.

At first, I will try to switch the keyboard and then if successful I will switch the mouse as well by buying another 4PDT switch.
 

Attachments

  • DSCN2451.JPG
    DSCN2451.JPG
    652 KB · Views: 135
  • DSCN2452.JPG
    DSCN2452.JPG
    466.4 KB · Views: 114
dougy83 Why do we need a 4PDT switch. Can't we just use a 3PDT switch and connect the GND without switching. Also, will the 3PDT switch have central neutral positions?
You could probably get away with 3PDT (you don't need a 4PDT); the grounds of the different PCs *should* be at the same potential (though you can get a small amount of sparking when connecting things with floating grounds, like some laptops - it's the fault of the PSU). The 3PDT can have a centre neutral position; it depends on the model you purchase.
At first, I will try to switch the keyboard and then if successful I will switch the mouse as well by buying another 4PDT switch.
I'm guessing you're already aware of this, but if you want to use a single switch, you can connect the mouse and keyboard to a USB hub and switch the connections to the hub.
 
Hello there,

CMOS 4066 switch ?? What? USB signals go up into the gigahertz, USB 2.0 500MHz or better, USB 3.0 goes up to 5GHz or better, USB 3.1 goes up to 10GHz or better. Can the 4066 handle 5 to 10 GHz signals? Cross talk is measured at 8MHz, which is about 1000 orders lower than the required bandwidth. Probably 50MHz tops for that kind of technology. USB bandwidth cant be taken lightly.

I made one for USB 2.0 with a 3PDT switch, which turns the USB device off, keeping the ground line connected. That allows another 3PDT to turn on for a second USB device, with bidirectional signal flow. The wiring is a little tricky however. It didnt work the first time because the wires were too long, and shorter wires didnt seem to work right either so i got a regular USB 2.0 Hub and modified the connectors internally following the wires from the D+, D-, and +5v, and broke into those three. The switch for that channel was mounted right over top, inside the USB hub box, so it was in close proximity. Did not get around to making one for USB 3.0 however. With the required higher bandwidth that would be more tricky.
 
Last edited:
MrAl huh!! Well, I didn't know that. And nobody here seemed to about it either. It seems like it leaves me with using the 4PDT switch only.

How does this circuit look?
 

Attachments

  • 20160621_184519.jpg
    20160621_184519.jpg
    788.8 KB · Views: 125
MrAl huh!! Well, I didn't know that. And nobody here seemed to about it either. It seems like it leaves me with using the 4PDT switch only.

How does this circuit look?

Hi,

Well as long as you have one device being switched on with all four lines and the other device switching off with all four lines it should be just fine. You'll have to keep the wiring short probably. The problem i had in USB 2.0 was i needed at least 3 feet of wire before the switches so i had to modify a hub instead.

Hey let us know how you make out with this ok?
Interesting project.
 
MrAl Yeah the switch I am looking at has an on-off-on functioning. So it should break the connection before making another one.

You'll have to keep the wiring short probably

I didn't understand what you meant by this.

Also, did the common ground line make all the problems that you mentioned in your post # 45?

And yeah... I will keep posting my progress.

Thanks for the help.
 
Hi,

The wiring to the switche(s) has to be short.

I dont think it was the common ground, just the wire length. Shorter wires worked.
 
CMOS 4066 switch ?? What? USB signals go up into the gigahertz, USB 2.0 500MHz or better, USB 3.0 goes up to 5GHz or better, USB 3.1 goes up to 10GHz or better. Can the 4066 handle 5 to 10 GHz signals? Cross talk is measured at 8MHz, which is about 1000 orders lower than the required bandwidth. Probably 50MHz tops for that kind of technology. USB bandwidth cant be taken lightly.
USB 3.x doesn't use four wires, so he's obviously not using it. A keyboard and mouse are not going to request high speed USB and will communicate at either 12Mbps or 1.5Mbps, which is well within the pass bandwidth of the 4066. That said, the issue with the 4066 would be its very high on-resistance (470 ohms for 5V supply), not its pass bandwidth.
 
USB 3.x doesn't use four wires, so he's obviously not using it. A keyboard and mouse are not going to request high speed USB and will communicate at either 12Mbps or 1.5Mbps, which is well within the pass bandwidth of the 4066. That said, the issue with the 4066 would be its very high on-resistance (470 ohms for 5V supply), not its pass bandwidth.

Hi,

Oh yes, and i always like building something more complicated that does less :)

I suppose it might work for a slow keyboard and mouse, but if anything else is used it might not work at all. It depends on other factors we dont have on hand, but a test would show for sure.
But if you insist, there are 'analog' switches made for high frequency transfers that can be used on a PC board.
I cant see any reason to go to that complexity though because for one it does not have to be controlled by an electrical signal. All depends what functionality we want, and when we want it.
 
I suppose it might work for a slow keyboard and mouse, but if anything else is used it might not work at all. It depends on other factors we dont have on hand, but a test would show for sure.
But if you insist, there are 'analog' switches made for high frequency transfers that can be used on a PC board.
I cant see any reason to go to that complexity though because for one it does not have to be controlled by an electrical signal. All depends what functionality we want, and when we want it.
My response was to your statement of requiring GHz bandwidth, which is not the case in his described situation. I never advocated using a 4066; in fact I stated that using a mechanical switch is a simpler and more robust solution.
 
Last edited:
MrAl This is probably a stupid question but shorter as in length, right? Also, why would it cause a problem?

dougy83 Yeah, I am going to be just using this switch for my keyboard and Mouse which operate on USB 2.0 so hopefully it won't be a problem.

What do you think of the circuit, though? Is it right? I was thinking of buying the parts today. So I need to add anything?

Also, did anyone actually open up a KVM switch and see how they manage the high frequency? I took this project to gain information right!! :p

Thanks.
 
My response was to your statement of requiring GHz bandwidth, which is not the case in his described situation. I never advocated using a 4066; in fact I stated that using a mechanical switch is a simpler and more robust solution.

Hi again,

Ok great, and now we have confirmation that only a keyboard and/or mouse will be used with this. If it's a regular mouse or keyboard that's good too.
 
MrAl This is probably a stupid question but shorter as in length, right? Also, why would it cause a problem?

dougy83 Yeah, I am going to be just using this switch for my keyboard and Mouse which operate on USB 2.0 so hopefully it won't be a problem.

What do you think of the circuit, though? Is it right? I was thinking of buying the parts today. So I need to add anything?

Also, did anyone actually open up a KVM switch and see how they manage the high frequency? I took this project to gain information right!! :p

Thanks.

Hi,

Yes shorter wires means each wire is shorter in length. You might get away with using a USB wire, but when i tried that for my devices (mostly USB thumb drives) it didnt make the connection when plugged in. That's when i turned to using a USB hub and wiring my switches right to the hub. That kept each wire less than 3 inches long as opposed to 3 feet long.

The wiring to this represents a transmission line. The transmission line has to carry signals back and forth over the length. The end impedances have to match or else there could be loss of signal or potentially damaging spikes. Because of the way wires translate to transmission lines in theory though is rather complicated so it is hard to predict what is gonig to work when there are so many variables like length, twisting or dual pair, etc. Antenna lines are like this too.
 
MrAl How did you wire your switches to the hub? Can you please include some pictures. Also, the circuit that I posted doesn't lack anything, right?
 
MrAlThis is probably a stupid question but shorter as in length, right? Also, why would it cause a problem?
Longer wires cause more signal reflection, noise reception, higher capacitance, etc. which degrade the signal integrity. It is more of an issue as the communication frequency increases. USB is specified at less than 5 metres (IIRC) between hubs/devices.
What do you think of the circuit, though? Is it right? I was thinking of buying the parts today. So I need to add anything?
Your switch drawing looks correct (ignoring the V- in place of D-)
 
dougy83 My wires are around 3 feet long and a couple of inches inside the box that will house the switch. Also only keyboard and mouse will be used so signal reflection should not be a problem, right?
 
I would expect it would be fine.
 
Hi,


The wiring to this represents a transmission line. The transmission line has to carry signals back and forth over the length. The end impedances have to match or else there could be loss of signal or potentially damaging spikes. Because of the way wires translate to transmission lines in theory though is rather complicated so it is hard to predict what is gonig to work when there are so many variables like length, twisting or dual pair, etc. Antenna lines are like this too.

To a point. I have a CAT5E RJ45 switch. they used a NICE signal relay in the path and wired twisted pairs directly to the pins from the RJ45 connector. It was tested for CAT5E (Gigabit) performance and they do that for every switch.

So, you can get really close or, acceptable behavior, without doing really fancy stuff like impeadance matching a 50 ohm relay to 120 ohms.

You do have to realize that USB is a transmission line and NOT a wire. the keyboard may be USB 1.1.
 
MrAl How did you wire your switches to the hub? Can you please include some pictures. Also, the circuit that I posted doesn't lack anything, right?

Hi,

Sorry i cant supply pictures because for one it is enclosed and i'd have to take it apart again, and two i dont use it anymore so i would have to find it to do any pictures. When i went to USB 3.0 i stopped using it because it was only for USB 2.0, so you see what happens when we design something for an old standard then later in the future decide to 'upgrade'.

But the wiring is so simple it doesnt even need a picture. This is how i did it, think about this..

Took the case of the USB hub apart. Took out the pc board. Found one of four USB connector lines (2 lines plus power and ground). The hub was made with individual ports from the single chip for each USB connector, so that meant i found the two data lines that went to the chip on the end and to the USB connector on the end, then cut them with either a sharp knife (being very careful not to cut any other lines on the PC board) or a Dremel, i think i used the knife on this one.
After they were cut, i cut the next set also, the next to last chip lines.
So now i have two sets of two data lines cut from the connectors, and also two power lines. I did not cut the ground lines.

Now i wire in the switches, which were 3PDT switches. The reason i used the "DT" type was because i wanted to wire both USB A female to one USB chip. Doing this meant that only one of the two ports could be used at any time, and that was cool with me.

Next the switches were wired onto the traces that had been cut, after removing a small amount of green board paint that covered the traces, again being very careful. The leads were kept short, and the switches were wired so that when one switch was off the other switch was allowed to take over the chip port, and when the opposite switch was on it would prevent the other from turning on. This is where the DT comes into play, because the opposite switch provides the feed though when it is off, but does not provide free through when it is on.

I'll try to find it again and see how hard it would be to get apart.
Also, i just realized i probably took pictures already so i'll look for those first.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top