Picture of Playing Wave file using arduino
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

Picture of Parts
Funduino Nano V3.JPG
Funduino Nano V3 1.JPG
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.
1-40 of 137Next »
DjXanJscud2 days ago

My setup is a little different, i used 2 buttons and 2 1 k resistors instead of 22k.
The setup is pretty fine, don't have amplifier, but the sound have noise and a continuous sine noise. i believe this is lack of amplifier, can be arranged with some amplification and a 104 capacitor!

hipsi7 days ago
This is driving me nuts. All i am able to get is static when it's playing the file (tested with earphones). I am using an Uno with an ethernet shield that has a micro sd. See you've had a couple of others with the same problem. Does that mean potentially that the ethernet shield is what's causing the problem?
MustafaG58 days ago

I set up this circuit with Arduino Uno. Is it necessary any changes on my circuit or codes?

jacobcpa15 days ago

Got it working!!!!!! (sorta)

1. Sound plays from each button, but after about 5 seconds it loudly fuzzes out, I used Cool Edit Pro to adjust the wav settings as stated about in instructions. Any ideas. I am attempting to download your wav files and try them to see what happens.

2. Can I put an 1/8th inch jack inplace of the speaker so I can connect to bigger speakers or a sound system? If so, is there a pinout for the 1/8 and ??transitor?

3. I am building a Tartus (phone booth) for a friend's daughter's door facaude. When she opens the door, he wants it to play music for her. I was thinking of doing an always on switch. Will I need to change the code a bit to tell it to play when a button is pushed, or will just telling it to play when the switch is high work the same (door will push the button "closed" when closed, and "open" the button when the door opens) hope you understand.

this is my first Arduino project and look forward to doing more now.


jacobcpa15 days ago

finally got it to work. My switches were only hooked to ground on the right side and the left went to the resistors. The transistor is flat side out not up like the picture looks like. this is for the ones who are new at it like me and try to follow the picture. I also connected 5v to the bottom line on breadboard that the resistors went to (along with the red wire for the speaker) and connected ground to the SD card (but any ground connection on the arduinos will work). You'll get a blue light on, on the Arduino Nano. couple questions to follow.

jacobcpa15 days ago
jgroner24 days ago

Thanks so much for this Instructable! I'm hoping you can help me with a coding issue. In my code I need to either call for TMRPCM to play the audio file in a specific directory or, use a variable to define which name of the file to call for TMRPCM to play...

Basically, I'm looking to have pages from a book recorded as separate tracks for each page.

In the first part of the code, the user defines the book to be played.

Then in the second part of the code, the page that is played is determined by sensor input. This sensor input will be the same for Page 1 of any of the books, so it ends up being something like:


But the files should be named:




So the call to play the file should have a variable for the BK1 part and then page1.wav at the end....

Cant figure out how to do that... tmrpcm.play(bookNumber, "page1.wav");

Or if it can just look into a directory? tmrpcm.play(bookNumer, "/page1.wav");

Something to that effect.. (Though those examples don't work, I've tried.)

ánegreiros made it!1 month ago

Hi Husham Samir ,

I have got some
problem, but a figured out.

-Fist problem, the transistor didn’t amplified well, so I
removed it and put this circuit (amp-op):


- I tried to convert some mp3 audios from r2d2 to wav
format, but only worked with this steps.

1. Open mp3 to Audacity 2.1.1

2. Split the stereo track on two tracks

3. Make each track

4. Mix them

5. Set Sample
Format -> 16-bit

6. Set Project
rate -> 8000Hz (this function is under the sample format)

7. Project rate
-> 8000Hz

8- Effect ->
change speed -> new length -> put the original time of the audio (when
you change project rate the audio slow down, so you need force it to the
original speed)

9. File->
export-> other uncompressed files -> options -> header-> wav

10. Options -> encoding -> unsigned 8-bit PCM

11- Save.

Or : https://learn.adafruit.com/adafruit-wave-shield-audio-shield-for-arduino/convert-files

but didn’t worked with 16khZ only with 8kHz…

by the way, you can’t put some characters like
“-“ or space, well, didn’t worked with me… And the audios working: https://www.dropbox.com/sh/b8u8d02kfddpd21/AABCBEbiO6Ow1Ro_aF0EiO8sa?dl=0

Thanks so much for the light. May the force be with you.

2015-07-29 20.49.53.jpg
Husham Samir (author)  ánegreiros29 days ago

Great Work,

Thanks for sharing your troubleshooting steps ,this will be helpful to many people who have some issues in this circuit.

lambsb made it!1 month ago

Hello, I'm using this library/concept to build a realistic engine sound system for a large scale Radio Controlled Ship model. The Arduino reads the pulse in from the R/C receiver, determines the throttle setting, and plays a .wav file that corresponds to each throttle setting, including cranking the engine, acceleration, deceleration, idle, shutdown, etc. The system works almost flawlessly except....... It seems that the read time from the SD Card isn't fast enough to blend the next sound on the fly without a silent "Gap" between each file, say accelerating and then running at that speed. I haven't had any luck playing two files at once, so I can't overlap the sounds, they always sound way distorted. Can you think of a solution? Basically I need to call .wav files from within the sketch (which I am doing successfully) but have them play instantaneously with no gap between one file and the next. BTW, I'm using one of the cheapo 3w stereo amplifiers with volume knob from Amazon, it sounds awesome with a .68uF capacitor between the L and R input and ground. Makes WAY LOUD sounds! See right hand side of breadboard in picture.

anilkumars made it!1 month ago
I have using arduino uno
instead of speaker I connected to GSM shield for reporting fault with playing the pre recorded voice
Husham Samir (author)  anilkumars1 month ago


congratulations AnilKumars.

anilkumars1 month ago
Hi thank you.. I have done same project but I used arduino uno and .. instead of speaker I interfaced to GSM module so that in case of any fault particular pre recorded audio will be played

thanks husham

Hi Husham,

This worked great! I was wondering if there is a way to use one button to play each wav sound / music in sequence. Like how a toy works where you hit a button and you get a different sound.


ParkerO2 months ago

Can you give a list of more specific items? For example: 10-wires. What type of wires? 4-Bread Board. How big? there are different sizes for it. or put in a link for each item.

Hi guys,

I want to play a audio file in a bluetooth headphone with arduino. Do you know how can I do this?

RenatoL made it!3 months ago

Guys I discovered the problem with Arduino 1.6.4 software version, just add a line with "#include <SPI.h>" after the line "#include <TMRpcm.h>", Now its working with 1.6.4 version and with ARDUINO UNO board.

photo 01.JPG
RenatoL3 months ago

I made it and works well with Arduino 1.0.3 software version, but if I try to use the same code with Arduino 1.6.4 software version I have several problems with Error compiling.

voltman4 months ago

I can't compile the sketch I get

TMRpcm.h: No such file or directory, yet the library is there.

safayeta voltman3 months ago

use arduino 1.0.3 software.. Newer version does not support this library

Husham Samir (author)  voltman4 months ago

this error telling you that you didn't install theTMRpcm library in the right location.

i also got a compile error:

TMRpcm.h: was not declared in this scope

But i have installed the library

speakerbock4 months ago

Hey wondering if you can help me, i have tried building this but the audio only plays as long as the button is held down, would you have any idea as to whats i have done wrong, thanks !

RameshK54 months ago
I did this project using an Arduino Uno and 8 Ohm speaker without the transistor and the sound volume was fair.

Thanks For Sharing It
AamirA1 RameshK54 months ago

hi ramesh, can you please tell me the parts you used for this project,code and the wiring diagram.please, because i also want to make this project with arduino uno

what is the parts of project using Arduino Uno??
and what is the Connection method??

AamirA14 months ago

can this project play voices

djoker074 months ago

can i use another transistor aside from the BC546B NPN???

thank you

SteveK84 months ago

Hi Husham,

Thanks for sharing your great work!

I'm having a problem with initializing the sd card using 'SD.begin()'. I've formatted the card with FAT32 AND all the connections seems to be ok to me.

What could be the problem? Can you shed a light please?

AdieV4 months ago

Excuse me sir, i want to ask you about
how much voltage in your input ?
what is the spesificaton of your speaker?
i want to make a project same as yours..:D

Husham Samir (author)  AdieV4 months ago

5 Volt

oke thankyou sir
how can i check my push button works or not with my arduino program?
can you help me..

mfreire45 months ago

I did the same as his scheme . But the speaker sound is very low.

I used the speaker 0,25W 8ohm and the sound remains low.

How do I put the loudest sound?

Husham Samir (author)  mfreire44 months ago


first of all ,make sure that you connect the transistor correctly.

if yes ,then try to amplify the wav file using the software.

PenguinM5 months ago

Hi, first off great instructions. I am working with the same library and your converted files were very helpful. For some reason, the files you have converted work perfectly, but when I try to convert my own, which include vocals, I get jsut static. I have used Audacity to convert them, and converted your files using the same method, but only yours seem to work. Do you have any advice on how I can get my files converted properly?

Husham Samir (author)  PenguinM4 months ago

Hi,maybe the software you used not convert it probably , try to use the same software I used (WAV sample converter) and set it as below

Samples Per second(Hz):16000

Channel :Mono
Bits PerSample: 8

I hope it will work.

Meka285 months ago

Dear, this is a nice piece of work!

Though, I tried to apply it on a BareConductive Touch Board, but couldn't successfully upload the WavSW_ino file: "Error Compiling" message.

Any idea if this could work on such board please?

BasS25 months ago

This is almost perfect for what i want to create:)

I want a slight modification: because I can only use two wires for the 5 buttons I have to create a switchboard like this (my electronics skills are the worst :( ).

Is it possible to digitize this output so the Arduino knows what key(s) are pressed? Do you have an example of how i could try and make this work...

You could use an I2C bus exapander like a PCF8574. Take a look at this tutorial: http://garagelab.com/profiles/blogs/tutorial-arduino-i-o-port-expander-with-pcf8574

Very helpfull, thanks!

I'm currently looking into this with R-2R ladder setup:


1-40 of 137Next »