DFPlayer Mini MP3 Player is not working with Arduino Mega 1280

I'm having an issue while working with Arduino Mega 1280 and DFPlayer Mini MP3.
The module works completely fine with Arduino Uno, but do not work Mega, I've tried software serial (I tried all the RX-supported pins on Mega), and I tried Hardware Serial, with no luck.
I formatted the SD card again but also no luck.
I'm using the example sketch "All Functions" provided by the library's creator.
Anyone has an idea why this is happening?

Please check this topic: How to get the best out of this forum - Using Arduino / Project Guidance - Arduino Forum

Code and wiring is needed.

Software serial worked on the UNO.
Using the same code but connecting to the proper pins ought to work.
Shifting to serial1 on the Mega would be easy so how could that fail?

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

DFRobotDFPlayerMini myDFPlayer;

void setup()
{
  Serial1.begin(115200);
  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(Serial1)) {  //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){
      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.
  }
}

Wiring:
DFPlayer <-----> Mega
RX <-----> TX1 (18)
TX <-----> RX1 (19)
VCC <-----> 5v
GND <-----> GND
SPK1 <-----> Speaker cable 1
SPK2 <-----> Speaker cable 2

Does your DFPlayer Mini communicate at 115200 baud?

lolll, it worked with 9600 baud. ty

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.