Jump to content

Simple USB KVM

MarcinPe

Hi, I found simple scheme to create USB KVM (one keyboard - two PC's). Can anyone look on this and tell me, should I add diodes on 5V line to prevent burn motherboard? 

IMG_20210411_212338.jpg

Link to comment
Share on other sites

Link to post
Share on other sites

Yes you should have diodes to prevent the supply from one board from feeding into the other. 

F@H
Desktop: i9-13900K, ASUS Z790-E, 64GB DDR5-6000 CL36, RTX3080, 2TB MP600 Pro XT, 2TB SX8200Pro, 2x16TB Ironwolf RAID0, Corsair HX1200, Antec Vortex 360 AIO, Thermaltake Versa H25 TG, Samsung 4K curved 49" TV, 23" secondary, Mountain Everest Max

Mobile SFF rig: i9-9900K, Noctua NH-L9i, Asrock Z390 Phantom ITX-AC, 32GB, GTX1070, 2x1TB SX8200Pro RAID0, 2x5TB 2.5" HDD RAID0, Athena 500W Flex (Noctua fan), Custom 4.7l 3D printed case

 

Asus Zenbook UM325UA, Ryzen 7 5700u, 16GB, 1TB, OLED

 

GPD Win 2

Link to comment
Share on other sites

Link to post
Share on other sites

Should I add something else before connect it to PC?

Link to comment
Share on other sites

Link to post
Share on other sites

For a keyboard it might work, they usually talk USB 1.1 speeds...

F@H
Desktop: i9-13900K, ASUS Z790-E, 64GB DDR5-6000 CL36, RTX3080, 2TB MP600 Pro XT, 2TB SX8200Pro, 2x16TB Ironwolf RAID0, Corsair HX1200, Antec Vortex 360 AIO, Thermaltake Versa H25 TG, Samsung 4K curved 49" TV, 23" secondary, Mountain Everest Max

Mobile SFF rig: i9-9900K, Noctua NH-L9i, Asrock Z390 Phantom ITX-AC, 32GB, GTX1070, 2x1TB SX8200Pro RAID0, 2x5TB 2.5" HDD RAID0, Athena 500W Flex (Noctua fan), Custom 4.7l 3D printed case

 

Asus Zenbook UM325UA, Ryzen 7 5700u, 16GB, 1TB, OLED

 

GPD Win 2

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Kilrah said:

For a keyboard it might work, they usually talk USB 1.1 speeds...

Yes, it's for the keyboard. Thanks for the reply. 

Link to comment
Share on other sites

Link to post
Share on other sites

If you want something super simple, just use a couple mechanical relays  ... each relay has 2 on-off switches so you can switch all 4 usb 2.0 wires with two relays. 

 

Example... 2 of these https://www.digikey.com/en/products/detail/cit-relay-and-switch/J104D2C5VDC-20S/12503179

 

See ms paint stuff i just drew ...  in default relays off, the usb 1 is connected to 5v, gnd, d+ and d-

Send 5v to the two relays, and the relays switch to usb out 2

 

A basic on-off switch would be enough ... off, the relays don't get power, defaults to usb 1 out.. on, you give power to relays, goes to usb 2 out.

 

It takes about 6ms to engage, and about 4ms to disconnect... so in theory you should be fine. If you're paranoid... you could use 4 separate relays and a 3 position slider switch so that when you're on middle position of slider both usb ports are disconnected. Also, you could add a basic resistor and capacitor combo so that voltage will raise slowly across maybe 2-3 seconds and therefore the relays will be engage 1-2 seconds after you move the slider switch to the new position.

 

 image.png.5d4c62eddf52830c2da0316152de38a8.png

 

Note 5v relays would consume about 100-200mA to stay powered, so if you use a usb 2.0 port you'll still have plenty of juice left for a keyboard and mouse.

The two diodes (pretty much anything that can handle 5v and 100mA, 1n4001.. 1n4007 are super common, 1n581x etc etc)  are needed for protection, when the magnetic field of the relay coils breaks (you turn off the relays), don't want voltages to go back in

I'd probably also add a small capacitor between usb 5v in and gnd, something like 47-100uF 10v+

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, mariushm said:

If you want something super simple, just use a couple mechanical relays  ... each relay has 2 on-off switches so you can switch all 4 usb 2.0 wires with two relays. 

 

Example... 2 of these https://www.digikey.com/en/products/detail/cit-relay-and-switch/J104D2C5VDC-20S/12503179

 

See ms paint stuff i just drew ...  in default relays off, the usb 1 is connected to 5v, gnd, d+ and d-

Send 5v to the two relays, and the relays switch to usb out 2

 

A basic on-off switch would be enough ... off, the relays don't get power, defaults to usb 1 out.. on, you give power to relays, goes to usb 2 out.

 

It takes about 6ms to engage, and about 4ms to disconnect... so in theory you should be fine. If you're paranoid... you could use 4 separate relays and a 3 position slider switch so that when you're on middle position of slider both usb ports are disconnected. Also, you could add a basic resistor and capacitor combo so that voltage will raise slowly across maybe 2-3 seconds and therefore the relays will be engage 1-2 seconds after you move the slider switch to the new position.

 

 image.png.5d4c62eddf52830c2da0316152de38a8.png

 

Note 5v relays would consume about 100-200mA to stay powered, so if you use a usb 2.0 port you'll still have plenty of juice left for a keyboard and mouse.

The two diodes (pretty much anything that can handle 5v and 100mA, 1n4001.. 1n4007 are super common, 1n581x etc etc)  are needed for protection, when the magnetic field of the relay coils breaks (you turn off the relays), don't want voltages to go back in

I'd probably also add a small capacitor between usb 5v in and gnd, something like 47-100uF 10v+

 

O my... That's too much than I expected 🤩

Link to comment
Share on other sites

Link to post
Share on other sites

You can buy a switch that does the same thing, I think.

https://www.amazon.com/UGREEN-Sharing-Peripheral-Switcher-Computer/dp/B01CU4QCRS/ref=sr_1_4?dchild=1&keywords=Usb+Printer+Switch&qid=1618678717&sr=8-4

They are usually marketed as a "printer switch" but I think it's just a regular usb port.

Or, there used to be a software solution to the problem, Synchron or something like that, they used to advertise online a lot but I haven't seen anything about them in a long time.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, cachethrash said:

You can buy a switch that does the same thing, I think.

https://www.amazon.com/UGREEN-Sharing-Peripheral-Switcher-Computer/dp/B01CU4QCRS/ref=sr_1_4?dchild=1&keywords=Usb+Printer+Switch&qid=1618678717&sr=8-4

They are usually marketed as a "printer switch" but I think it's just a regular usb port.

Or, there used to be a software solution to the problem, Synchron or something like that, they used to advertise online a lot but I haven't seen anything about them in a long time.

I know about ready-to-use UGREEN switcher but I want to built my own. I like to built something from time to time.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×