A great & very cheap MP3 sound module without need for a library!


#82

That’ll do - I’ll investigate the busy pin. Unlike you, I’m not a coder so sometimes I just check what I’m about to attempt is feasible before barking up the wrong tree. Thanks
EDIT Looks like there’s also a readState function which seems to be a feature of the library I’m using and the board itself. I wonder if that would be better AND save my a I/O pin.


#83

Ah. NOW I see why you recommended the busy pin, @ScruffR - looks like the software methods are fraught with difficulty/hiccups.


#84

I came across and ordered this MP3 + Amp board the other day and it reminded me of this thread.

I’m posting here in case you guys are interested in other MP3 player options, it’s not as cheap but has more features.


#85

Any idea or example circuit on How can i disable the long button press detection in using the AD KEY pins without using a microcontroller? Its annoying to unintendedly play same mp3 file bec of this function. Thanks


#86

While it is always possible that someone here might be able to answer your question, I expect most of our experience involves the use of a microprocessor.

I’d suggest you contact the manufacturer: http://www.flyrontech.com/ They were willing and able to answer some questions for me a few months ago.


#87

Hi all.

I stumbled on this thread from a reply on another thread and have one of these boards on order. I’m sure I’ll have more questions once I start working with it.

Quick general question.

Is the SD card on this board available to write / read data from? Or can it only be used for audio files?

THANKS!


#88

As mentioned in the thread you came from :wink:

That limitation is because you can’t (easily) access the SD card from the µC with this board.


#89

Hello again!

Board came in and I’m trying to simplify the code. I only need to play one of 5 MP3s from function calls from with in my program.

In the root of my SD card I made a folder called MP3. In that folder I have a single file called 001.mp3.

My simplified sketch is:

/* MP3 PLAYER PROJECT
From project: http://educ8s.tv/arduino-mp3-player/
Modified for "Particle world" by @FiDel
*/

# 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 ACTIVATED LOW

boolean isPlaying = false;

void setup ()
{
  Serial1.begin(9600);
  delay(1000);
  playFirst();
  isPlaying = true;
}

void loop ()
{ 

}


void playFirst()
{
  execute_CMD(0x3F, 0, 0);
  delay(500);
  setVolume(20);
  delay(500);
  execute_CMD(0x11,0,1); 
  delay(500);
}

void setVolume(int volume)
{
  execute_CMD(0x06, 0, volume); // Set the volume (0x00~0x30)
  delay(2000);
}


void execute_CMD(byte CMD, byte Par1, byte Par2) // Excecute the command and parameters
{
 // Calculate the checksum (2 bytes)
 int16_t 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, checksum >> 8, checksum & 0xFF, End_Byte};

 //Send the command line to the module
 for (byte k=0; k<10; k++)
 {
  Serial1.write( Command_line[k]);
 }
}

Should this just be playing the first file?

THANKS@


#90

When placing the files in a folder called mp3 the contained mp3 files should be numbered with four digits.


#91

Thanks for the quick replies! This project will be fun once I get some sound kicking…

I renamed my folder to lowercase, (mp3) and now have my one file in that folder named 0001.mp3.

Still no sound at startup for the board with the code above.

Here is my wiring…

Any ideas of what to try next?


#92

I got out the multi meter…

photo in the 1st post shows power hooked up to Vin. Moved it to the 3.3v pin and it works now!


#93

Yes, Vin is not powered by the LiPo. Vin only gets powered when USB is plugged in.


#94

So I figured out the board is very stable when tied directly to the +pos of the battery (solder pad next to the battery connector).

Two issues I’m having now.

  • With the code above the 1st audio file is looping instead of playing once.
  • trying to play the 2nd track in my mp3 folder I changed the code to execute_CMD(0x3F, 1, 0); but it is still playing the 1st track?

Thanks again for all the help!

edit…
when I comment out the execute_CMD(0x3F, 0, 0); line the 1st file still plays. This is making me think this line of code is not working for some reason

edit again…
I found the DFPlayer.h library and this code is working like a champ!

#include "DFPlayer.h"

    // global variables
    DFPlayer dfPlayer;

int volume = 20;

void setup() {
    Serial.begin(115200);
    Serial1.begin(9600);
    delay(5000);

    dfPlayer.setVolume(volume);
    dfPlayer.playTrack(1);
    delay(5000);
    dfPlayer.playTrack(2);
    delay(5000);
    dfPlayer.playTrack(3);
    
}

void loop() {

}

#95

Yup, I already wondered why you didn’t use the library I linked in my post in your original thread :wink:


#96

Hi, thanks for the code adaptation for controlling MFPlayer from Photon. I got this working (for volume +/- only, activation of only sound in SD card is made hardwiring from a digital pin to ADKEY1 through a 51K resistor in order to get loop play on/off as I need). Regarding capacitor in series between SPK1(+) and one terminal of the speaker, would it need to be so big? (I have a 2200uF now). Is that connection OK? I have a speaker 8Ohm, 0.5W installed, more than volume 15 sound badly either way. Thanks.


#97

My DFPlayer Mini starts making this noise a few seconds into playing a sound file. Any ideas why? I’m using a resistors, but otherwise I’m connecting exactly the same way as in the picture in the first post. I have about six other DfPlayer Minis connected to other Photons and/or Cores and they don’t make this noise. Anything else to try before starting to connect different DFPlayer Minis and different Photons to my setup to try to troubleshoot? Bit strange. Thank you!


#98

Hi Daneboomer,

Looking at the vid its not a ‘mains hum’ issue, and likely to be some sort of data rate failure. It looks like you are driving the DFplayer off an Arduino mega clone.

To be honest I’d try the subsittution method first. Swap out the DFplayer mini 1st keeping the original SD card. Then the SD card, and then a photon/core.

I’d take the elements from a known good setup.

Don’t forget to check for false positive’s by using the suspected faulty element in the know good setup, and ensure the fault transfers over.

Liam


#99

Why are you powering the player off an Arduino?
Do you have common ground between the Arduino and the Photon?
Does any component on the module get extraordinarily warm?


#100

Sorry for being unclear - while that is exactly the noise the DFPlayer Mini makes, it’s not my video (hence why there’s an Arduino in the video!). I nearly uploaded a video of my setup but then realised the exact same issue was already online.

I’ll try swapping out some parts and report back.

Thanks


#101

Hmmm - strange - I’m still trying to isolate the problem. Whenever I use that particular Photon and that particular DFPlayer Mini in combination, the DFPlayer Mini seems able to somehow cause the Photon to semi freeze. It still responds to pings, but doesn’t respond to anything else. If you try and flash new or different firmware, it eventually times out. The only thing that revives it is Particle Doctor - but as soon as you connect it to the DFPlayer Mini again it freezes. At the moment I’ve got it running some very basic code which doesn’t involve a DFPlayer Mini and that’s fine and stable.

Any way I could test the pins on my DFPLayer Mini for continuity (or another test?) to see if it’s fried?

I would connect the suspect DFPlayer Mini to another Photon…but I don’t want to do that if the DFPlayer Mini is compromised and dangerous to Photons!


Any way to test if TX/RX pins are borked?