Build a MP3 player with DFPlayer and an Arduino

Using the DFPlayer

It is quite easy to build your own MP3 player with an Arduino and a DFPlayer miniDFPlayer module.

You can buy the DFPlayer module on aliexpress or ebay for about 1,5 Euro.

I wanted he player to start playing the music as soon I connected the power on the setup, without pushing any buttons.
For this the DFPlayer has the busy pin. This pin will become HIGH when the player is idle. As soon as the player is playing music the pin will become low.

I used the DFPlayer_Mini_Mp3 control library from github. (see the program code below for the details.)

The code used

/*******************************************************************************
 * DFPlayer_Mini_Mp3, This library provides a quite complete function for      * 
 * DFPlayer mini mp3 module.                                                   *
 * www.github.com/dfrobot/DFPlayer_Mini_Mp3 (github as default source provider)*
 *  DFRobot-A great source for opensource hardware and robot.                  *
 *                                                                             *
 * This file is part of the DFplayer_Mini_Mp3 library.                         *
 *                                                                             *
 * DFPlayer_Mini_Mp3 is free software: you can redistribute it and/or          *
 * modify it under the terms of the GNU Lesser General Public License as       *
 * published by the Free Software Foundation, either version 3 of              *
 * the License, or any later version.                                          *
 *                                                                             *
 * DFPlayer_Mini_Mp3 is distributed in the hope that it will be useful,        *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of              *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               *
 * GNU Lesser General Public License for more details.                         *
 *                                                                             *
 * DFPlayer_Mini_Mp3 is distributed in the hope that it will be useful,        *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of              *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               *
 * GNU Lesser General Public License for more details.                         *
 *                                                                             *
 * You should have received a copy of the GNU Lesser General Public            *
 * License along with DFPlayer_Mini_Mp3. If not, see                           *
 * http://www.gnu.org/licenses/.                                               *
 *									       *
 ******************************************************************************/


#include "DFPlayer_Mini_Mp3.h"


void setup () {
  Serial.begin (9600);
  mp3_set_serial (Serial);	    // set Serial for DFPlayer-mini mp3 module 
  delay(1000);                  // wait 1 sec for mp3 module to set volume
  mp3_set_volume (20);          // value 0~30
  delay(1000);                  // wait 1 sec for mp3 module to set volume
}

void loop () {   
  boolean play_state = digitalRead(8);
  if(play_state == HIGH){
    mp3_next ();
    delay(1000);
  }
  delay(1000);
}

The connections

Below the schematic I used for the connections between the arduino and the DFPlayer.
Connecting the DFPlayer mini