Pages: [1]   Go Down
Author Topic: Using Arduino to output (via USB) to a nerf gun?  (Read 1081 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm wondering if it's at all feasible to program an Arduino board to fire a nerf gun via a USB connection. Basic setup is to run the Arduino from a battery with several inputs (motion sensor, RFID reader, etc.) and triggering the USB gun depending on the conditions. I'm not too familiar with the actual functionality of USBs, but I'm hoping that even if the nerf gun typically uses specialized software on a desktop to trigger the firing then the same signal can be copied for use by the Arduino. If this is at all possible, what is the best way to go about doing this? Or is it simpler than that?
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 551
Posts: 46236
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You have a nerf gun with a USB port? What is the port normally used for? Links are nice.
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

While you are getting those links that PaulS mentioned... smiley-wink 

Theoretically it would be possible, but you'd have to know the command signals sent over the USB's data line.  If they aren't in the documentation, you'd need an oscilloscope or logic probe and a little work to determine the necessary commands.  Basically you'd take USB (use a 2.0/1.1 cable, I'm sure this type of desktop toy doesn't need a 3.0 USB bus) with at least one USB plug A and cut that plug off along with some spare cable.  Attach the data lines (see here) to either the 'scope or probe so you can read the signals being sent.  Then plug the modified cable into your computer, start up the program used to control the nerf gun, and finally record the data pulses associated with each specific command sent by the program.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Whoops, my bad! Definitely should've included an example. I don't have anything specific in mind yet but this was the inspiration. Sorry, I meant a nerf gun that normally plugs into a USB port on a larger machine.
Attach the data lines (see here) to either the 'scope or probe so you can read the signals being sent.  Then plug the modified cable into your computer, start up the program used to control the nerf gun, and finally record the data pulses associated with each specific command sent by the program.
Thanks a ton for that. Would it be as simple as outputting a certain number through the data lines to the gun or would you expect it to be more difficult than that? I'm guessing it depends on the design of the nerf gun but I'm not sure if there's a standard used for this purpose or not.
« Last Edit: November 06, 2012, 04:03:48 pm by Tsirist » Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 50
Posts: 1767
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well one way is to use a servo to fire the trigger.  That doesn't rely on knowing any details about the protocol used to fire the projectiles.  Here is a video on how to use a servo to fire a camera shutter that madmeco sent me today: http://www.youtube.com/watch?feature=player_embedded&v=FhRnf90AYJU

Then there is instructable on how to fire a Nerf Vulcan via arduino: http://www.instructables.com/id/Arduino-Controled-Nerf-Vulcan/

If you can figure out the protocol, there is this USB rocket launcher: http://www.thinkgeek.com/product/8a0f/
Logged

UK
Offline Offline
Shannon Member
****
Karma: 184
Posts: 11197
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Using USB devices is easy, but writing USB device drivers is hard. Presumably you could interface to the NERF gun mechanically or electrically rather than electronically, if you wanted. That would eliminate the hardest part of the problem.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 50
Posts: 1767
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Using USB devices is easy, but writing USB device drivers is hard. Presumably you could interface to the NERF gun mechanically or electrically rather than electronically, if you wanted. That would eliminate the hardest part of the problem.
Another approach using a Leonardo is have it simulate a keyboard and/or mouse, and have it connected to the PC with the Nerf attached via USB and issue the commands on Windows (or whatever OS you use) to fire the Nerf gun.  You can probably do this on an Uno with a USB host shield.
Logged

UK
Offline Offline
Shannon Member
****
Karma: 184
Posts: 11197
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

issue the commands on Windows (or whatever OS you use)

This is the part that is an unknown. If there is a utility/application/API that can be run on a PC to fire the gun, and it is feasible to include a PC in the solution, then all you need to do is send a command over the serial link to execute the command to fire the gun - no USB emulation needed, just use the standard Arduino USB drivers. Is such an interface available, though?
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 50
Posts: 1767
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This is the part that is an unknown. If there is a utility/application/API that can be run on a PC to fire the gun, and it is feasible to include a PC in the solution, then all you need to do is send a command over the serial link to execute the command to fire the gun - no USB emulation needed, just use the standard Arduino USB drivers. Is such an interface available, though?
The USB rocket launcher that I linked to earlier in the thread (from thinkgeek.com) includes programs on Windows and Mac to fire the rockets.  I don't own it, so I don't know how clunky it is.
Logged

Pages: [1]   Go Up
Jump to: