r/arduino • • Sep 19 '26

Using DFPlayer Pro Without Code

Is there a way to play a sound file on a DFPlayer Pro module from an Arduino Uno without using any code? I can trigger an Uno output pin to go high using my existing code but I want to avoid adding any code for the player. Any suggestions would be appreciated.

2 Upvotes

12 comments sorted by

View all comments

2

u/Hissykittykat Sep 19 '26

Is there a way to play a sound file on a DFPlayer Pro module from an Arduino Uno without using any [serial] code?

Connect the GPIO pin to the PLAY terminal on the DFplayer, and connect the grounds too. In your software, set the GPIO pin LOW. Never set it HIGH or DFplayer might be damaged. To trigger the player, set the pinMode to OUTPUT briefly, then back to INPUT. This will simulate pressing a switch wired to ground.

2

u/gm310509 400K , 500K , 600K , 640K , 750K Sep 20 '26

Given OP said they wanted to "avoid adding any code", this would require adding code.

I believe that you are on the right track, OP will need to add code, but if they do add code, why not just add "proper code" that controls it correctly via the Serial Mode interface?

1

u/DiegoMike1303 Sep 19 '26

Thank you for your help. I’m still a little confused. Does the GPIO pin (pin 7 in my scheme) start as an input or output? You say in order to trigger the sound card I should change it to OUTPUT briefly and then to INPUT. This suggests that it started as an INPUT, but you have me set it initially to LOW. Can you clarify?

1

u/Krististrasza Sep 19 '26

Yes, that is correct. You set it to be an INPUT. Then you set it to LOW. And to trigger you set it to OUTPUT and back to INPUT.

1

u/DiegoMike1303 Sep 19 '26

 Okay, this is what I've got for code:

void setup() {

  // put your setup code here, to run once:

  

  pinMode(5,OUTPUT);    // Sets pin 5 as OUTPUT, Pin 5 controls Main lights      

  pinMode(7,INPUT);     // Controls Opening narration                            

  pinMode(6,OUTPUT);    // Controls Distraction light                            

  pinMode(8,OUTPUT);    // Controls Distraction noise                            

  pinMode(9,OUTPUT);    // Controls Dummy spotlight                              

  pinMode(10,OUTPUT);   // Controls Lid                                          

  pinMode(12,OUTPUT);   // Controls Dummy scream                      

  pinMode(11,OUTPUT);   // Controls Dummy rise, lower, bounce                

  pinMode(13,OUTPUT);   // Controls Exit narration                              

 

  // Program Start

   digitalWrite(7,LOW);  // Opening narration starts  (Sound module 1)  

  pinMode(7,OUTPUT);

  delay(200);

  pinMode(7,INPUT);

 

  analogWrite(5,0);     // Main lights fade on  (Mosfet 1)

  delay(2000);

  delay(fadeDelay);

 

Does this look right?

0

u/DiegoMike1303 Oct 04 '26

Hello All, OP Here. Thank you for the help, I have it working almost exactly the way I need. BTW, I apologize for creating some confusion with my original request – I shouldn’t have said “no coding”. I meant that I wanted to avoid all the serial connections and library coding. Happily, the first response nailed it:

“Connect the GPIO pin to the PLAY terminal on the DFplayer, and connect the grounds too. In your software, set the GPIO pin LOW. Never set it HIGH or DFplayer might be damaged. To trigger the player, set the pinMode to OUTPUT briefly, then back to INPUT. This will simulate pressing a switch wired to ground.”

My code for this looks like: 

pinMode(7,INPUT);    

pinMode(7,OUTPUT);

digitalWrite(7,LOW);

This works and now I have another question: I want to stop the recording after, let’s say, 5 seconds.  I tried changing the trigger pin back to INPUT using

delay(5000);

pinMode(7,INPUT);

 

but that doesn’t seem to work. How can I do this?