Instructables
Picture of Autonomous Paintball Sentry Gun
Make your own, custom AUTONOMOUS SENTRY GUN!

A Microcontroller Contest Finalist and Runner Up Winner.

This instructable is out-of-date. For the most recent version of the tutorial, see the website . Cheers!

This sentry gun autonomously tracks, aims, and shoots at targets, using:
-An airsoft or paintball gun
-A webcam to find targets
-A computer to process the video feed and aim the gun
-Servo motors to physically aim the gun and squeeze the trigger
-A sturdy tripod base
-A microcontroller to interface between the computer and the servo motors
-Lots of camo paint
The end result is a paintball/airsoft spewing robot, that can turn the tides of any match.

Video if it in action here .

Want to build your own?
You're in luck! All the help and information you will need is here, and the software is free and open-source. Lots of people have already used this system in their own sentry guns, with successful results.
So go ahead, make your own, and soon your own backyard will be no-man's land, too!


P.S. take pictures during the project, and when you are finished, send me a picture, and a description of your project, and I will feature it on the Successful Projects page of my website. Thanks!
 
Remove these adsRemove these ads by Signing Up

Step 1: Parts List

Picture of Parts List
          Airsoft / paintball gun, or other 'projectile dispenser'
$30   Webcam
$25   Arduino (or equivalent)
$27   3 Servo motors (pan, tilt, trigger) $9 ea.
$10   Assorted screws, nuts and bolts
$9     Wood/metal for construction
$5     USB A to B cable
$2     Some 22 gauge solid wire
$2     Servo battery box
$110 TOTAL

Also, you will need a laptop or computer to run the sentry gun program. $250 for a cheap netbook, if you don't have anything else...
1-40 of 111Next »
StephanM115 days ago

my processing code keep saying "A library used by sketch is not installed properly" probably not going to get replay ??

vdancev25 days ago

Здравствуйте,

мне очень нравится Arduino но я в нём абсолютно не понимаю.

Помогите пожалуйста, хочу самостоятельно изготовить дистанционно управляемую подставку для видеокамеры и закрепить на штатив. Стобы эта подставка поворачивалась горизонтально 120 градусв и вертикально 60 градусов. И чтобы данное устройство управлялось с андроида.

Подскажите мне новичку какие устройства мне понадобятся, желательно с ссылками где можно приобрести.

nivang7 months ago

is it possible to use a raspberry pi as the processor and hard drive for the software? Without using a note book?

catshark110 months ago
does this work using a raspberry pi instead of an arduino?
Hi ,
I'll build a turret using your tutorial, but from where i can buy the Controller and motors and all other stuff ?!
Sir I am facing an Error Message saying "Error inside Serial.ports" and the compiler shows

java.lang.UnsatisfiedLinkError: D:\Workshops\processing-1.5.1\rxtxSerial.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform thrown while loading gnu.io.RXTXCommDriver
java.lang.UnsatisfiedLinkError: D:\Workshops\processing-1.5.1\rxtxSerial.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1728)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123)
at processing.serial.Serial.list(Unknown Source)
at Turret_06_04.retryArduinoConnect(Turret_06_04.java:1917)
at Turret_06_04.setup(Turret_06_04.java:188)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
Exception in thread "Animation Thread" java.lang.RuntimeException: Error inside Serial.ports()
at processing.serial.Serial.errorMessage(Unknown Source)
at processing.serial.Serial.list(Unknown Source)
at Turret_06_04.retryArduinoConnect(Turret_06_04.java:1917)
at Turret_06_04.setup(Turret_06_04.java:188)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)

PLEASE HELP ME OUT
I'm a highschool student looking for a senior project and I think this is what I want to do! Our goal is to find something we are interested in but know little about and become experts. My questions are would someone with little experience with computer programming do alright pulling this off? It seems easy enough but then again what do I know? :P Also approximately how much time does this project take? If you could get back to me soon that would be great! Thanks!
habs191 year ago
How much does this project cost, total?
ledfreak012 years ago
im geting an error running procesing
"unsatisfiedlinkerror: C:\users\owener\documents\processing\libraries\jmyron\library\jmyron.dll: cant find dependent libraries "
why is this?

ME TO.
fishguy3551 year ago
how would I go about changing the servo pins? the code calls for pins 8,9,10 for pan tilt and trigger servos, but me servo shield only has pins 10,11,12,13.
Hello... i am a beginner too. Im having problems with the mechanical design of .the robotic sentry im making... any advice?? Please... thanks... how can i make it more stable?
starkec3 years ago
when trying to run i keep getting this error,

processing.app.debug.RunnerException: UnsatisfiedLinkError: D:\Software\processing-1.2.1\libraries\JMyron\library\JMyron.dll: Can't find dependent libraries
at processing.app.Sketch.placeException(Sketch.java:1543)
at processing.app.debug.Runner.findException(Runner.java:582)
at processing.app.debug.Runner.reportException(Runner.java:558)
at processing.app.debug.Runner.exception(Runner.java:498)
at processing.app.debug.EventThread.exceptionEvent(EventThread.java:367)
at processing.app.debug.EventThread.handleEvent(EventThread.java:255)
at processing.app.debug.EventThread.run(EventThread.java:89)
Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: D:\Software\processing-1.2.1\libraries\JMyron\library\JMyron.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1728)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at JMyron.JMyron.(JMyron.java:14)
at Turret_05_03.setup(Turret_05_03.java:142)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)

I have installed jmyron as instructed in the file but i still get this error :(
Your help would be greatly appreciated :)
sentryGun53 (author)  starkec3 years ago
Hey there, The .txt file in theJMyron download has an inaccuracy:

Copy the "JMyron" folder found in this directory into the Processing/libraries directory.
NO! Put that folder instead at C:\Users\USERNAME\Documents\processing-1.1\processing-1.1\libraries

Copy the "JMyron Examples" folder into your Processing Examples folder.

IMPORTANT FOR WINDOWS USERS: there is a folder called "Extra DLLs" - those are DLLs that JMyron depends on so make sure they're copied into your system's DLL search path - such as the Processing root directory, or even C:\windows\System32.

If Processing is already running, then restart it.
I just run into that problem yesterday, seems like they doulbe do the packaging work
sentryGun53 (author)  ljfa3213 years ago
Well, the library was originally made for older versions of Processing. Newer versions store the libraries in a different palce. The instructions and file packaging were not updated on the JMyron site, and many other libraries as well.
ok, that make sence XD

BTW, do you know what kind of souce I will be able to find a air solenoid?

I want to use it to control the release of compressed air.

Ask every shops I can think of in my town and still no luck.

sorry for the late reply, but couldn't you just use a water solenoid(for irrigation) and put air through it instead?
sorry for the late reply, but couldn't you just use a water solenoid(for irrigation) and put air through it instead?
sentryGun53 (author)  ljfa3213 years ago
FESTO, AndyMark, SMC, Automation Direct
thx alot
ljfa321 ljfa3213 years ago
Something funny happen, I have no problem with this setting in my Windows VISTA machine, but fail to work when I try to install it to my Windows 7 machine.

The error message is exactly the same
(processing.app.debug.RunnerException: UnsatisfiedLinkError: D:\Software\processing-1.2.1\libraries\JMyron\library\JMyron.dll: Can't find dependent libraries)

I event try to copy the entire working folder from VISTA to 7, but still no luck, and I do put the DLLs in to both process root and C:\Windows\System32.

Any idea how this happened?

BTW, my windows 7 machine is completly clean, I only install the new version of JAVA since the one come with the installing CD is old I think.
ljfa321 ljfa3213 years ago
Also, my Windows7 machine don't have a webcam installed, perhaps thats the reason of the error message?
sentryGun53 (author)  ljfa3213 years ago
well, it could very posssibly be the lack of a webcam. Try running the code on the vista machine, without the webcam plugged in, and see if you get the same error.
I actually bought a webcam to connect to the windows7 machine this morning. The webcam work like a charm, but the process still show the same error massage.

Also, I try to put the two dll files all over the place, but still got no luck so far.

I will keep trying tonight~
ljfa321 ljfa3213 years ago
OK, problem solved, you might want to add this to your tutorial, since all windows 7 machine should inconter this problem.


Reason: Windows 7 doesn't come with MicroSoft C libraries, which were normally include in the other (older) Windoes system.
This means there are two files missing in the Windows 7 system: MSVCP71.DLL and Msvcr71.dll

Solution: Download these two files from here:
http://www.addictivetips.com/?attachment_id=38105

AND!

For Windows 7 32-bit OS: put both dll files inside Windows/System32 folder

For Windows 7 64-bit OS: put both dll files inside Windows/SysWOW64 folder

Than the program should run with no problem.

==========================================

New problem occurs now, but not a very big deal to me though.

Still, in Windows 7 machine, the behavior of the portal sound track is weired.

When start the program, the first sound track (deploying~) plays no problem, but whatever the sound track comes after that, tent to lag forever at the end of it.

Example: press RUN > First sound: "Deplaying" > Second sound: "Will you come over herererererererererererererererererererer................"


The tracking still works fine and smooth while the sound is lagging, it just really creeped me out when I first heard this at 1:30am by myself XD"
sentryGun53 (author)  ljfa3213 years ago
Ok, thanks for the tip, I'll put that on the software step. Nice work researching the problem!
Can't wait to do your build.
However, I did the same thing and no results
can you explain a little more on your instructions:

"IMPORTANT FOR WINDOWS USERS: there is a folder called "Extra DLLs" - those are DLLs that JMyron depends on so make sure they're copied into your system's DLL search path - such as the Processing root directory, or even C:\windows\System32."

Place "Extra DLLs" to system's DLL search path" I don't understand this.

a video tutorial would be great for your instrucable
sentryGun53 (author)  torivc3 years ago
Put them inside system32, that should be inside the search path. Actually, a lot of the time it will work fine without doing this anyways.
Cheers. Any more questions, let me know!
So i've done that and various ways to get this program off the ground. Unfortunately, no avail can you make a screen cast of exactly how to successfully acomplish this project. There nothing but endless failures on my attempts on this project. I'm really looking forward to this.
what would be really great is if you could make an app to wirelessly control the sentry and see the camera veiw from any mobile device that you sync with
AJMansfield2 years ago
What would be cool is if you then got an IR camera, so it can track body heat, and then some sort of marker (UV led vest? Tracking dots?) you can use to distinguish between your own team and others.
I would think a special hat or helmet with an IR bulb on top would do just fine.
tayyab002 years ago
Hello,
I am a beginner in these things, I want to know that how u have managed to pull the trigger of the gun as soon as it sense something ? is it something to change with the mechanical design or what, How have u taken that as input to the board? I will be obliged to you for the answer

Thanks
tayyab002 years ago
hello,
I am a beginner in making these things, one thing that i want to know is how u have manged to pull the trigger automatically as soon as the target is detected ? is there any mechanical alteration that is actually doing it or what ? i will obliged if you can answer to clear me

Thanks
PJPEEJ2 years ago
Do the downloaded programs work on a mac? Or should i use a pc/linux computer?
sentryGun53 (author)  PJPEEJ2 years ago
If you use a mac or linux, you have to get the Mac or linux specific versions of Processing and the libraries. Most people use a PC and all the support and tutorials are for a PC, so that is probably your best option if you have one
lxu2 years ago
Nice work. Very interesting project. Thanks for sharing.
dilbert2272 years ago
hi,

Is there anyway to reverse the direction of the of the servos through the code.

thanx
sentryGun53 (author)  dilbert2272 years ago
Yes. In the Processing code, near the beginning, swap the values of xMin and xMax to change the direction of the panning servo, and swap the values of yMin and yMax to change the direction of the tilt servo.
Cheers,
-Bob
1-40 of 111Next »