I'm building a simple soundboard: pressing an arcade button should play a random track (1 of 100) from folder "01" on the SD card. Board is a DFRduino Nano V4 (Arduino Nano clone, paired with a generic DFPlayer Mini module.
Wiring:
- Nano +5V → DFPlayer VCC
- Nano GND → DFPlayer GND
- Nano GND → GND rail on breadboard
- Nano D12 → 1kΩ resistor → DFPlayer RX
- Nano D9 → DFPlayer TX
- DFPlayer SPK_1 → speaker (−)
- DFPlayer SPK_2 → speaker (+)
- Button COM → GND
- Button NO → Nano D2
SD card: FAT32, folder "01" in root, files named 001.mp3 through 100.mp3.
Code:
#include <SoftwareSerial.h>
#include <DFRobotDFPlayerMini.h>
SoftwareSerial mySerial(9, 12);
DFRobotDFPlayerMini myDFPlayer;
const int buttonPin = 2;
bool lastButtonState = HIGH;
unsigned long lastDebounceTime = 0;
const unsigned long debounceDelay = 200;
void setup() {
Serial.begin(115200);
mySerial.begin(9600);
pinMode(buttonPin, INPUT_PULLUP);
randomSeed(analogRead(A0));
Serial.println("Initializing DFPlayer Mini...");
if (!myDFPlayer.begin(mySerial, true, true)) {
Serial.println("Error: DFPlayer not responding.");
while (true) {
delay(1000);
}
}
myDFPlayer.volume(15);
Serial.println("DFPlayer ready");
}
void loop() {
bool buttonState = digitalRead(buttonPin);
if (buttonState != lastButtonState) {
if ((millis() - lastDebounceTime) > debounceDelay) {
if (buttonState == LOW) {
int track = random(1, 101); //random audio drom 1 to 100
Serial.print("Playing track: ");
Serial.println(track);
// folder "01", files 001.mp3 - 100.mp3
myDFPlayer.playFolder(1, track);
}
lastDebounceTime = millis();
lastButtonState = buttonState;
}
}
}
Symptom: myDFPlayer.begin() always returns false. Using a diagnostic snippet that reads readType()/read() right after a failed begin(), I consistently get error type DFPlayerError with error code Busy (1) — on every attempt, even with retries and delays in between.
What I've already ruled out:
- Shorting the DFPlayer's IO_1 pin directly to GND plays a track through the speaker just fine, so the SD card, file indexing, amplifier, and speaker all work correctly.
- Checked continuity of every UART and power connection with a multimeter - all read close to 0Ω, no opens.
My board:










