{"id":16322064,"url":"https://github.com/balassy/music-player","last_synced_at":"2026-04-19T05:33:36.609Z","repository":{"id":147827611,"uuid":"312077046","full_name":"balassy/music-player","owner":"balassy","description":"An Arduino-based device that can play MP3 files from a microSD card.","archived":false,"fork":false,"pushed_at":"2020-11-11T20:53:46.000Z","size":1026,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-21T03:46:02.590Z","etag":null,"topics":["arduino","arduino-nano","arduino-sketch","dfplayer","dfplayer-mini","dfplayer-mini-mp3"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/balassy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-11T20:03:52.000Z","updated_at":"2025-01-01T18:43:12.000Z","dependencies_parsed_at":"2023-05-27T15:15:06.189Z","dependency_job_id":null,"html_url":"https://github.com/balassy/music-player","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"99373c4805ad25be0dd38c38ee6995cc3f0e51e0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/balassy/music-player","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balassy%2Fmusic-player","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balassy%2Fmusic-player/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balassy%2Fmusic-player/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balassy%2Fmusic-player/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/balassy","download_url":"https://codeload.github.com/balassy/music-player/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balassy%2Fmusic-player/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31996441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","arduino-nano","arduino-sketch","dfplayer","dfplayer-mini","dfplayer-mini-mp3"],"created_at":"2024-10-10T22:49:53.683Z","updated_at":"2026-04-19T05:33:36.590Z","avatar_url":"https://github.com/balassy.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arduino Music Player\n\nAn Arduino-based device that can play MP3 files from a microSD card.\n\n## Features\n\n- Play MP3 files from microSD card.\n- Go to next and previous songs with single press.\n- Increase and decrease volume level with long press.\n- Pause and resume the currently played song with double press.\n- LED that indicates when a song is played.\n\n## Parts List\n\n- 1x Arduino Nano\n- 1x DFRobot's [DFPlayer Mini](https://wiki.dfrobot.com/DFPlayer_Mini_SKU_DFR0299) board\n- 1x 8Ω 0.5W speaker - according to the specs DFPlayer can direct drive a 4/8Ω 3W speaker\n- 3x button\n- 1x 220Ω resistor\n- 1x 1kΩ resistor - required because the Arduino is 5V, but the DFPlayer is 3.3V\n- 1x microSD card - maximum 32GB formatted to FAT32\n- 1x LED\n- wires\n\n## Wiring\n\n![](./wiring/breadboard.png)\n\n![](./wiring/schematic.png)\n\n\n## Feature Highlights\n\n### DFPlayer Communication\n\nDFPlayer has a serial protocol, so we are using the Arduino [SoftwareSerial](https://www.arduino.cc/en/Reference/softwareSerial) library to use pin 11 and 10 as TX and RX ports. The low level protocol is documented in the module's [datasheet](./doc/FN-M16P+Embedded+MP3+Audio+Module+Datasheet.pdf).\n\nAlthough there are newer libraries (like [DFPlayerMini_Fast](https://github.com/PowerBroker2/DFPlayerMini_Fast)) I used DFRobot's [DFRobotDFPlayerMini](https://github.com/DFRobot/DFRobotDFPlayerMini) library to wrap the low level serial details. The best documentation of this library is the [FullFunction example](https://github.com/DFRobot/DFRobotDFPlayerMini/blob/master/examples/FullFunction/FullFunction.ino).\n\n### MP3 Files\n\nSection 1.4 in the [datasheet](./doc/FN-M16P+Embedded+MP3+Audio+Module+Datasheet.pdf) describes how the files should be named on the SD card. Basically you have to create an `mp3` folder in the root and name your files `0001.mp3`, `0002.mp3` and so on.\n\n**Important!** The order of the files is not determined by their name, but by the order they are written to the SD card! The best approach is to name the files on your computer and then copy them to the SD card. \n\nThe SD card must be formatted to FAT32 and in my experience it must have only a single partition.\n\nI downloaded several files from https://www.101soundboards.com and they all worked with DFPlayer.\n\n### Buttons\n\nAccording to the documentation the `IO1` and `IO2` pins can be used to control volume level and to navigate between the songs.\n\n![](./wiring/buttons.png)\n\nShort press means playing the next and previous songs, long press means increasing and decreasing the volume level.\n\nIn my experience the **documentation is not correct**: `IO2` has the `Next/Vol+` functionality and `IO1` has `Pre/Vol-`.\n\nAlthough the `ADKEY` pins could be used to add more buttons, I decided to control play/pause from software, so I connected a button to the Arduino and used [Matthias Hertel's OneButton library](https://github.com/mathertel/OneButton) so I didn't have to deal with debouncing the button and I could easily add support for  double press.\n\n### Busy LED\n\nDFPlayer's `BUSY` pin goes `LOW` when a song is being played and goes `HIGH` when the device is in idle state, so I added a LED that works in sync with the onboard LED.\n\nFrom code the `player.available()` function behaves similarly.\n\n## About the author\n\nThis project was created by [György Balássy](https://linkedin.com/in/balassy).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalassy%2Fmusic-player","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbalassy%2Fmusic-player","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalassy%2Fmusic-player/lists"}