Cheap and Easy SD WAVE Player




Introduction: Cheap and Easy SD WAVE Player

About: These instructables are mostly about electronics. I hope you find them helpful!
I forgot to add this link. Might be useful

First of all, my blog
Second of all, the original
Third, files needed

Well, you can read my blog about my rant about proper citation.


Ever since I got started with microcontrollers, I always wanted to know how to build an MP3 player, or just something that could play music. My first electronics projects (and a lot of them) were audio amplifiers, VU meters, etc.

Well, digging around on the web, I found elm-chan's awesome WAVE player that uses an SD card!

External storage is perfect.

Here is a video of it working. It's a comparison of SD audio and regular computer audio.

Step 1: Parts and Tools Needed

Besides from the soldering iron, PCB, etchant, etc. There are a few specific things you will need...

- SD card (FAT 32)
- Audio plug
- LPF (optional, I was lazy so I didn't)
- ATtiny85 (HEX files is pretty big!)
- Stereo/Mono plug and speakers (in this project I will be using a stereo layout)
- 100nf capacitor (104)
- SMD LED (optional)
- 270 ohm resistor (optional)
- 4.7k resistor
- male and female headers
-  battery
- button

Now those are parts.

There is a tool I use in order to easily use modified SD cards with my Arduino/ breadboard projects.

In the picture you will see I bought a $5 SD to USB adapter. We will have to modify it a bit to fit our modified SD.

There are two switches that the SD connects when you plug it in. One switch is to indicate whether there is an SD or not, another is to indicate whether you can write to the SD or not. Short both of them to the case/ground

Later in this instructable I will show you how I recharge my Ni-Cd battery.

Step 2: PCB

Nothing more than etching a PCB.

I cut grooves in the side where my SD card socket will be. All PCB files are in the TSJWang's stuff folder. I use Robot Room Copper Connection.

Step 3: Programming It

I did NOT write the code. I am just a curious person writing replicating this project.

If you look in the hex file you will see that the fuses are at the end. If your programmer does not support that, just remove it
Write the fuses AFTER you upload the hex.

I am assuming you all are familiar with AVR programming.

In order to program the SMD chip I plugged in wires to the SD socket. One wire was left, so I just held that one wire down while programming.
It worked fine.

Step 4: Finished!

Now that you programmed it, all you have to do is load some WAV files onto your SD with your modified adapter, and..

How do you recharge the battery?

Simply use an old USB connector and add a 4001/4007 power diode from USB to the battery.
Give it an hour to charge (and no more).
I'm using 400mAh. I probably am overcharging it, but it didn't get hot yet.
Consider your battery and how long you should charge it.

And of course, after it is charged, plug it in (I had an idiot lamp to tell me whether I plugged it in backwards or not), and it should automatically play. press the button to move onto the next file.

And of course, while we are in the mood, this can definitely be implemented into halloween projects. Just add a relay on the button switch or the power supply to play audio files. 
For example, an IR sensor that players a spooky sound when someone passes.
Or a part of your costume.

I just use it to listen to music :)

Please note that SD Cards operate at 3.3 v logic. I am using a 4 volt battery (which claims that it is 3.6v)
Please note this, as you may need a logic level shifter.

Thanks, and please upload pictures to show us how you built your WAV player, or to ask any questions.



    • Water Contest

      Water Contest
    • Creative Misuse Contest

      Creative Misuse Contest
    • Fix It! Contest

      Fix It! Contest

    22 Discussions

    hi there

    I have been trying to get this run for long time not too familiar with avr prg....So I need your help :) first i burned hex without fuse code
    then i burned -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xff:m to setup my fuse ..but it still not working ...

    2 replies

    Hey menuka,
    So what I understand is that you uploaded the hex file, the wrote the fuses?
    avrdude told you that everything was working, and you plugged in the chip and it was NOT working.
    Is this correct?

    Ohhh, I see why this might not be working for you.
    The picture shown in step 3 was simply an example. Those fuses are for the mono version of the SD WAVE player. In this particular instructables, I was doing the stereo version.

    The fuses for that should be in the sd8p_st.hex
    -U lfuse:w:0xe1:m -U hfuse:w:0x7d:m -U efuse:w:0xff:m

    Your hfuse was off. The stereo version bricks the ATTiny, so make sure you upload the right hex file (sd8p_st.hex) and burn the fuses afterwards.
    Sorry for not being clear, hope that helps!

    Wait, so the atiny decodes the wave files on the card by ITSELF?
    Could this code be turned into an arduino library?

    1 reply

    Hey Quin,
    I actually did not write the code. Yes, it decodes directly on the chip.
    I'm not that advanced into legitimate AVR-C programming, so I guess you'll have to consult elm-chan. He wrote the library to read off of an SD. You can look in the main.c to try to understand how he decodes the WAVE.
    Good question!

    So do I need certain software to program it?

    1 reply

    Yep its avrdude

    Sorry that I didn't give an in depth tutorial about using avrdude yet... I should do that sometime.

    its possible for attiny45+mono hex file?

    I want to use this project for a simple sd-wave player but from what I understand, you can only get stereo out in "lo res"...? I really want to have CD-quality sound out in stereo! Did you manage to do that with this project? It is not evident for me to see here. Best regards, Daniel

    7 replies

    To me the quality is impressive (for an ATTiny) but to an audiophile it won't be so satisfying. CDQ is pretty high quality. I don't think this will do it.
    Usually if you want really GOOD audio, there isn't a price limit. I hope that helps

    On elm-chan's site it says that you can either choose between 44.1 khz 16-bit mono (hi-res) or 44.1 khz 8-bit stereo (lo-res) so I was wondering if maybe one could use two attiny's in some way? This might be close to impossible I know but I feel so close to goal with this! ;-) I think I read a guide somewhere where some guy managed to tweak the code to get it to read stereo. Here it is!

    Oh right.
    I've forgotten. If you are OK with mono audio (which is like, one ear of CDQ) then I guess you can try that, but I'm not sure if you can say that it's CDQ.

    Please go ahead and try that tweaked code and tell the rest of us about the results!

    I am currently chatting with the hackerspace-ffm guys about using an atmega328 to acheive 16-bit stereo outputs - the 328 come as DIP IC and is very DIY friendly and not very expensive these days, as you might already know - so I am very excited to see what this will result in!

    Yea the 328p will probably be able to do more than an ATTiny.
    Wow I didn't know the price is trending down.. Almost to how much an attiny used to cost. That could be good or bad. I'll go buy a whole lot.

    Yeah, although I like the idea of the ATTiny as the "brain" in the player, I am drawn towards the idea of having another DIP-chip spit out CD quality sound. Appearantly it should just be done by using 4 pwm outputs from the atmega, combining two (8 bit) channels with the resistor for getting 16 bit and then just duplicate that for stereo channels. It's all in the link I sent you abve - give it a try, you might benefit all of the DIY world with a new instructable ;-)

    Sounds like the four outputs become two outputs; two are combined so that the audio doesn't clip when it's negative voltage.

    I would like a mp3 shield, trigger or something similar.

    I would like to send a 12v signal to the MP3 player. when the MP3 player receives the 12v power I would like it to automatically start playing an MP3 file. then when the 12v is removed the mp3 player stops playing. then when the 12v is supplied again it starts playing the same mp3 file.

    I know i can do this quite simply with an arduino but can i do this without it?

    1 reply

    You probably will need to scale down the 12v signal to 3.3v-5v so that you don't burn out the Arduino.

    There are plenty of ways you can do this. I'll list a few:

    1) Use other microcontrollers

    2) Use an actual MP3 player, and use the 12v signal to turn on a relay to power on the player and start playing the song.

    3) Use those audio cards and record your MP3 file on that.