Go Down

Topic: DF Player mini very low volume (Read 280 times) previous topic - next topic

ningaman151

Feb 05, 2019, 10:47 pm Last Edit: Feb 05, 2019, 11:04 pm by ningaman151
Hi I am testing the DF player mini module by playing a mp3 file. The DF player receives the commands as the indicator LED lights up and sound is played albeit at a very low volume; I have to have the speaker touching my ear to be able to hear anything. I tried adding a 1000uF capacitor between Vcc and GND and the volume then became as expected. But when I powered off the project and turned the power back on, the audio returned to being played at a low volume,. I have provided my code, although I doubt it is the issue as sound is being produced. I have attached the schematic of my circuit. The power supply is capable of providing 2A (lab bench power supply). The arduino nano is powered by USB.


Code: [Select]

# define Start_Byte 0x7E
# define Version_Byte 0xFF
# define Command_Length 0x06
# define End_Byte 0xEF
# define Acknowledge 0x00 //Returns info with command 0x41 [0x01: info, 0x00: no info]

#define c_play_file  0x0F
#define c_set_volume 0x06
#define c_stop_track 0x16
#define c_play       0x0D
#define c_pause      0x0E
#define c_setvolume  0x06
#define c_initialize 0x3F
#define c_repeat_track 0x08
#define c_stop       0x16
#define c_equalizer  0x07

void setup_DF();

void DF_initialize();
void DF_playfile(byte folder_num, byte file_num);
void DF_repeat(byte track_number);
void DF_pause();
void DF_stop();
void DF_play();
void DF_setVolume(int vol);

void DF_execute_CMD(byte CMD, byte Par1, byte Par2);


void setup() {
  setup_DF();
}

void loop() {

}

void setup_DF()
{
  Serial.begin(9600);
  DF_initialize();
  DF_setVolume(25);
  DF_playfile(1,1);
}

void DF_initialize()
{
  DF_execute_CMD(c_initialize, 0, 0);
  delay(30);
}

void DF_playfile(byte folder_num, byte file_num)
{
  DF_execute_CMD(c_play_file,folder_num,file_num);
  delay(30);
}

void DF_repeat(byte track_number)
{
  DF_execute_CMD(c_repeat_track,0,track_number);
}

void DF_pause()
{
  DF_execute_CMD(c_pause,0,0);
  delay(30);
}

void DF_stop()
{
  DF_execute_CMD(c_stop,0,0);
}

void DF_play()
{
  DF_execute_CMD(c_play,0,1);
  delay(30);
}

void DF_setVolume(int vol)
{
  DF_execute_CMD(c_setvolume, 0, vol); // Set the volume (0x00~0x30)
  delay(30);
}

void DF_execute_CMD(byte CMD, byte Par1, byte Par2)
  // Excecute the command and parameters
{
  // Calculate the checksum (2 bytes)
  word checksum = -(Version_Byte + Command_Length + CMD + Acknowledge + Par1 + Par2);
  // Build the command line
  byte Command_line[10] = { Start_Byte, Version_Byte, Command_Length, CMD, Acknowledge,
  Par1, Par2, highByte(checksum), lowByte(checksum), End_Byte};
  //Send the command line to the module
  for (byte k=0; k<10; k++)
  {
    Serial.write(Command_line[k]);
  }
}

Grumpy_Mike

You have C1 the wrong way round. It is possible shorting out your power supply. It will get hot and maybe explode.

ningaman151

#2
Feb 06, 2019, 05:37 am Last Edit: Feb 06, 2019, 05:38 am by ningaman151
You have C1 the wrong way round. It is possible shorting out your power supply. It will get hot and maybe explode.
Sorry, I made a mistake in the schematic. I rotated the power supply to make the wiring clearer. It is hooked up correctly on the breadboard.

Grumpy_Mike

Quote
I tried adding a 1000uF capacitor between Vcc and GND and the volume then became as expected. But when I powered off the project and turned the power back on, the audio returned to being played at a low volume,.
That doesn't ring true, I can't see anything that could possibly produce that effect. It sounds more like intermittent connections. Breadboards are notorious for being rubbish like this.

ningaman151

That doesn't ring true, I can't see anything that could possibly produce that effect. It sounds more like intermittent connections. Breadboards are notorious for being rubbish like this.
Those were my thoughts, as it is a very simple connection. I've grounded both the GND pins of the DF player and now the volume is as loud as expected both on the breadboard and prototype board, even without the decoupling capacitors. I saw a post on some forums that stated that the two GND pins are not identical, one is for data while other is power GND. The manufacturer's site (DF robot) notes both GND pins as "Power GND" in the pinout.

I guess the lesson learned is to always ground all ground pins (for all modules and ICs)?

MarkT

Yes, always ground all grounds, they wouldn't pin it out if it wasn't meant to be used...
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up