I present this new Arduino project: A full MP3 player based on Arduino.
As you can see in the photo, the idea was to build a standalone player, in the style of antique radios or 'tapes', in the age of Iphones ....
The player uses a small module based on the VS1002d chip (now discontinued, but who had a drawer). The module in question I bought at Futurlec . Currently you can get similar modules on ebay for a bit more than 10$, although the chip is the VS1003 o VS1053. You can also use a SparkFun MP3 shield, but significantly more expensive (this shield already includes an SD slot).
The three chips are quite compatible in terms of programming, and indeed almost all initialization the I have taken from the library to the SparkFun MP3 Shield ;-)
Elements of Arduino mp3 player :
- Arduino
- Mp3 module based on chip VS 1XXX
- SD Module (It is also available on ebay)
- 4x20 characters LCD
- Small amplifier
- 2 speakers.
Both the SD as the MP3 module are connected to the Arduino using the SPI bus. The LCD is connected in 4 bits mode to save Arduino pins.
This is a table with the connections between Arduino and the other components. In parentheses, the name of the individual connections on modules (and the pin in the SD card).
This is a table with the connections between Arduino and the other components. In parentheses, the name of the individual connections on modules (and the pin in the SD card).
PIN Arduino | MP3 Module | SD Card | LCD | Buttons |
0 | -- | -- | -- | Forward |
1 | -- | -- | -- | Back |
2 | DREQ | -- | -- | -- |
3 | -- | -- | RS | -- |
4 | -- | -- | ENABLE | -- |
5 | (RESET) | -- | -- | -- |
6 | CS (XCS) | -- | -- | -- |
7 | DCS (BSYNC) | -- | -- | -- |
8 | -- | -- | -- | Encoder A |
9 | -- | CS (CD/DAT3-1) | -- | -- |
10 | -- | -- | -- | Encoder B |
11 | MOSI (SI) | MOSI (CMD-2) | -- | -- |
12 | MISO (SO) | MISO (DATO-7) | -- | -- |
13 | CLK (SCLK) | CLK (5) | -- | -- |
A0 | -- | -- | D4 | -- |
A1 | -- | -- | D5 | -- |
A2 | -- | -- | D6 | -- |
A3 | -- | -- | D7 | -- |
A4 | -- | -- | -- | -- |
A5 | -- | -- | -- | -- |
Both the MP3 module and SD card work with 3.3 V, making it necessary adjust the levels to make them compatible with the Arduino 5V. The simplest option is to use voltage dividers with a pair of resistors. For the signals to the micro is not necessary, the 3.3 V are interpreted as high level without problem.
The schema is as follows (clik to enlarge):
According to the modules that you use for MP3 and SD, you will have to set the pins of the connectors (the order shown in the diagram does not correspond to any particular module).
If you use the SparkFun MP3 shield, Read the documentation to set the pins for both CS and for SD MP3 and modify it as necessary in the source code.
In the next post the code ...
If you liked it, remember to share it on your favorite social network. Thanks
Dear Sir
ReplyDeleteWe are extremely interested in your project. Could you please email me at m.louise.dreyer@gmail.com.
We would like to get in contact with you.
Thank you kindly
Marie-Louise
Dear Sir,
ReplyDeleteGood night
I are extremely interested in your project. Could you please email me
it's urgent. renatoalves1900@hotmail.com
please contact
I have a question...
ReplyDeleteIf playing an MP3 song...then I turn it OFF...when tunr it ON again.it will start playing from beginning or it will continue from last played song ?
Thank you
My circuit not working... Please help me...contact me on 91 8698541080
DeleteMy circuit not working... Please help me...contact me on 91 8698541080
DeleteHi!,
ReplyDeleteIt looks awesome!
What kind of encoder did you use?
Kind Regards
Jory
@Jory Zoetendaal
ReplyDeleteAn cheap 'rotary encoder switch' found at ebay ...
@JAJTNo, the state is not saved. But you can save in the EEPROM of Arduino.
ReplyDeletehttp://arduino.cc/en/Tutorial/EEPROMWrite
if I use the shield mp3 still need Mp3 Mini board?
ReplyDeleteInteresting project. I built the circuit very carefully. 328P chip used in stand alone mode (with the appropriate matching pin) but the circuit does not work. The display lights up and shows strange characters react buttons and encoders. Sometimes the error message appears reading SD card is not present. (only this message displayed with exact characters) sometimes volume bar appears but does not respond. There are no updates to this project? I used an MP3 module LC technology (chip 1053B) and SD reader LC study. I have read that some adjustments are based on wings modules but it is not explained how and what to change. It 'a shame it does not work. BY Eu.
ReplyDelete@Anonymous
ReplyDeleteI also had problems at first, mostly due to the wiring.
Must be taken that the wires are not too long, apparently high data rates create interference.
In a first attempt, I used ribbon cable and had similar problems. Use twisted wires and it worked.
https://www.facebook.com/ArduinoGuay/photos_stream
Check the connections, especially pin CS (MP3 and SD share the SPI bus).
Try to run the single SD card, without the rest to check that everything works fine.
Thank you for your kind reply I sent message on FB is the best player who is on the network apart toys with a few buttons and without a display, I hope to solve. By
ReplyDeletehow to create raiz
ReplyDelete+-artistas.txt
+-[ARTIST01]
| +-album.txt
| +-[ALBUM01]
| | +-track.txt
| | +-track001.mp3
| | +-track002.mp3
| | .....
| | +-track0nn.mp3
| +-[ALBUM02]
| .......
| +-[ALBUMnn]
+-[ARTIST02]
.....
+-[ARTISTnn]
Can you help me
This comment has been removed by the author.
ReplyDelete@Dtvt Dh
ReplyDelete'raiz' is root ...
No need to create, is the root directory
Good evening! I can't deal with creation of the catalog in the card SD. Share please skreenshot as at you the card SD root looks. Thanks, my email digits1@yandex.ru
ReplyDeleteI am wondering if your code can connect to a real jukebox? I have a non working machine and would like to connect the buttons to an arduino to play music. Any advice?
ReplyDeleteI made it!!! and it works. Thank you. My only problem was low memory using the UNO board sot I switched to Mega 2560. Next step is to build an enclosure. Once again Thank you.
ReplyDelete