Audio Player with SD Card Experiments

1 Pinouts for the DFPlayer
Audio module connections
Pin Description
1 VCC Input voltage 3.2V to 5V
2 RX UART serial receive
3 TX UART serial transmit
4 DAC_R Audio output right channel drive earphone and amplifier
5 DAC_L Audio output left channel drive earphone and amplifier
6 SPK_1 Speaker
7 GND Ground
8 SPK_2 Speaker
9 IO_1 Short GND to play previous song. Long GND to decrease volume
10 GND Ground
11 IO_2 Short GND to play next song. Long GND to increase volume
12 ADKEY_1 Trigger play first segment
13 ADKEY_2 Trigger play fifth segment
14 USB+
15 USB-
16 Busy Output playing status: low=playing; high=stopped
2 Here are all the functions in the DFPlayer library for operating the DFPlayer audio module:
  • void begin();
  • void increaseVolume();
  • void decreaseVolume();
  • void setVolume(uint8_t vol);
  • int getVolume();
  • void playTrack(uint16_t filename); // play the global filename
  • void playTrack(uint8_t folder, uint8_t filename); // play filename in folder
  • void playMP3Folder(uint16_t filename); // play filename in mp3 folder
  • void playAdvertFolder(uint16_t filename); // play filename in advert folder. Only when another file is currently playing
  • void playFolder(uint8_t folder); // play all files in folder
  • void playAll();
  • void repeatTrack(uint16_t filename);
  • void nextTrack();
  • void previousTrack();
  • int currentTrack();
  • void stopAll();
  • void stopPlay();
  • void stopAdvertisement();
  • int getNumberOfTracks();
  • int getNumberOfTracks(uint8_t folder);
  • int getNumberOfFolders();
  • int getPlayerStatus();
  • void setEQ(uint8_t mode);
  • int getEQ();
  • bool playing();
  • bool playing(int pin);
  • int readStatus();
  • void reset();

3 Here's the detail datasheet for the DFPlayer Mini audio module