![]() |
ARDUINO UNO REV3 |
x 1 | |
|
MG 996RSeamuing
|
x 1 |
![]() |
arduino IDEArduino
|
Full-auto nerf gun that shoots you in face, using OpenCV
I've been building this project as a way to learn computer vision.
I've been documenting the build progress on my YouTube channel: https://www.youtube.com/channel/UCcT3iGeJJfpGU1QehvG48tg/videosw
Currently the project sort of works as an initial version, but I may come back to it at some point and try to improve it. If you want to see the final testing watch this video, and then below I'll put more details about the build process
I started with creating a prototype to test the face-tracking without the nerf gun, which would both mean it would be lighter and easier to quickly to together, and also that I wouldn't be constantly shot by nerf bullets whilst trying to get the software working.
The testing setup comprises of two servos, one for pan and one for tilt, with a webcam mounted on top, as shown below:
The webcam is plugged into a computer running a python script with OpenCV. That detects a face, and sends the coordinates of where it is within the image to an Arduino, which moves the pan and tilt servos so that the centre of the face (green dot) is within the centre of the image (white square).
I used a guide by Shubham Santosh (https://create.arduino.cc/projecthub/shubhamsantosh99/face-tracker-using-opencv-and-arduino-55412e) for this part, so thanks to him for pretty much half the project!
I could then design and print a larger and more sturdy two axis mount for the nerf gun, and a firing mechanism which is triggered when the face is within the centre of the screen (shooting me in the face, apologies for my lack of eye protection!)
And after that, all that was left to do was test it!
It works, although currently motion is a bit jerky, and it might be worth adding in a feature to scan the room if no face is detected.
To see the test (and me get shot in the face) check out the testing video: https://www.youtube.com/watch?v=N5vzpi4yF7A&ab_channel=AdamBeedle
Full-auto nerf gun that shoots you in face, using OpenCV

Raspberry Pi 5 7 Inch Touch Screen IPS 1024x600 HD LCD HDMI-compatible Display for RPI 4B 3B+ OPI 5 AIDA64 PC Secondary Screen(Without Speaker)
BUY NOW
ESP32-S3 4.3inch Capacitive Touch Display Development Board, 800×480, 5-point Touch, 32-bit LX7 Dual-core Processor
BUY NOW
Raspberry Pi 5 7 Inch Touch Screen IPS 1024x600 HD LCD HDMI-compatible Display for RPI 4B 3B+ OPI 5 AIDA64 PC Secondary Screen(Without Speaker)
BUY NOW- Comments(3)
- Likes(4)
-
Engineer Dec 14,2023
-
DrkZ May 27,2023
-
Andre Almeida Pinto May 01,2023
-
Sebastian Mackowiak Mar 21,2023
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by adambeedle
-
Robot that swings and climbs walls like Spider-Man I've been building this project for over a month as a way to get to grips with electronics/robotics/...
-
Full-auto nerf gun that shoots you in face, using OpenCV I've been building this project as a way to learn computer vision.I've been documenting the build pr...
-
-
Commodore 64 1541-II 1581 Floppy Disk Drive C64 Power Supply Unit USB-C 5V 12V DIN connector 5.25
279 1 3 -
Easy to print simple stacking organizer with drawers
106 0 0 -
-
-
-
-
-
-
Modifying a Hotplate to a Reflow Solder Station
1195 1 6 -
MPL3115A2 Barometric Pressure, Altitude, and Temperature Sensor
680 0 1 -
Also try using the tracking again to focus on emissions like such when a digital CCD is activated and it then pulses a laser beam to block the image or motion picture from forming. I was going to take the notion to places of interest where photographs are not usually permissible and thus prevent said action from taking place to respect the rules. You'll have some great giggles and you could earn possible patents and such for yourself :D