Picture of Das Uber Airsoft Gun Turret
This Instructable will show you how to Design, Build and Trouble Shoot an Airsoft Gun Turret with a USB interface. The turret can be toggled between Manual Mode, where a Human interfaces with it using an Xbox 360 Controller, or Automatic Detect and Fire Mode, where the turret springs to life and detects any human presence in its surroundings. Firing at Humans is not advised.

A Special Thanks to Colin. For helping me with the WebCam calibration concept way back when.

Visit my blog, for all other details not contained in this instructable.

Update: HACK-A-DAY Post checking out the turret. Very flattered from these guys words.
Remove these adsRemove these ads by Signing Up

Step 1: Get an "Electronic" Airsoft BB Gun. And Slice it open.

If you are in the U.S. Say just as the title says, go to any Department Store and buy one.

Look for guns that look easy to cut or to take apart.

After you've got your gun, open it up (follow this guide).

As you can see, it is very simple. If you power the motor, you fire the pistol. Before you hack it open you do this by closing the circuit by pushing a switch with your finger as you pull the trigger. But there are many, many ways to close an electric circuit, and you can get very creative. In this project we are going to use Relays to do that.

If you are not in the U.S, this may take some doing.

I am obviously not in the U.S. but I got Lucky. A friend of mine gave me his.

'(Gracias Pinche Bronzon!! Ahi esta el Robot que te dije que iba a hacer con tu Pistola.)'

If you are in Mexico: 'jalense a los bazares o a los mercados y busquen a la gente que vende cuchillos y pistolas tipo militar. las tiendas de chucherias afuera de los super mercados (Soriana y la Comer y demas) a veces las tienen. De ultimas, preguntenle a algun amigo que le gusten las gotchas si tiene una o sabe donde comprarla. En Mexico es comun que vendan gotchas y Airsoft Guns en las mismas tiendas.'
1-40 of 96Next »
oyu17 months ago
You should sell these dude... These are bad (as in good)
Miltron_B (author)  oyu14 months ago

Thanks! I don't think it would be profitable though.

GeckoLink3 years ago
can it be controlled without needing a computer on-site?
Miltron_B (author)  GeckoLink4 months ago

Yes. There are many solutions now days.

You cold use a Raspberry Pie!

I will probably make this, for ultimate backyard supremacy, but with a stronger gun, prob a G&G ABS M4-A1. But really cool build anyway.
bighead54544 years ago
hey hook this up to a simple selfmade rc car being controlled by a friend and use the turret while it is gion through ur enemys house
Miltron_B (author)  bighead54543 years ago
I'm working on a Sentry Bot for my new Home.

I will post the results!

resistance is futile....

Miltron_B (author)  Cadillachearseguy3 years ago
It is ineed.
mking20124 years ago
Nice!! Do you think it would be possible to make a version of this that looks, sounds and talks like the turrets from Portal?
Miltron_B (author)  mking20123 years ago
Hey, sorry for the late response. Yes! This robot uses a PC for a brain. You simply need to add the DirectX code for sound playback.
can you do one on a mac?
Miltron_B (author)  TheInventor19973 years ago
Sorry for the late response. Yes you need to use the PHP APi for the Phidgets so you can control the turret from any plataform with a browser. Even an iPod Touch or an iPad would work.
Chowmix124 years ago
Can i use micro servos for the X and Y axis? Im pretty sure i can because the bearings take off most of the weight.
Miltron_B (author)  Chowmix123 years ago

Sorry for the very late response. yes, you can use micro servos.

The servos I used were way over caculated. The bearings help a lot with the load!

Be sure to use ball bearings for the Y Axis servo and push bearings for the X Axis Servo.
pyrocord4 years ago
 I am building an exoskeleton to mount airsoft guns on as "armor". Could this be mounted on a shoulder of an armor suit made of sheet metal? If so, how much does it weigh?
Miltron_B (author)  pyrocord4 years ago

I think the best choice you have is to use a "Pan and Tilt" mechanism and attach it directly to the Airsoft Gun's body.

It requires only two servos and the firing signal.

Lynxmotion has some sweet pre-made "Pan and Tilt" assemblies.

As for the weight, it depends on the servos, the mechanism's material and the gun.

Good luck!
could you make a vid or something :))
Miltron_B (author)  sillyplatapus4 years ago
Sadly, the gun turret died in acction before any vid could be made. It was just too much fun playing with it to bother filming it!
this confuses me ? :o
Hey mate nice invention, I think you will be keen to see this paint ball one, let me know what you think and what software they are using?
Miltron_B (author)  donalexander4 years ago
Thanks Mate. There are several painball turrets out there. All of them are awesoem. I think the software for their robots is costum made. Probably motion tracking using openCV.
tkezic5 years ago
hi mate, can i get the software in vb 6? and the one that has the auto fire? cheers
Miltron_B (author)  tkezic5 years ago
Hi! Well, it depends on a whole bunch of things. Are you also using phidgets? If so, just get hte phidgets VB6 API to control the servos and relays. Now, sadly, the API I used for visual recnition is based in C++ (Intel OpenCV). Try googling for VB6 Computer Vision API, see if you get anything. Best of luck!
hi thanks for the quick reply. yes i am using phidgets, a polulu servo controller which i can program. would i be able to harrass you for a copy of the code anyway? cheers
Miltron_B (author)  tkezic5 years ago
Hey! Regretably, the code is long long lost in the realm on formatted hardrives and lost HDD partitions. But, it was very simple. Just grab these examples and mash them up nicely. From the Phidgets API: Servo Example and the InterfaceKit Example. From the OpenCV API: Face recognition Example. From DirectX 9.0 SDK (asumming you want to use the xbox controller): Xinput Example. With those, and the comments in them, you should be able the get it to work. The hardest part, is to align your robot with the cameras. You do this with a regression taking various data points. Oh! You need the Windows SDK for the DirectX SDK to work properlly. Also, thanks to teh DreamSpark programme, you can get VisualStudio 9 for free is you are a student. Best regards, and don't hasitate on contacting me again if you need anything else.
cheers. I have looked and looked and all i could find was the c# and i get lost within minutes of trying to figure out how to use it. i am very good with vb6, and found motion detecting software, but it gives me lots of boxes, say pic height = 50 boxes which is good for sensitivity, but the servo tries to go back and forth to all the boxes, i cant seem to get an average or centre of the x and y value. here is my code. could you help with any suggestions? thankyou so much.

Sub GetMotion()

Static Counter As Single 'counter
BoxesX = 50 'from 1 to 50 50 default on x and y
BoxesY = 50 'from 1 to 50
AveragePixelLoop = 30 'from 1 to 250 30 default

For Px = 0 To (MotionPic.Width) Step Int(MotionPic.Width / BoxesX)
For Py = 0 To (MotionPic.Height) Step Int(MotionPic.Height / BoxesY)

pixx = Fix(Px / (MotionPic.Width / BoxesX))
pixy = Fix(Py / (MotionPic.Height / BoxesY))
For Repeat = 0 To 5 ' default is 5
ColorSumStr = Right$("000000" + Hex(GetPixel(MotionPic.hdc, Px + Repeat, Py + Repeat)), 6)
ColorRedStr = Mid$(ColorSumStr, 5, 2)
ColorGreenStr = Mid$(ColorSumStr, 3, 2)
ColorBlueStr = Mid$(ColorSumStr, 1, 2)
ColorRedDec = Val("&H" + ColorRedStr)
ColorGreenDec = Val("&H" + ColorGreenStr)
ColorBlueDec = Val("&H" + ColorBlueStr)
AveragePixel(Repeat) = ColorRedDec + ColorGreenDec + ColorBlueDec

Counter = Counter + 1
If Counter = AveragePixelLoop Then Counter = 1

mdSample(pixx, pixy, 0) = 0
mdSample(pixx, pixy, Counter) = 0
For Repeat = 0 To 5
mdSample(pixx, pixy, 0) = mdSample(pixx, pixy, 0) + AveragePixel(Repeat)
mdSample(pixx, pixy, Counter) = mdSample(pixx, pixy, 0) + AveragePixel(Repeat)

AverageSum = 0
For Repeat = 1 To AveragePixelLoop
AverageSum = AverageSum + mdSample(pixx, pixy, Repeat)
AverageSum = AverageSum / AveragePixelLoop

'preveri proženje motion-a
If Abs(mdSample(pixx, pixy, 0) - AverageSum) > mdTriger Then
MotionPic.Line (Px - 4, Py - 4)-Step((MotionPic.Width / BoxesX) - 4, (MotionPic.Height / BoxesY) - 4), , B

If pixx = 0 Then Label2.Caption = 84 Else Label2.Caption = (pixx * 5)
If pixy = 0 Then Label3.Caption = 84 Else Label3.Caption = (pixy * 3) '(MotionPic.Height / 2)
Label9.Caption = MotionPic.Height

MSComm1.Output = Chr$(255)
MSComm1.Output = Chr$(8)
MSComm1.Output = Chr$(Label2.Caption)
MSComm1.Output = Chr$(85) 'Terminate and Update

MSComm1.Output = Chr$(255)
MSComm1.Output = Chr$(9)
MSComm1.Output = Chr$(Label3.Caption)
MSComm1.Output = Chr$(85) 'Terminate and Update

Miltron_B (author)  tkezic5 years ago
The thing is, your servo does not know what those values are.

Here is what you are going to:

Find the x,y value for a single pixel you want in your image. (this will be what ever you are aiming for)

Manually move your servos so that the gun is aiming to that point in the real world (if you shoot, it's going to hit where your point is)

Wirte down the value for the servo moving your X and write down the value for the servo moving Y.

Do this for all XY points for the entire cross section of the image.

Once you have the data to what servo values correspond to what x/y value, make a mathematic regresion (you can use excell or a TI calculator to do this)

Your program should be something like:

servoX = regression in fuction of X pixel data;
servoY = regression in fuction of Y pixel data;
thankyou very much, i will try it out and let you know. your help is much appreciated. thankyou
Miltron_B (author)  tkezic5 years ago
Here is a good link on how to make Regressions with Office.

If you run into trouble let me know.

It would be awesome if you post some pics of your work in progress.

Good Luck.
geekazoid5 years ago
lol i don't speak spanish or live in mexico, but i still firgured out wat it meant.. lol dictionary (i guess i go a bit overboard)
Miltron_B (author)  geekazoid5 years ago
qwertyman105 years ago
2 things that would make this machine even more awesome: 1. support with bluetooth or peer to peer wifi so it could be used with smartphones or mini laptops in the heat of battle up to 100 feet away, and 2. a set of wheels and some motors to make it portable. Awesome invention!
Miltron_B (author)  qwertyman105 years ago
Hey mate! Glad you liked it. This is actually controlled by a PC already, so you just need another laptop and VNC in both machines. This way you can controll it half around the world! Making it a mobile BB tank would be awesome indeed though.
qwertyman105 years ago
that looks like a multi-thousand dollar investment.. awesome! i could take down both my brothers and both their friends with that! that thing looks so cool.
marcos1015 years ago
lol I want to see some one do this with a paintball gun. _
Ddog1965 years ago
It would be bad if you can have like three of these and plant them somewhere around in the woods (if you're playing airsoft) and being able to control each one seperately and use them to take out random targets.
Miltron_B (author)  Ddog1965 years ago
I want to make something voice controlled, and get a feed of what each turret is seeing un a small, head mounted LCD.

I just found the perfect plataform:
how did you come up with this? that seems a little complicated for playing around with useless junk.
kerneykid15 years ago
thats cool. really.
1-40 of 96Next »