This is a simple circuit to play wav files using arduino Nano V3.0 ,it consist from 4 buttons ,each one play specific wav file loaded to SD card.

Step 1: Parts

1- Arduino Nano V3.0 (I used the chines version called Funduino Nano).
2- SD card Module.
3- SD card.
4- Bread Board.
5- four push Button .
6- four 22K resistors.
7- one 4.7K resistor.
8- BC546B NPN transistor.
9- Speaker.
10- wires.
<p>Hey I'm planing on using an Arduino Mega to do the same thing, what pins would i connect the SD card reader to? Thank you </p>
Nice tutorial!
<p>Hey, I had some questions. i used a BC547B, i built my circuit as shown in the pictures below, i converted my files to .wav format. the problem is, my code complies, but when i push the buttons, no sound is produced. </p><p>also i used an uno board </p><p>thank you!</p>
<p>me too, just finished everything....it compiles just fine but no sound (if I put my ear really close to the speaker I can hear static).My push buttons have two outputs instead of one so I connected them differently (don't know if that is the problem)</p>
@sophocha the only other to do is trouble shoot and make sure your circuit is correct. It could be the smallest of errors.
<p>me too, just finished everything....it compiles just fine but no sound (if I put my ear really close to the speaker I can hear static).My push buttons have two outputs instead of one so I connected them differently (don't know if that is the problem)</p>
Also trying to integrate lights to mine. I want an LED to blink when the button is pressed and then the sound plays, u have momentary switches that have LEDs
<p>Hey, I had some questions. i used a BC547B, i built my circuit as shown in the pictures below, i converted my files to .wav format. the problem is, my code complies, but when i push the buttons, no sound is produced. </p><p>also i used an uno board </p><p>thank you!</p>
<p>Hi can I play some mp3 sound if I convert them to WAV for example I have mp3 sound of my voice and I want to convert it to WAV and play it via Arduino</p>
<p>Hello, I really liked this project. Right now I'm doing a piano with Arduino Mega 2560, and I'll use 12 buttons for the keys. Can I use the same 22k ohms resistors to 12 buttons? It works only with 2 pins connected, the 3rd pin no longer plays. If you don't fully understand what I ask, I apologize for my English.</p>
<p>Hi,</p><p>you can not connect 1 resistor instead of 12 resistors because each resistor connected to specific pin in arduino , also if you want to make a piano ,the best way is by using tone command instead of this method.</p>
<p>Hi Husham</p><p>Firstly I hope you are safe where you are so to for your country's future.</p><p>I have project to build similiar to this .</p><p>I have a panel with 30 buttons and want to have 30 different waves sound for each one. Of course the board only hace limited inputs. Can you help a little with this?</p><p>Thanks you</p>
<p>Thanks Felwin,</p><p>I will suggest you to use one analog input for multiple buttons by connecting different type of resisters ,just search in google (Arduino analog input for multiple buttons ) to understand the concept.</p><p>Also there is MP3 module support multiple buttons without using Arduino ,Search for the below and take a look on the datasheet :</p><p>MP3 FN-M16P Embedded MP3 Audio Module Datasheet</p>
<p>Hello Husham Samir, could you please explain how I would set up the MP3 FN-M16P Embedded MP3 Audio Module with 4 buttons to play 4 different and short drum sounds. (The idea is to be able to play the drum sounds triggered by 4 foot operated switches to accompany my guitar playing) . I would want to play the sounds through an amplifier.</p><p>Thanking you in anticipation,</p><p>Dave.</p>
<p>I've attempted this but there is a crackle and a beep but I don't know how to define the buffsizes or the fullspeed, do I include these into the provided code?</p>
<p>How would i create this so it could play wav files at a certain date/time? instead of buttons</p>
<p>Hey! Mine worked straight away but has anyone got any &quot;clicking&quot; noise about 3 &quot;click&quot; sounds per second?</p><p>I get the music tracks I copied but I also get these clicks over the music. When I play the same files on my PC, I hear no click, just the music as expected.</p><p>Any suggestions?</p>
<p>FYI: From the library's page<br><a href="https://github.com/TMRh20/TMRpcm/wiki">https://github.com/TMRh20/TMRpcm/wiki</a><br>Under Common Issues:</p><p>...</p><p>2.Popping or clicking when music is playing<br> If pops or clicks are heard during playback, it is most likely that buffer underruns are occurring or the volume is just too high.<br> Ensure that #define SD_FULLSPEED is uncommented in pcmConfig.h. The value in #define buffSize 128 can be increased to provide<br> additional memory for playback, which will reduce these issues. Audio can be encoded at a lower sample rate otherwise.<br></p><p>...</p>
<p>I have recorded my audio file as 512 bytes buffer ..can i play my 512 buffer audio with this code, but i have read somewhere that only 128 buffer audio can be played by using this TMRpcm library...</p>
<p>Nice and simple! It's been a pleasure to mount this schema and many, many thanks for providing everything we need to do it!!</p><p>Specially the sample sounds. I've tried to make my own and the first attempt has been a partial success: it sounds but too low... Volume matters, in deed!! Thanks a lot.</p>
<p>Success!! Thank you to Gutisie for all your suggestions! It seems the audio converter I was using must not have been getting things into the right format. I tried a different online .wav converter and BOOM... It worked just fine. I really appreciate the advice though. </p><p>This is one of those head-smacking &quot;doh&quot; moments </p>
<p>Posted this a few months ago and I'm still at a loss. Any help would be appreciated:</p><p>Hello! This instructable is awesome, and I appreciate your writing it. I am, however, having major issues getting my audio files to play. I have gotten the whole set up working using the sample files, but I cannot get mine to play.</p><p>I have converted the files to 8bit 16 kHz mono wav files, and have tried multiple attempts with naming conventions with no luck. The files play fine on my computer (degraded in quality somewhat due to the 8bit 16 kHz factor, but certainly more recognizable the fuzz I'm getting out of the speaker in my set up).</p><p>Thanks for any help anyone could give me in this. I have multiple DAWs and am capable of manipulating the audio files however is necessary, but I'm at a loss of what to try.</p>
<p>hi, did you get any luck? i have same problem. converted my files to the required setting but still nothing.</p>
<p>No luck yet. I'm at a loss of what else to try. I'm working on a mac, but I can't imagine how that would matter. I've tried everything I could think of. At this point I've entirely abandoned the project out of frustration. I'd love to make it happen, but it doesn't seem like its going to work for me. Certainly give a reply back if you figure it out though! Most of my arduino project ideas require this functionality at the core of their purpose.. kind of a bummer. </p>
<p>i think you forgot to put the delay:</p><p>tmrpcm.play(&quot;1a.wav&quot;); </p><p> delay(6000);</p><p>for me its that long as my intro wav file is nearly a min long.</p>
<p>Good thought! I have been holding down the button, however, to let the sound play completely</p>
<p>hi, i figured out!! it is the volume, basically your computer has better speakers than the little one, and better gain, so i found out with audacity that increasing the db levels i can hear them, so i have got me an amplifier module booster for arduino, sort of like a volume control. I hope that helps.</p><p>Or if you are not too bothered with distortion, then amplifly the audio with audify and export it, remember the &quot;save as other formats&quot;, then in option click the 8 bits unsigned, and wav (windows). that will do the trick.</p>
<p>Hello Friend! Thanks so much for your replies. After a few months of my life being too busy for side projects I'm finally back to it, and I appreciate the help! </p><p>I don't think my files were playing out of my computer much/any quieter than the sample files were. I will, however, definitely give boosing them a shot. </p>
<p>hi,</p><p>Do you have more buttons than 4? are you compiling code with more than 4 buttons, but you only have 4 connected? if you do, that is why you get noice etc...</p><p>in code buttons pins are to 5 volts but if you dont connect pins in arduino to the 5 volts with the resistor then your code will not work.</p><p>so that is why when you compile only 4 buttons it works, but when you put 5 or 6, if they are not wired, it doesnt work.</p><p>any way...just trying to help.</p>
<p>here, try this link to adjust volume. <a href="https://discussions.apple.com/thread/4957602" rel="nofollow">https://discussions.apple.com/thread/4957602</a></p>
<p>Hey, can you still use this set up for the arduino 1.6.6?<br>If you can will somebody send me his sketch? <br>I use an arduino uno.</p>
<p>hey!!<br>i am usung IMU as well as sd card reader together, but there is an eroor twlling that 'Buffer' has been defined defined twice, once in actual code(for IMU) and once in tmrpcm(audio library).<br>how can i remove this error?</p>
<p>Just made it worked.</p>
<p>Got the tmrpcm Lib and the sample provided here to work with the Arduino IDE 1.6.5 and a Nano.</p><p>Add the SPI.h at the beginning of the code (as mentioned before).</p><p>Put a delay(5); directly behind the .play method. Without delay, no sound is played.</p>
<p>Thanks Stefan , That's Perfect . Without delay(5) it is not working . I wasted almost 3hr's and then saw your comment . It now works .</p>
<p>can ask for all who has the complete codes regarding on this project?...i would like make a project that really needs basic codes...thank you</p>
I have using arduino uno <br>instead of speaker I connected to GSM shield for reporting fault with playing the pre recorded voice<br>....thanks
<p>can you kindly share your sketch? It will be useful to many other! :) Thank you in advance</p>
<p>Yes Sure .. Sorry for Late reply ..</p>
<p>Hi Anil , Could you please share your contact details to me at <a href="mailto:brevildsilva100@gmail.com" rel="nofollow">brevildsilva100@gmail.com</a> </p>
<p>Here is the link .. hope its accessible</p><p>https://drive.google.com/file/d/0B4iK8w7n6zwWNUxxYmVQQ3IwSUk/view?usp=sharing</p>
<p>hi, i haven't the gsm shield, i've 2 sim800l modules... where do i need to link the wires you disconnected from speaker and connected to the shield? Thanks</p><p>http://www.aliexpress.com/item/Smallest-SIM800L-GPRS-GSM-Module-MicroSIM-Card-Core-BOard-Quad-band-TTL-Serial-Port/32284560394.html?ws_ab_test=searchweb201556_2_79_78_77_92_91_80,searchweb201644_5,searchweb201560_9</p>
<p>yes instead of speaker connect to Microphone of GSM .. look for polarity.. connect Speaker + to Mic+ and Gnd to Mic - ..</p>
<p>thank you, i'll try this weekend :)</p>
<p>Great work AnilKumar . I am trying to build this . Will need your help . </p>
<p>Sure i will help as soon as possible.. some times it takes two days sorry for that</p>
<p>thank you very much! :D</p>
<p>Awesome!</p><p>congratulations AnilKumars.</p>
<p>Thank you very much for this instructable Husham!</p>
<p>Awesome project, helped me out a lot. If your a MAC user make sure you get the drivers for Arduino Nano Installed (https://learn.sparkfun.com/tutorials/how-to-install-ftdi-drivers/mac). Also, if you need to convert to 8 bit, 16 KHz WAV files you can 1.) import any WAV file into iTunes 2.) Change your import settings in preferences to WAV / 8 bit / 16000 Hz and 3.) Select your WAV files &quot;right click&quot; and convert to WAV which will apply the new settings. Then you just drag them out of iTunes and on to your SD</p>

About This Instructable


336 favorites


Bio: Electrical Engineer
More by Husham Samir: Using MikroTik Router Board 433 & Arduino To Control Two LEDs Arduino Keypad Door Lock Temperature Data Logger
Add instructable to: