Cant connect DFPlayer mini to ESP8266

Hi guys, im working on arduino to create a song system using DFPlayerMini and a ESP8266 card. Im tired, i tried something and no one solution work, the card wont connect to DFPlayer, what can i do ? Code :
#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"

SoftwareSerial softwareSerial(12, 14);

// Create the Player object
DFRobotDFPlayerMini player;

void setup() {

// Init USB serial port for debugging
Serial.begin(115200);
// Init serial port for DFPlayer Mini
softwareSerial.begin(9600);

// Start communication with DFPlayer Mini
if (player.begin(softwareSerial)) {
Serial.println("OK");

// Set volume to maximum (0 to 30).
player.volume(20);
// Play the first MP3 file on the SD card
player.play(1);
} else {
Serial.println("Connecting to DFPlayer Mini failed!");
}
}

void loop() {}
#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"

SoftwareSerial softwareSerial(12, 14);

// Create the Player object
DFRobotDFPlayerMini player;

void setup() {

// Init USB serial port for debugging
Serial.begin(115200);
// Init serial port for DFPlayer Mini
softwareSerial.begin(9600);

// Start communication with DFPlayer Mini
if (player.begin(softwareSerial)) {
Serial.println("OK");

// Set volume to maximum (0 to 30).
player.volume(20);
// Play the first MP3 file on the SD card
player.play(1);
} else {
Serial.println("Connecting to DFPlayer Mini failed!");
}
}

void loop() {}
Monitor out :
rld��|�d�|�$�c<����r�#�c��o'�l'o���cp�lrl{lp�'��$��co�<���c��og�$��$`�nod`gs���'c$�lp�'�r������co�|�c��no�l`�ogl`gs�ۓnc��`s��gc��`��#d`��o�l����n�{��'|�d�$`c��|;�l�'��'�d`��{�l�l��Connecting to DFPlayer Mini failed!
rld��|�d�|�$�c<����r�#�c��o'�l'o���cp�lrl{lp�'��$��co�<���c��og�$��$`�nod`gs���'c$�lp�'�r������co�|�c��no�l`�ogl`gs�ۓnc��`s��gc��`��#d`��o�l����n�{��'|�d�$`c��|;�l�'��'�d`��{�l�l��Connecting to DFPlayer Mini failed!
No description
40 Replies
AnonEngineering
AnonEngineering2mo ago
is the Serial Monitor set to match your Serial.begin(115200);? especially on a 3.3v chip like ESP you should have a resistor in series with the DF Mini RX pin https://wiki.dfrobot.com/DFPlayer_Mini_SKU_DFR0299
elecsprint73
elecsprint73OP2mo ago
i forgot to add the resistior on my schema, i had a 1K between D6 and Rx mini. My serial monitor is in 115200 but between esp and dfplayer, 9600
AnonEngineering
AnonEngineering2mo ago
those odd characters can be the result of mismatched baud rates, but if both ends are 115200 then idk. it's fine to have serial at one rate and the second serial at a different rate you may need a level shifter or a voltage divider between DF Mini Tx and the esp Rx. the esp is a 3.3v device and doesn't like to see 5v signals
elecsprint73
elecsprint73OP2mo ago
do u think i need to try with same baud rate for sotfwareSerial and classic serial ?
AnonEngineering
AnonEngineering2mo ago
it should be fine to have two different rates on two different ports
elecsprint73
elecsprint73OP2mo ago
okey, i'll try it later, ty
elecsprint73
elecsprint73OP2mo ago
Hiii, i do that but its not working, i cant connect to the dfplayer. I share to u the assembly
No description
AnonEngineering
AnonEngineering2mo ago
I don't think you can feed power into the USB on the bread board supply
elecsprint73
elecsprint73OP2mo ago
i have 5v out so its ok for ?
AnonEngineering
AnonEngineering2mo ago
is 5v getting to the player? oh mb, you can power it from USB
elecsprint73
elecsprint73OP2mo ago
yes have u an idea why its not working, sd card can be the pb source ? or just im bad x)
AnonEngineering
AnonEngineering2mo ago
connect only 5v, ground, the speaker, and short pin 11 to ground, does it play?
elecsprint73
elecsprint73OP2mo ago
short pin 11 is busy on dfplay schema ?
AnonEngineering
AnonEngineering2mo ago
pin 11 is IO2
No description
elecsprint73
elecsprint73OP2mo ago
hi, i try it, and i have just a "poke" in speaker and nothing, i try with 2 differently dfplayer so i think its the speaker or the sd card not work
AnonEngineering
AnonEngineering2mo ago
did you setup your folder structure as outlined at the bottom of the link i sent?
elecsprint73
elecsprint73OP2mo ago
oh no so i place it in my sd card like that
No description
elecsprint73
elecsprint73OP2mo ago
but same just a poke
AnonEngineering
AnonEngineering2mo ago
does the "BUSY" LED pulse?
elecsprint73
elecsprint73OP2mo ago
on df player ?
AnonEngineering
AnonEngineering2mo ago
yes
elecsprint73
elecsprint73OP2mo ago
no
elecsprint73
elecsprint73OP2mo ago
No description
AnonEngineering
AnonEngineering2mo ago
while it's playing the BUSY LED turns on just tap the wire going to pin 11 to the SD card case, you want to pulse pin 11 also, do those mp3's play properly on your PC?
elecsprint73
elecsprint73OP2mo ago
do just a pulse is okey ?, what did u mean "to SD card case" ? yes i verify it right now
AnonEngineering
AnonEngineering2mo ago
the silver case is ground, you just want to momentarily connect the pin to ground
elecsprint73
elecsprint73OP2mo ago
nothing happend :/ led stay off
AnonEngineering
AnonEngineering2mo ago
i think it's 11. but try pin 9 or pin 12 one of them makes it play the next song 😉
elecsprint73
elecsprint73OP2mo ago
its working just im stupid on 9 pin ty :'
AnonEngineering
AnonEngineering2mo ago
great, ok now you know your hardware works and go back to getting software serial to do the same thing
elecsprint73
elecsprint73OP2mo ago
yeah i'll to try it and i push news here its good its working but its very unstable so i think i'll going to weld before continuing with my code and other things ty so much u save me
AnonEngineering
AnonEngineering2mo ago
glad it's working if you have bad connections it is very frustrating 😉
elecsprint73
elecsprint73OP2mo ago
Hi @AnonEngineering i want to connect an amplifier for my speaker because 3w of dfplayer i can do nothing xD did u think i can use dac_l and dac_r pin to connect to the amplifier ?
No description
AnonEngineering
AnonEngineering2mo ago
yes, that is what those pins are for
elecsprint73
elecsprint73OP2mo ago
Okey ty
elecsprint73
elecsprint73OP2mo ago
Hiii @AnonEngineering im back xD i do that but its not working so good :c i have electric noise on the speaker, do u think i need to add resistor between dfplayer and amplifier ? If i put 12v on amplifier, i have to connect GND to all ground ?
No description
No description
AnonEngineering
AnonEngineering2mo ago
idk what amp you have, it works at 12V? all things in the circuit should have a common reference point, ground. is it noisy only when using the amplifier?
elecsprint73
elecsprint73OP2mo ago
Hi sorry, i tried something and do answer, the circuit working with some fixes, i want to do a final one and i did this schema, what do u think ?
No description
AnonEngineering
AnonEngineering2mo ago
it's a very confusing drawing, but does it work with the amp now?
elecsprint73
elecsprint73OP2mo ago
yes 👍

Did you find this page helpful?