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.
If both computers are on together, then, as you said, there is no need to switch the 5V supply.

The 4066 IC could be supplied by this 5V.
The control pins of two switches (belonging to D+ and D- of one computer) could be connected together and made at ground level (for off state) by a common resistor (say of 10K). By using 1P2T switch, the 5V could be applied on the switch control pin (10K) of one of the two pairs.

Edited:
But if you can use 2P2T switch, the 5V could be switched too.
 
KeepItSimpleStupid So there won't be any problems if I switch the +5V lines? It won't blow up my USB port right. :p


If you look at a USB connector, https://www.ti.com/general/docs/refdesignsearchresults.tsp, the inner pins are recessed. The power connections are made before the data connections are.

The device "enumerates" power. i.e. A small amount of current is allowed until the device requests more. With phones, particularly, there are pull-ups on the data lines that can let the device charge without actually enumerating. Those pull-ups let the phone say charge at 500 ma or 1 Amps instead of 100 mA.

EDIT: Here's abetter pic

https://commons.wikimedia.org/wiki/File:USB.svg
 
Last edited:
KeepItSimpleStupid Okay, I think I understand what you are trying to say. So, switching the power lines with the 4066 won't have any effect on it. Also, my keyboard is rated at 5V and 100mA so I don't think I will pull ups will be used and so there is no danger of current over-flow.

One more question how do you think I should toggle the control on the 4066. Should I plug in an external adapter or the data line's power will do it.?The control pins need to work in 1-3.5 volts so I will need to bring the voltage of the power lines down using a resistor right ?

Thanks.
 
Kerim What could happen if both the PCs were not on together. I think there might be a danger of current back flow. To stop it we can use a diode on the power lines just to be safe right

Thanks
 
The 4066 is incapable of switching power.

Your Box may have to be an independent device.

At one point in time, I used a piece of software (Windows). I was able to use two independent computers and effectively move a mouse/keyboard between monitors. The computers were networked as usual.

I'd bring may laptop to work and use my work's keyboard and mouse on my laptop. I forget the name of the program.

Found it (multiplicity): **broken link removed**

It's free too.
 
KeepItSimpleStupid Well, then I will have to switch the power line using a simple toggle switch and then switch the data lines using a 4066. Also, the toggle switch would be used for both the power lines and the control pins of the 4066. How does that sound?

Also, I am aware of the software approach, but I wanted to get into electronics and a simple KM switch sounded like a good starter project.
Thanks btw.
 
Kerim What could happen if both the PCs were not on together. I think there might be a danger of current back flow. To stop it we can use a diode on the power lines just to be safe right
Yes, there is that issue. This has probably been mentioned already, but you can use a pair of diodes on the PC 5V supplies to isolate them from each other if you insist on using an analog switch IC.

The simplest, safest and most robust is to use a 4PDT mechanical switch and just switch all the lines that way. Hopefully the keyboard will be reenumerated when switched over to the other PC.
 
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?

Thanks.
 
4PDT switches ( https://www.newark.com/multicomp/1m41t1b1m1qe/switch-toggle-4pdt-5a-250v/dp/98K4992 ) are common. OK 3PDT exists too: https://www.newark.com/multicomp/1m31t1b5m1qe/switch-toggle-3pdt-5a-120v/dp/95M4614

Just plain wires may be a problem. i.e. maintain twisting on the data lines.

An Aside:
I had one USB device that I liked. It's a mouse with a "pretty big transmitter side", but the mouse "fits perfectly" in my hand. When they break, I buy used ones. The USB side usually breaks. I have put a USB surge suppressor on it and, so far, zero issues. There's no surge suppresssion that I could see by opening up the devices.

I've only had one other USB issue which I have never solved. I had a phone that worked fine, but my current phone doesn;t. I can't really charge and use tethering at the same time. The phone's battery dies. I even tried an isolator which theoretically allows independent power.
 
KeepItSimpleStupid Yeah I know but you see DPDT switches are costing me like 1$ for a pair. Also, they have a lower max current setting. I don't need like 5A of current right. At max I will be needing 250to300mA.

So I made temp circuit using two DPDT switches. How does this look?

Thanks
 

Attachments

  • version 1.PNG
    version 1.PNG
    12.6 KB · Views: 110
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top