My dfplayer mp3 doesn't work

I cannot make the DFPLAYER MP3 work. I can't understand if the problem is the circuit or the skrecth i programmed. I tried to use the example associated with the library but it doesn't work.
Can anyone help me?

How do you know it's not working? I don't see a speaker of any kind.

Does the blue led on the player light up?

Yes the speaker is plugged and the blue led doesn't light up

Disconnect the Rx & Tx wires from the Uno, leaving only the 5V, ground and speaker connected. Then connect a wire from ADKEY1 and touch it to ground. This should cause the player to play the first track and the blue led to light.

Is there a ground connection back to the Uno? Your photo is blurry. Please post a schematic, and your code. Please read the forum guide first so you don't break any form rules.

How can I make a schematic. can you advice me some software?

You can use hardware to make you schematic. Pencil and paper.

1 Like

It doesn't work anyway


#include "Arduino.h"
#include "DFRobotDFPlayerMini.h"

#if (defined(ARDUINO_AVR_UNO) || defined(ESP8266))   // Using a soft serial port
#include <SoftwareSerial.h>
SoftwareSerial softSerial(/*rx =*/10, /*tx =*/11);
#define FPSerial softSerial
#else
#define FPSerial Serial1
#endif

DFRobotDFPlayerMini myDFPlayer;
void printDetail(uint8_t type, int value);

void setup()
{
#if (defined ESP32)
  FPSerial.begin(9600, SERIAL_8N1, /*rx =*/D10, /*tx =*/D11);
#else
  FPSerial.begin(9600);
#endif

  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(FPSerial, /*isACK = */true, /*doReset = */true)) {  //Use serial 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){
      delay(0); // Code to compatible with ESP8266 watch dog.
    }
  }
  Serial.println(F("DFPlayer Mini online."));
  
  myDFPlayer.volume(10);  //Set volume value. From 0 to 30
  myDFPlayer.play(1);  //Play the first mp3
}

void loop()
{
  static unsigned long timer = millis();
  
  if (millis() - timer > 3000) {
    timer = millis();
    myDFPlayer.next();  //Play next mp3 every 3 second.
  }
  
  if (myDFPlayer.available()) {
    printDetail(myDFPlayer.readType(), myDFPlayer.read()); //Print the detail message from DFPlayer to handle different errors and states.
  }
}

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 DFPlayerUSBInserted:
      Serial.println("USB Inserted!");
      break;
    case DFPlayerUSBRemoved:
      Serial.println("USB Removed!");
      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;
  }
  
}

Ok. Possible causes I can think of:

  1. The player isn't getting any power
  2. The SD card is not formatted correctly

Until you can make the player play by connecting ADKEY1 to ground, do not be concerned about the connections to the Uno and the code (except for 5V and ground, of course).

So Do I should buy a charger to connect directly to the Arduino instead of the USB wire
in your opinion?

No, you should first respond to the suggestion made. Once you’ve confirmed that the DFR module and speaker are working independently then we can proceed to look at the Arduino aspects.

The DFR will work fine on its own from the same 5 V supplied by the USB cable. If it makes you more comfortable you can instead use a battery holder with three AA batteries, delivering about 4.5 V .

There are GND pins on both sides of the player. They all must be connected to the GND.

Make sure your breadboard is providing the connections you think it does - do you measure 5V on the pin of the DF Player board itself?

So Should I unplugg everything from the board instead of the dfplayer and the connection with itself?

I tried to plug only the GND and the 5v on the arduino to the player but it doens't work yet

Never found that necessary. Why would it be? They are directly connected, and presumably provided for convenience. Like those on some of the Arduino boards.

It provides better stability for the player, it's just one more way of preventing noise, as is that resistor in the Tx/Rx lines. I know they're internally connected, yet I have seen the difference when experimenting with those boards.

It could be for current sinking capability. The DFplayer is a fairly current hungry beast (>200mA while playing) and it may need the two grounds to be able to sink enough current. There's a fairly famous example from the early days of microprocessors. A uP die had to be redesigned and an A version of the chip released after it was discovered that the ground traces on the original were too thin and the uP couldn't sink the spec'd amount of current. The too thin ground traces turned into little resistors as they heated up and limited how much current the I/O pins could sink to well below the spec.

You have all those wires plugged into the Wrong side of the board.

image

(And - it's not a real DFPlayer, it's some copy-clone thing.)

2 Likes

GND to ground rail is good.
You have D10 or D11 going to the Ground rail. oops...