The sword in question is called Zephyr - The Wind Spirit, it belongs to Yuno and is used for wind magic as well as general combat. However, given that I knew I would spend a lot of time and money making this cosplay tool, I decided to expand on Yuno's sword by adding all the other elements which would make it adaptable to other character cosplay costumes. Thus was born the Elemental Sword.
The sword features 4 elemental modes (Earth, Wind, Water, Fire), one neutral mode, and one pink mode. In each mode, the sword lights up in the appropriate colors (ie. blue for water) and when swung outputs elemental sound effects (ie. water splashing for water). The special twist is that the sword is only active when the handle is gripped. This is because anime swords are typically fueled by mana and/or only glow when touched by the right person. To create this "chosen one" illusion I placed a small force sensor somewhere on the grip at a location that only I, or whoever the sword is made for, would know. The sword elemental modes are only active when this force sensor is pressed, therefore unless the owner knows the location of the sensor the sword won't work. Lastly, just for fun, I added a set of moving wings at the bottom of the blade that swings open when the force sensor is touched and closes when the force sensor is no longer being touched.
Current User Interaction Flow ChartThis project is still a work in progress but so far I have managed to get the core of the code working as a proof of concept, I will be describing the simplified proof of concept on this project page. Once the final sword is made I will update the page! The final intended user interaction flow chart and the current user interaction flow charts are shown below to illustrate the functions of the sword.
- Get all the hardware components including a large breadboard
- Follow the wiring diagram
- Download the GitHub repository onto the Beagleboard
- Go through each hardware and component make sure that the test code for each component can run ( Test codes exist for all components in the file labeled as component name)
- run Sword code manually and check everything works
- Set up the Sword program to start on bootup using the crontab
The sword currently uses the following electrical components: 5 LEDs, a push button, a USB-A breakout board, two 100uF capacitors, a level shifter, a black Beagleboard, led strip lights, a 5V USB-A power adapter, a force sensor, an accelerometer, a servo, a USB-A Speaker, one 1kohm resistor, and one 3.3kohm resistor. The final project will also include a 5V battery with two USB-A outputs and a power switch to eliminate the need for a computer to power the beagle board and the led strip lights. The diagram below depicts the system wiring. They are several things worth noting. First, the two capacitors are connected to the USB-A breakout board in order to provide enough initial power to the board. Second, the accelerometer is used to detect a swing of the sword, if the sword is swung a sound effect corresponding to the chosen elemental mode is randomly chosen and played. Third, the servo is used to open the wings/flower while the touch sensor is being touched. Lastly, the LEDs are used for indicating which elemental mode the sword is currently in.
Building this prototype was fairly simple however they are two main issues I have yet to solve and two important/repeating hurtles that I have had to overcome.
The first of the two main issues that I have yet to solve is that when the program is run on boot up the strip LED lights become very glitchy and unable to work. I suspect it may have something to do with the run-opc-server operation that needs to run in the background of the program. The second of the first two problems is that there is a long delay between when the accelerometer senses a swing and the beginning of a sound effect playing. I am not sure what causes this but I plan on trying threading or a different audio player command to see if it will decrease this delay.
The first of the repeating hurdles I faced was making sure that all the necessary packages were uploaded to the Beagleboard, hence why I made a point to include the above section on important setup instructions. The majority of this project really is setting up and being able to control all the hardware components, this includes the three inputs (force sensor, accelerometer, button) and the three outputs (speaker, LEDs, servo). If something does not work, make sure the Beagleboard has all the necessary uploads. The second repeating hurdle was learning how to properly structure my code. For example, I spent a lot of time defining an array to switch between the elemental modes but this approach did not work. I also spent a lot of time figuring out how to nest while and if statements in order to make sure that inputs were taken in at the right times and that the right system responses were outputted in a timely manner.
Video of Current PrototypeFuture Steps- Build physical sword to integrate electronics into
- decrease lag time between accelerometer sensing movement and the sound playing
- add all black-box functions from the user interaction flow chart
- add neutral mode to the button cycle of elemental modes
- possibly add more intricate led displays
- Obtain and integrate all power systems for operation w/o a computer
- Built physical sword to integrate electronics into
- added all black-box functions from the user interaction flow chart except the fail safe
- add neutral mode to the button cycle of elemental modes
- Obtain and integrate all power systems for operation w/o a computer
- Added muggle vs chosen mode so that in chosen mode if the touch sensor is no longer touched the sword returns to neutral mode
- Created PCB
- My dimensioning was off for a lot of the components so I was unable to create the full sword with all the electronics.
Comments