The World’s Simplest Open Source DIY MP3 player! with circuit

Tags


Picture

For around $30 in parts and a good amount of patience, you can have a completely open source and hackable mp3 player ready to go. It can be modified to accept serial commands, be embedded in an art project, used as the voice of your next smart talking robo-sidekick, or filled with music and used as is. Put in whatever size card you want, up to the theoretical limit of the MMC format! All the source and schematics are here for free as part of the Creative Commons. I have kits available if you don’t feel like scavenging for the parts yourself.

This player features a shuffle mode, basic track navigation, volume control, FAT32 support, fragmented file support, an unlimited number of files on the root directory, and high quality playback. Files at 256Kbps can be played without a hitch. Variable bitrate files are supported with peaks up to 320Kbps.

WAV files are also supported, but they have to be less than CD quality unless you put a faster oscillator in the pic. It works on my test device, but running the pic at over ~8MHz with only a 3.3 volt supply can be problematic. So I hear. I’m still working on the WAV stuff, so if you have some funny results playing WAV files, let me know.

To load the memory card, you will need some sort of card reader/writer. Many computers have them built in. External USB models are available for ~$10. Make sure to format the card FAT32, not FAT16.

For normal playback, load a card up with MP3 files (make sure they all have a “.mp3” file extension) and insert it into the player. Turn on the power and it should immediately start playing the first track. Tracks are played in the order that they are put onto the memory card.

To get into shuffle mode, hold the “next track” button down while you power on the device. It will remain in shufle mode until the next power cycle. Once all the songs have played once (and only once) it will go to sleep until the next power cycle.

Please Email me if you have any specific questions, or just to let me know you are doing this project!

BEGINNERS BEWARE! This is an intermediate level project. You will need things like a PIC programming device and some working knowlege of C programming, as well as a decent but not huge amount of electronics experience. An oscilloscope doesn’t hurt either. Be warned! And the parts are tiny!

If you are a beginner, give these books and websites a look:

www.parallaxinc.com www.sparkfun.com www.microchip.com www.microchipc.com www.dontronics.com www.jameco.com ccsinfo.com (the midrange compiler is the one I used for this project)

all the Forrest Mims III books, available at radio shack

Practical Electronics for Inventors, by Paul Scherz

and Nuts and Volts Magazine (tower books has it most of the time)

Why is it called Sakura? It’s spring here and the cherry blossoms are blooming everywhere. Sakura means cherry blossom in japanese. And the first prototype was housed in a pink plastic box.



links:

Pcb and Source Code.

Buy a Kit




~Schematic~

Below is the schematic diagram. Click here for a larger version in .bmp format, or go to the downloads section for the expressPCB .sch file.



Picture

~Source Code~

The source code is available in the download section. Click here.

The source code is in C. The compiler I use is the PCM midrange compiler from CCS. It’s about $100 and compiles very tight code and has a reasonably full set of built in functions and datatypes. I’m very happy with it. Their website is here: ccsinfo.com.

For people without any need to modify the code, there is a HEX file ready to be burned directly into a pic. Be sure to clear the BROWNOUT and WATCHDOG fuses. That means disabling them. If you don’t, the whole thing will fail to run. This is the most common mistake.

Currently, all 4K of program space is nearly used up. The 256 byte EEPROM is completely used up for a lookup table for the shuffle function. There are a few non critical functions that can be removed to make some space, like the button interface and the shuffle routines. If microchip ever comes out with an 8k, 18 pin device, I will switch to that one for this project. Also, you might be able to make some of the code more efficient than I can. If so, let me know what you come up with!



~Printed Circuit Board~

Go to the downloads section for the .pcb file to be used at www.expressPCB.com.



Picture

~Parts Layout~

click here for a printable version of the parts layout




Picture

~Parts List~




quantity

part number

description

1

PIC16LF88, SOIC package (as of april ‘06 mouser has them cheapest)

pic microcontroller

1

VS1011b, SOIC package I think the vs1011e is fine too, but it might need some minor modifications

MP3 decoder chip

1

Alps # SCDA1A0901 (available at Mouser.com)

SD/MMC card socket

1

red low current LED, 1206 package

1

digikey# CP-3523SJCT-ND

stereo headphone jack

1

ECS inc.# ECS-129-18-4 12.96 MHZ or equivalent

12.96 MHz crystal

2-4

digikey# 311-1154-1-ND

22pF capacitor, 1206 package

1

digikey# MCP1700T3302ETTCT-ND

3.3 volt regulator, SOT23-3 package

6

digikey# BC1300CT

0.1uF capacitor, 0805 package

3

digikey# PCE3093CT

100 uF capacitor, surface mount

9

10K resistor, 0805 package

5

digikey# 401-1131-1-ND

mini joystick (4 way plus select)

1

NOT DEFINED

5 pin .1 inch spacing header

1

digikey# SBH-431A-ND

3 cell Ni-MH battery pack (AAA works well)

1

1M resistor 1206 package

1

1K resistor 0805 package

1

digikey# 478-3026-1

10 to 15 uF tantalum cap


EmoticonEmoticon

Advertisement