Using a Nerf Hammershot and an Arduino, I built my own custom video game controller for the character of McCree in Overwatch.
Overview
The Arduino inside of the Nerf gun acts as a mouse and keyboard, sending HID commands over USB to the computer. The trigger and hammer are wired to buttons, and the cylinder is wired to a rotary encoder. Pulling the trigger fires, sliding the hammer back “fans the hammer”, and spinning the cylinder reloads. The gun also includes an inertial measurement unit (IMU) with an accelerometer and a gyroscope. This allows me to track movement for aiming. McCree’s ultimate and flashbang are also controlled by the IMU by pointing the gun down or twisting my arm, respectively.
To keep things minimal and within the one-handed style of the game, the controller includes no movement controls (move, jump, roll). I designed it to be paired with a DDR-style dance pad to handle movement, although I did end up switching that out for a Wii Nunchuk suspended from my belt. The game sees the gun as a system peripheral and is none-the-wiser, meaning that there is little risk of triggering anti-cheat protections.
I was inspired by a number of streamers on Twitch who build their own wacky controllers for playing games, notably Rudeism and SuperYoshi64 (formerly ATwerkinYoshi). They call this style of playing games with strange methods “AltCtrl”. If you like this project, I recommend checking them out.
Video
Here’s a short video that shows how the controller works. Enjoy!
Posts
- Part 1: Planning and Disassembly
- Part 2: Buttons and Rotary Encoder
- Part 3: RGB LED and Capacitive Touch
- Part 4: Custom PCB
- Part 5: Wiring and Final Assembly
- Part 6: Programming
- Part 7: Demonstrations and Playtesting
- Part 8: Bug Fixing and Refinements
- Part 9: Nunchuk Movement
- Part 10: Conclusion
Related Posts
How to Use a Wii Nunchuk with an Arduino
Software Download
I’ve created a repository on GitHub for the project files. This repository contains the final Arduino code for the Nerf controller and Nunchuk, the few 3D printed designs I used, and the rough PCB design. Click here.
Parts List
For full disclosure, note that most of these are Amazon affiliate links that help fund the content on this site. Thank you for your support!
- Nerf Hammershot
- Arduino Pro Micro
- Push-Buttons
- Rotary Encoder
- Copper Tape
- Wii Nunchuk
- Nunchucky Breakout Board
Those are the key parts that are absolutely necessary for the build. I tried to make this controller using only things I had on-hand, so there’s a lot of supplies that I used which wouldn’t be economical (or even practical!) to buy specifically for this project and thus aren’t listed.
For the sake of completeness, other parts and supplies are linked in the posts as they are used. If I missed something, feel free to leave a comment.
1 Comment
fabio · February 7, 2021 at 11:46 am
Hi
the Nerf Hammershot is awesome !!!
I wanted to ask you if it is possible to see the prototype, mpu6050, arduino micro and 2 buttons, it works like a mouse, I would like to build a gun to play house of the dead on sega model 2
let me know ,
good day