# DIY USB KM switch



## mthrnite (Mar 1, 2007)

Greetings hardware hackers..
Here's my deal. I've got a PC and a Mac that I want to hook to my LCD tv. The mac has DVI and the PC has VGA so I don't need a full blown KVM switch. What I need is simply (I hope) a usb switch for the mouse & keyboard so I can switch them between the computers with no ill effects.

I'm hoping that there's something I can build with spare parts and not have to buy. Anybody have any good ideas. I'm looking to do this as dirt cheap as possible. I'm handy with a soldering iron, but my electronics knowledge is a bit sketchy. C'mon and help your mthr out.


----------



## FAST6191 (Mar 1, 2007)

The principle problem with such a situation is that computers tend to be less agreeable if you remove devices during use, USB and modern OS' this and most monitors do not mind.

For the actual hard part USB has 8 active pins, diagram here:
http://www.short-media.com/img/3214

What you want it two male USB plugs for every device and 1 female, you will also need to wire the female port(s) to a series of DPDT switches and wire the equivalents to the male ports.

DPDT switch






The main issue will come with switching the ports all at once (I do not think  they make octo pole double throw switches you can get off the shelf)

Ultimately you will end up with something like this (although with all the connections made):


----------



## mthrnite (Mar 1, 2007)

Ok I'm gonna need a little time to absorb this schematic before I can ask any questions about it, and I gotta run right now...

But right off the top of my head...

I'll need four dpdt switches total and they'll all have to be switched simultaneously? Is precise timing an issue, I mean can I switch 'em with just a piece of metel with four holes drilled in it?

The keyboard I'm using has an extra usb port built in for the mouse, so I'm only switching that one output.

Again, when I'm not so rushed, maybe your much appreciated answer will make more sense to me, 
	

	
	
		
		

		
		
	


	




 so I'll revisit this in about an hour with full synaptic power.

Thanks FAST!


----------



## FAST6191 (Mar 1, 2007)

Timing should not be much of an issue so if you just got a bar and attached it and then slid several switches at once it should not matter. I just found a relay switch here that effectively acts as a quad pole so you may even luck out and find one with 8.
Unfortunately they are not the sort of thing you tend to have in devices so a trip to your electronics supply store with a few dollars in hand is going to happen (unless you want to make one which for this sort of thing I do not suggest doing).

The fact you only need one port is even better.

For what it is worth though USB leads are not advised to be longer than 1.5m, 3 at a push.

As for my awful diagram I apologise (it was done in 30 seconds in paint as I have not installed any electronics stuff on my new machine yet), all I meant to say is that the devices USB wire (or the female port it is connected to) goes into a switch that allows you to select two outputs and then each output goes into the equivalent wire on the male ended lead.
As for a source of USB ports I suggest breaking a USB hub (I got one in an airport 3 years ago for $7) or if you have an old motherboard or USB card that would work as well.


----------

