Jump to content

arduino: a cheap board for E11 blaster effects


Recommended Posts

thank you guys

i am here to give any assistance needed for building your arduino blaster :)

 

p.s.

i have found another seller on aliexpress that sells the small mp3 board at very cheap price, i just ordered 2 for future projects

 

this is the address

 

it's the half price than ebay same product ;)

Edited by skyone
Link to comment
Share on other sites

Hey mate, you think all this gear would fit inside a doopydoo kit? Obviously the trigger etc would be a problem though.

with dd kit there are severals modification from original project needed:

 

- the battery should be moved inside the pipe and replaced with cylindrical batteries (for example 2x 18650 li-ion 3.7v)

 

- the arduino board should be moved inside the receiver, wich internal resin should be removed

 

- speakers should be smaller (i don't remember the internal diameter of DD pipe)

 

- you will need to build an henglster counter to place the mp3 player and bar-led

 

this is only a temporary list of the changes required but not having the DD kit may be others not mentioned

 

 

in the meantime i just upgraded my arduino code because i noticed something about the laser effect:

20073145_firing-sterling-stormtrooper-bl 20073146_gallery_12157_11_483237.jpg 20073147_gallery_12157_11_264016.jpg 20073148_gallery_14191_18_405602.jpg

 

they added in post production a white smoke effect that last less than a second and disappears completely after the laser is gone.It does not always appear, but is mostly present in foreground scenes.

so i updated the code adding a very short white light emission before the red light of the E11 laser

    delay(30); // pause to wait mp3 start
      digitalWrite(ledPin, HIGH); //red
      digitalWrite(ledPin10, HIGH); //blue
      digitalWrite(ledPin9, HIGH); //green
      delay(1);
      digitalWrite(ledPin10, LOW); //blue
      digitalWrite(ledPin9, LOW); //green
      delay(80);  // partial lenght of sound
      digitalWrite(ledPin, LOW);
      delay(250); // pause to wait the sound finish

lx1q.jpg

 

would be nice to have a real smoke, which could be easily controlled by arduino adding a small device derived from green cigarettes, but it would be 'problematic its control (may be set only once every 10/20 gunshots or activated via a switch)
 
Edited by skyone
Link to comment
Share on other sites

Hi Skyone

 

Could you please clarify which speaker you settled on?

 

I'm starting to get the parts together I need to make sure I am ordering the correct part.

 

Thanks

it depends of the inner diameter of your pipe, everything above or equal to 3 watt @4 ohm is fine (the mini amplifier board works better with 4ohm speakers)

i am using a pairs of this one but they are 4watt @16ohm:

http://www.ebay.com/itm/220734504352?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

 

img9974w.jpg

 

they works fine but they can't make the mini amplifier works at max power (3 watt)

 

i also tested with success another set of speakers from sourcingmap but now they are out of stock

 

70mmx30mm Rectangle Shape Aluminum Internal Speaker Loudspeaker 4 Ohm 3W

 

http://www.sourcingmap.com/advanced_search_result.html?keyword=4+Ohm+3W&main_page=advanced_search_result&inc_subcat=1&search_in_description=0&categories_id=0&x=0&y=0

 

 

 

p.s,

i see finally another arduino blaster set around..

 

p.p.s. i see other arduino serving the empire.. :D

Edited by skyone
Link to comment
Share on other sites

I told you that I would have more questions! :)

 

Will this LED Driver be suitable?

 

1) it's 12Volts 300mA

the one i linked can work at 8volts 320-350mA (or even less voltage because we save energy cutting out the transistors/resistors)

http://dx.com/p/mr16-1-1w-320-350ma-constant-current-regulated-led-driver-8-40v-input-13553

 

2) it's not clear what IC uses and then if can be controlled with arduino

the one i linked uses PT4115 IC that supports a DIM pin input to turn on/off or to set the brightness each led via Arduino

 

http://www.micro-bridge.com/data/CRpowtech/PT4115E.pdf

 

20148578_img_9969.jpg

Edited by skyone
Link to comment
Share on other sites

  • 3 months later...

i just discovered another mp3 sound module even cheaper and smaller that might fit this project

just ordered for a test ;)

 

http://www.aliexpress.com/item/Free-Shipping-1pc-MP3-module-U-disk-TF-card-serial-sound-card-card-reader-module/1404739474.html

 

822547948_401.jpg

 

822547956_538.jpg

 

this module is similar to this but it's not the same,  it is better because does support the serial communications with arduino

 

it also has a LM4871 build in amplifier (3w@3ohm or 2,5w@4ohm)

 

pdf datasheet and serial commands manual

http://www.dfrobot.com/image/data/DFR0299/DFPlayer%20Mini%20Manul.pdf

 

as stated on the manual, it is important to add a 100ohm resistor between the RX of the mp3 and TX of the arduino because of different TTL voltage (3.3 vs. 5v)

 

edit:

i also found a support page with library and code

http://www.dfrobot.com/wiki/index.php/DFPlayer_Mini_SKU:DFR0299

 

edit2

fully tested

not reliable:

many problems with coding (needs its library because the serial string not only needs conversion to hexadecimal but also to calculate the checksum; the libraty code often doesn't do what requested; also, it needs to unplug power everytime the code is uploaded)

audio loud but some background noise

Edited by skyone
Link to comment
Share on other sites

  • 2 weeks later...

I used this one : WT5001M02-28P U-disk audio player SD card voice module MP3 Sound

 

http://i.ebayimg.com/00/s/NjAwWDYwMA==/z/UXEAAOxyuGFR0A2y/$T2eC16RHJG8FGrlqhTwmBR0!2yuo3g~~60_12.JPG

 

Product Features:

High-quality audio output, can access 1W 8Ω speaker;

With the BUSY output;

Support wav, mp3 format file;

SPI interface, SPI-FLASH download;

 

An ADC key interface, support for MP3 function keys of the five criteria;

With a special function keys, play the next songPress once to achieve, and the song cycletracks, long press to copy the contents of the TF card to FLASH;

Supports RS232 communication can becontrolled through the serial port or analog serial;

With a TF card socket, support TF card to play;

With a USB interface pins, support U disk player;

Support off-line copies of the content of the TFcard or U disk to the SPI-FLASH, copy by setiSound.mp3 file to change the power-play mode;

Control playback, rapid response, and better thansimilar products;

Long time stability, strong anti-interference ability.

 

Module Model:WT5001M02-28P

Capacity:SPI-FLASH: 4MB ~ 64MB

SPI-FLASH: 4MB ~ 64MB

TF card: 128MB to 32GB

3.3V-5.2V

36.1mm * 19.7mm

 

It works great with the arduino and has a good sound

Link to comment
Share on other sites

Thanks skyone for all your effort in this project,I have made this up with the WT5001M02-28p sound module and its working great !!

I ended up using less sounds as it takes to long to cycle back to the beginning for the E-11 blaster sound, would be good if you added some code so you could hold the selector button down for a few seconds to start back at the beginning. 

 

Awesome stuff !!!   :jc_doublethumbup:

Link to comment
Share on other sites

Hi Chivo

 

that's a good idea pressing the button longer to get the first sound.

I implemented this feature to switch the LED in may scope on and off with the sound selector button.

So i will implement this on my realod button. Press it short < 2 sec then reload press lond >3 Sec go to the first sound. Thanks for the idea

Link to comment
Share on other sites

would be good if you added some code so you could hold the selector button down for a few seconds to start back at the beginning. 

 

Awesome stuff !!!   :jc_doublethumbup:

i  remember i tried to add this feature but i couldn't find the correct code .. :/

 

 

Hi Chivo

 

that's a good idea pressing the button longer to get the first sound.

I implemented this feature to switch the LED in may scope on and off with the sound selector button.

So i will implement this on my realod button. Press it short < 2 sec then reload press lond >3 Sec go to the first sound. Thanks for the idea

 

if you like you can share your code here to make this project go further and better :)

Edited by skyone
Link to comment
Share on other sites

Here how i bulid my blaster
 
http://www.whitearmor.net/forum/topic/27140-blaster-with-light-and-sound/page-2
 
Here the Code of my blaster:
 
It is the const int buttonPin = 4; // the pin that the SELECTOR pushbutton is attached to i used for this
 

//MAKE SURE TO USE 10K Ohm PULL DOWN RESISTORS FOR SWITCH AND SELECTOR BUTTON

// folder advert01 -- Schusssound
// Sounds 0-5: SchussSound
// advert02 -- Blastersound
// Sound 1 Blasterstarten
// Sound 2 Sound für Auswahl Selector Button
// Sound 3 batterie leer Sound abspielen
// Sound 4 reload Sound abspielen

#include <Arduino.h>

// MP3 player
// TX --> int dataPin = 1; // The pin number of the data pin.

//int busyPin = 4; // The pin number of the busy pin.
//int resetPin = 3; // The pin number of the reset pin.


// Buttons
const int buttonPin = 4; // the pin that the SELECTOR pushbutton is attached to
const int reloadPin = 5; // the pin that the reload is attached to
const int triggerPin = 6; // the pin that the Fire is attached to

//LEDS
const int BAR1 = 7;     // the pin that the BAR LED is attached to
const int BAR2 = 8;     // the pin that the BAR LED is attached to
const int BAR3 = 9;     // the pin that the BAR LED is attached to
const int BAR4 = 10;     // the pin that the BAR LED is attached to
const int BAR5 = 11;     // the pin that the BAR LED is attached to
const int BAR6 = 14;
const int BAR7 = 15;
const int BAR8 = 16;
const int BAR9 = 17;
const int BAR10 = 18;
const int scope = 19;
const int RedLedreset = 13;// RED FIRE LED reset
const int RedLedclk = 12; // RED FIRE LED clock

// Variables will change:
int buttonPushCounter = 1; // counter for the number of SELECTOR button presses
int buttonState = 0;         // current state of the SELECTOR button
int lastButtonState = 0;     // previous state of the button
int triggerState = 0;         // current state of the Trigger
int lastTriggerState = 0;     // previous state of the Trigger
int triggerCounter = 0; // counter for the number of fire Button presses
int reloadState = 0;         // current state of the reload
int lastreloadState = 0;     // previous state of the reload
int redledcounter = 0; // counter for the 10 fire LED's
int blueledspeed = 50;        // Lauflicht Geschwindigkeit
long lastDebounceTime = 0;         // the last time the output pin was toggled
long lastscopeTime = 0;         // the last time the output pin was toggled
long debounceDelay = 200; // the debounce time, increase if the output flickers
long haltezeit = 3000; // wie lange muss man die Taste drücken
int scopestate = 0;


void setup() {

// initialize the SELECTOR and Trigger button pins as a inputs:
pinMode(buttonPin, INPUT);
pinMode(triggerPin, INPUT);
pinMode(reloadPin, INPUT);
// initialize the Barrel LED's as an outputs:
pinMode(RedLedreset, OUTPUT);
pinMode(RedLedclk, OUTPUT);
pinMode(BAR1, OUTPUT);
pinMode(BAR2, OUTPUT);
pinMode(BAR3, OUTPUT);
pinMode(BAR4, OUTPUT);
pinMode(BAR5, OUTPUT);
pinMode(BAR6, OUTPUT);
pinMode(BAR7, OUTPUT);
pinMode(BAR8, OUTPUT);
pinMode(BAR9, OUTPUT);
pinMode(BAR10, OUTPUT);
pinMode(scope, OUTPUT);

// initialize serial communication:
Serial.begin(9600);

    // Volume setting
Serial.write(0x7E); // startcode
Serial.write(0x03); // Datalength
Serial.write(0xA7); // Adjuste Volume
Serial.write(0x1F); // volume 0-31
Serial.write(0x7E); // Endcode

// set playing mode
Serial.write(0x7E); // startcode
Serial.write(0x03); // Datalength
Serial.write(0xA9); // Command
Serial.write(0x00); // single and no cycle
Serial.write(0x7E); // Endcode
delay(50); // pause to wait mp3 start

    
// LED initialisieren
digitalWrite(RedLedclk, LOW);
digitalWrite(RedLedreset, HIGH);
digitalWrite(RedLedreset, LOW);
digitalWrite(scope, LOW);

//digitalWrite(RedLedclk, LOW);
digitalWrite(BAR10, HIGH);
delay(300);
digitalWrite(BAR9, HIGH);
delay(300);
digitalWrite(BAR8, HIGH);
delay(300);
digitalWrite(BAR7, HIGH);
delay(300);
digitalWrite(BAR6, HIGH);
delay(300);
digitalWrite(BAR5, HIGH);
delay(300);
digitalWrite(BAR4, HIGH);
delay(300);
digitalWrite(BAR3, HIGH);
delay(300);
digitalWrite(BAR2, HIGH);
delay(300);
digitalWrite(BAR1, HIGH);    

     // play file 001.mp3 -- Start sound
Serial.write(0x7E); // Startcode
Serial.write(0x04); // Datalength
Serial.write(0xA0); // Command
Serial.write(0x00); // High byte
Serial.write(0x01); // low byte
Serial.write(0x7E); // Endcode
delay(1000); // pause to wait mp3 start


}
void loop() {
// read the pushbutton input pin:
buttonState = digitalRead(buttonPin);
triggerState = digitalRead(triggerPin);
reloadState = digitalRead(reloadPin);
// compare the buttonState to its previous state
if (buttonState != lastButtonState && millis() - lastscopeTime > debounceDelay) {
    // if the state has changed
if (buttonState == LOW && millis()- lastscopeTime > haltezeit) {
    if (scopestate == 0) {
digitalWrite(scope, HIGH);
scopestate = 1;
Serial.print("Selector Button scope on: ");
// play file 011.mp3 -- end fx
         Serial.write(0x7E); // Startcode
Serial.write(0x04); // Datalength
Serial.write(0xA0); // command
Serial.write((byte)0x00); // High byte
Serial.write(0x0B); // low byte
Serial.write(0x7E); // Endcode
        
delay(50); // pause to play mp3
}
else {
digitalWrite(scope, LOW);
scopestate = 0;
// play file 011.mp3 -- end fx
         Serial.write(0x7E); // Startcode
Serial.write(0x04); // Datalength
Serial.write(0xA0); // command
Serial.write((byte)0x00); // High byte
Serial.write(0x0B); // low byte
Serial.write(0x7E); // Endcode
        
delay(50); // pause to play mp3
}
}


    if (buttonState == LOW && millis() - lastscopeTime < haltezeit) {
     // if the current state is LOW then the button
     // went from off to on:
    
     Serial.println("Selector Button Pushed");
    
     // play file 002.mp3 -- select sound
Serial.write(0x7E); // Startcode
Serial.write(0x04); // Datalength
Serial.write(0xA0); // command
Serial.write((byte)0x00); // High byte
Serial.write(0x02); // low byte
Serial.write(0x7E); // Endcode
     delay(30); // pause to wait mp3 start
     if (buttonPushCounter < 6) // Anzahl der Sounds
     {
     buttonPushCounter++;
     Serial.print("Selector Button State1: ");
     Serial.println(buttonPushCounter);
     }
     else buttonPushCounter = 1;
    }
    else {
    }
lastscopeTime = millis();
}


// compare the triggerState to its previous state
if (triggerState != lastTriggerState && millis() - lastDebounceTime > debounceDelay) {
    // if the state has changed, do something
    if (triggerState == HIGH) {
     Serial.println("Trigger Pushed");
     Serial.print("Selector Button State: ");
     Serial.println(buttonPushCounter);
lastDebounceTime = millis();
     if (triggerCounter < 10) // es wurde noch nicht 10x geschossen
        {
        triggerCounter++;
        SelectorPosition();
        // LED-BAR runterschalten
        LEDBar ();
        }
        else {
         // play file 003.mp3 -- batterie leer sound
         Serial.write(0x7E); // Startcode
Serial.write(0x04); // Datalength
Serial.write(0xA0); // command
Serial.write((byte)0x00); // High byte
Serial.write(0x03); // low byte
Serial.write(0x7E); // Endcode
        
delay(50); // pause to play mp3
        }
    }
    else {
    }
}


// compare the reloadState to its previous state
if (reloadState != lastreloadState && millis() - lastDebounceTime > debounceDelay) {
    // if the state has changed, do something
    if (reloadState == HIGH) {
     triggerCounter = 0;
lastDebounceTime = millis();
Serial.print("reload Botton: ");
    
     // play file 010.mp3 -- minigunstart 4sek
        Serial.write(0x7E); // Startcode
Serial.write(0x04); // Datalength
Serial.write(0xA0); // Play
Serial.write((byte)0x00); // High byte
Serial.write(0x0A); // Play
Serial.write(0x7E); // Endcode
    delay(50); // pause to wait mp3 start
//LED-BAR wieder ganz einschalten
     digitalWrite(BAR10, HIGH);
     delay(200);
     digitalWrite(BAR10, LOW);
     delay(200);
     digitalWrite(BAR10, HIGH);
     delay(200);
    digitalWrite(BAR9, HIGH);
    delay(200);
    digitalWrite(BAR9, LOW);
    delay(200);
    digitalWrite(BAR9, HIGH);
    delay(200);
    digitalWrite(BAR8, HIGH);
    delay(200);
    digitalWrite(BAR8, LOW);
    delay(200);
    digitalWrite(BAR8, HIGH);
    delay(200);
    digitalWrite(BAR7, HIGH);
    delay(200);
    digitalWrite(BAR6, HIGH);
delay(200);
    digitalWrite(BAR5, HIGH);
delay(200);
    digitalWrite(BAR4, HIGH);
delay(200);
    digitalWrite(BAR3, HIGH);
delay(200);
    digitalWrite(BAR2, HIGH);
delay(200);
    digitalWrite(BAR1, HIGH);
    }
    else {
    }
}


// save the current state as the last state,
//for next time through the loop
lastButtonState = buttonState;
lastTriggerState = triggerState;
lastreloadState = reloadState;
}

void LEDBar() {
// LED-Bar runterschalten nach Schuss
switch (triggerCounter){
case 1:
    digitalWrite(BAR1, LOW);
    break;

case 2:
    digitalWrite(BAR2, LOW);
    break;

case 3:
    digitalWrite(BAR3, LOW);
    break;

case 4:
    digitalWrite(BAR4, LOW);
    break;
    
case 5:
    digitalWrite(BAR5, LOW);
    break;
case 6:
    digitalWrite(BAR6, LOW);
    break;    
case 7:
    digitalWrite(BAR7, LOW);
    break;    
case 8:
    digitalWrite(BAR8, LOW);
    break;    
case 9:
    digitalWrite(BAR9, LOW);
    break;    
case 10:
    digitalWrite(BAR10, LOW);
    break;    
    }
}

void feuerled() {
    Serial.print("feuer modus: ");
    if (redledcounter < 9) // es sind noch nicht alle 10 LED's an
        {
        redledcounter++;
digitalWrite(RedLedclk, HIGH); //Clock für Lauflicht an
        delay(blueledspeed);
        digitalWrite(RedLedclk, LOW); //Clock f+r Lauflicht aus
feuerled ();
     }
    else {
redledcounter = 0;
Serial.print("feuer modus ende: ");
    }
}

void SelectorPosition(){
switch (buttonPushCounter) {
case 1:
     // play file 009.mp3 -- e11 Blaster sound
        Serial.write(0x7E); // Startcode
Serial.write(0x04); // Datalength
Serial.write(0xA0); // Play
Serial.write((byte)0x00); // High byte
Serial.write(0x09); // Play
Serial.write(0x7E); // Endcode
        delay(30); // pause to wait mp3 start
        blueledspeed = 50;
        feuerled();
        delay(200); // so lange bleibt die rote LED an
        digitalWrite(RedLedreset, HIGH); //Turns off Red LED
digitalWrite(RedLedreset, LOW); //Turns off Red LED
         break;
    
case 2:
     // play file 004.mp3 i-- alien mg 4 Sek
        Serial.write(0x7E); // Startcode
Serial.write(0x04); // Datalength
Serial.write(0xA0); // Play
Serial.write((byte)0x00); // High byte
Serial.write(0x04); // Play
Serial.write(0x7E); // Endcode
     delay(30); // pause to wait mp3 start
        blueledspeed = 30;
for (int i=0; i <= 5; i++){
blueledspeed = blueledspeed + 10;
        feuerled();
        delay(100); // so lange bleibt die rote LED an
        digitalWrite(RedLedreset, HIGH); //Turns off Red LED
digitalWrite(RedLedreset, LOW); //Turns off Red LED
}
        
     break;
    
case 3:
     // play file 005.mp3 -- MG42 3 Sek
        Serial.write(0x7E); // Startcode
Serial.write(0x04); // Datalength
Serial.write(0xA0); // Play
Serial.write((byte)0x00); // High byte
Serial.write(0x05); // Play
Serial.write(0x7E); // Endcode
     delay(30); // pause to wait mp3 start
        blueledspeed = 20;
        for (int i=0; i <= 7; i++){
feuerled();
        delay(100); // so lange bleibt die rote LED an
        digitalWrite(RedLedreset, HIGH); //Turns off Red LED
digitalWrite(RedLedreset, LOW); //Turns off Red LED
        }
     break;
    
case 4:
     // play file 006.mp3 -- Alienlaser 2 Sek
        Serial.write(0x7E); // Startcode
Serial.write(0x04); // Datalength
Serial.write(0xA0); // Play
Serial.write((byte)0x00); // High byte
Serial.write(0x06); // Play
Serial.write(0x7E); // Endcode
     delay(30); // pause to wait mp3 start
        blueledspeed = 40;
for (int i=0; i <= 3; i++){
        feuerled();
blueledspeed = blueledspeed - 10;
        delay(300); // so lange bleibt die rote LED an
        digitalWrite(RedLedreset, HIGH); //Turns off Red LED
digitalWrite(RedLedreset, LOW); //Turns off Red LED
        }
     break;
    
case 5:
     // play file 007.mp3 -- Laser 1 Sek
        Serial.write(0x7E); // Startcode
Serial.write(0x04); // Datalength
Serial.write(0xA0); // Play
Serial.write((byte)0x00); // High byte
Serial.write(0x07); // Play
Serial.write(0x7E); // Endcode
     delay(30); // pause to wait mp3 start
        blueledspeed = 50;
        feuerled();
        delay(1000); // so lange bleibt die rote LED an
        digitalWrite(RedLedreset, HIGH); //Turns off Red LED
digitalWrite(RedLedreset, LOW); //Turns off Red LED
        
     break;
    
case 6:
     // play file 008.mp3 -- Shotgun 1 Sek
        Serial.write(0x7E); // Startcode
Serial.write(0x04); // Datalength
Serial.write(0xA0); // Play
Serial.write((byte)0x00); // High byte
Serial.write(0x08); // Play
Serial.write(0x7E); // Endcode
     delay(30); // pause to wait mp3 start
        blueledspeed = 50;
        feuerled();
        delay(300); // so lange bleibt die rote LED an
        digitalWrite(RedLedreset, HIGH); //Turns off Red LED
digitalWrite(RedLedreset, LOW); //Turns off Red LED
        
     break;
}
}
Link to comment
Share on other sites

  • 4 weeks later...
  • 4 weeks later...

in the meantime i could finally test the WT5001M02-28P sound board into a new E11 arduino set, and it's working great!

 

it's even louder and more responsive than the old/bigger one

 

now i have to finish to convert the code to make it compatible with this mp3 board; when ready i will share it here.

 

i4Zhb5GVR26xU.jpg

 

iOGGHt4yFsSdq.jpg

Link to comment
Share on other sites

in the meantime i could finally test the WT5001M02-28P sound board into a new E11 arduino set, and it's working great!

 

it's even louder and more responsive than the old/bigger one

 

now i have to finish to convert the code to make it compatible with this mp3 board; when ready i will share it here.

 

i4Zhb5GVR26xU.jpg

 

iOGGHt4yFsSdq.jpg

 

 

I'm using the same sound module and it works great with your setup !!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...