Arduino Proton Pack

Hi, This is a spin off project that I learned how to do 75% of the set up and design thru the Lightsaber thread by int user = Jakesoft;

It uses some basic boolean conditions to check thru the code to play sounds, and flash lights.

parts list

3W LED of choice (RGB, Blue, Green or White, 3.3v-3.7v 3W)
Nchannel Mosfet
Momentary switch
on/off switch
Any Arduino
WT588d-U 32M sound module
3.7v lithium battery
S.1v step up buck boost boost module
2- mini solderless breadboards
any 8ohm 2W speaker (i got mine from a broken white-noise sound machine. old laptop speakers will work good)
you will need solder and soldering iron if you want to secure this in your prop. it should fit into the wand or pack portion of the proton pack.

to wire your mosfets, and program the WT, see the Lightsaber thread. it’s a prop builders treasure trove over there.

// Proton Pack Arduino Code October 20 2016,  Bill Pealer billpealer@gmial.com
#define WT588D_SDA 6 
int ledPin = 13; // blinks the mosfet gate pin        
int button = 2;  // positron glider trigger
bool pack_on;  // conditioanl statement 
bool power_up;  // conditioanl statement 
byte file_count = 1;  //WT588D as per manufacturer
 
void setup() {
  pinMode(WT588D_SDA, OUTPUT);
  pinMode(ledPin, OUTPUT);        
  pinMode(button, INPUT_PULLUP);
  digitalWrite(WT588D_SDA, HIGH);
  pack_on = false;
  power_up = true;
}
 
void loop()
{
  if (digitalRead(button) == HIGH && power_up)
  {
    WT588D_Send_Command(0x00);
    delay(20);
    power_up = false;
  }
   if (digitalRead(button) == LOW)  // hold the button down nice shootin' tex!
 { 
    delay(10); 
    if (pack_on)  
  { 
    WT588D_Send_Command(0xFE); //stop audio
    delay(5);
    digitalWrite (ledPin, LOW);
    pack_on = false;
    delay(100);  
  }
  else
   {   
      WT588D_Send_Command(0x01); // stream sound dont cross the streams
      delay(100);
      pack_on = true;
      attachInterrupt(digitalPinToInterrupt(button), stop_pack, CHANGE);
      
    for(int i = 0; pack_on == true; i++)
  { 
    digitalWrite (ledPin, HIGH);
    delay(50);
    digitalWrite (ledPin, LOW);
    delay(50);
   }
  }
 }
}

void WT588D_Send_Command(byte addr) {
    digitalWrite(WT588D_SDA, LOW);
    delay(5);

    for(int i = 0; i < 8; i++)  {
        digitalWrite(WT588D_SDA, HIGH);
        if(bitRead(addr, i)) {
            delayMicroseconds(600);
            digitalWrite(WT588D_SDA, LOW);
            delayMicroseconds(200);
        } else {
            delayMicroseconds(200);
            digitalWrite(WT588D_SDA, LOW);
            delayMicroseconds(600);
        }
    }

    digitalWrite(WT588D_SDA, HIGH);
    delay(100);
} //end WT588D_Send_Command
  
void stop_pack()  // the interupt takes you here 
{
  digitalWrite (ledPin, LOW);
  delay(50);
  WT588D_Send_Command(0xFE);
  pack_on = false;
}

Wiring diagram

That's awesome, well done! How about a button to play sound bites from the original song? "I aint afraid of no ghost", "Ghost Busters! da da da", and the like. Your crew is going to be awesome for halloween.

Edit: "He slimed me!"

Now that's what I'm talking about! It's very gratifying to see that you have truly learned how to fish and now you are applying what you've learned toward original project ideas. Good job!

One note: if you want your fire sound to last longer you can chain the sounds back to back in the WT588D playlist just like you could with the lightsabers where you put, for example, a clash followed by a bunch of hum sounds. That way you could accommodate a trigger press of several minutes, I'd imagine.

Playlist = FIRE, FIRE, FIRE, FIRE ,FIRE ....

yeah that's right. playlists. i may try to find the end audio for the fire sound. i think there may be one.

handy.

RubberToe:
Edit: “He slimed me!”

i feel so… funky.

New Code.
Added An On switch.

// Proton Pack Arduino Code October 20 2016,  Bill Pealer billpealer@gmial.com
#define WT588D_SDA 6 
int ledPin = 13; // blinks the mosfet gate pin        
int button = 2;  // positron glider trigger
int Pack_SW = 12;  // pack switch
bool pack_on;  // conditioanl statement 
bool power_up;  // conditioanl statement 
byte file_count = 1;  //WT588D as per manufacturer
 
void setup() {
  pinMode(WT588D_SDA, OUTPUT);
  pinMode(ledPin, OUTPUT);        
  pinMode(button, INPUT_PULLUP);
  digitalWrite(WT588D_SDA, HIGH);
  pinMode(Pack_SW, INPUT_PULLUP);
  pack_on = false;
  power_up = true;
  digitalWrite(button, HIGH);
  digitalWrite(Pack_SW, HIGH);
}
 
void loop()
{
  if (digitalRead(Pack_SW) == LOW && power_up)
  {
    WT588D_Send_Command(0x00);
    delay(20);
    power_up = false;
  }
  if (digitalRead(Pack_SW) == HIGH && !power_up)
  {
    delay(20);
    power_up = true;
  }
   if (digitalRead(button) == LOW)  // hold the button down nice shootin' tex!
 { 
    delay(10); 
    if (pack_on)  
  { 
    WT588D_Send_Command(0xFE); //stop audio
    delay(5);
    digitalWrite (ledPin, LOW);
    pack_on = false;
    delay(100);  
  }
  else
   {   
      WT588D_Send_Command(0x01); // stream sound dont cross the streams
      delay(100);
      pack_on = true;
      attachInterrupt(digitalPinToInterrupt(button), stop_pack, CHANGE);
      
    for(int i = 0; pack_on == true; i++)
  { 
    digitalWrite (ledPin, HIGH);
    delay(50);
    digitalWrite (ledPin, LOW);
    delay(50);
   }
  }
 }
}

void WT588D_Send_Command(byte addr) {
    digitalWrite(WT588D_SDA, LOW);
    delay(5);

    for(int i = 0; i < 8; i++)  {
        digitalWrite(WT588D_SDA, HIGH);
        if(bitRead(addr, i)) {
            delayMicroseconds(600);
            digitalWrite(WT588D_SDA, LOW);
            delayMicroseconds(200);
        } else {
            delayMicroseconds(200);
            digitalWrite(WT588D_SDA, LOW);
            delayMicroseconds(600);
        }
    }

    digitalWrite(WT588D_SDA, HIGH);
    delay(100);
} //end WT588D_Send_Command
  
void stop_pack()  // the interupt takes you here 
{
  digitalWrite (ledPin, LOW);
  delay(50);
  WT588D_Send_Command(0xFE);
  pack_on = false;
}

RubberToe: That's awesome, well done! How about a button to play sound bites from the original song? "I aint afraid of no ghost", "Ghost Busters! da da da", and the like. Your crew is going to be awesome for halloween.

Edit: "He slimed me!"

i think i WILL do this! the WT 32mb model can easily fit whole songs. i can make it the other toggle of the main power button. so power up whine / play song

Just found this... very nice!

I will work with this and see what I can come up with for a alternate proton pack set up to what I have now!

Thanks for sharing!!! :D