Introduction: Self Aiming and Engaging Gun
This is controlled by image processing method for finding and eliminating human moving in front of the camera.
this can be used for
paint gun laser
i am going to use laser just to demonstrate . u can use anything
Step 2: Parts
1.Arduino uno or msp430 or any micro controller with serial communication facility
3. ARDUINO IDE
4. SERVO motors(positional control)X2
5.servo mounts and ply woods
7. small laser pointer (or) electrically operated pain ball gun etc
Step 3: Uploading Msp430 Program (energia)
energia is same as arduino ide. this program can also be used for arduino uno(you just have to change the pin numbers that all it needs).
connect the board to your computer and click upload
i have uploaded the edited version of the matlab code in this pro.rar file
Step 4: Image Processing
open matlab software
browse to the downloaded file and load the checksent.m file
change the webcam number to yours
line no 3 = change the webcam number if you are using 2 or more webcam simultaneously
(vid = videoinput('winvideo',1);)
line no 8= change the com port number to your needed com port
(s = serial('COM4','BaudRate',9600);)
Step 5: Calibration
this is the though job . i had given you the values for an 7 feet room . in case if you are using this mechanism for a different sized room you have to find the angle for the ground and top servo (enter a new angle and check where the laser hit, then find the distance between the points and change the angle to reach your point are the center of the box)..... just an hour or two will be enough for finding and updating these values .
Step 6: Fitting
do it as shown in the image
We have a be nice policy.
Please be positive and constructive.