help with turret on arduino w/ tracking

Hello, 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.

Oh ok.....ill think about it

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?

How would i use the laser 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.

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 dont need any thing of great 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

Define "near" and "long".

Near ....1 to 6 ft Long 30+

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.

Actually i am going to do the panning of an ultrasonic sensor and read its value then when the value of sensor changes it will fire. Thanks for all the advice

A PIR sensor module does not detect heat (as designed), it looks for changes in heat and does so over a fairly wide area. The lens is an essential part of that discrimination.

Anyway... If you want it to be a surprise, you could have a PIR sensor watching to see if anyone is in the field of fire, and only then will it start sweeping the ultrasonic sensor back and forth.

That sounds good

The long range thing does intrigue me now, but it is a lot of money! For the software recognition, so ur saying i need a laptop to do this, well i am NOT using a laptop because i dont have any to spare. And i am not going out to buy one either. Is there any other way i could do this, arduino or not.

I have done some research and found this for 40$ and it is 25 ft range. Would this work with an arduino?