Controlling an airsoft cannon with BBII and PicoSwitch

Inspired by the Mech-Wars… uh, Mechs, we’ve decided to add to the information pool by documenting how to fire one of these model tank airsoft cannons using an BBII/Atom Pro

The gun has a motor and a switch. You turn the motor on and monitor the status of the switch. As soon as the gun fires the switch goes low and the motor is turned off. Now off to attach it to a mech!

Here’s a video of it in action.

Schematic:

[code] (+) 6vdc
|
|
|--------| |
| pico |—o
| switch |
| |—o
|--------| |
|
|
red |
/-------\
| |
| motor |
| |
-------/
black |
|
|
-----

-

(+) 5vdc
|
| 10k
o-----///-----o-----> To I/O pin
|
|
switch |
|
/ |
o------o o------o
| black green
|


-[/code]

Code:

[code]
buttonA var byte

gunSW var bit
prevGun var bit
x var word

button_down con 0
button_up con 1

GunPin con p0

gunSW = in1
input p12

sound 9,[50\3500,30\3700,50\4000]

main

button p12, 0, 0, 0, buttonA, 1, A_Press

pulsout GunPin,2000

pause 20
goto main

A_Press
sound 9,[50\3800]
goto fire

fire

pulsout GunPin,4000
pause 20

gunSW = in1

if (gunSW = 0) AND (prevGun = 1) then
prevGun = 0
goto main
endif

prevGun = gunSW

goto fire[/code]

Step 2:
Get some ammo :unamused:

That was the first time I have seen one of those fired. I did not see any rounds fired so I assume it was dry fired? Great post!

Now if only they had a miniture airsoft gatling gun the same size as that tank gun, that would be great on a mech!

I found this video but it is way to big for a mech bot.
youtube.com/watch?v=A_djlYMFK6s

Great vid(s)!

It would be fun to play around with those…

Both of them!

Great work James!

I’ve been looking at adding an airsoft cannon onto my rover, and was wondering where you found that cannon. I’ve seen a few electric airsoft pistols for a reasonable price, but am afraid that once I open them up, the firing mechanisms won’t be a contained unit inside the case, and I’ll have to fight with the motors etc and build a new case around them. This here looks like a simple unit you just wire up. Any thoughts/ suggestions on where to order? Are most of them pretty easy to modify from a gun into a mini cannon, or should I look for something off of a miniature tank?

I ordered some from www.toyseast.com

Kurt

The link didn’t work for me.

Try toyeast.com

toyeast.com/v3/pdtdetail.asp?pdt_id=A02106714 to be more specific…they have a few others similar too, just for different tanks. Yay for a lot of fun in a few weeks!

Sorry for necroposting, anyone know where to find these still?
My boyfriend wants to put one ontop of my rover, he wants to start small before moving up.

I believe this is the one that Jim is using, the link is:

toyeast.com/v3/pdtdetail.asp?pdt_id=A02102961

Link doesn’t work in opera or internet explorer.
It goes to toyeast.com/v3/ncatlvl1list.asp?cid=3

So i’m unable to buy from them at all, or even find it in the store.

I think this is the turret i’d need too, by the way, how large is the airsoft clip? it’s not 1 shot and you’re done is it?

That is so odd, that link I posted last night goes to the main toyseast website, oh well… What you can do is what I am doing, go to google.com, type in A02102961 and look for the link that has toyseast in it, the one that comes up for me is toyeast.com - vstank pro parts leopard2a5 airsoft barrel mechanism . I am not sure about the clip size though…

ok… i think it’s showing up ok now.

toyeast.com/v3/pdtdetail.asp … =A02102960
toyeast.com/v3/pdtdetail.asp … =A02102961
I don’t know…

Toyeast’s search is broken too, cant even search barrel mechanism…
Those two links work for me now, their site is really messed up.

They have more stuff here, i’m guessing the wiring is the same or very similar.
toyeast.com/v3/catproductlis … 988&clvl=4

You think instead of a pico switch, a simple high/low relay switch will work?
viewtopic.php?f=26&t=2463&start=15

Yeah I had a hec of a time trying to find anything on that site, and most of the time it’s so slow that you can’t even do a search…

I’m not sure about any of the wiring on those, I would assume it’s similar…

On your switch it would depend on the rating of your switch and what one of those guns draw for power…

Oh the relay is 30V @ 5A.
Plenty of the motor on these turrets, no the concern is with the controls.

I assume it would be the same, except besides sending pulses, i would simply set high or set low.
I tested the relay, it works great. Nice and compact.

I haven’t used the picoswitch, but have two cannons on my rover, the mounting is only half done but I’ve been so busy with a new job haven’t been able to update to a project page. They’re a one shot deal, but some work with a straw, hot glue and a funnel and you’ve got yourself a hopper that works nicely. then in a small area you can hold 1k shots and more. I’m using a simple npn darlington to run mine, works beautifully though my code is broken :frowning: For some reason though the code starts with pins high instead of low, so aim away from your ankles when turning it on! I promise to work on it this weekend and get some form of update going, All I need to finish the project is a bigger servo horn to mount the structure on! Two cannons draw about an amp and a half when firing, enough to brown out your bot board if you use regulated 5v btw and reset the micro, so use battery power. No offense fish, but something about this example makes it seem more complicated than it really is to run them, especially the code, it’s really quite easy! But then again yours is working properly and mine misfires…

I use external regulators for just about everything. The micros regulator is kept separate from the header pin regulators on my board.
But i’m not using a botboard 2 anymore, i use this blog.basicmicro.com/blog/2010/10 … ardmini28/

I’m actually going to keep an eye on those npn darlington transistors.
Those sound awesome for a lot of projects.

Especially if they can handle that kind of power. Like an alternative to using transistor triggered relays.

Maybe if you set low on the pins, the first thing the bot does, like the very top of the code, it’ll go low, before it could even fire.

low p4
pause 10
low p4

A double low, at the very top. Just incase.

As for a hopper, i was thinking of using a straw too, 10 shots should be reasonable. And the gentlemen here at lynxmotion know i’m no stranger to hot glue. If only they could invent hotglue that didn’t leave those damn “webbies” everywhere. Damn hotglue webs.

This is a cool video man.

wow!! i like the picture below just like a flow chart… ahm
but i think it is effective???