loading
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>What type of 22k resistor do you need? how many wats? 1/4? 1/2?</p>
Hello, thank you for your guide, it make my project finished. But i have one question, can we pause the wav when that wav was playing?<br>Thank you
<p>Hello there. Thank you for your guide, I made it using Uno R3 and SD module and it worked. Now I face a little problem with Mega 2560 + LCD screen with SD card reader. I am using library UTFT SdFat and UTFT_SdRaw to display images from SD card on LCD screen. TMRpcm library needs SD library to work but when I include it I get lots of errors that point to SD and SdFat. When I upload your code Mega 2560 plays from SD card without any problems. Is there any way to make TMRpcm work on SdFat only?</p>
<p>Hi,</p><p>I didn't try this before so I have no idea.</p><p>Sorry. </p>
<p>I am now making a workaround. I connected Nano+SD module to Mega 5V so that Mega is now powering on my Nano.. Well it's a strange idea, but all I need is background music with no control over it. Nano plays music by itself using SD library and Mega works with LCD using UTFT_SdRaw. Too bad I have to connect 2 SD cards now :D. My power bank is 5V/1A. </p>
<p>Hello Husham where download library UTFT_sdRaw, where the codec download and .raw file in Windows 10.</p>
<p>can i use arduino uno 3 as i have to make a voice comand blind helmet</p>
<p>yes you can.</p><p>please put in your mind that the quality of voice is bad ,so if you want a good quality ,try to connect arduino to MP3 serial module. </p>
<p>i wonder how to make one button which plays a random wav each time. </p>
<p>to get random number you need to use arduino random(min,max) command with switch/case statements . </p>
<p>thank you husham, i will try that out. </p>
<p>Hi, I've tried to make one. The SD card reads and writes without problem, but the sound from the speaker is very noisy and distorted. I'm using a BC547 transistor and a 0.2W/16ohm speaker. I'm not sure if the resistance of the speaker is too high? Thanks very much! </p>
<p>I tried once again, this time simply connect a 220ohm resistor in series with the speaker and it works. I've tried with your 'nano' sketch. The first few files sound okay, but the last file 88.wav still sounds very distorted. What do you think could be the problem? Thanks! </p>
<p>Well, Music quality looks better than voice ,you can download &quot;Wav Sample rate converter&quot; software and try to change the samples per sec to 8000 and check.</p>
<p>Thanks! I've been using Reaper, and the sound quality worsened after down sampling. Let me try the software you suggest. </p>
<p>Hi, i have an atmega8 with the arduino bootloader, this will work on it?thanks</p>
<p>I'm not sure if the library support atmega8.</p><p>check below link for library feature :</p><p><a href="https://github.com/TMRh20/TMRpcm/wiki">https://github.com/TMRh20/TMRpcm/wiki</a></p><p>Supported devices: Arduino Uno, Nano, Mega, etc.</p>
<p>its working</p>
<p>Great Work,Congrats.</p>
<p>tnx</p>
<p>Hai Husham, How do you do?</p><p>recently i tried this for my final project. but this was not working at all. i used wav files u provide. was theere something wrong on my wiring? thanks</p>
<p>try to remove the transistor and connect a head phone ,if you hear something that's mean that you connect the transistor wrongly ,if not check the connection again ,and have a look on below comments ,you may find the solution. </p>
<p>sir,is the circuit in the above was connected to pc????</p>
<p>You will need the PC to upload the code only ,after that you can power it up with out source 5 volt .</p>
<p>Very good, but how can I improve the quality of sound?</p>
<p>Well ,I suggest to buy MP3 module with serial support and connect it to arduino ,in this way you can send command from arduino to play MP3 file with good quality.</p>
<p>sir is this the above one BC546B NPN transistor.???????</p>
<p>BC546B NPN transistor.</p>
<p>sir,</p><p>4.7 k ohm resistor of 1/4 watt or something other??</p>
<p>yes 4.7</p>
<p>sir,is the circuit in the above was connected to pc????</p>
<p>hi Husham, i hope you are doing good.</p><p>i m making a project in which i m using ultrasonic sensors to detect obstacle and then arduino play an audio(that we recorded and converted into .wav of 128kbps bitrate: which is compulsory)</p><p>THE ISSUE IS, the output(our recorded sound) comes out with lots of noise, we put another random audio it went out fine.</p>
<p>hi friend,</p><p>I faced the same problem, in the same project. Have you considered using the following functions to play the beeps?</p><p>tone(buzzer_pin,frequency); </p><p>delay(milisseconds); </p><p>* in my project i wanted to use human voices when a obstacle was detected. I used the library PCM.h (you can read more in <a href="http://highlowtech.org/?p=1963" rel="nofollow">http://highlowtech.org/?p=1963</a>). </p><p>I figured some days after the problem was the quality of the record I generated. Try to keep it in focus. </p><p>Good look in your project.</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>Hi Ahmed ,</p><p>yes you can but the quality of the voice will be bad ,so it's better to use MP3 module instead of this way. </p>
<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,</p><p>I notice from your picture that pin 4 in arduino not connected ,it should be connected to CS pin in SD card. </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'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>
<p>Hi,</p><p>Read SD library information for arduino Mega in below link</p><p>https://www.arduino.cc/en/Reference/SD </p>
<p>Thumbs up indeed...</p><p> I am trying to make a talking bust that picks the files randomly..can you please help with the code only the part that generates the random call please ??</p>
<p>to get random number you need to use arduino random(min,max) command with switch/case statements ,try to understand these two commands then you will able to modify the code.</p><p>the issue that I used my arduino board in another project so I don't have the circuit to test your request.</p><p>good luck. </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>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>

About This Instructable

186,603views

355favorites

License:

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: