A while ago I was sorting some old Star Wars toys that my brothers and I got during SW fan years (before and during the prequel trilogy). I found this 2004 lightsaber in a box and load batteries in it. Nope - it was broken. Sad.
I thought about throwing it away, then I got an idea.
Since this lightsaber is a "color changing" version, the blade is white (or transparent). You can make it light up as any kind of colors with RGB LEDs. So I tear it open, break down some inner wall structures and put it various components:
- Arduino Nano
- 9 NeoPixel (WS2812b) LEDs (8 in a ring and an additional one in the center - I linked them together)
- ADXL335 3-axis acceleration analog sensor
- DFPlayer Mini MP3 Player (see docs)
I downloaded a bunch of lightsaber sound effects and put them into a mini SD card in the MP3 player. I added a few movie quotes and soundtrack music as well.
Also, two parts in the lightsaber are kept as part of the system (I cut and soldered their wires to jumper wires):
- The side button
- The speaker
As it happens, a small 5V power bank (which I used for my first project here) can be fitted into the original battery compartment.
Right now the saber functions as follows:
- When you press the side button, the saber would "activate" with a random activation sound and a random color (red, green, blue, yellow, cyan, purple, white).
- Play a random humming sound.
- When the saber is activated, pressing the button and release quickly would shut it down (also playing a random shut down sound).
- However, if you press the button a bit longer or long enough, it would play a random movie quote or soundtrack music,
- While playing a quote or music, pressing it again quickly would return it to the humming mode.
- While in humming mode, moving the saber fast enough would make it play a random whooshing sound.
I decided not to put in clashing sounds and the corresponding motion detection, since it would be tricky to detect different motions, and I don't want to smash this thing around and break it again.
I also don't want to use rainbow colors...it's meaningless here and the effect looks less effective in the plastic tube.
Probably someday I'll make it a Spaceball parody version, just maybe.
Comments