Is It Possible - Activate Momentary Switch Via Software

I'm fairly new to Arduino, and very excited as there are lots of cool things I would like to accomplish.

I have an old StarTech KVM and wanted to see about programming an Arduino to activate the various switches on it to switch ports. Most of these KVM's simply use a momentary switch to accomplish that.

Now, with software (and perhaps a few resisters etc as required) is it possible for Arduino to emulate or activate the circuit that the momentary switch would have done? My goal would be to make a small program that could activate that for me, perhaps using USB to communicate.

I did a bunch of searching on Google, but I'm afraid I don't know how to technically name what function I'm looking for, so most results came from people using actual switches, not using software to open and close a circuit.

Basically, I know there are data lines on the Arduino, and I would need at minimum 8 to connect to each of the 4 momentary switches and trip them (or the circuits they control) unless some of the lines can be shared. If I can keep it to a minimum, there is a Nano USB Arduino project that makes a Nano version of Arduino that is the size of your typical USB Receiver, perfect for plugging into one of the USB Host Ports this KVM has, making for a low footprint solution that gets power from the host.

I'll investigate how the momentary switches are wired but for now I wanted to test the waters and see if someone understands what I'm looking to do. :slight_smile:

Just in case you wonder what kind of KVM it is, it's this one: 4 Port VGA USB KVM Switch with Hub - KVM Switches | StarTech.com Canada

Thanks!

David

It sounds from your description that the device you want to control has physical switches that are closed by a momentary push button.

If so you should be able to wire a relay in parallel with the switches and use an Arduino to control the relay - but that would be a very clunky solution.

Maybe it would be possible to use a transistor instead of the relay?

You should measure the voltage across the switch when it is open and, ideally, the current through the switch when it is closed. However the current is probably very low.

...R

I think I stumbled upon a better option. I was looking at the most recent boards and Leonardo has the ability to emulate USB HID, so you can send keystrokes as if it's a keyboard connected. I've ordered one to play with as the USB HID Keyboard library would seem to be an easier start than trying to open and close circuits.

This way Leonardo can be plugged in to the KVM and I can figure out how to trigger it. Simple wiring I'm good at but talk about resistors and loops with feedback, and I gloss over. :o