Go Down

Topic: help with turret on arduino w/ tracking (Read 3964 times) previous topic - next topic


I have an airsoft gun, 5- 1 kilo ohm resistors,an arduino uno and a pir sensor. Also a motor from a wind up generator flashlight. I want to make an airsoft turret(sentry gun) with these parts. I finally figured out how to fire the gun via arduino. To shoot the gun i would just need to turn one pin on the arduino uno high to fire it. Im sure the motor part is easy escpecially since i already have gears mounted and every thing else. What i need help with is the tracking part. I would like to use 1 pir sensor for tracking if possible. If its not possible i can get a different sensor. I would like to keep it cheap though as in 15 dollars cheap if needed. I understand that there are motion detecting softwares out there, but i do not know how any of them work, or how to use them. Thank you. By the way i am only 14 and am a newbie when it comes to electronics. Any advice welcome!


If you have a servo you could turn a ultrasonic distance sensor like a ping sensor from parallax and have it store the values and compare them to the previous one to see if anythings changed then you could have the gun rotate in whatever direction the sensor was triggered at and the shoot.


Ok, ill think about it, but do i NEED servo or can i use a motor that is geared down to spin slow like a servo?


The servo will have some sense of where it is pointing, which a simple geared motor will not.
That may or may not be important to you.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.



Oct 04, 2013, 12:02 am Last Edit: Oct 04, 2013, 12:11 am by bigred1212 Reason: 1
For tracking, a PIR sensor is simply going to give you a high voltage reading when there is something in its field of view.  Somewhere.  Anywhere.  I don't think they discriminate.

If you use LuketheDuke's idea of an ultrasonic range finder I think you would be better off.  This is actually something that is on my "to-do" list.

One sensor would be a start but I think two (2) sensors mounted say like 3 feet apart would be really cool.  Take a reading from each and adjust direction based on the difference in values.  The problem is that a hobbyist level sensor like a PING has a range of about 3 meters which doesn't do you any good for an airsoft turrent.  You probably want ranges of more like 30 or 40 feet I would think.  That starts to blast a real giant hole in your budget.  

This 18 foot range one is $65 as an example.

This good looking baby with a 30 foot range is $119.

Laser range finder?  



I think they are a lot of money as well, now that I look.

Sorry, I don't know what to recommend for a low price decent range tracking sensor for this application.


Oct 04, 2013, 03:39 pm Last Edit: Oct 04, 2013, 03:41 pm by PeterH Reason: 1
I've seen lots of successful motion tracking projects based on video processing, and none based on any other technologies. That's not to say that other approaches couldn't be made to work with enough time and effort, but the video processing approach is so massively more practical that it's really the only approach worth considering IMO.

The Arduino doesn't have enough power to be any help with the video processing, although you could potentially do it on any low spec laptop, or buy something like an RPi for the job. The only role for the Arduino would be to operate servos and so on under the control of whatever does your image processing.
I only provide help via the forum - please do not contact me for private consultancy.


I dont need any thing of great quality....so laser and long distance r out......i should have been more specific because the purpose of this is to have it near two intersecting paths meet in the woods and when someone walks by for that short amout of time that it will follow them and shoot them.....its not long distance




The easiest way would be to make sure that there is nothing within 6ft of the turret, and if detects anything within 6 ft (using an ultrasonic sensor for example), then fire wildly.  You can then have it track back and forth, and if anything enters the 6ft range, it will go off.
More complicated Option:
Have an initialization procedure, and have it pan back and forth, taking regularly measurements at known rotational angles.  As it pans back and forth, have it fire if the current value doesn't match the initialized value.


I like the second version a lot better


you could also put buttons on the path where you want to detect people and if the button is pushed you could have it pan back and forth in small increments from the triggered button.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131