DFPlayer Mini Help with Wrong Stack Error

Greetings! I have been working on a foot pedal that will act like a stomp box mp3 player on stage at our church. I built my first prototype several months back and ironed out all the kinks. Since then, I have been asked to make more by friends and have been having issues with the new ones I am making.
The DFPlayer mini will initialize, but will display the "wrong stack" error as soon as I try to play any files. It will then "Time Out". I have not been able to find anything online to help understand what this error means and what I need to do in order to fix it. I am using an Arduino Nano, DFPlayer mini, and the DFRobotDFPlayerMini library.

The old version works fine. What is different in the new version?

There are many DF Mini libraries out there. I'd switch to a better one like the DFMini_Fast library. Just type in DFMini in your library manager and several will pop up.

The lack of a decoupling cap for the DF Player Mini is a potential issue.

Not having both ground pins connected is another.

A 7-segment display with a single 110 ohm cl resistor (electrically) and a DFPlayer with built-in 3watt amplifier, all powered through the onboard 5volt regulator also sounds like a potential problem.

What is connected to that mini jack output, and what voltage is connected to the DC socket.
Would be easier on the Nano if you power it with a 5volt cellphone charger, connected to the USB socket.
Leo..

Honestly, I have built everything to the same schematic, so I am not sure what the issue is. I am not sure if I had made a subtle change to the code or not between builds, but the dfplayer will work if I connect the ground on it to one of the “play” pins on it. I just can’t seem to get it to work through the arduino.

I guess I don’t understand what a decoupling cap is. What would it look like to add one?

Also, do you mean connecting both grounds on the dfplayer to the arduino?

Sound wise, the audio jack goes through a 1/4inch cable to headphones or a direct box into an xlr cable, and from there to the sound board.

I have been using a 9v power supply. It will turn on the arduino and lights, but for some reason the arduino won’t cause the dfplayer to trigger the file. It will boot up fine, but not play. Instead it gives the “wrong stack” error (in the terminal).

However, if I connect the dfplayer ground pin to the manual “play” button on the dfplayer, the file will start. Does that mean the power is enough from the arduino? It seems to me like it is a communication issue with the arduino and dfplayer.

I will try coding with another library to see if it is a coding issue. Thanks for the tip!

Please post a wiring diagram, not a Fritzing painting and the code.
Read the advice to use code tags for code!
Your information lacks way too much to give You any help.

Sorry. This new plattform tricked me, showing Your very last postings.
Still it stands, use real wiring diagram, not toy Fritzings. In engineering Fritzing does not exist…

Here is my code. I programmed it to have 3 different banks with 12 keys to play in each. 2 foot switches control up and down, and the third controls play and stop.

#include "DFRobotDFPlayerMini.h"
#include "Bounce2.h"
#include "Arduino.h"
#include "SoftwareSerial.h"



SoftwareSerial mySoftwareSerial(10, 11); // RX, TX
DFRobotDFPlayerMini myDFPlayer;
void printDetail(uint8_t type, int value);

//Make sure the SD Card doesn't have hidden files on it! https://www.youtube.com/watch?v=fVWJMdFeUbU


int seg1 = 2;
int seg2 = 3;
int seg3 = 4;
int seg4 = 5;
int seg5 = 9;
int seg6 = 7;
int seg7 = 8;
int segDot = 6;
int led = 12;

float previous = A1;
float next = A2;
float playPause = A3;
int shortBlink = 400;
int jump = 50;
int degrade = 200;


//EXPERIMENT WITH LONGPRESS
long FS1Timer = 0;
long FS2Timer = 0;
long FS3Timer = 0;

boolean startOne = true;
boolean startTwo = false;
boolean startThree = false;
boolean startFour = false;
boolean bankOne = true;
boolean bankTwo = false;
boolean bankThree = false;
boolean bankFour = false;

long longPressFS1Time = 1000;
long longPressFS2Time = 1000;
long longPressFS3Time = 1000;

boolean longPressFS1Active = false;
boolean longPressFS2Active = false;
boolean longPressFS3Active = false;

boolean FS1Active = false;
boolean FS2Active = false;
boolean FS3Active = false;

boolean lcdStompmode = false;  //FS1
boolean lcdSnapshotmode = false; //FS2
boolean lcdLoopermode = false; //FS3
boolean goOut = false;
boolean isPlaying = false;
int i = 1;
int j = 1;
int outOne;
int outTwo;

Bounce button1 = Bounce(previous, 10);
Bounce button2 = Bounce(next, 10);  
Bounce button3 = Bounce(playPause, 10); 





void setup() {
  // put your setup code here, to run once:
  delay(1000);
  
mySoftwareSerial.begin(9600);
Serial.begin(115200);

Serial.println();
  Serial.println(F("DFRobot DFPlayer Mini Demo"));
  Serial.println(F("Initializing DFPlayer ... (May take 3~5 seconds)"));
 
  if (!myDFPlayer.begin(mySoftwareSerial)) {  //Use softwareSerial to communicate with mp3.
    Serial.println(F("Unable to begin:"));
    Serial.println(F("1.Please recheck the connection!"));
    Serial.println(F("2.Please insert the SD card!"));
    while(true);  
  }
  
  Serial.println(F("DFPlayer Mini online."));
myDFPlayer.setTimeOut(500); //Set serial communictaion time out 500ms
  
 myDFPlayer.volume(20); //Set volume value. From 0 to 30
  delay(100);
pinMode(seg1,OUTPUT);
pinMode(seg2,OUTPUT);
pinMode(seg3,OUTPUT);
pinMode(seg4,OUTPUT);
pinMode(seg5,OUTPUT);
pinMode(seg6,OUTPUT);
pinMode(seg7,OUTPUT);
pinMode(segDot, OUTPUT);
pinMode(led,OUTPUT);
pinMode(next,INPUT_PULLUP);
pinMode(previous,INPUT_PULLUP);
pinMode(playPause,INPUT_PULLUP);



 //Initial volume level 0-30

//startup display


startDisplay();
startDisplay();
startDisplay();
startDisplay();
startDisplay();
digitalWrite(seg7,HIGH);
delay(3000);



}

void loop() {

 button1.update();
 button2.update();
 button3.update();

 //FS1 LONGPRESS
if (button1.read() == LOW) {
  //Button pressed
    if (FS1Active == false) {
      FS1Active = true;
      FS1Timer = millis();
    }

    if ((millis() - FS1Timer > longPressFS1Time) && (longPressFS1Active == false)) {
      longPressFS1Active = true;
      lcdStompmode = !lcdStompmode;
      j--;
      
      return;
    }
  } else {
    //Button not pressed
    if (FS1Active == true) {
      if (longPressFS1Active == true) {
        longPressFS1Active = false;
      } 
      FS2Active = false;
      FS1Active = false;
      FS3Active = false; 
    }
  }


//FS2 LONGPRESS
if (button2.read() == LOW) {
  //Button pressed
    if (FS2Active == false) {
      FS2Active = true;
      FS2Timer = millis();
    }

    if ((millis() - FS2Timer > longPressFS2Time) && (longPressFS2Active == false)) {
      longPressFS2Active = true;
      lcdStompmode = !lcdStompmode;
      j++;
      
      return;
    }
  } else {
    //Button not pressed
    if (FS2Active == true) {
      if (longPressFS2Active == true) {
        longPressFS2Active = false;
      } 
      FS2Active = false;
      FS1Active = false;
      FS3Active = false; 
    }
  }



//Button1 Pressed..................................................................................
  if ((button1.fallingEdge())) {
      i--;
      
  }

//Button2 Pressed..................................................................................
  if ((button2.fallingEdge())) {
      i++;

  }
///////////////////////////////////////////////////////KEY PRESSES

//Conditions for playing each file.
  if (((button3.fallingEdge())&&(isPlaying == false))||((button3.fallingEdge())&&(isPlaying == true)&&(((outOne!=i)||(outTwo!=j))))) {
      digitalWrite(led,HIGH);
      if ((i==1)&&(j==1)) {
        myDFPlayer.play(1);
     
        isPlaying = true;
        outOne = i;
        outTwo = j;
      }
     else if ((i==2)&&(j==1)) {
        myDFPlayer.play(2);
        
        isPlaying = true;
        outOne = i;
        outTwo = j;
      }
     else if ((i==3)&&(j==1)) {
        myDFPlayer.play(3);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==4)&&(j==1)) {
        myDFPlayer.play(4);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==5)&&(j==1)) {
        myDFPlayer.play(5);
        isPlaying = true;
        outOne = i;
        outTwo = j;
       
      }
     else if ((i==6)&&(j==1)) {
        myDFPlayer.play(6);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==7)&&(j==1)) {
        myDFPlayer.play(7);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==8)&&(j==1)) {
        myDFPlayer.play(8);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==9)&&(j==1)) {
        myDFPlayer.play(9);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
    else  if ((i==10)&&(j==1)) {
        myDFPlayer.play(10);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
    else  if ((i==11)&&(j==1)) {
        myDFPlayer.play(11);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==12)&&(j==1)) {
        myDFPlayer.play(12);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }

      //bank2

     else if ((i==1)&&(j==2)) {
        myDFPlayer.play(13);
        isPlaying = true;
        outOne = i;
        outTwo = j;
      }
     else if ((i==2)&&(j==2)) {
        myDFPlayer.play(14);
        
        isPlaying = true;
        outOne = i;
        outTwo = j;
      }
     else if ((i==3)&&(j==2)) {
        myDFPlayer.play(15);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==4)&&(j==2)) {
        myDFPlayer.play(16);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==5)&&(j==2)) {
        myDFPlayer.play(17);
        isPlaying = true;
        outOne = i;
        outTwo = j;
       
      }
     else if ((i==6)&&(j==2)) {
        myDFPlayer.play(18);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==7)&&(j==2)) {
        myDFPlayer.play(19);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==8)&&(j==2)) {
        myDFPlayer.play(20);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==9)&&(j==2)) {
        myDFPlayer.play(21);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
    else  if ((i==10)&&(j==2)) {
        myDFPlayer.play(22);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
    else  if ((i==11)&&(j==2)) {
        myDFPlayer.play(23);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==12)&&(j==2)) {
        myDFPlayer.play(24);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }

       //bank3

     else if ((i==1)&&(j==3)) {
        myDFPlayer.play(25);
        isPlaying = true;
        outOne = i;
        outTwo = j;
      }
     else if ((i==2)&&(j==3)) {
        myDFPlayer.play(26);
        isPlaying = true;
        outOne = i;
        outTwo = j;
      }
     else if ((i==3)&&(j==3)) {
        myDFPlayer.play(27);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==4)&&(j==3)) {
        myDFPlayer.play(28);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==5)&&(j==3)) {
        myDFPlayer.play(29);
        isPlaying = true;
        outOne = i;
        outTwo = j;
       
      }
     else if ((i==6)&&(j==3)) {
        myDFPlayer.play(30);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==7)&&(j==3)) {
        myDFPlayer.play(31);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==8)&&(j==3)) {
        myDFPlayer.play(32);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==9)&&(j==3)) {
        myDFPlayer.play(33);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
    else  if ((i==10)&&(j==3)) {
        myDFPlayer.play(34);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
    else  if ((i==11)&&(j==3)) {
        myDFPlayer.play(35);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==12)&&(j==3)) {
        myDFPlayer.play(36);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }

      //bank4

     else if ((i==1)&&(j==4)) {
        myDFPlayer.play(37);
        isPlaying = true;
        outOne = i;
        outTwo = j;
      }
     else if ((i==2)&&(j==4)) {
        myDFPlayer.play(38);
        isPlaying = true;
        outOne = i;
        outTwo = j;
      }
     else if ((i==3)&&(j==4)) {
        myDFPlayer.play(39);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==4)&&(j==4)) {
        myDFPlayer.play(40);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==5)&&(j==4)) {
        myDFPlayer.play(41);
        isPlaying = true;
        outOne = i;
        outTwo = j;
       
      }
     else if ((i==6)&&(j==4)) {
        myDFPlayer.play(42);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==7)&&(j==4)) {
        myDFPlayer.play(43);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==8)&&(j==4)) {
        myDFPlayer.play(44);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==9)&&(j==4)) {
        myDFPlayer.play(45);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
    else  if ((i==10)&&(j==4)) {
        myDFPlayer.play(46);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
    else  if ((i==11)&&(j==4)) {
        myDFPlayer.play(47);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
     else if ((i==12)&&(j==4)) {
        myDFPlayer.play(48);
        isPlaying = true;
        outOne = i;
        outTwo = j;
        
      }
   
  } else if ((button3.fallingEdge())&&(isPlaying == true)&&(outOne==i)&&(outTwo==j)) {
      digitalWrite(led,LOW);
      
      myDFPlayer.stop();
      
      isPlaying = false;
      
  }
//incrimenter for changing keys in a bank.
if (i==1) {
  letterA();
}

if (i==2) {
  letterAsharp();
}

if (i==3) {
  letterB();
}

if (i==4) {
  letterC();
}

if (i==5) {
  letterCsharp();
}

if (i==6) {
  letterD();
}

if (i==7) {
  letterDsharp();
}

if (i==8) {
  letterE();
}

if (i==9) {
  letterF();
}

if (i==10) {
  letterFsharp();
}

if (i==11) {
  letterG();
}

if (i==12) {
  letterGsharp();
}

if (i>=13) {
  i=1;
}

if (i<=0) {
  i=12;
}

if ((j==1)&&(startOne==true)) {
  numberOne();
  bankOne=true;
  bankTwo=false;
  bankThree=false;
  bankFour=false;
  startOne=false;
  startTwo=true;
  startThree=true;
  startFour=true;
}

if ((j==2)&&(startTwo==true)) {
  numberTwo();
  bankOne=false;
  bankTwo=true;
  bankThree=false;
  bankFour=false;
  startOne=true;
  startTwo=false;
  startThree=true;
  startFour=true;
}

if ((j==3)&&(startThree==true)) {
  numberThree();
  bankOne=false;
  bankTwo=false;
  bankThree=true;
  bankFour=false;
  startOne=true;
  startTwo=true;
  startThree=false;
  startFour=true;
}

if ((j==4)&&(startFour==true)) {
  numberFour();
  bankOne=false;
  bankTwo=false;
  bankThree=false;
  bankFour=true;
  startOne=true;
  startTwo=true;
  startThree=true;
  startFour=false;
}
//incrimenter for changing banks.
if (j>=5) {
  j=1;
}

if (j<=0) {
  j=4;
}


if (myDFPlayer.available()) {
    printDetail(myDFPlayer.readType(), myDFPlayer.read()); //Print the detail message from DFPlayer to handle different errors and states.
  }
}





//startup display
void startDisplay() {
//1
 digitalWrite(seg1,HIGH);
 digitalWrite(seg2,HIGH);
 digitalWrite(seg3,HIGH);
 digitalWrite(seg4,HIGH);
 digitalWrite(seg5,HIGH);
 digitalWrite(seg6,HIGH);
 digitalWrite(seg7,HIGH);
 digitalWrite(segDot,HIGH);
 delay(jump);
//2
digitalWrite(seg1,HIGH);
 digitalWrite(seg2,LOW);
 digitalWrite(seg3,HIGH);
 digitalWrite(seg4,HIGH);
 digitalWrite(seg5,HIGH);
 digitalWrite(seg6,HIGH);
 digitalWrite(seg7,HIGH);
 digitalWrite(segDot,HIGH);
 delay(jump);
 //3
digitalWrite(seg1,LOW);
 digitalWrite(seg2,LOW);
 digitalWrite(seg3,LOW);
 digitalWrite(seg4,HIGH);
 digitalWrite(seg5,HIGH);
 digitalWrite(seg6,HIGH);
 digitalWrite(seg7,HIGH);
 digitalWrite(segDot,HIGH);
 delay(jump);
//4
digitalWrite(seg1,LOW);
 digitalWrite(seg2,LOW);
 digitalWrite(seg3,LOW);
 digitalWrite(seg4,LOW);
 digitalWrite(seg5,HIGH);
 digitalWrite(seg6,HIGH);
 digitalWrite(seg7,HIGH);
 digitalWrite(segDot,HIGH);
 delay(jump);
//5
digitalWrite(seg1,LOW);
 digitalWrite(seg2,LOW);
 digitalWrite(seg3,LOW);
 digitalWrite(seg4,LOW);
 digitalWrite(seg5,LOW);
 digitalWrite(seg6,LOW);
 digitalWrite(seg7,HIGH);
 digitalWrite(segDot,HIGH);
 delay(jump);
//6
digitalWrite(seg1,LOW);
 digitalWrite(seg2,LOW);
 digitalWrite(seg3,LOW);
 digitalWrite(seg4,LOW);
 digitalWrite(seg5,LOW);
 digitalWrite(seg6,LOW);
 digitalWrite(seg7,LOW);
 digitalWrite(segDot,LOW);
 delay(jump);
 //7
digitalWrite(seg1,LOW);
 digitalWrite(seg2,HIGH);
 digitalWrite(seg3,LOW);
 digitalWrite(seg4,LOW);
 digitalWrite(seg5,LOW);
 digitalWrite(seg6,LOW);
 digitalWrite(seg7,LOW);
 digitalWrite(segDot,LOW);
 delay(jump);
 //8
digitalWrite(seg1,HIGH);
 digitalWrite(seg2,HIGH);
 digitalWrite(seg3,HIGH);
 digitalWrite(seg4,LOW);
 digitalWrite(seg5,LOW);
 digitalWrite(seg6,LOW);
 digitalWrite(seg7,LOW);
 digitalWrite(segDot,LOW);
 delay(jump);
 //9
digitalWrite(seg1,HIGH);
 digitalWrite(seg2,HIGH);
 digitalWrite(seg3,HIGH);
 digitalWrite(seg4,HIGH);
 digitalWrite(seg5,LOW);
 digitalWrite(seg6,LOW);
 digitalWrite(seg7,LOW);
 digitalWrite(segDot,LOW);
 delay(jump);
 //10
digitalWrite(seg1,HIGH);
 digitalWrite(seg2,HIGH);
 digitalWrite(seg3,HIGH);
 digitalWrite(seg4,HIGH);
 digitalWrite(seg5,HIGH);
 digitalWrite(seg6,HIGH);
 digitalWrite(seg7,LOW);
 digitalWrite(segDot,LOW);
 delay(jump);
 
}

 
//Song Key Displays
void letterP() {
  digitalWrite(seg1,LOW);
  digitalWrite(seg2,LOW);
  digitalWrite(seg3,LOW);
  digitalWrite(seg4,LOW);
  digitalWrite(seg5,LOW);
  digitalWrite(seg6,HIGH);
  digitalWrite(seg7,HIGH);
  digitalWrite(segDot,HIGH);
  delay(1000);
}

void letterS() {
  digitalWrite(seg1,HIGH);
  digitalWrite(seg2,LOW);
  digitalWrite(seg3,LOW);
  digitalWrite(seg4,LOW);
  digitalWrite(seg5,HIGH);
  digitalWrite(seg6,LOW);
  digitalWrite(seg7,LOW);
  digitalWrite(segDot,HIGH);
  delay(1000);
}

void letterA() {
digitalWrite(seg1,LOW);
 digitalWrite(seg2,LOW);
 digitalWrite(seg3,LOW);
 digitalWrite(seg4,LOW);
 digitalWrite(seg5,LOW);
 digitalWrite(seg6,LOW);
 digitalWrite(seg7,HIGH);
 digitalWrite(segDot,HIGH);
}

void letterAsharp() {
digitalWrite(seg1,LOW);
 digitalWrite(seg2,LOW);
 digitalWrite(seg3,LOW);
 digitalWrite(seg4,LOW);
 digitalWrite(seg5,LOW);
 digitalWrite(seg6,LOW);
 digitalWrite(seg7,HIGH);
 digitalWrite(segDot,LOW);
}

void letterB() {
digitalWrite(seg1,LOW);
 digitalWrite(seg2,LOW);
 digitalWrite(seg3,LOW);
 digitalWrite(seg4,LOW);
 digitalWrite(seg5,LOW);
 digitalWrite(seg6,LOW);
 digitalWrite(seg7,LOW);
 digitalWrite(segDot,HIGH);
}

void letterC() {
digitalWrite(seg1,HIGH);
 digitalWrite(seg2,LOW);
 digitalWrite(seg3,LOW);
 digitalWrite(seg4,HIGH);
 digitalWrite(seg5,LOW);
 digitalWrite(seg6,HIGH);
 digitalWrite(seg7,LOW);
 digitalWrite(segDot,HIGH);
}

void letterCsharp() {
digitalWrite(seg1,HIGH);
 digitalWrite(seg2,LOW);
 digitalWrite(seg3,LOW);
 digitalWrite(seg4,HIGH);
 digitalWrite(seg5,LOW);
 digitalWrite(seg6,HIGH);
 digitalWrite(seg7,LOW);
 digitalWrite(segDot,LOW);
}

void letterD() {
digitalWrite(seg1,LOW);
 digitalWrite(seg2,LOW);
 digitalWrite(seg3,LOW);
 digitalWrite(seg4,HIGH);
 digitalWrite(seg5,LOW);
 digitalWrite(seg6,LOW);
 digitalWrite(seg7,LOW);
 digitalWrite(segDot,HIGH);
}

void letterDsharp() {
digitalWrite(seg1,LOW);
 digitalWrite(seg2,LOW);
 digitalWrite(seg3,LOW);
 digitalWrite(seg4,HIGH);
 digitalWrite(seg5,LOW);
 digitalWrite(seg6,LOW);
 digitalWrite(seg7,LOW);
 digitalWrite(segDot,LOW);
}


void letterE() {
digitalWrite(seg1,HIGH);
 digitalWrite(seg2,LOW);
 digitalWrite(seg3,LOW);
 digitalWrite(seg4,LOW);
 digitalWrite(seg5,LOW);
 digitalWrite(seg6,HIGH);
 digitalWrite(seg7,LOW);
 digitalWrite(segDot,HIGH);
}

void letterF() {
digitalWrite(seg1,HIGH);
 digitalWrite(seg2,LOW);
 digitalWrite(seg3,LOW);
 digitalWrite(seg4,LOW);
 digitalWrite(seg5,LOW);
 digitalWrite(seg6,HIGH);
 digitalWrite(seg7,HIGH);
 digitalWrite(segDot,HIGH);
}

void letterFsharp() {
digitalWrite(seg1,HIGH);
 digitalWrite(seg2,LOW);
 digitalWrite(seg3,LOW);
 digitalWrite(seg4,LOW);
 digitalWrite(seg5,LOW);
 digitalWrite(seg6,HIGH);
 digitalWrite(seg7,HIGH);
 digitalWrite(segDot,LOW);
}

void letterG() {
digitalWrite(seg1,HIGH);
 digitalWrite(seg2,LOW);
 digitalWrite(seg3,LOW);
 digitalWrite(seg4,HIGH);
 digitalWrite(seg5,LOW);
 digitalWrite(seg6,LOW);
 digitalWrite(seg7,LOW);
 digitalWrite(segDot,HIGH);
}

void letterGsharp() {
digitalWrite(seg1,HIGH);
 digitalWrite(seg2,LOW);
 digitalWrite(seg3,LOW);
 digitalWrite(seg4,HIGH);
 digitalWrite(seg5,LOW);
 digitalWrite(seg6,LOW);
 digitalWrite(seg7,LOW);
 digitalWrite(segDot,LOW);
}
//Banks
void numberOne() {
  digitalWrite(seg1,LOW);
  digitalWrite(seg2,HIGH);
  digitalWrite(seg3,HIGH);
  digitalWrite(seg4,HIGH);
  digitalWrite(seg5,HIGH);
  digitalWrite(seg6,LOW);
  digitalWrite(seg7,HIGH);
  digitalWrite(segDot,HIGH);
  delay(1000);
  
}

void numberTwo() {
  digitalWrite(seg1,LOW);
  digitalWrite(seg2,LOW);
  digitalWrite(seg3,HIGH);
  digitalWrite(seg4,LOW);
  digitalWrite(seg5,LOW);
  digitalWrite(seg6,HIGH);
  digitalWrite(seg7,LOW);
  digitalWrite(segDot,HIGH);
  delay(1000);
  
}

void numberThree() {
  digitalWrite(seg1,LOW);
  digitalWrite(seg2,LOW);
  digitalWrite(seg3,HIGH);
  digitalWrite(seg4,LOW);
  digitalWrite(seg5,HIGH);
  digitalWrite(seg6,LOW);
  digitalWrite(seg7,LOW);
  digitalWrite(segDot,HIGH);
  delay(1000);
  
}

void numberFour() {
  digitalWrite(seg1,LOW);
  digitalWrite(seg2,HIGH);
  digitalWrite(seg3,LOW);
  digitalWrite(seg4,LOW);
  digitalWrite(seg5,HIGH);
  digitalWrite(seg6,LOW);
  digitalWrite(seg7,HIGH);
  digitalWrite(segDot,HIGH);
  delay(1000);
  
}

void printDetail(uint8_t type, int value){
  switch (type) {
    case TimeOut:
      Serial.println(F("Time Out!"));
      break;
    case WrongStack:
      Serial.println(F("Stack Wrong!"));
      break;
    case DFPlayerCardInserted:
      Serial.println(F("Card Inserted!"));
      break;
    case DFPlayerCardRemoved:
      Serial.println(F("Card Removed!"));
      break;
    case DFPlayerCardOnline:
      Serial.println(F("Card Online!"));
      break;
    case DFPlayerPlayFinished:
      Serial.print(F("Number:"));
      Serial.print(value);
      Serial.println(F(" Play Finished!"));
      break;
    case DFPlayerError:
      Serial.print(F("DFPlayerError:"));
      switch (value) {
        case Busy:
          Serial.println(F("Card not found"));
          break;
        case Sleeping:
          Serial.println(F("Sleeping"));
          break;
        case SerialWrongStack:
          Serial.println(F("Get Wrong Stack"));
          break;
        case CheckSumNotMatch:
          Serial.println(F("Check Sum Not Match"));
          break;
        case FileIndexOut:
          Serial.println(F("File Index Out of Bound"));
          break;
        case FileMismatch:
          Serial.println(F("Cannot Find File"));
          break;
        case Advertise:
          Serial.println(F("In Advertise"));
          break;
        default:
          break;
      }
      break;
    default:
      break;
  }

}

Forget the decoupling caps for now - that isn’t the issue. The real issue is needing to connect the ground on the MP3 player to the ground on the Arduino.

Also, I would suggest using this library instead (installation guide), but whatever works for you

So, I have actually been trying to work on the issue with the same DFPlayer library, and I have gotten the Arduino to communicate with the DFPlayer. It will play a file when I do the command myDFPlayer.start(), but it will not play if I designate a particular mp3 file ( myDFPlayer.play(1) ). This makes me think that it is somehow an issue with how the SD card is set up with the files on it. I believe the file names have 4 digits (ex. 0001.mp3), and are placed inside a folder named "mp3". I have also erased any "._" hidden files from the sd card. Any ideas?

There is a difference between play() and playFolder().

play() just plays a file from the SD card, not necessarily the mp3 directory. The order of the files is dependent on the order they were written to the SD card. There is an example sketch that prints a lot of info about what is going on. Have you tried that?

And seriously, use a different library, like #13

From the given functions, I have tried playing around with playFolder(), play() and playMp3Folder(), and none of those seem to help. I have also tried placing files on the root of the SD card with labels 0001.mp3, putting them in a folder named "mp3" with labels 0001.mp3, and using folder "01" with the file name 001.mp3.

So far, only the myDFPlayer.start() seems to work.

I have also tried using the DFPlayerMini_Fast library, but I can't seem to get any sound. Not really sure what I am doing wrong. :confused:

I have tried using the DFPlayerMini_Fast library, but for some reason, I can't seem to get a sound from the DFPlayer when I use it.

It might be that you're using a DFPlayer clone with incompatible firmware - can you run the code in debug mode and post the output?

I am not sure how to do that, other than using the Serial.print() function. Here is what I tried. The serial monitor will print both "check point one" and "check point two", which is before and after the myDFPlayer.play(1). So, It makes me think that the issues is the command not triggering the file.

if ((i==1)&&(j==1)) {
      //  myDFPlayer.start();// --> this works but for some reason pla(1) doesn't.
        //myDFPlayer.playFolder(1,1);// --> Doesn't work.
        Serial.print("check point one");
         myDFPlayer.play(1);
        Serial.print( "Check point two");
   
        isPlaying = true;
        outOne = i;
        outTwo = j;
        return;
      }

Hello fiend do you find the issue ,I think I have same problem the New Module IC is MH2024 they are not working