First of all, sorry for possible texting errors (Im not a native english speaker)
How it started
In this project, I proposed myself to create Cappy, from Super Mario Odyssey. I thought it would be a simple and fun first individual project. My principle was that if I attached a string to a motor and at the other end to a cap, when I started the motor the cap would spin around it. So, if I managed to put a contraption like that at the top of my head, the cap would spin around me, just like in the game.
After various tests, this is the end result (For more videos be sure to check out my Instagram as @alguienmuyrobotico):
How it works
It ended up having two motors, one responsible for the spinning part and the other one for the pulley. In conjunction, this two allow me to do both the spinning attack and the normal attack. To detect when the cap is on my head and when not, I used an IR light sensor with a white surface in the bottom of the cap (this approach would later present some issues). I started prototyping with an Arduino UNO board, but then changed it for an Arduino Nano to reduce weight and size. I also initially used a 9v battery, that I ended up upgrading later too. To mount it all on my head I purchased a helmet and snapped off the inner part from the plastic shell (That part would also turn out to be very useful).

The spinning attack
In this attack the cap starts spinning around you, then the pulley extends so the cap gets further away from you, then it retracts and finally the other motor stops spinning. This was the principal feature of this contraption, and ended up being also the most complicated. My first problem emerged as soon as I attached the cap to the string; the motor, probably too small for this task, couldn't spin a real cap or even a paper one, so I added two more batteries (AA, 1.2v each), this time really pushing the 6v limit of the motors. I also replaced the Arduino UNO for an Arduino Nano to reduce the weight a little bit and to make space for the extra batteries. After all of that and tons of testing it finally worked, and I moved on to the next feature.

The normal attack
This attack starts with the pulley fully extended, after a delay it moves one motor a little bit as a signal for you to throw the cap, and then it retracts it at maximum speed. This part was considerably easier than the previous one, and went with almost no casualties. The principal thing was to get the timings just right, but nothing else. I also by this point made a nicer looking cap with diary paper and glue, using the shell of the helmet as a mold and replaced the wool cord for a synthetic one.

Technical Implementation Details
The core logic of the project is handled by the Arduino Nano. While this build uses motors and an IR sensor for physical actuation and detection, a similar interactive system could be implemented using motion sensors. For instance, a project like this could integrate an MPU6050 6-Axis Gyro/Accelerometer to detect the orientation and motion of the hat itself. The sensor data could then be used to trigger the motor sequences, creating a more intuitive, motion-controlled experience. The Arduino code would read the raw gyro and accelerometer data to detect specific gestures, like a sudden forward motion for a "throw" or a rapid rotation for a "spin," and activate the corresponding motor routine.
The final program
To finish up this project, I programmed a sequence with both attacks triggered by the IR light sensor (a simple 4 state state machine). So the sequence goes like this:
- Extends pulley
- Waits until you put the cap on your head
- Waits until you take off the cap
- Does normal attack
- Waits until you put the cap on your head
- Waits until you take off the cap
- Does spinning attack
- Starts all over again
There is an issue with the sensor and it's that it detects different values depending on the light level of the ambient, so the program and the bottom of the cap must be changed depending if you are indoors or outdoors. I didn't solve this problem, by this point I just wanted to finish it.
Future Expansion Ideas
This project has great potential for enhancement. To solve the ambient light issue, one could use a more reliable proximity sensor or the motion-based approach mentioned earlier. Other improvements could include:
- Vibration Feedback: Add a haptic feedback motor to the hat to provide tactile confirmation when an attack is triggered.
- Wireless Operation: Integrate a Bluetooth module to make the hat completely wireless, removing the need for trailing wires.
- Refined Motion Detection: Implementing an MPU6050 would allow for more complex and accurate gesture control, differentiating between various throw strengths or spin directions.
Hope that you found this interesting, thanks for reading.