{"id":9027,"date":"2020-10-17T12:50:38","date_gmt":"2020-10-17T12:50:38","guid":{"rendered":"https:\/\/wolles-elektronikkiste.de\/mp3-payer-yx5300"},"modified":"2023-12-03T15:32:22","modified_gmt":"2023-12-03T15:32:22","slug":"mp3-player-yx5300","status":"publish","type":"post","link":"https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300","title":{"rendered":"MP3-player YX5300"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">About the post<\/h2>\n\n<p>In this article I would like to introduce an MP3 player module based on the YX5300 chip. I will deal with the following topics:<\/p>\r\n<ul>\r\n\t<li><a href=\"#Eigenschaften\">Features \/ Specification<\/a><\/li>\r\n\t<li><a href=\"#SerialMP3Player\">SerialMP3Player Library<\/a><\/li>\r\n\t<li><a href=\"#Schaltung\">circuit<\/a><\/li>\r\n\t<li><a href=\"#Ardu_YX5300_MP3_Player\">Ardu_XY5300_MP3_Player &#8211; smartphone control<\/a><\/li>\r\n\t<li><a href=\"#Probleme\">Problems with the SD card?<\/a><\/li>\r\n\t<li><a href=\"#Alternative\">Alternative MP3 modules<\/a> <a id=\"Eigenschaften\"><\/a><\/li>\r\n<\/ul>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_vorne_und_hinten-1024x278.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"278\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_vorne_und_hinten-1024x278.webp\" alt=\"\" class=\"wp-image-19586\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_vorne_und_hinten-1024x278.webp 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_vorne_und_hinten-300x82.webp 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_vorne_und_hinten-768x209.webp 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_vorne_und_hinten-1536x417.webp 1536w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_vorne_und_hinten-1320x359.webp 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_vorne_und_hinten.webp 1888w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Serial MP3 player YX5300<\/figcaption><\/figure>\n\n<h2 class=\"wp-block-heading\">Features \/ Specification<\/h2>\n\n<p>The MP3 player YX5300 module \u00a0 is available for 5-10 Euro e.g. on <a href=\"https:\/\/smile.amazon.de\/\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon.<\/a> The supplied documentation is &#8211; as mostly with electronic components &#8211; very poor, but there is a <a href=\"http:\/\/geekmatic.in.ua\/pdf\/Catalex_MP3_board.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">data sheet<\/a> on the net. The main features are:<\/p>\n\n<figure class=\"wp-block-table aligncenter is-style-stripes\"><table><tbody><tr><td>Power supply<\/td><td>3.2 &#8211; 5.2 V<\/td><\/tr><tr><td>Power consumption<\/td><td>max. 200 mA<\/td><\/tr><tr><td>File types<\/td><td>WAV \/ MP3<\/td><\/tr><tr><td>SD card<\/td><td><p>Micro SD (&lt;= 2 GB)<br\/>&#13;\n<br\/>&#13;\nMicro SDHC (&lt;=32 GB)<\/p><\/td><\/tr><tr><td>Format<\/td><td>FAT16 \/ FAT 32<\/td><\/tr><tr><td>Communication<\/td><td>Serial via RX\/TX<\/td><\/tr><tr><td>Max. voltage for TX\/RX<\/td><td>3.3 V \/ 5 V<\/td><\/tr><tr><td>Baud rate<\/td><td>9600<\/td><\/tr><tr><td>Loudspeaker\/headphone jack<\/td><td>3.5mm jack<\/td><\/tr><tr><td><\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n<p>I successfully tested the module with a 2GB SD card and a 16GB SDHC card. If you have a problem with your SD card, just like me at first, then maybe the chapter <a href=\"#Probleme\">below<\/a> about this issue will help you.<\/p>\r\n<p>The module expects the directory names in the format &#8220;01&#8221;, &#8220;02&#8221;, &#8220;03&#8221;, etc. on the SD card. The files in the directories must have the format &#8220;001xxx.mp3&#8221;, &#8220;002xxx.mp3&#8221;, &#8230; Have. &#8220;xxx&#8221; is freely selectable (apart from special characters).\u00a0<\/p>\r\n<p>The jack connection can be seen as a positive or negative feature. Additional pins for connecting to self-built amplifiers or loudspeakers would have made sense. But first of course it is very convenient to be able to connect a headphone or (active) speaker directly.\u00a0<\/p>\r\n<p>The module is addressed serially and has implemented a set of instructions that one would expect from an MP3 player. I do not want to go through the instructions individually. Either you look in the data sheet or in the example sketch of the library, which I would like to introduce in a moment. The only thing I miss a little is a function to switch from single song mode to playlist mode (or back), which does not interrupt the currently played song. <a id=\"SerialMP3Player\"><\/a><\/p>\n\n<h2 class=\"wp-block-heading\">SerialMP3Player library<\/h2>\n\n<p>Actually, it is not very difficult to control the module without a library, but it is a lot of work to copy all the commands from the data sheet manually. <span style=\"background-color: #ffffff;\">Using<\/span> the <a href=\"https:\/\/github.com\/salvadorrueda\/SerialMP3Player\" target=\"_blank\" rel=\"noopener noreferrer\">SerialMP3Player library,<\/a> you don&#8217;t need to do this and therefore you can get started right away. Nevertheless, I recommend to look at data sheets sometimes, e.g. in order to be able to improve libraries if necessary.<\/p>\r\n<p>With the help of the example sketch BasicCommands, the module can be tested extensively. The sketch lists the available commands on the serial monitor, which can then be executed accordingly. \u00a0 It is nice that the raw data that are sent or received are displayed on the serial monitor. You can change this in line 42 \u00a0 by replacing the &#8220;1&#8221; with a &#8220;0&#8221; and commenting the lines 67-69.<\/p>\r\n<p>The sketch is easy to understand and I don&#8217;t think it needs any great explanations. The loop function checks whether entries have been made on the serial monitor. The inputs are evaluated by the &#8220;decode_c&#8221; function and then passed to the &#8220;menu&#8221; function. The menu function then calls the functions defined in the library. \u00a0<\/p>\n\n<div class=\"scroll-paragraph-long\">\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-title=\"BasicCommands.ino\" data-enlighter-group=\"BasicCommands.ino\">\/******************************************************************************\r\n  Basic Commands examples for the SerialMP3Player YX5300 chip.\r\n\r\n  Copy the files of \"SDcard_example\" to an empty SD card\r\n  Connect the Serial MP3 Player to the Arduino board\r\n    GND \u2192 GND\r\n    VCC \u2192 5V\r\n    TX \u2192 pin 11\r\n    RX \u2192 pin 10\r\n\r\n  After compile and upload the code,\r\n  you can test some basic commands by sending the letters\r\n  ? - Display Menu options.\r\n  P01 - Play 01 file\r\n  F01 - Play 01 folder\r\n  S01 - Play 01 file in loop\r\n  p - play\r\n  a - pause\r\n  s - stop\r\n  &gt; - Next\r\n  &lt; - Previous\r\n  ...\r\n\r\n  Some commands like 'P' must be followed by two digits.\r\n\r\n  This example code is in the public domain.\r\n\r\n  https:\/\/github.com\/salvadorrueda\/ArduinoSerialMP3Player\r\n\r\n  by Salvador Rueda\r\n *******************************************************************************\/\r\n\r\n#include \"SerialMP3Player.h\"\r\n\r\n#define TX 11\r\n#define RX 10\r\n\r\nSerialMP3Player mp3(RX,TX);\r\n\r\n\r\nvoid setup() {\r\n  mp3.showDebug(1);       \/\/ print what we are sending to the mp3 board.\r\n\r\n  Serial.begin(9600);     \/\/ start serial interface\r\n  mp3.begin(9600);        \/\/ start mp3-communication\r\n  delay(500);             \/\/ wait for init\r\n\r\n  mp3.sendCommand(CMD_SEL_DEV, 0, 2);   \/\/select sd-card\r\n  delay(500);             \/\/ wait for init\r\n\r\n  menu('?',0); \/\/ print the menu options.\r\n}\r\n\r\n char c;  \/\/ char from Serial\r\n char cmd=' ';\r\n char cmd1=' ';\r\n\r\n\r\n\/\/ the loop function runs over and over again forever\r\nvoid loop() {\r\n\r\n  if (Serial.available()){\r\n    c = Serial.read();\r\n    decode_c(); \/\/ Decode c.\r\n  }\r\n  \/\/ Check for the answer.\r\n  if (mp3.available()){\r\n    Serial.println(mp3.decodeMP3Answer()); \/\/ print decoded answers from mp3\r\n  }\r\n}\r\n\r\nvoid menu(char op, int nval){\r\n  \/\/ Menu\r\n  switch (op){\r\n    case '?':\r\n    case 'h':\r\n        Serial.println(\"SerialMP3Player Basic Commands:\");\r\n        Serial.println(\" ? - Display Menu options. \");\r\n        Serial.println(\" P01 - Play 01 file\");\r\n        Serial.println(\" F01 - Play 01 folder\");\r\n        Serial.println(\" S01 - Play 01 file in loop\");\r\n        Serial.println(\" V01 - Play 01 file, volume 30\");\r\n        Serial.println(\" p - Play\");\r\n        Serial.println(\" a - pause\");\r\n        Serial.println(\" s - stop \");\r\n        Serial.println(\" &gt; - Next\");\r\n        Serial.println(\" &lt; - Previous\");\r\n        Serial.println(\" + - Volume UP\");\r\n        Serial.println(\" - - Volume DOWN\");\r\n        Serial.println(\" v15 - Set Volume to 15\");\r\n        Serial.println(\" c - Query current file\");\r\n        Serial.println(\" q - Query status\");\r\n        Serial.println(\" x - Query folder count\");\r\n        Serial.println(\" t - Query total file count\");\r\n        Serial.println(\" r - Reset\");\r\n        Serial.println(\" e - Sleep\");\r\n        Serial.println(\" w - Wake up\");\r\n        break;\r\n\r\n    case 'P':\r\n        Serial.println(\"Play\");\r\n        mp3.play(nval);\r\n        break;\r\n\r\n    case 'F':\r\n        Serial.println(\"Play Folder\");\r\n        mp3.playF(nval);\r\n        break;\r\n\r\n    case 'S':\r\n        Serial.println(\"Play loop\");\r\n        mp3.playSL(nval);\r\n        break;\r\n\r\n    case 'V':\r\n        Serial.println(\"Play file at 30 volume\");\r\n        mp3.play(nval,30);\r\n        break;\r\n\r\n\r\n    case 'p':\r\n        Serial.println(\"Play\");\r\n        mp3.play();\r\n        break;\r\n\r\n    case 'a':\r\n        Serial.println(\"Pause\");\r\n        mp3.pause();\r\n        break;\r\n\r\n    case 's':\r\n        Serial.println(\"Stop\");\r\n        mp3.stop();\r\n        break;\r\n\r\n    case '&gt;':\r\n        Serial.println(\"Next\");\r\n        mp3.playNext();\r\n        break;\r\n\r\n    case '&lt;':\r\n        Serial.println(\"Previous\");\r\n        mp3.playPrevious();\r\n        break;\r\n\r\n    case '+':\r\n        Serial.println(\"Volume UP\");\r\n        mp3.volUp();\r\n        break;\r\n\r\n    case '-':\r\n        Serial.println(\"Volume Down\");\r\n        mp3.volDown();\r\n        break;\r\n\r\n    case 'v':\r\n        Serial.println(\"Set to Volume\");\r\n          mp3.setVol(nval);\r\n          mp3.qVol();\r\n        break;\r\n\r\n    case 'c':\r\n        Serial.println(\"Query current file\");\r\n        mp3.qPlaying();\r\n        break;\r\n\r\n    case 'q':\r\n        Serial.println(\"Query status\");\r\n        mp3.qStatus();\r\n        break;\r\n\r\n    case 'x':\r\n        Serial.println(\"Query folder count\");\r\n        mp3.qTFolders();\r\n        break;\r\n\r\n    case 't':\r\n        Serial.println(\"Query total file count\");\r\n        mp3.qTTracks();\r\n        break;\r\n\r\n    case 'r':\r\n        Serial.println(\"Reset\");\r\n        mp3.reset();\r\n        break;\r\n\r\n    case 'e':\r\n        Serial.println(\"Sleep\");\r\n        mp3.sleep();\r\n        break;\r\n\r\n    case 'w':\r\n        Serial.println(\"Wake up\");\r\n        mp3.wakeup();\r\n        break;\r\n  }\r\n}\r\n\r\nvoid decode_c(){\r\n  \/\/ Decode c looking for a specific command or a digit\r\n\r\n  \/\/ if c is a 'v', 'P', 'F', 'S' or 'V' wait for the number XX\r\n  if (c=='v' || c=='P' || c=='F' || c=='S' || c=='V'){\r\n    cmd=c;\r\n  }else{\r\n    \/\/ maybe c is part of XX number\r\n    if(c&gt;='0' &amp;&amp; c&lt;='9'){\r\n      \/\/ if c is a digit\r\n      if(cmd1==' '){\r\n        \/\/ if cmd1 is empty then c is the first digit\r\n        cmd1 = c;\r\n      }else{\r\n        \/\/ if cmd1 is not empty c is the second digit\r\n        menu(cmd, ((cmd1-'0')*10)+(c-'0'));\r\n        cmd = ' ';\r\n        cmd1 = ' ';\r\n      }\r\n    }else{\r\n      \/\/ c is not a digit nor 'v', 'P', 'F' or 'S' so just call menu(c, nval);\r\n      menu(c, 0);\r\n    }\r\n  }\r\n}<\/pre>\r\n<\/div>\r\n<p>&nbsp;<\/p>\n\n<h2 class=\"wp-block-heading\">Connection to Arduino and Co<\/h2>\n\n<p>It couldn&#8217;t be easier: GND to GND, VCC to 5V or 3.3V, RX to TX and TX to RX. RX and TX are set as PIN 10 and PIN 11 in the example sketch via SoftwareSerial. <a id=\"Ardu_YX5300_MP3_Player\"><\/a><\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_Plan.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"363\" height=\"481\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_Plan.jpg\" alt=\"YX5300 MP3 Player attached to Arduino\" class=\"wp-image-1040\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_Plan.jpg 363w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_Plan-226x300.jpg 226w\" sizes=\"auto, (max-width: 363px) 100vw, 363px\" \/><\/a><figcaption class=\"wp-element-caption\">YX5300 MP3 Player attached to Arduino<\/figcaption><\/figure>\n<\/div>\n<h2 class=\"wp-block-heading\">Smartphone control for the MP3 player YX5300<\/h2>\n\n<h3 class=\"wp-block-heading\">Alternative control of the YX5300<\/h3>\n<p>Being able to control the MP3 player YX5300 via the serial monitor is already a first success experience, but in the long run you probably want to work independently of the PC. In essence, I can think of three alternatives:<\/p>\n<ul>\n<li>Install a button for each function, if necessary in conjunction with a small membrane switch keyboard.<\/li>\n<li>Use a touch display, available for &lt; \u20ac20 on Amazon<\/li>\n<li>Smartphone control via Bluetooth<\/li>\n<\/ul>\n<p>Since I find the smartphone variant particularly exciting, I will go into this in more detail.\u00a0<\/p>\n\n<h3 class=\"wp-block-heading\">The functionality of the smartphone app<\/h3>\n\n<p>I have developed a small app (&#8220;Ardu YX5300 MP3 Player&#8221;) that has implemented the most important functions for the player. You can also easily expand the app and add more features. As a special feature, I added a voice control (&#8220;Talk2Me&#8221; button).\u00a0<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/ArduYX5300MP3PlayerApp-498x1024.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"498\" height=\"1024\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/ArduYX5300MP3PlayerApp-498x1024.webp\" alt=\"\" class=\"wp-image-19588\" style=\"width:125px;height:256px\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/ArduYX5300MP3PlayerApp-498x1024.webp 498w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/ArduYX5300MP3PlayerApp-146x300.webp 146w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/ArduYX5300MP3PlayerApp.webp 500w\" sizes=\"auto, (max-width: 498px) 100vw, 498px\" \/><\/a><figcaption class=\"wp-element-caption\">The surface of the smartphone app<\/figcaption><\/figure>\n<\/div>\n<p>The &#8220;Continuous&#8221; Check Box switches from single song mode to folder mode or back. Unfortunately, this is interrupting of the current song.\u00a0<\/p>\n\n<p>What exactly the app does in the background and how you can develop something like this without special knowledge in the app programming, I explain below.\u00a0<\/p>\n\n<h3 class=\"wp-block-heading\">Setup of the Arduino side<\/h3>\n\n<p>First, however, let&#8217;s have a look into the Arduino side. We add Bluetooth capabilities to the Arduino with an HC-05 or HC-06 module. How to deal with these modules I have described <a href=\"https:\/\/wolles-elektronikkiste.de\/en\/hc-05-and-hc-06-bluetooth-modules\" target=\"_blank\" rel=\"noopener noreferrer\">here.<\/a> The Bluetooth module communicates with the Arduino via a SoftwareSerial connection. In my sketch (below) I defined pin 5 and 6 as RX or TX. I used a small active loudspeaker. On the breadboard, it looks like this:<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Breadboard_Schaltung-1024x768.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Breadboard_Schaltung-1024x768.webp\" alt=\"\" class=\"wp-image-19590\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Breadboard_Schaltung-1024x768.webp 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Breadboard_Schaltung-300x225.webp 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Breadboard_Schaltung-768x576.webp 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Breadboard_Schaltung-1320x990.webp 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Breadboard_Schaltung.webp 1360w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n<p>To make the MP3 player independent of the PC, I replaced the Arduino Uno with a Pro Mini, put it in a case, switched to battery operation and added a control LED for the power supply. The battery power supply is external and is plugged in via a socket. How to program a Pro Mini I have described <a href=\"https:\/\/wolles-elektronikkiste.de\/en\/programming-the-arduino-pro-mini\" target=\"_blank\" rel=\"noopener noreferrer\">here.<\/a> The circuit looks like this:\u00a0<\/p>\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_BT_Plan_bearb.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"564\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_BT_Plan_bearb.jpg\" alt=\"Circuit for the smartphone-controlled MP3 player\" class=\"wp-image-1051\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_BT_Plan_bearb.jpg 800w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_BT_Plan_bearb-300x212.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_BT_Plan_bearb-768x541.jpg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/figure>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/MP3_Player_offen_und_zu-1024x387.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"387\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/MP3_Player_offen_und_zu-1024x387.webp\" alt=\"\" class=\"wp-image-19592\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/MP3_Player_offen_und_zu-1024x387.webp 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/MP3_Player_offen_und_zu-300x113.webp 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/MP3_Player_offen_und_zu-768x290.webp 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/MP3_Player_offen_und_zu-1536x580.webp 1536w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/MP3_Player_offen_und_zu-1320x498.webp 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/MP3_Player_offen_und_zu.webp 1666w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Here&#8217;s what the full project looks like<\/figcaption><\/figure>\n\n<h3 class=\"wp-block-heading\">Preparation &#8211; Adaptation of the sketch <\/h3>\n\n<p>For the sketch, I take the BasicCommand sketch as the basis and use its &#8220;infrastructure&#8221;. I renamed it Ardu_YX5300_MP3_player.ino. You find the sketch below. <\/p>\r\n<p>The connection to the Bluetooth module is defined in line 40:<\/p>\r\n<p><code>SoftwareSerial BT_Module(5,6);<\/code><\/p>\r\n<p><span style=\"display: inline !important; float: none; background-color: #ffffff; color: #191e23; cursor: text; font-family: 'Noto Serif'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;\">In the loop function, rows 74-76 check whether there is data for retrieval:<\/span><\/p>\r\n<p><span style=\"display: inline !important; float: none; background-color: #ffffff; color: #191e23; cursor: text; font-family: 'Noto Serif'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;\"> <code>if(BT_Module.available()){ decode_BT(); }<\/code>. <\/span><\/p>\n\n<p>The new function &#8220;decode_BT&#8221; in lines 206 &#8211; 216 evaluates the commands received so that the menu function understands them. The first character is expected to be &#8220;BT_START_CMD_CHAR&#8221; and is defined as &#8220;*&#8221; at the beginning of the sketch.\u00a0<\/p>\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-title=\"decode_BT Funktion\" data-enlighter-group=\"decode_BT Funktion\">void\u00a0decode_BT(){\r\n\u00a0\u00a0char\u00a0cmdType\u00a0=\u00a0'\u00a0';\r\n\u00a0\u00a0int\u00a0value\u00a0=\u00a00;\r\n\u00a0\u00a0char\u00a0getChar\u00a0=\u00a0'\u00a0';\u00a0\u00a0\/\/read\u00a0serial\r\n\u00a0\u00a0if(BT_Module.find(BT_START_CMD_CHAR)){\r\n\u00a0\u00a0\u00a0\u00a0while(BT_Module.available()&lt;1);\r\n\u00a0\u00a0\u00a0\u00a0cmdType\u00a0=\u00a0BT_Module.read();\u00a0\/\/\u00a0read\u00a0the\u00a0command\r\n\u00a0\u00a0\u00a0\u00a0value\u00a0=\u00a0BT_Module.parseInt();\r\n\u00a0\u00a0}\r\n\u00a0\u00a0menu(cmdType,value);\u00a0\r\n}\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/pre>\n\n<p>Here&#8217;s what the full sketch looks like:<\/p>\n\n<div class=\"scroll-paragraph-long\">\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-title=\"Ardu_YX5300_MP3_Player.ino\" data-enlighter-group=\"Ardu_YX5300_MP3_Player.ino\">\/******************************************************************************\r\n  Salavdor Rueda's Basic Commands examples for the SerialMP3Player YX5300 chip.\r\n\r\n  Modified by Wolfgang Ewald in order to communicate with a smartphone app. \r\n\r\n    GND \u2192 GND\r\n    VCC \u2192 5V\r\n    YX 5300 TX \u2192 pin 10\r\n    YX 5300 RX \u2192 pin 11\r\n    BT Modul TX \u2192 pin 5\r\n    BT Modul RX \u2192 pin 6\r\n\r\n  After compile and upload the code,\r\n  you can test some basic commands by sending the letters\r\n  ? - Display Menu options.\r\n  P01 - Play 01 file\r\n  F01 - Play 01 folder\r\n  S01 - Play 01 file in loop\r\n  p - play\r\n  a - pause\r\n  s - stop\r\n  &gt; - Next\r\n  &lt; - Previous\r\n  ...\r\n\r\n  Original:\r\n  \"This example code is in the public domain.\r\n  https:\/\/github.com\/salvadorrueda\/ArduinoSerialMP3Player\r\n  by Salvador Rueda\"\r\n  \r\n *******************************************************************************\/\r\n\r\n#include \"SerialMP3Player.h\"\r\n#define TX 11\r\n#define RX 10\r\n#define BT_START_CMD_CHAR '*'\r\nint statusLEDPin = 4;\r\n\r\nSerialMP3Player mp3(RX,TX);\r\nSoftwareSerial BT_Module(5,6);\r\n\r\nvoid setup() {\r\n  mp3.showDebug(0);       \/\/ print what we are sending to the mp3 board. 1= active\r\n  Serial.begin(9600);     \/\/ start serial interface\r\n  mp3.begin(9600);        \/\/ start mp3-communication\r\n  BT_Module.begin(9600);   \/\/ start serial connection to BT Modul\r\n  delay(500);             \/\/ wait for init\r\n  pinMode(statusLEDPin, OUTPUT);\r\n  digitalWrite(statusLEDPin, HIGH);\r\n\r\n  mp3.sendCommand(CMD_SEL_DEV, 0, 2);   \/\/select sd-card\r\n  mp3.setVol(15); \r\n  mp3.playF(1);  \/\/ Folder 1, cycle play\r\n  delay(500);    \/\/ wait for init\r\n\r\n  menu('?',0); \/\/ print the menu options.\r\n}\r\n\r\n char c;  \/\/ char from Serial\r\n char cmd=' ';\r\n char cmd1=' ';\r\n\r\n\r\n\/\/ the loop function runs over and over again forever\r\nvoid loop() {\r\n  if (Serial.available()){\r\n    c = Serial.read();\r\n    decode_c(); \/\/ Decode c.\r\n  }\r\n  \/\/ Check for the answer.\r\n\/\/  if (mp3.available()){\r\n\/\/    Serial.println(mp3.decodeMP3Answer()); \/\/ print decoded answers from mp3\r\n\/\/  }\r\n  if(BT_Module.available()){\r\n    decode_BT();\r\n  }\r\n}\r\n\r\nvoid menu(char op, int nval){\r\n  \/\/ Menu\r\n  switch (op){\r\n    case '?':\r\n    case 'h':\r\n        Serial.println(\"SerialMP3Player Basic Commands:\");\r\n        Serial.println(\" ? - Display Menu options. \");\r\n        Serial.println(\" P01 - Play 01 file\");\r\n        Serial.println(\" F01 - Play 01 folder\");\r\n        Serial.println(\" S01 - Play 01 file in loop\");\r\n        Serial.println(\" V01 - Play 01 file, volume 30\");\r\n        Serial.println(\" p - Play\");\r\n        Serial.println(\" a - pause\");\r\n        Serial.println(\" s - stop \");\r\n        Serial.println(\" &gt; - Next\");\r\n        Serial.println(\" &lt; - Previous\");\r\n        Serial.println(\" + - Volume UP\");\r\n        Serial.println(\" - - Volume DOWN\");\r\n        Serial.println(\" v15 - Set Volume to 15\");\r\n        Serial.println(\" c - Query current file\");\r\n        Serial.println(\" q - Query status\");\r\n        Serial.println(\" x - Query folder count\");\r\n        Serial.println(\" t - Query total file count\");\r\n        Serial.println(\" r - Reset\");\r\n        Serial.println(\" e - Sleep\");\r\n        Serial.println(\" w - Wake up\");\r\n        break;\r\n\r\n    case 'P':\r\n        Serial.println(\"Play\");\r\n        mp3.play(nval);\r\n        break;\r\n\r\n    case 'F':\r\n        Serial.println(\"Play Folder\");\r\n        mp3.playF(nval);\r\n        break;\r\n\r\n    case 'S':\r\n        Serial.println(\"Play loop\");\r\n        mp3.playSL(nval);\r\n        break;\r\n\r\n    case 'V':\r\n        Serial.println(\"Play file at 30 volume\");\r\n        mp3.play(nval,30);\r\n        break;\r\n\r\n\r\n    case 'p':\r\n        Serial.println(\"Play\");\r\n        mp3.play();\r\n        break;\r\n\r\n    case 'a':\r\n        Serial.println(\"Pause\");\r\n        mp3.pause();\r\n        break;\r\n\r\n    case 's':\r\n        Serial.println(\"Stop\");\r\n        mp3.stop();\r\n        break;\r\n\r\n    case '&gt;':\r\n        Serial.println(\"Next\");\r\n        mp3.playNext();\r\n        break;\r\n\r\n    case '&lt;':\r\n        Serial.println(\"Previous\");\r\n        mp3.playPrevious();\r\n        break;\r\n\r\n    case '+':\r\n        Serial.println(\"Volume UP\");\r\n        mp3.volUp();\r\n        break;\r\n\r\n    case '-':\r\n        Serial.println(\"Volume Down\");\r\n        mp3.volDown();\r\n        break;\r\n\r\n    case 'v':\r\n        Serial.println(\"Set to Volume\");\r\n          mp3.setVol(nval);\r\n          \/\/mp3.qVol();\r\n        break;\r\n\r\n    case 'c':\r\n        Serial.println(\"Query current file\");\r\n        mp3.qPlaying();\r\n        break;\r\n\r\n    case 'q':\r\n        Serial.println(\"Query status\");\r\n        mp3.qStatus();\r\n        break;\r\n\r\n    case 'x':\r\n        Serial.println(\"Query folder count\");\r\n        mp3.qTFolders();\r\n        break;\r\n\r\n    case 't':\r\n        Serial.println(\"Query total file count\");\r\n        mp3.qTTracks();\r\n        break;\r\n\r\n    case 'r':\r\n        Serial.println(\"Reset\");\r\n        mp3.reset();\r\n        break;\r\n\r\n    case 'e':\r\n        Serial.println(\"Sleep\");\r\n        mp3.sleep();\r\n        break;\r\n\r\n    case 'w':\r\n        Serial.println(\"Wake up\");\r\n        mp3.wakeup();\r\n        break;\r\n  }\r\n}\r\n\r\nvoid decode_BT(){\r\n  char cmdType = ' ';\r\n  int value = 0;\r\n  char getChar = ' ';  \/\/read serial\r\n  if(BT_Module.find(BT_START_CMD_CHAR)){\r\n    while(BT_Module.available()&lt;1);\r\n    cmdType = BT_Module.read(); \/\/ read the command\r\n    value = BT_Module.parseInt();\r\n  }\r\n    menu(cmdType,value); \r\n}      \r\n\r\nvoid decode_c(){\r\n  \/\/ Decode c looking for a specific command or a digit\r\n\r\n  \/\/ if c is a 'v', 'P', 'F', 'S' or 'V' wait for the number XX\r\n  if (c=='v' || c=='P' || c=='F' || c=='S' || c=='V'){\r\n    cmd=c;\r\n  }else{\r\n    \/\/ maybe c is part of XX number\r\n    if(c&gt;='0' &amp;&amp; c&lt;='9'){\r\n      \/\/ if c is a digit\r\n      if(cmd1==' '){\r\n        \/\/ if cmd1 is empty then c is the first digit\r\n        cmd1 = c;\r\n      }else{\r\n        \/\/ if cmd1 is not empty c is the second digit\r\n        menu(cmd, ((cmd1-'0')*10)+(c-'0'));\r\n        cmd = ' ';\r\n        cmd1 = ' ';\r\n      }\r\n    }else{\r\n      \/\/ c is not a digit nor 'v', 'P', 'F' or 'S' so just call menu(c, nval);\r\n      menu(c, 0);\r\n    }\r\n  }\r\n}\r\n<\/pre>\r\n<\/div>\r\n<p>&nbsp;<\/p>\n\n<p>An adjustment has to be made in the library in SerialMP3Player.cpp, but nothing complicated. The library requires a time span of one second between two statements. This causes problems with the volume slider in the app, because each small move immediately triggers a corresponding instruction. That means, moving the slider from e.g. volume level 10 to 20 would take 10 seconds. All you have to do is comment line 185 (the delay command) in SerialMP3Player.cpp and that&#8217;s it. \u00a0<\/p>\n\n<p>Before connecting to the smartphone, you can test the whole thing by sending the instructions from the smartphone via a terminal app such as Bluetooth Terminal. The app is available <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=Qwerty.BluetoothTerminal&amp;hl=de\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a> on Google Play. For example, a &#8220;*F*1&#8221; should play all songs in directory 01.\u00a0<\/p>\n\n<h3 class=\"wp-block-heading\">Development of the smartphone app<\/h3>\n\n<p>If you have read my last post <a href=\"https:\/\/wolles-elektronikkiste.de\/en\/controlling-arduino-boards-with-your-smartphone\" target=\"_blank\" rel=\"noopener noreferrer\">Controlling Arduino with your smartphone,<\/a> you can rush through the following explanations.\u00a0<\/p>\n\n<p>Actually, learning to develop smartphone apps is quite time-consuming. If you really want to deep-dive into this topic, you should learn Java and deal with development environments like Eclipse or Android Studio. The good news is that there is a simple alternative that is completely sufficient for our purposes and that is called MIT App Inventor. If you follow this <a href=\"http:\/\/appinventor.mit.edu\/explore\/\">link,<\/a> you will get a lot of information about who is behind this project, how it works, which tutorials tare available (highly recommended as an introduction) and much more. A step-by-step guide would go beyond the scope of this post, but I will try to convey the essential points to you.\u00a0<\/p>\n\n<h4 class=\"wp-block-heading\">How does MIT App Inventor work?<\/h4>\n\n<p>First of all, MIT App Inventor is an online solution, i.e. no program installation is required on your PC. One does not write a single program line during app development, but constructs program blocks visually from prefabricated individual parts. If you&#8217;ve ever worked with <a href=\"https:\/\/scratch.mit.edu\/\" target=\"_blank\" rel=\"noopener noreferrer\">Scratch,<\/a> you&#8217;ll find yourself here quickly.<\/p>\r\n<p>What is particularly cool is that you can follow the creation of your apps in real time on your smartphone. This applies to both design and functionality. It is not necessary to compile code in between and beam apk files to the smartphone. You don&#8217;t do that until you&#8217;re satisfied with your result and the app is supposed to run independently of the development environment.<\/p>\r\n<p>To connect the smartphone to MIT App Inventor, you must first install the <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=edu.mit.appinventor.aicompanion3&amp;hl=en_US\" target=\"_blank\" rel=\"noopener noreferrer\">APP MIT AI2 Companion.<\/a> MIT App Inventor then provides a number or QR code for the connection. Very convenient! I had some problems with Edge, but Chrome did a wonderful job. \u00a0<\/p>\r\n<p>Following this <a href=\"http:\/\/ai2.appinventor.mit.edu\/\" target=\"_blank\" rel=\"noopener noreferrer\">link<\/a> you will get to the development environment (log on with your Google account).\u00a0<\/p>\n\n<h4 class=\"wp-block-heading\">The Designer screen<\/h4>\n\n<p>As already mentioned, I can&#8217;t provide step-by-step instructions here, but only explain the concept because it would be too big. The app development takes place in two basic steps, first the design development and then the definition of the functions behind it. For this purpose there are two screens between which you can switch, namely &#8220;Designer&#8221; and &#8220;Blocks&#8221;. The designer screen for the Ardu_YX5300_MP3_Player app looks like this:\u00a0<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Appinventor_Designer-1024x777.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"777\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Appinventor_Designer-1024x777.webp\" alt=\"\" class=\"wp-image-19594\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Appinventor_Designer-1024x777.webp 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Appinventor_Designer-300x228.webp 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Appinventor_Designer-768x583.webp 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Appinventor_Designer-1320x1002.webp 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Appinventor_Designer.webp 1378w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">The Designer screen &#8211; selection of components and arrangement<\/figcaption><\/figure>\n\n<p>On the left side you see the menu for the different elements that can be inserted. In the submenu &#8220;User Interface&#8221; you find buttons, checkboxes, sliders, etc. Under &#8220;Layout&#8221; there are elements such as horizontal and vertical arrangements, which serve to keep defined spaces between the elements. As expected, the Bluetooth function can be found under connectivity. Just take a look.\u00a0<\/p>\r\n<p>The Components window reflects the structure of the components. Here you can also rename components, which is absolutely advisable so as not to lose track. For example, &#8220;Playbutton&#8221; is a more helpful term than the pre-set &#8220;Button1&#8221;.\u00a0<\/p>\r\n<p>In the &#8220;Properties&#8221; window you can define the properties of the components, e.g. shape, color or which values are displayed for the sliders. For example, for the Volume Slider, I specified a range from 0 to 30 because that&#8217;s the allowed range for the YX5300. \u00a0<\/p>\n\n<h4 class=\"wp-block-heading\">The Blocks screen<\/h4>\n\n<p>The components assembled in the Designer screen can&#8217;t do anything at first. What they trigger and under what conditions or how they should change is specified in the Blocks screen:\u00a0<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Appinventor_Blocks-1024x776.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"776\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Appinventor_Blocks-1024x776.webp\" alt=\"\" class=\"wp-image-19596\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Appinventor_Blocks-1024x776.webp 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Appinventor_Blocks-300x227.webp 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Appinventor_Blocks-768x582.webp 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Appinventor_Blocks-1320x1001.webp 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Appinventor_Blocks.webp 1377w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">The Blocks screen &#8211; function of the components<\/figcaption><\/figure>\n\n<p>In the &#8220;Blocks&#8221; window, you can click on one of the components to get a selection of different blocks to choose from. The selected block will be transferred into the viewer window where it can be moved freely. For example, because a slider can only do certain things, only the corresponding blocks are suggested. This allows you to work quite intuitively and quickly. In addition, under &#8220;Built-In&#8221; there are general blocks e.g. for text, if-then-else constructs and much more.\u00a0<\/p>\r\n<p>Another help is that the blocks are shaped like puzzle pieces. As a result, only certain components fit together and everything must be completed. This avoids syntax errors, but you have to pay attention to the logic errors yourself.\u00a0<\/p>\n\n<h4 class=\"wp-block-heading\">Save and install the app<\/h4>\n\n<p>Finally, you can generate an apk file under the menu item &#8220;Build&#8221;, which can be conveniently transferred to the smartphone via a QR code. \u00a0<\/p>\r\n<p>The project is saved online. You can also export it as a .aia file, save it to your PC, share it with others, and then import it again. You can download the &#8220;.aia&#8221; file for the Ardu_YX5300_MP3_Player app presented <a href=\"https:\/\/github.com\/wollewald\/BlogStuff\/blob\/main\/YX5300\/Ardu_YX5300_MP3_Player.aia\" target=\"_blank\" rel=\"noopener\">here<\/a> (click on the link and then on the download symbol on the right side) and customize it as you wish. Alternatively, you can find the project in the gallery of MIT App Inventor if you follow this <a href=\"https:\/\/gallery.appinventor.mit.edu\/?galleryid=6087293543251968\" target=\"_blank\" rel=\"noopener noreferrer\">Link<\/a>. <a id=\"Probleme\"><\/a><\/p>\n\n<h2 class=\"wp-block-heading\">Problems with the SD card?<\/h2>\n\n<p>The SD card is not working? I experienced this problem and it took me quite some time to figure out why it happened. If the player does not want to play even though the audio format is correct, the directory structure has been created as required, the wiring is correct, etc., then it may be because of the partitioning of the card. An SD card can have a small boot partition ex works or if it was previously used for other purposes.\u00a0 Accordingly, there are two drives in File Explorer:\u00a0<\/p>\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"514\" height=\"72\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/SD_Karte_mit_Boot_sektor.jpg\" alt=\"\" class=\"wp-image-1082\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/SD_Karte_mit_Boot_sektor.jpg 514w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/SD_Karte_mit_Boot_sektor-300x42.jpg 300w\" sizes=\"auto, (max-width: 514px) 100vw, 514px\" \/><figcaption class=\"wp-element-caption\">SD card with boot sector<\/figcaption><\/figure>\n\n<p>Right-clicking and formatting is useless, as the partitions are preserved. When the problem occurred to me, I solved it with the small tool called SD Card Formatter, which is available <a href=\"https:\/\/www.heise.de\/download\/product\/sd-formatter-74314\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>, for example. After installation, select the small boot partition (it doesn&#8217;t necessarily need to be called &#8220;boot&#8221;) and activate the &#8220;Overwrite Format&#8221; formatting option. The process takes several minutes. After that you only have one partition and everything works wonderfully. <a id=\"Alternative\"><\/a><\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/SD_Card_Formatter.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"391\" height=\"429\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/SD_Card_Formatter.jpg\" alt=\"SD Card Formatter\" class=\"wp-image-1083\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/SD_Card_Formatter.jpg 391w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/SD_Card_Formatter-273x300.jpg 273w\" sizes=\"auto, (max-width: 391px) 100vw, 391px\" \/><\/a><figcaption class=\"wp-element-caption\">SD Card Formatter <\/figcaption><\/figure>\n<\/div>\n<h2 class=\"wp-block-heading\">Alternative MP3 modules<\/h2>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Alternativen-1024x544.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"544\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Alternativen-1024x544.webp\" alt=\"\" class=\"wp-image-19598\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Alternativen-1024x544.webp 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Alternativen-300x159.webp 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Alternativen-768x408.webp 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Alternativen-1320x701.webp 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/Alternativen.webp 1500w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Alternatives to the MP3 player YX5300<\/figcaption><\/figure>\n\n<p>There are a number of alternatives to the YX5300 MP3 player. You will come across these, e.g. if you search for &#8220;MP3 module Arduino&#8221; on Amazon. I tried the WTV020M01 module (top right of the photo) and the no-name player on the left side of the photo.\u00a0<\/p>\r\n<p>I would very much advise against the WTV020M01, because this device is very tricky in terms of the file format and the details of the audio recording. For example, the level and noise must meet certain specifications. If you still want to do this, there is a very compact instruction available <a href=\"https:\/\/www.mikrocontroller.net\/topic\/345527#4414156\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>. \u00a0<\/p>\r\n<p>In a separate post I explained the details of the DFPlayer Mini (<a href=\"https:\/\/wolles-elektronikkiste.de\/en\/arduino-controlled-dfplayer-mini\">here<\/a>). In terms of control, it is very similar to the YX5300. The main advantages are the small size and that it can be operated very easily with buttons. The jack for the headphones is an advantage of the MP3 player YX5300.<\/p>\n\n<p>The no-name modulet works perfectly, but apparently can only be operated manually. At least I haven&#8217;t found a way to communicate with it via software. However, since it starts immediately when it is supplied with power, you could attach an arduino-controlled on\/off switch.\u00a0<\/p>\r\n<p>I haven&#8217;t tried (at least so far) modules based on the VS1053 chip. These are available in various designs, e.g. as shields, with or without SD card slot, with or without microphone, etc. This may also find its way on my to-do list.\u00a0<\/p>\r\n<p>Anyone who has had good or bad experiences with these or other alternative modules is welcome to share it as a comment. \u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Control your YX5300 MP3 player with the SerialMP3Player library. And: how to (voice-) control the MP3 player with the smartphone. Also: SD card problems?<\/p>\n","protected":false},"author":1,"featured_media":7921,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[568,576,548],"tags":[556,615,638,637,639,623,628,633,631,619,626],"class_list":["post-9027","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bluetooth-en","category-sound-en","category-wireless","tag-arduino-en-2","tag-control-with-smartphone","tag-control-yx5300-with-arduino","tag-mit-app-inventor-en-2","tag-mp3-module","tag-mp3-player-en-2","tag-sd-card-does-not-work-en","tag-serial-mp3-player-en-2","tag-serialmp3player-en-2","tag-voice-control","tag-yx5300-en-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>MP3-player YX5300 &#8226; Wolles Elektronikkiste<\/title>\n<meta name=\"description\" content=\"Control your YX5300 MP3 player with the SerialMP3Player library. And: how to (voice-) control the MP3 player with the smartphone (voice). Also: SD card problems?\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MP3-player YX5300 &#8226; Wolles Elektronikkiste\" \/>\n<meta property=\"og:description\" content=\"Control your YX5300 MP3 player with the SerialMP3Player library. And: how to (voice-) control the MP3 player with the smartphone (voice). Also: SD card problems?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300\" \/>\n<meta property=\"og:site_name\" content=\"Wolles Elektronikkiste\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-17T12:50:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-03T15:32:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_Beitragsbild.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"766\" \/>\n\t<meta property=\"og:image:height\" content=\"766\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Wolfgang Ewald\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Wolfgang Ewald\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"19 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mp3-player-yx5300#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mp3-player-yx5300\"},\"author\":{\"name\":\"Wolfgang Ewald\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"headline\":\"MP3-player YX5300\",\"datePublished\":\"2020-10-17T12:50:38+00:00\",\"dateModified\":\"2023-12-03T15:32:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mp3-player-yx5300\"},\"wordCount\":2416,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"image\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mp3-player-yx5300#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/YX5300_Beitragsbild.jpg\",\"keywords\":[\"Arduino\",\"control with smartphone\",\"Control YX5300 with Arduino\",\"MIT App Inventor\",\"MP3 module\",\"MP3 player\",\"SD card does not work\",\"Serial MP3 Player\",\"SerialMP3Player\",\"voice control\",\"YX5300\"],\"articleSection\":[\"Bluetooth\",\"Sound\",\"Wireless\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mp3-player-yx5300#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mp3-player-yx5300\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mp3-player-yx5300\",\"name\":\"MP3-player YX5300 &#8226; Wolles Elektronikkiste\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mp3-player-yx5300#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mp3-player-yx5300#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/YX5300_Beitragsbild.jpg\",\"datePublished\":\"2020-10-17T12:50:38+00:00\",\"dateModified\":\"2023-12-03T15:32:22+00:00\",\"description\":\"Control your YX5300 MP3 player with the SerialMP3Player library. And: how to (voice-) control the MP3 player with the smartphone (voice). Also: SD card problems?\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mp3-player-yx5300#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mp3-player-yx5300\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mp3-player-yx5300#primaryimage\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/YX5300_Beitragsbild.jpg\",\"contentUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/YX5300_Beitragsbild.jpg\",\"width\":766,\"height\":766,\"caption\":\"YX5300 Beitragsbild\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mp3-player-yx5300#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Startseite\",\"item\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MP3-player YX5300\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#website\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\",\"name\":\"Wolles Elektronikkiste\",\"description\":\"Die wunderbare Welt der Elektronik\",\"publisher\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\",\"name\":\"Wolfgang Ewald\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"contentUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"width\":512,\"height\":512,\"caption\":\"Wolfgang Ewald\"},\"logo\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MP3-player YX5300 &#8226; Wolles Elektronikkiste","description":"Control your YX5300 MP3 player with the SerialMP3Player library. And: how to (voice-) control the MP3 player with the smartphone (voice). Also: SD card problems?","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300","og_locale":"en_US","og_type":"article","og_title":"MP3-player YX5300 &#8226; Wolles Elektronikkiste","og_description":"Control your YX5300 MP3 player with the SerialMP3Player library. And: how to (voice-) control the MP3 player with the smartphone (voice). Also: SD card problems?","og_url":"https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300","og_site_name":"Wolles Elektronikkiste","article_published_time":"2020-10-17T12:50:38+00:00","article_modified_time":"2023-12-03T15:32:22+00:00","og_image":[{"width":766,"height":766,"url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_Beitragsbild.jpg","type":"image\/jpeg"}],"author":"Wolfgang Ewald","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Wolfgang Ewald","Est. reading time":"19 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300#article","isPartOf":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300"},"author":{"name":"Wolfgang Ewald","@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"headline":"MP3-player YX5300","datePublished":"2020-10-17T12:50:38+00:00","dateModified":"2023-12-03T15:32:22+00:00","mainEntityOfPage":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300"},"wordCount":2416,"commentCount":4,"publisher":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"image":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300#primaryimage"},"thumbnailUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_Beitragsbild.jpg","keywords":["Arduino","control with smartphone","Control YX5300 with Arduino","MIT App Inventor","MP3 module","MP3 player","SD card does not work","Serial MP3 Player","SerialMP3Player","voice control","YX5300"],"articleSection":["Bluetooth","Sound","Wireless"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300","url":"https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300","name":"MP3-player YX5300 &#8226; Wolles Elektronikkiste","isPartOf":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#website"},"primaryImageOfPage":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300#primaryimage"},"image":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300#primaryimage"},"thumbnailUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_Beitragsbild.jpg","datePublished":"2020-10-17T12:50:38+00:00","dateModified":"2023-12-03T15:32:22+00:00","description":"Control your YX5300 MP3 player with the SerialMP3Player library. And: how to (voice-) control the MP3 player with the smartphone (voice). Also: SD card problems?","breadcrumb":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300#primaryimage","url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_Beitragsbild.jpg","contentUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/04\/YX5300_Beitragsbild.jpg","width":766,"height":766,"caption":"YX5300 Beitragsbild"},{"@type":"BreadcrumbList","@id":"https:\/\/wolles-elektronikkiste.de\/en\/mp3-player-yx5300#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Startseite","item":"https:\/\/wolles-elektronikkiste.de\/en"},{"@type":"ListItem","position":2,"name":"MP3-player YX5300"}]},{"@type":"WebSite","@id":"https:\/\/wolles-elektronikkiste.de\/en#website","url":"https:\/\/wolles-elektronikkiste.de\/en","name":"Wolles Elektronikkiste","description":"Die wunderbare Welt der Elektronik","publisher":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wolles-elektronikkiste.de\/en?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46","name":"Wolfgang Ewald","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","contentUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","width":512,"height":512,"caption":"Wolfgang Ewald"},"logo":{"@id":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png"}}]}},"_links":{"self":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts\/9027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/comments?post=9027"}],"version-history":[{"count":0,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts\/9027\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/media\/7921"}],"wp:attachment":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/media?parent=9027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/categories?post=9027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/tags?post=9027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}