Connect two wires with a computer

So I’m trying to fire an electronic airsoft gun with my computer. I have two leads coming from the gun, (+) and (-). When I apply power (5V) to the wires the gun fires. I first thought about the serial port, but I have my servo controller plugged in that. I’d like to eventually run this off of my laptop (going to get a serial to usb convertor for servo controller), so I’m pretty much left with USB ports, an ethernet connection, and a modem connection.

I really don’t want to waste a servo by giving it the job of pushing a button.
Any ideas?

Hello.

Can you find out more about the interface? Are the wires providing power, and if so, how much current do you need? If it’s a digital input, what are its characteristics?

- Jan

The wires really just connect to a simple motor. As for power, it was run on 4AA batteries. So 6v, not sure what amps. So I basically need to send that amount of power from the computer to the motor. So I’m not running it off of batteries anymore.

You could use something like our RC switch, plugged into the servo controller, to control a MOSFET. There are similar products out there that have a built-in relay to switch something directly, but they tend to be more expensive than a cheap servo. It might help to figure out your current requirement so you don’t get a switch that’s too small or pay more than you need to for a big one.

- Jan

What about something like this?
radioshack.com/product/index … ab=summary

Though I have no idea how to use it yet. Looking up tutorials right now.

That’s just a relay; you’ll need some more circuitry to control it from a computer. For instance, to connect it to the RC switch I mentioned, you would need an extra transistor (and base resistor) to drive the coil and a diode across the coil.

- Jan

Just get a USB cable with 2 males ends. Connect the 2 computers together and transfer your stuff. :slight_smile:

Jennismortal - You obviously have absolutely no idea what’s going on. That is not what he’s trying to do.

OP - You could connect it to a USB controlled microcontroller such as a BASIC Stamp or Javelin Stamp.

Even worse, the USB hardware standard does not support direct connection of two host devices (computers) in this way, and attempting to do so could seriously damage your hardware and risk causing a fire. (References: http://www.usbmadesimple.co.uk/ums_2.htm, http://store.a2zcable.com/u2-10.html). USB cables with two ‘A’ ends are actually considered illegal to the standard, and it’s my belief that we’re only seeing certain cheaper product using cables like this as a result of cost cutting by cowboy manufacturers (only having to buy one connector type, in bulk, instead of two).

jennismortal, I always try and be fair on forums, not everyone’s at the same level (I’m a beginner at robotics myself), but you should take a bit of criticism on this; not only have you given inappropriate advice by not bothering to read the question, but it’s also dangerous advice.

Think before you speak