Don't like ads? Help support the Mercs by becoming a Supporter or Auxiliary Member today! (You will need to be logged into the store)
Official Members also get to use the forum ad-free - so kit up and join us!

 Blaster sound/light tutorials?

  • 12 Replies
  • 4225 Views

Celtkhan


    *
  • 367
  • Want some soup?
Blaster sound/light tutorials?
« on: Dec 08, 2020, 05:59 PM »
I’m looking for some tutorials on adding sounds and lights to a blaster, but a lot of what I’m finding is out of date or has a bunch of extras I don’t need. The most recent article I can find is on the Adafruit site for Lucio’s blaster, but it has an accelerometer for secondary sound effects I don’t need. Whitearmor has an E11 blaster sound tutorial using an Arduino, but it’s nearly a decade old.

I’d like to set up a blaster to fire sounds and light up an LED on a trigger pull, a secondary button to switch between lethal and stun settings, and preferably, an “ammo counter” LED bar that depletes as it’s fired.

I’m mostly looking for advice on which modules would be most cost-effective (Arduino, Adafruit, Featherwing?) and where I can find code tutorials to figure out the programming commands myself?

Logged

LightningLion


    *
  • 177
  • Electronics are my thing
Re: Blaster sound/light tutorials?
« Reply #1 on: Dec 09, 2020, 04:54 AM »
Take a look at this Facebook group:

FX Blaster Arduino

Logged
Lion's electronics corner

Rionu Custom Electronics for your Mandos
--->> Sales thread

WIP's: Post-Imperial costume. Nite Owl helmet.

Mundo Airsofter - Airsoft news & reviews

Celtkhan


    *
  • 367
  • Want some soup?
Re: Blaster sound/light tutorials?
« Reply #2 on: Dec 09, 2020, 01:25 PM »
Alas, my hatred of Facebook is immeasurable. I’d rather fail entirely than give it a single scrap of information about myself. Even false information.

I do appreciate the effort, though.

Logged

JarekVekarrIrunel

Re: Blaster sound/light tutorials?
« Reply #3 on: Dec 10, 2020, 03:27 AM »
20 seconds on a common search engine, looking for "arduino blaster sound", gave several interesting results, with from sites related to storm troopers to the arduino build forums.

For example
https://www.whitearmor.net/forum/topic/19322-arduino-a-cheap-board-for-e11-blaster-effects/

https://forum.arduino.cc/index.php?topic=109432.0

(Both are build logs from the same project.)

Feel free to give it a try.  :D

« Last Edit: Dec 10, 2020, 03:42 AM by Jarek Tahl-Tracyn » Logged

rlobrecht


    *
  • *
  • *
  • *
  • *
  • 584
  • Awards Award for 10 official invasions.
Re: Blaster sound/light tutorials?
« Reply #4 on: Dec 10, 2020, 10:12 AM »
Take a look at the Blaster Core by Plecter Labs.

Logged
Kotep Dral | Arqet Clan | MMCC #2677 | The OT Guard #63 | B.O.M.B #96

Helmet build - SWJFH-A7R pepakura | Soft parts WIP | Armor WIP | Sniper upgrades

Celtkhan


    *
  • 367
  • Want some soup?
Re: Blaster sound/light tutorials?
« Reply #5 on: Dec 17, 2020, 09:11 PM »
I've been looking at Adafruit boards for sound and light, but I've hit a bit of a snag.

My idea is this: I want code to play a blaster sound WAV file and light up a barrel LED on triggerpull, which is pretty straightforward. I was also hoping to have a bar LED graph to function as an ammo counter, and that's where my issue is coming in. I can declare a couple variables, one to function as an ammo counter, and one to function as a timer. I like the idea of an auto-recharge function, so the ammo recharges one round every ~6 seconds or so. I'd also like the highest LED on the bar graph to blink once per second until the ammo has fully recharged.

The problem I've encountered is that CircuitPython (apparently) only has "time.sleep" as its time-regulation function, and you have to use that function to regulate how fast the ammo counter increments and how fast the LED blinks. I've figured out that portion of the code, but having a one-second wait during each code cycle prevents the board from playing the blaster sound/light unless you hold the trigger down for up to a second. I'd rather have it be a bit more responsive than that, so I'm hoping someone knows another way to increment a timer in CircuitPy (or Arduino, I'm willing to learn that one, too) without interfering with a more responsive blaster sound effect.

Help?

Logged

Fi-8015


    *
  • *
  • *
  • *
  • 3458
  • Awards 40% increase or more Award for 10 official invasions.
Re: Blaster sound/light tutorials?
« Reply #6 on: Dec 18, 2020, 03:08 AM »
I think that sounds like
Code: [Select]
delay(); in Arduino. That way you pause the code for the given milliseconds. If you want to have multiple tasks running parallel, you have to link them to
Code: [Select]
millis();, which returns a value, counting the time the code is running.

At least that's, what I know.
I have no experience with CircuitPython though.

Logged
Resin helmets for sale in the Trading Station

electriFi - Mando Electronics English / German

Celtkhan


    *
  • 367
  • Want some soup?
Re: Blaster sound/light tutorials?
« Reply #7 on: Dec 18, 2020, 02:11 PM »
I think that sounds like
Code: [Select]
delay(); in Arduino. That way you pause the code for the given milliseconds. If you want to have multiple tasks running parallel, you have to link them to
Code: [Select]
millis();, which returns a value, counting the time the code is running.

Looks like “delay()” is the same as “time.sleep()” and “millis()” is the same as “time.monotonic()”. Thanks, that was exactly what I needed; I ran into a tutorial for non-blocking timers in Arduino that I can directly translate into Circuitpy. It’ll take some fiddling and testing, but I think I can get exactly what I wanted now.

Logged

Vorpal


    *
  • 271
Re: Blaster sound/light tutorials?
« Reply #8 on: Dec 23, 2020, 02:28 PM »
I have looked into these. They are cheap, easy to use and if wired right can run a led for the blaster effect.

WT588C re programmable electronic music sound chip

https://www.instructables.com/Getting-the-Most-Out-of-a-WT588D-Sound-Module/

« Last Edit: Dec 23, 2020, 02:46 PM by Vorpal » Logged
ti his kov'nyn

Celtkhan


    *
  • 367
  • Want some soup?
Re: Blaster sound/light tutorials?
« Reply #9 on: Dec 26, 2020, 10:59 PM »
I actually learned just enough CircuitPython to do what I want, and I am exceptionally pleased with the result. I haven’t soldered all the LEDs in place or the selector switch, but if it does work the way I’ve designed it, then the code should do the following:

At full charge, the blaster has 30 rounds. (Tested and confirmed).
Each trigger pull on the Lethal setting plays the blaster sound effect in Mp3 format, lights a red LED in the barrel, and decrements the ammo counter by 1. (Tested and confirmed)
Each trigger pull on the Stun setting plays the Stun sound effect, lights a red LED in the barrel, and decrements the ammo counter by 3. (Not yet tested; I wanted to differentiate the Stun setting function, so decided it consumes 3 charges instead of 1).
Ammo is represented by a bar graph LED with 10 bars; each bar represents 3 rounds. When a particular bar’s complement of rounds is recharging, it blinks. When the full complement is charged, it shines solid. (Not yet tested).
1 round recharges for every 6 seconds that the trigger is not pulled (tested and confirmed).
A momentary selector switch will transition between Lethal and Stun settings. When Stun is active, an LED will light up.
A power LED shines solid when the battery pack is showing a good charge. As the voltage drops, it will begin flashing and then go dark.

I’m hoping to run a full test tomorrow. I’ll be more than happy to share the code if anyone is interested.

Logged
Re: Blaster sound/light tutorials?
« Reply #10 on: Jan 16, 2021, 02:56 PM »
I started working on that FX blaster project mentioned...

Depending on how much you want it to do, even just using an arduino and a dfplayer mini and a low powered LED could get the job done.

The hardest part so far has been trying to fit everything into my blaster build...

While that TK8177 blaster project is complicated, it is quite louder with the stereo sound.  If (when!) I make another blaster, I would probably stick to justusing a round 28mm speaker and appropriate length of pipe as a resonance  chamber to increase volume.  The RGB LED is something else altogether, but adds another level to stun setting with blue LED, or green.


I do think the code could be cleaned up a bit, and have noticed that the library used for the player is an outdated version. I'm procrastinating doing the soldering before I get all components onto a breadboard...  I'll try to remember to update with how it goes.

Logged

Celtkhan


    *
  • 367
  • Want some soup?
Re: Blaster sound/light tutorials?
« Reply #11 on: Jan 16, 2021, 05:35 PM »
I’d love to see it.

I’m hoping to finish up mine soon; I’m installing the switches and LEDs in the control plate now. The body of the blaster still needs work, and I actually regret installing the headers because it adds so much volume on the Z axis; if I’d just soldered the connections directly to the board, I’d only have to deal with the X and Y axis dimensions. Plus I could have mounted the audio boards separately. Now I have to make sure there’s enough volume for the duplex prototyping board, the headers, AND the wiring in the electronics chamber. Since I’m using a 10-LED bar graph, it’s a lot of wires.

Logged
Re: Blaster sound/light tutorials?
« Reply #12 on: Feb 25, 2021, 05:39 AM »
Lol, the idea is really cool and a like it. I guess you can find everything on youtube but I don't know what to say about the quality of the sound. Because when you download the sound, the quality can lower and it will not be that cool as you expected. The best idea is to download the sound from a specialized platform like https://depositphotos.com/music.html and the quality will be the best of the best. I also used sound for a few toys and sometimes it seems like they are real because of the sound.

« Last Edit: Feb 26, 2021, 05:17 PM by nashandra » Logged
 


Don't like ads? Help support the Mercs by becoming a Supporter or Auxiliary Member today! (You will need to be logged into the store)
Official Members also get to use the forum ad-free - so kit up and join us!




Powered by EzPortal