How would I press the electrical switch on say an electronic paintball or airsoft gun? Let's say it is just a SPST switch.
3 Answers 3
To press a switch, you'll need some kind of expensive solenoid or servo, and mechanical linkages, and mounting hardware, and trigger pressure characterizations, and power-loss state characterization, and a 12V power supply, and driver circuitry, and it all adds up to a lot of work to push the physical trigger.
If I were you, though, and had access to the hardware, I'd characterize the circuit the trigger switch is attached to (is it normally open or normally closed is really all you need to know), and attach a simple relay or MOSFET to an I/O pin on a microcontroller (I'd suggest the relay, because it's closer to the original circuit, avoids any voltage referencing issues, and has a mechanical spring to ensure that if your circuit goes dead, the trigger won't go off). Then, remove the switch from the gun, and attach your circuit.
-
\$\begingroup\$ Basically the airsoft gun circuit goes: battery ->trigger -> SPST switch -> turns on motor -> shoots. So all I have to do is replace that switch with this relay and use the digital pin to trigger it? Can I do sustained fire with this? (hold the trigger down) \$\endgroup\$ssfdr– ssfdr2010年06月26日 00:12:27 +00:00Commented Jun 26, 2010 at 0:12
-
\$\begingroup\$ @ssfdr: Yes . \$\endgroup\$davr– davr2010年06月26日 00:55:28 +00:00Commented Jun 26, 2010 at 0:55
-
2\$\begingroup\$ I'd go with a MOSFET because with a relay you would also need a transistor to switch the relay, also relays are kinda bulky compared to a MOSFET. \$\endgroup\$Squirt8500– Squirt85002010年06月26日 03:37:20 +00:00Commented Jun 26, 2010 at 3:37
-
\$\begingroup\$ If it's a one-off, some of these "expensive" solenoids might be scavenged from old cassette decks, VCR's or the like. But if it's hitting and electronic switch, it's probably easier to interface there if invasive connection is ok. You may even be able to make a kind of OR circuit inside so either the trigger or your electronics can trigger it. So you'll have a gun with a socket for external trigger for example. \$\endgroup\$XTL– XTL2010年06月26日 22:30:07 +00:00Commented Jun 26, 2010 at 22:30
I would go with the relay personally, quick and easy.
Arduino to close the relay, NO connected to the switch. Easy as. Digital pin to run the relay. Sustained fire will work just keep the relay energised. Just make sure your relay can take the current from the switch it's replacing, which should be low anyway, and that the 5v from the arduino is enough to active the relay.
Here's a bit of a tutorial on relays and Arduino:
http://tronixstuff.wordpress.com/2010/04/20/getting-started-with-arduino-chapter-three/