DC-15A/S arduino based lights and sound
#1
Build Thread 
WARNING: Electrical Engineers look away now!  This won't be pretty...

A few months ago after the 3D printed DC-15s started coming together, I started working on lights and sound for them.  I've seen a few impressive lights and sound creations (DC-17M with digital counter, the arduino based E-11, etc) and wanted to give it a crack myself.  So I started trying to teach myself arduinos to use as the basis of it.  I started just blinking an led and gradually built it one step at a time.  I'm onto about the 20th cut of the code since the start and at every update  I've had a problem that needed to fixed, overcome or worked-around.  What I've got so far is still on the breadboard because I wanted to complete the concept before I start trying to design a permanent fit, shrink it, etc.

Notes:
1.  Still working on making the audio louder.  Maybe it's the small speaker not helping.  I'm going to try and build the amplifier circuit from scratch myself with better chips to improve it.  Unfortunately a bigger speaker is hard to pull off with the limited space of a blaster.  Two might help, but space Sad   Putting the speaker on the end of the barrel makes it louder but I don't know if I will be able to achieve that when it's assembled.  Also not yet sure on how to power the amp, i.e.- separate battery or pulled from the arduino. 

2.  The led bar can be made to count down as if there's 10 shots, 20, 50, whatever you like.  I just use 10 so I don't have to press the button 50 times to get to the low power mode when testing.

3.  I still need to work out a couple of bugs with one sound cutting another out.  I may have to tweak the audio library I'm using to allow simultaneous sounds but I'd rather find a code way around it.

4.  Disregard if the lights flash while the magazine wire is removed.  It won't be able to do that as it has no power in the magazine alone...... although that would be cool. 

5.  I was originally going to mount the led bar on the sloped area behind the rear sight but when it arrived it was a lot smaller than I thought it would be and would probably look pretty silly there.   So the the led controller chip and led bar will go in the detachable magazine like this (which has created its own power problems, but I have a plan):
[Image: 20160927_205433.jpg]

6.  The voice recordings were made using an online text to speech converter (naturalreader.com).  Just ask for Rachel   Wink 

7.  The plan for power is a 7.4 volt rechargeable lipo battery. I'm going to steal one from my son's remote control car to do a test on how long it'll last powering the system. In this regard a separate battery for the amplifier would be better.  And 9v on the amp means louder too, but 9 volts are notorious for crappy capacity... and space Sad

8.  The little rumble motor is.... little.  I'm planning on using 2 but still not sure how they'll go, but they were the only fully contained ones I could find. They will probably be good for the DC-17 pistols I'll be doing next.  I will likely try out one from an x-box controller too but space is the issue and they have an external/exposed weight which spins around to do the vibrating and I'm not sure how that will go inside a blaster with other stuff.

9.  Due to my zero starting knowledge and experience I've probably done it the hard way, and from a code and hardware point of view it could probably be done a lot better, but it's not as simple as it looks.  Every addition made something that was working stop working.

Personally I'm pretty happy with the overall workings of it.  Now I need some feedback on how you think it looks and any changes you'd make to the way it works.  Or any ideas to make it better, so I can consider them before I tidy up the code to the final version and start soldering chips into permanent boards for the Mk 1 version.

A short video so you don't have to listen to my voice for long:
[Image: aIWrVx8.gif]
Reply
#2
I have the same set up sitting on proto boards, found a oval shaped speaker in the UK and it is plenty loud, will see if I can find the part number, as I ordered it off evil bay


Sent from my iPad using Tapatalk

Another thought, could be the little amp chip you are using too. Is it a 3watt?


Sent from my iPad using Tapatalk
"The Death Star plans are not in the main computer"

[Image: T0ZvRQv.png]

[Image: Eu2xjUD.png]
Reply
#3
Thanks mate. Ebay is usually my first stop for electronics unless I need it fast. Having a look at the datasheet for the amp chip yesterday and I noticed there are 3 versions. I'm assuming the 1/4 watt one is on the modules I have so I've ordered some of the 1 watt chips separately. I'm still trying to get my head around audio wattage, ohms, power, etc and how they relate to create a result.

Sent from my SM-G900I using Tapatalk
[Image: aIWrVx8.gif]
Reply
#4
5volt is the key to Arduino, the 3 watt amp chip is what you need, it is stereo, but if you only use one channel it performs better.
If you are going to use multiple sounds through the mini SD, make sure you use a program called Drivesort so you can keep the files in the required order as the Arduino and the SD player will only run in order. I have 3 sounds for different blasters set up and have utilised one of the RGB LED colours for each.
Amp chip link\
http://www.ebay.com.au/itm/2-Channel-DC-...OSwaB5Xid4-
"The Death Star plans are not in the main computer"

[Image: T0ZvRQv.png]

[Image: Eu2xjUD.png]
Reply
#5
Ahh yes I tried one of the PAM8403s first and it didn't work.  I can't find the details where I read what the problem was now but I think it had something to do with the PAM not being able to deal with the audio output as PWM or something like that.  That's why I went to the LM386.  Maybe using something like a WT588D might fix it but it may also make it more complicated than it needs to be.  I suppose now that I have something working is a good time to give it another go though, especially based on the success you and others have had with it.  I think because I'm not across audio powering at all I'm not sure if my issue is the speaker, whether I'm pushing it to it's limit, or whether it can take heaps more and still give good sound, whether it needs a better amp with the same speaker, bigger speaker/s, etc, etc........

My plan for the 7.4v battery is based around the 5 volt magic figure.  From what I understand, because of the power the voltage regulator needs to dissipate, the higher the voltage input on the VIn, the less current is available for distribution across the output pins and around 7 volts seems to allow the maximum and still provide the full 5 volts on the 5V pin.  I may have that entirely wrong though.

The arduino E-11 thread on whitearmor was what I looked at first when I started writing the code so I saw the file order issue there.  I read his code to see how he structured his processes because I thought I'd use it as a basis for mine, but tbh especially because he was running 10 different firing sounds, did his reloading differently, etc, I didn't use it at all and went from scratch.  The library I'm using for the playback makes it easy and the files are called by using their names, e.g.- play("powerup.wav").  There's no calling of specific addresses or anything like what he had to do.  You just need to keep the wav file formatted within the sample rate, etc that it can handle.

If you want to have a look at the code, the latest handful of commits are here but I warn you, it ain't pretty.  I just thought of a solution for delaying the low power sound so it doesn't conflict with the firing sound so I'll fix that tonight too.

Edit: OK @Sly, I've tried my original PAM4803 module and a different one. If I listen very closely I can here the audio very distorted and very very faint. Powered from the arduino and using the logical L/G/R, +/-, etc connections with a single speaker. Are you using a module or naked chip and have you got anything else wired in with it?

Edit2: putting my finger across the pot contacts on the back of the module gets it up to an audible level.
[Image: aIWrVx8.gif]
Reply
#6
That's some nice work, it'd only be better if you had the pommie republic commander guy from the Clone Wars cartoons voice :P
[Image: 36487379910_dbb9166743_o.png]

Reply
#7
Electronics bamboozle me, so I think this is awesome! Great work for a starter...

And like Payney said, the clone wars voice over would just top it off!
Have we ever hit anything with these things?


DW2016   OCC2016   BN16  
Reply
#8
Thanks for the feedback. I went for a British female because the aural warnings in an aircraft are normally female... "pull up... pull up...." and British sounds better than American. Although I'm making this for the realistic blasters I'm doing, I could do an animated version, so Challenge: Accepted.

Google's not helping find him. Any ideas on a name or episode/s he's in, so I get the right one?
[Image: aIWrVx8.gif]
Reply
#9
He's in every episode. His voice is also the narrator. I'm not sure if you'll get the phrases you need tho.


Sent from my iPhone using Tapatalk
[Image: 36487379910_dbb9166743_o.png]

Reply
#10
(Tuesday 18-Oct-2016, 09:42 AM)major payne Wrote:  He's in every episode. His voice is also the narrator. I'm not sure if you'll get the phrases you need tho.


Sent from my iPhone using Tapatalk

Heh turns out the guy that was the narrator and Admiral Yularen also did Yoda for the series.... and he's actually a seppo.  Tom Kane  And yeah, after having refreshed my memory with a few clips on youtube, he does do an awesome voice for it.  I'll see what I can do.  Promising nothing.

In other news I soldered some headers to another PAM8403 module I had and tried it out today in the breadboard.  For some bizzare reason it works great.  Too loud for testing at work, as it turns out....
[Image: aIWrVx8.gif]
Reply




Users browsing this thread: 1 Guest(s)