You don’t need a microcontroller to use DFPlayer Mini. A simple wire is enough to get started: when you connect KEY_1
to GND
, DFPlayer Mini will automatically play and seamlessly loop the first audio file copied to your SD card.
Adding one or more push buttons to the four exposed GPIOs provides increasing control. At most, you can directly play, autoplay, or loop up to 14 audio files or sound effects.
If GPIO Mode isn’t sufficient for your needs, you can switch to UART Mode, which allows a microcontroller to send more complex commands to DFPlayer Mini.
Overview
DFPlayer Mini supports two control modes:
- GPIO Mode:
Uses four GPIOs (IO_1
,IO_2
,KEY_1
, andKEY_2
) that can be connected toGND
to trigger actions.IO_1
andIO_2
are digital inputs and respond to both short and long presses.KEY_1
andKEY_2
are analog inputs that recognize up to 10 different resistance values, allowing multiple button functions on a single pin.
In this mode, you need no micro controller and other external components.
- UART Mode:
Uses a serial interface (RX
andTX
) to send commands from a microcontroller, enabling more advanced control. TheBUSY
pin provides feedback on whether a track is currently playing or paused.
This guide focuses on GPIO Mode, demonstrating how to use simple wires, push buttons, and resistors to control DFPlayer Mini.
Understanding how DFPlayer Mini identifies audio files in GPIO Mode is crucial because it works differently from UART Mode, affecting playback sequence, autoplay, and direct file access.
How DFPlayer Identifies Audio Files
In GPIO Mode, DFPlayer Mini relies on the FAT (File Allocation Table) to assign ID numbers to audio files. When powered on, DFPlayer Mini scans the FAT structure of the microSD card and assigns track IDs based on the order in which the files appear in the table.
This means that playback order and direct track selection are determined solely by the order in which files were copied to the SD card. The file name and storage location (root folder or subfolder) have no effect in GPIO Mode.
For example, 0001.wav
will not necessarily play first unless it was the first file copied to the SD card.
AutoPlay Loop Mode
DFPlayer Mini supports a little-known but highly useful loop mode that automatically starts playback and then seamlessly repeats an audio file.
This mode is available only for the first file copied onto your microSD card.
To activate this mode, connect KEY_1
to GND
:
Once powered on, DFPlayer Mini will automatically start playing the file in a continuous loop.
In this special loop mode, the audio file loops seamlessly, without any noticeable gap—perfect for sound effects.
Single Button Mode
For more control, add a push button between IO_1
and GND
:
This enables the following controls:
- Short Press: Play the next audio file
- Long Press: Decrease volume
Two-Button Mode
Adding a second push button between IO_2
and GND
introduces reverse functionalities:
- Short Press: Play the previous audio file
- Long Press: Increase volume
Full-Control Mode
Using KEY_1
and KEY_2
allows direct access to one of the first 14 audio files copied to your SD card. Additional features like play/pause and loop all become available.
Important Considerations
- Analog Inputs:
KEY_1
andKEY_2
are analog inputs that can differentiate 10 different resistance values. To use multiple buttons on a single pin, you must connect resistors in series with each button. - Firmware Differences: Various DFPlayer Mini versions exist, often with different firmware. This means that key assignments (and required resistor values) may vary between versions. Testing is recommended to confirm the correct functionality for your specific module.
Maximum Button Control
Here’s the full control setup using 22 push buttons and 18 resistors (as tested on my version of DFPlayer Mini):
You’ll notice some overlapping functionalities, and some features are rarely needed (such as selecting input mode). You don’t have to use all available options. In my setup, I omitted redundant buttons and those for selecting the audio source or play mode:
With this setup:
- 14 push buttons allow direct access to the first 14 audio files on the SD card.
- The remaining 4 buttons handle volume control, track navigation (next/previous), pause, and loop all mode.
To loop a specific file, simply keep the assigned button pressed for that file.
Slow Website?
This website is very fast, and pages should appear instantly. If this site is slow for you, then your routing may be messed up, and this issue does not only affect done.land, but potentially a few other websites and downloads as well. Here are simple steps to speed up your Internet experience and fix issues with slow websites and downloads..
Comments
Please do leave comments below. I am using utteran.ce, an open-source and ad-free light-weight commenting system.
Here is how your comments are stored
Whenever you leave a comment, a new github issue is created on your behalf.
-
All comments become trackable issues in the Github Issues section, and I (and you) can follow up on them.
-
There is no third-party provider, no disrupting ads, and everything remains transparent inside github.
Github Users Yes, Spammers No
To keep spammers out and comments attributable, all you do is log in using your (free) github account and grant utteranc.es the permission to submit issues on your behalf.
If you don’t have a github account yet, go get yourself one - it’s free and simple.
If for any reason you do not feel comfortable with letting the commenting system submit issues for you, then visit Github Issues directly, i.e. by clicking the red button Submit Issue at the bottom of each page, and submit your issue manually. You control everything.
Discussions
For chit-chat and quick questions, feel free to visit and participate in Discussions. They work much like classic forums or bulletin boards. Just keep in mind: your valued input isn’t equally well trackable there.
(content created Feb 14, 2025)