DFPlayer on AD KEY mode

Hey all :slight_smile: I am trying to connect a DFPlayer to play some sound files, but it's not working to me :frowning: I am trying to use it without Arduino at the moment, I hope you guys can still help me anyway, I will really really appreciate it.

So I connected it just as the scheme shows : all the switches from AD KEY 1 are parallel connected, each one with a resistor with the specified resistance. The Arduino is there only as a power source (I tried also with batteries and it didn't work). When I press one of the buttons no one makes the sound of the file (they have voltage when pressed, I checked). When I press on the first button (the one which connected to no resistor) it makes sound, yet with a lot of disturbance when playing. When I press on the second button it makes only disturbances, no sound at all. Button number three doesn't make even disturbances.

Does somebody know / can guess where the problem is ? The wires are good, the DFPlayer is also good, it worked well with the Arduino. I will appreciate your help very much, thank you in advance :slight_smile:

I also attached a picture of the board although I suppose one doesn't see much there

I think you are forgetting how solderless bread board works. The board with the DF player has two 5 way connectors plugged into it. However, as the connecting tracks go vertically down the board all you are doing is shorting out everything on those two connectors. The signals are not going anywhere.

Sorry, I see it just now. Thank you for your answer :slight_smile: I think I didn't get what you mean, the wires are connected, just as the diagram shows, in parallel. The wires are not connected to each other as their connection to each other is GND-GND

Anyway I found out what the problem was already, I didn't connect the DFPlayer to the ground (it doesn't appear in the diagram), only the resistors and buttons and it made it all a mess. After I did it it worked :slight_smile: Thank you for your answer and time anyway

Although I do have now a new problem which I will be happy do ask you guys. So I am trying to connect the DFPlayer to the Arduino now and something very weird happens to me. So I connected the DFPlayer and two buttons, one should start to play a random MP3 file (buttonStart), the other should stop/continue the playing (buttonStop).

The problem that I encounter is the following : when I press the start button a random number is generated and all is good. Then, when I press again on the startButton (in order to let a different file play) it plays file number 1. Again. And again. And again. I started to hate this file sooo much ahahahah, can't hear it anymore. When I press the stopButton and just after that on the StartButton a new random number is generated and a random file is played. When I change the creation of the random number from (1,numberFiles) to (2, numberFiles) then a random number is created, file number 2 appeared to be playing more than the others but it might be that I just paranoid. I would appreciate your help so much.

This is the code (without lines which are unnecessary for the question like volume and so) :

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

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

int buttonStart = 5 ;
int buttonStop = 4 ;

int stopButtonWillNotStart = 0 ;
int randomNumber ;

void setup()
{
mySoftwareSerial.begin(9600);
Serial.begin(115200);

pinMode (buttonStart, INPUT) ;
digitalWrite (buttonStart,HIGH);

pinMode (buttonStop, INPUT) ;
digitalWrite (buttonStop,HIGH);
}

void loop()
{
int numberFiles = myDFPlayer.readFileCounts() + 1 ; //counts the number of files in DFP

if (!digitalRead (buttonStart)) {
delay (100);
if (!digitalRead (buttonStart)) {
// I placed randomNumber = in different lines and the result is always the same
randomNumber = random (1,numberFiles) ;
stopButtonWillNotStart = 1 ;
myDFPlayer.play(randomNumber);
delay (300);
}
}

if (!digitalRead (buttonStop) && stopButtonWillNotStart == 1) {
delay (100);
if (!digitalRead (buttonStop) && stopButtonWillNotStart == 1) {
myDFPlayer.pause () ;
delay (300) ;
}
}

if (!digitalRead (buttonStop) && stopButtonWillNotStart == 1 ) {
delay (100);
if (!digitalRead (buttonStop) && stopButtonWillNotStart == 1 ) {
myDFPlayer.start () ;
delay (300);
}
}
}

Thank you thank you thank you :slight_smile:

The wires are not connected to each other

Yes they are because they are all connected to the same column of the bread board and the holes in all columns are connected together.

yes, they do, but the other side of both wires goes to the ground, the potential difference is between the wires is 0, there is no conductivity between them. This is what I meant