Project showcase
Sound Effects for Dok-Ondar's Lightsaber Box

Sound Effects for Dok-Ondar's Lightsaber Box © GPL3+

Add sound effects to opening the box and lifting the lightsaber.

  • 748 views
  • 0 comments
  • 2 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
Arduino UNO is what I used.
×1
Adafruit Music Maker Shield
×1
3 Watt 8 Ohm Speaker
These are the speakers I used but they do not have to be the same
×1
Mfr 25frf52 1k sml
Resistor 1k ohm
×2
4657352
Microswitch, Roller Lever
Solder a piece of wire to the common leg and another piece of wire to the NO leg
×1
Adafruit industries ada64 image 75px
Solderless Breadboard Half Size
×1
Male/Male Jumper Wires
×1
826 04
Male/Female Jumper Wires
×1

Necessary tools and machines

09507 01
Soldering iron (generic)
4966285
Solder Wire, Lead Free
34ac9633 40
PCB Holder, Soldering Iron
This is not necessary but it helps to solder the pins and wires.

Apps and online services

Ide web
Arduino IDE
Audacity
I used this to edit the audio files for the project, not necessary.

About this project

When I bought the Reforged Skywalker Lightsaber from Galaxy's Edge, I saw how other people would customize their box so I thought I would do the same. I made the "force theme" play when I opened the box and when I lifted the lightsaber. It gives me a similiar feeling of when Rey opened the box at Maz's Castle or when she handed the saber to Luke in TLJ.

Here's a video of it working:

You can add any sounds you want, it doesn't have to be the same.

Here's a picture of how I managed to fit it all in:

You will need the custom Arduino library built for the shield which can be found here:

https://learn.adafruit.com/adafruit-music-maker-shield-vs1053-mp3-wav-wave-ogg-vorbis-player/installing-software

I used Audacity to cut the sound I wanted from the finale song from the Rise of Skywalker Soundtrack. I cut them to the length I wanted and added a fade out to the clips. Then I just uploaded them to a microSD card and put that in the Music Maker Shield.

Code

Finale.inoArduino
// include SPI, MP3 and SD libraries
#include <SPI.h>
#include <Adafruit_VS1053.h>
#include <SD.h>

//This part of the code is from the example in the Adafruit library. I just copied and pasted it, I don't really know what it does but it makes the code work.
// These are the pins used for the breakout example
#define BREAKOUT_RESET  9      // VS1053 reset pin (output)
#define BREAKOUT_CS     10     // VS1053 chip select pin (output)
#define BREAKOUT_DCS    8      // VS1053 Data/command select pin (output)
// These are the pins used for the music maker shield
#define SHIELD_RESET  -1      // VS1053 reset pin (unused!)
#define SHIELD_CS     7      // VS1053 chip select pin (output)
#define SHIELD_DCS    6      // VS1053 Data/command select pin (output)

// These are common pins between breakout and shield
#define CARDCS 4     // Card chip select pin
// DREQ should be an Int pin, see http://arduino.cc/en/Reference/attachInterrupt
#define DREQ 3       // VS1053 Data request, ideally an Interrupt pin

Adafruit_VS1053_FilePlayer musicPlayer = 
  // create shield-example object!
  Adafruit_VS1053_FilePlayer(SHIELD_RESET, SHIELD_CS, SHIELD_DCS, DREQ, CARDCS);

//Adds names to the pins for clarity
int button = 8;
int buttonVal = 0;
int done = 0;
int forceSensor = A0;
int forceVal = 0;
int musicPlaying = 0;
  
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(button, INPUT);

//Checks if any errors happen
  if(!musicPlayer.begin()){
    Serial.println(F("Couldn't find VS1053, do you have the right pins defined?"));
    while (1);
    }
  Serial.println(F("VS1053 found"));
  
  if (!SD.begin(CARDCS)){
    Serial.println(F("SD failed, or not present"));
    while (1);
    }
  else{
    Serial.println("SD Card Successful");
    }
}

void loop() {
  // put your main code here, to run repeatedly:

  //Any Serial.print code is only used for debugging.
  buttonVal = digitalRead(button);
  forceVal = analogRead(forceSensor);
  Serial.print("ForceVal: ");
  Serial.print(forceVal);
  Serial.print(" ButtonVal: ");
  Serial.print(buttonVal);
  Serial.print(" Done: ");
  Serial.println(done);
  delay(500);

  //Checks if the box is closed and the lightsaber is in place. If it is, play the opening music
  //The values for forceVal may vary, if it doesn't work, try changing the values to see what happens.
  if(buttonVal == HIGH && done == 0 && forceVal >= 50){
    done = 1;
    musicPlayer.setVolume(20,20);
    Serial.println("Playing Opening");
    musicPlayer.playFullFile("open2.mp3");
    delay(200);
    }

  //Checks if the lightsaber has been removed. If it is play the lifting music.
  if(forceVal <=50 && done == 1){
    done = 2;
    musicPlayer.setVolume(10,10);
    Serial.println("Playing Lifting");
    musicPlayer.playFullFile("lift4.mp3");
    delay(200);
    }

  //This resets everything so that it can happen again.
  if(forceVal >= 50 && done == 2 && buttonVal == LOW){
    done = 0;
    delay(200);
    }

}

Schematics

Finale Diagram
In the diagram, only the shield is shown, this is because the shield is stacked on top of the arduino.
Untitled sketch bb l1kexgujbj

Comments

Similar projects you might like

Sound Sensor Activated LEDs with LCD for Sound Level Data!

Project tutorial by HeathenHacks

  • 7,642 views
  • 7 comments
  • 21 respects

Interactive Toddler Music Box Toy

Project tutorial by Christopher Monreal and Nick Udell

  • 1,447 views
  • 0 comments
  • 2 respects

Automatizing Percussion with Solenoids: "The Sound Compass"

Project tutorial by touchmysound

  • 4,534 views
  • 4 comments
  • 14 respects

Boom Box

Project in progress by Team Trouble

  • 3,975 views
  • 2 comments
  • 9 respects

Kid's Majestic Streamer Fan Light Button Box

Project in progress by Team Max 35

  • 1,804 views
  • 0 comments
  • 0 respects
Add projectSign up / Login