# Replacing a mechnical switch with a digital one

I have a circuit which allows me to manually (physically) switch between two VGA inputs (PCB push switches) to feed one VGA output (a standard commercial KVM). I want to be able to switch between the two inputs digitally - ie. from an output of my arduino.

I'm happy with everything I need to do from the arduino side of things, but I don't know how I should go about replacing the mechanical switch with a transistor (or even if that's the right thing to use!)

How should I go about making this swap? Thanks!

EDIT: Some photos of the KVM for your viewing pleasure!

-
By manually, do you mean physically? You have to specify the max current and the max voltage values. –  abdullah kahraman Dec 16 '11 at 11:53
What is the switch of your KVM doing? Like is it a multipole switch that is physically directing the input from one source to the other, or is it just a single pole that is connected to circuitry that then performs the switch. Also, are you just wanting to switch the VGA, or the mouse and keyboard also? And if you want to switch the mouse and keyboard, are they USB or PS/2? –  Kellenjb Dec 16 '11 at 12:41
I just need to switch VGA, but I thought I'd make use of a KVM I had lying around (as I supposed I could just replace the physical switch) I can find max and min current values if that's a good next step! –  JP. Dec 16 '11 at 14:59

It would be really helpful if you knew how the switch was wired within the KVM relative to the rest of the circuit to understand the best application of a transistor or IC.

For instance, if the switch is just bringing an input to ground through a resistor, you may be able to sink the current directly through an I/O line

In the absence of specific information on what the switch is doing, you can't go wrong with replacing a switch with a relay. The relay contacts would replace the switch, and you would drive the coil from the Arduino through a transistor (since the I/O line can't drive the relay directly). Of course, you would have to deal with the clicking and the relatively shorter operational life of a relay over a transistor.

-
This of course is presuming you have an electronic KVM with a pushbutton switch, and it is this pushbutton you are trying to control with the Arduino. –  Tevo D Dec 16 '11 at 13:51
Correct assumption! –  JP. Dec 16 '11 at 15:34
Having had a quick look at the KVM's PCB, it looks like the physical switch is swapping over the USB and the VGA on totally separate circuits with a multipole switch. Which is a little annoying! –  JP. Dec 16 '11 at 15:37
Well, a 4PDT relay wired to those two switches is still a viable option. And yes, that is annoying. The USB IC is potted, but what are the three other IC's? Maybe that could be helpful for a better solution... –  Tevo D Dec 16 '11 at 17:15

You can buy premade commercial ones - costs seem to be $100+ but it would be easy for people to sell one for far less, so they may. I'd look around for a hobbyist priced one. Added : MAX465 DIY version only some details - page stolen by an ad server. These say Electronic but may not be. Failing that : • You could use a mulipole relay. Probably a minimum 5 lines required to be switched. Qualit will probably be terroble with no care through OK with great care. • You can make an electronic one using ICs designed for this purpose - See Maxim IC related notes at end. • You could drive a mechanical KVM switch with a motor or solenoid. This is a very Heath Robinson approach but should not be too hard and would work well. You can get slide switch and rotary switch KVMs (at least). A slide switch one could be operated with a solenoid, a servo, a nut on a threaded shaft driven by a motor, a geared motor, other ... . A rotary switch one could use most of the above. Hobby outlets sell ?Mamiya? geared motors with speeds as sow as a fraction of a turn per second. One of those could turn a knob very nicely. MAX4885: Premade - Here's a premade Maxim evaluaton kit from Digikey about$40.
Seems to do exactly what you want.

or DIY

OR for \$4 ish you can buy the IC from Dikikey and do it yourself - BUT TQFP pack - not a beginners ideal package.

• T h e M A X 4 8 8 5 i n t e g r a t e s h i g h - b a n d w i d t h a n a l o g switches and level-translating buffers to implement a complete 1:2 or 2:1 multiplexer for VGA signals. The device provides switching for RGB, display data channel (DDC), and horizontal and vertical synchronization (HSYNC, VSYNC) signals. A low-noise charge pump with internal capacitors provides a boosted gate-drive voltage to improve performance of the RGB switches.
• In the 1:2 multiplexer mode, HSYNC/VSYNC inputs feature level-shifting buffers to support low-voltage CMOS or standard TTL-compatible graphics controllers. In the 2 : 1 m u l t i p l e x e r m o d e , t h e o u t p u t b u f f e r s f o r t h e HSYNC/VSYNC inputs are disabled, allowing bidirectional signaling. In both modes, DDC signals are voltage-clamped to an external voltage to provide level translation and protection.

• The MAX4885 features a 5µA shutdown mode and is ESD protected to ±8kV Human Body Model (HBM) on externally routed pins. The MAX4885 is specified over the extended (-40°C to +85°C) temperature range, and is available in the 32- pin, 5mm x 5mm TQFN package

http://datasheets.maxim-ic.com/en/ds/MAX4885EEVKIT.pdf

-
What usually makes these things more expensive is that they simulate a mouse, keyboard, and monitor still being connected to computer A even when the switch has computer B active. Many of them even have memory to hold the mouse in the same location on the screen when you come back to it. Plus there is some supply and demand aspects. –  Kellenjb Dec 16 '11 at 12:44
While this is all very good information, I think what the OP is trying to do is use the existing KVM switch and drive it electronically, rather than manually poking the button on it. –  Tevo D Dec 16 '11 at 12:56
@TevoD The problem is we know nothing about the KVM he is using. On the surface it sounds like it is a mechanical switch that has multiple polls that just physically move between 2 sources. If this is the case then Russell's answer is perfectly in line with the question. The only way this wouldn't be the case is if the switch on his existing KVM is just acting as a digital control. –  Kellenjb Dec 16 '11 at 13:56
BTW... the s p a c i n g b e t w e e n l e t t e r s i s v e r y h a r d t o r e a d . –  Kellenjb Dec 16 '11 at 13:58
@Kellenjb - I fixed the wierd spacing. It looks like a symptom of copying out of a PDF. Ahhh the joys of the PDF file format. –  Connor Wolf Dec 16 '11 at 17:24