Adding sound switching to 2-port KVM
Finally I got docking station for my subnotebook (Dell D430 if you want to know), and it allowed me to work with it normally. By using dual KVM switch I connected it to my existing keyboard and monitor, as I use PS/2 mouse in my desktop and USB in subnotebook I decided just to use USB mouse with notebook in a dock.
But what with sound? Docking station has speakers output, desktop computer too. And I have only one pair of speakers. I decied to add speaker switching to KVM too.
First, things you need:
My KVM is a Newstar NS-231 unit, but procedure is more or less the same in evey KVM. We have to find a signal which changes to 5V when one of computers is selected and goes much below if not. This signal will drive relay.
Open your KVM. Connect power to enable switching, in my unit I had to plug 2 keyboard ports of working computers. Now use a voltmeter, connect its ground to circuit's ground (usually metal casing, but check it before) and try to measure voltages on connectors and circuit pins while switching computers. Find something which has 5V when one computer is selected and ~0V when another. This is your switching signal. Now find a source of good +5V (look near power pins of keyboard connectors, they must connect together somewhere) and ground. It's time to build a simple circuit.
We cannot drive this relay directly from digital signal as digital signals are generally too weak to drive relays. Build a simple circuit shown in the schematic below:
What happens there? Switching signal drives transistor, when it's driven it turns relay on by shorting to ground. When you shut the signal off, the transistor stops conducting and relay returns. Because coil returns quite high voltage peaks reversely when it's shut off, we discharge these peaks through reversely-polarized diode. Without this diode transistor may be easily broken by voltage peak.
Let's return to my KVM. I found a nice 4-pin connector near the
edge of PCB, which drives digitally VGA switching part. The pinout of this
connector is simple:
KVM's front facing you, left to right:
1 - +5V, black cable
2 - Digital clock (red wire)
3 - Computer select signal (brown wire)
4 - Ground (orange wire)
Now it's only needed to connect the circuit with 3 wires, test it (if you switch computers you should hear the relay!) and solder proper sound cables to apropriate relay pins. You may use sockets for it, but I had no space on the rear to put them, so I used 3 cables with 3.5mm jack connectors (2 male, 1 female - for speakers). Finally remember to connect speaker's grounds together.
To see exactly, here are 2 pictures of this modification. PCB is kept in place with thermal glue: