New Project: play .wav file from SD card from button press (need direction)

I need some direction on how to play a .wav file off an SD card from a simple button press.

I do not have any SD or .wav shields..

but I do have my SD card (with headers soldered to it) attached to breadboard/Arduino..

I guess I should break it into steps.. but would like some help/feedback on 'how' to accomplish these steps.

1.) set-up/interface.. the SD card and the Arduino wiring..

I have set as so:

Is this correct?

I have also seen this thread:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1235125412/0

and notice the resistors..etc.. (but not sure how that gets set up in practical use/breadboard)

2.) I guess the ability to read a .txt file for some variables/data would be nice...... but MOST importantly and the focus here,..is just being able to play a .wav file off the SD card from a simple button press.. (specific file to be hard coded in the sketch I guess)

3.) I dont think I have ever used or imported a library before.. so am not really sure how that works? I need the library classes/files to be in a certain directory? and then use some import line in my sketch? Is there a nice stable FAT lib (fat16lib?.. uFat?) that the community likes? and is fairly easy to use?

I guess I'll just start here.. and see if I get help or validation on the SD card set-up/diagram.

then move onto the play .wav files from SD card..

thanks!

No you can't do that. The SD card is a 3V3 device, that means the signals have to be 3V3 as well as the power. At the simplest you will need potential dividers on all the arduino outputs to the board. However these do not always work with all SD cards and for the best results you will have to have voltage level shifting circuits in the signal lines.
Time to do a bit more research.

Yes, for the SD card go to adafruit and see how their SD/RTC shield is set up. You need the active buffer chip for reliable high speed reads/writes with SD cards, and also a good source of 3.3V current to power it.

Also, check out the fat16lib, very well maintained & up to date.

You could also take a look at the shields here

and here
http://www.mdfly.com/index.php?main_page=product_info&products_id=284&zenid=62dqqveimlmovjl7gmck1ddp57

but MOST importantly and the focus here,..is just being able to play a .wav file off the SD card

You will also need to add an external D/A as well as an output low pass filter in order to play the file you get off the SD card.

Im trying to learn more/do more research..

(which is why Im here at the Arduino 'help forums')..

Looking for a bit more 'hand holding' on this one.. (if you dont feel up to helping..thats fine) :slight_smile:

So reading the replies.. (thank you by the way guys)..

to re-cap:

1.) the diagram is 'wrong'.. correct? it can NOT be done this way.. is it because the missing resistors? or is the wiring wrong all together?

I had asked if it should be like one: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206874649/all (no response?)

and if so.. Im a bit un-sure on how things are supposed to be wired up.. but it doesnt look 'too' scary.. just add the resistor values in the diagram linked to.. between the Arduino and the SD lines..and the SD lines and the GND rail? WOudl this not only give my 3.3v power..but keep the 'signals' at 3.3v as well as Grumpy Mike mentioned?

this:"voltage level shifting circuits in the signal lines" unfortunately..means nothing to me.. (or any noob I would venture to say).. just big words that confuse more. (especially without any explanation or help on it)..

2.) I need to get a D/A? (Is this like a DAC? Digital to Analog Converter?) or something else?
So another piece of hardware/component.. is that what your saying?
Is there a recommendation? I dont know anything about them..

anyways.. @ CrossRoads.

thanks for the reply and links! =)

unfortunately.. I want to play .wav files.. 'not' .mp3's.. (and not looking to use or buy a shield).. looking to wire it up component level on breadboard to Arduino..(if you can help with that)..

Also.. the fat16lib.. thanks! I had read a few posts on it.. as well as a few others.. but some of them were started in 07 or 08.. so I wasnt sure what was up-to-date or viable anymore.
Still havent been able to find any links or diagrams on how to hook up the 'shields' like you said though?

another questions I have you may be able to help with is..

I see these .wav shields.. what do they all include?

what is difference between wav shield and sd shield? the .wav has the DA? (DAC?) built in?

also.. by 'low pass filter' are you saying using resistors or whatever on the amp?

If noone is willing to throw me a bone here.. maybe some links on the things I 'should' be reading/learning?

Its drving me nuts with this 'hardware' I care little to none about hardware side of things.. its a PITA obstacle for me to get to the code aspect where I truly want to play and spend my time learning!

Thanks!

If you don't care about the hardware side, then I'd recommend getting some shields to take care of that part for you.

I'd recommend an SD shield that has the proper hardware to reliably read/write the SD card. If you don't want the shield, at least learn from the SD connections what the best way to connect up an SD card is. Old slow small cards may work with resistor voltage divider circuit, newer cards need better signal integrity and more 3.3V current, so you need the additional 3.3V regulator as well.

Take a look at this one as well for .wav playback.

Or look around for a higher bit version of something like this.

Try doing some math on the # of bits around - reading from SD card using SPI, SPI transfers to a DAC chip, x2 for all that for stereo.
Could be tricky.

http://code.google.com/p/sdfatlib/

this:"voltage level shifting circuits in the signal lines" unfortunately..means nothing to me.. (or any noob I would venture to say)..

OK break it down:-
Voltage level - the size of the voltage
Shifting circuit - a circuit that shifts or changes the voltage level
signal lines - the lines or wires that carry the signals or information to and from the chip (as opposed to the lines that carry the power to the chip)

just big words that confuse more. (especially without any explanation or help on it)..

So google them or ask, there are a wide variety of users on this forum, it is a waste of everyone's time trying to second guess what you don't understand.

had asked if it should be like one: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206874649/all (no response?)

That is a very long thread with many ideas and discussions in it. The circuit close to the end uses resistor potential dividers, that in my opinion will not work very well and you need a proper voltage level shifting circuit.

I need to get a D/A? (Is this like a DAC? Digital to Analog Converter?)

Yes.

So another piece of hardware/component.. is that what your saying?

Yes

I dont know anything about them..

They convert the numbers you get from the SD card into voltages you can send to an audio amplifier. Without one you can't generate any sound.

I see these .wav shields.. what do they all include?

Every thing you need to make what you want.

what is difference between wav shield and sd shield?

A wav shield will contain an SD card reader, A/D and low pass filter. An SD shield will just allow you to read and SD card.

by 'low pass filter' are you saying using resistors or whatever on the amp?

It is a circuit that blocks high frequencies and lets through low ones. You need this to stop the switching noise of the digital samples from spoiling the sound. You make them with carefully calculated resistors and capacitors and op amps.

I care little to none about hardware side of things.

You have to care if you want to build your own and save money, the cost of not caring is paying some one else to care for you in the form of buying a ready built design.

can i put wires directly on the adaptor without any sd card module?