Search code examples
arduinomp3arduino-ide

Arduino nano, mini DFplayer MP3 is disconnecting


I want to make a mp3 player with Arduino nano, a mini dfplayer mp3 and 3 buttons (next,prev,pause/resume).

I found the datasheet to make the connection and I tried this one:

enter image description here

The powersource will be a powerbank 5V 1A but for the test I am using the usb pluged in the pc.

CODE:

#include <SoftwareSerial.h>
#include <DFPlayerMini_Fast.h>
    
SoftwareSerial mySerial(10, 11); // RX, TX
DFPlayerMini_Fast myDFPlayer;


void setup()
{
  Serial.begin(115200);
  mySerial.begin(9600);      
  myDFPlayer.begin(mySerial);
}


void loop()
{
  myDFPlayer.play(1); //play mp3 file with leading identifier "0001"
  myDFPlayer.volume(1); //set volume low    
  delay(100); //wait 100ms

  myDFPlayer.volume(30); //crank that stuff!    
  delay(100); //wait another 100ms
    
  while(1); //halt
}

PROBLEM:

So my problem is that I can upload the code without errors and the light of the mp3 module is enabled, BUT when I connect the speaker is disconnecting and I hear the sound from the windows 10 when something is disconnecting.

The sound is like an old tv without signal.

PARTS:

NOTE:

I gave you a code without any button usage because this is not my problem and I can handle this.

Rx,Tx resistor is 1kΩ.

Buttons resistor is 10KΩ

Yes I have formatted the sd card to fat32 and I have a folder under the root called mp3 with 5 mp3 files 0001,0002,0003 etc.

The speaker it isn't soldered yes, so I just attach the wires(speaker1 and speaker2 of the module) to see if it works.

The speaker has worked before.

Library: https://github.com/PowerBroker2/DFPlayerMini_Fast

If you want anything else ask me!


Solution

  • Powering the MP3 module/speakers off of an external 5V power supply should fix it (based off of what you describe to be happening).