Hey everyone, first time posting here. I’ve been struggling to get sound out of the speakers using an Argon connected to a DF Player mini.
I tried setting it up following this post, where it seems to be pretty straightforward, but I haven’t had any luck.
Below is a diagram of my setup. The only difference is that I’m using an Argon instead of the pictured Arduino controller and using 3.3V instead of 5V to power the MP3 player.
I tried the code shared in the link above, but didn’t work. Since then I’ve moved on to using the DFRobotDFPlayerMini
library for Particle, but still no dice; I get the “Unable to begin… please insert SD card message”. I’ve also tried the DFPlayer
Particle library, but still nothing.
Also, as soon as the Argon gets power, the speaker (connected to the MP3 player) continuously makes a crackling sound; not sure why.
DFRobotDFPlayerMini Code
#include "DFRobotDFPlayerMini.h"
DFRobotDFPlayerMini myDFPlayer;
void printDetail(uint8_t type, int value);
void setup()
{
Serial1.begin(9600);
Serial.begin(115200);
Serial.println();
Serial.println(F("DFRobot DFPlayer Mini Demo"));
Serial.println(F("Initializing DFPlayer ... (May take 3~5 seconds)"));
if (!myDFPlayer.begin(Serial1)) { //Use softwareSerial to communicate with mp3.
Serial.println(F("Unable to begin:"));
Serial.println(F("1.Please recheck the connection!"));
Serial.println(F("2.Please insert the SD card!"));
while(true);
}
Serial.println(F("DFPlayer Mini online."));
myDFPlayer.volume(10); //Set volume value. From 0 to 30
myDFPlayer.play(1); //Play the first mp3
}
void loop()
{
static unsigned long timer = millis();
if (millis() - timer > 3000) {
timer = millis();
myDFPlayer.next(); //Play next mp3 every 3 second.
}
if (myDFPlayer.available()) {
printDetail(myDFPlayer.readType(), myDFPlayer.read()); //Print the detail message from DFPlayer to handle different errors and states.
}
}
DFPlayer Code
#include "DFPlayer.h"
DFPlayer dfPlayer;
int folder = 0;
int volume = 20;
void setup()
{
Serial.begin(115200);
Serial1.begin(9600);
delay(5000);
// the following command tells the program to display data on the serial console.
// logging can be turned on and off at will throughout the user's code
dfPlayer.setLogging(true);
dfPlayer.setVolume(volume);
}
void loop()
{
playMusic();
}
int playMusic()
{
// the following commands play 6 tracks that were stored in the root folder of the TFCard
// the dfPlayer.playTrack method uses DFPlayer command 0x03
// The tracks were named 001 - 006.
// The tracks were added to the TFCard in the following sequence 001, 002, 003, 005, 004, and 006
// This code plays the tracks in order 001 - 006
delay(3000);
dfPlayer.playTrack(1);
delay(3000);
dfPlayer.playTrack(2);
delay(3000);
dfPlayer.playTrack(3);
delay(3000);
dfPlayer.playTrack(4);
return 0;
}
SD Card Contents
I also tried all kinds of folder structures just to see if anything would work.
Root
Inside folder
Similar contents to root without the folders. Can’t share screenshot since new users are limited to 2 per post.
Hardware Components
Any ideas on what I might be doing wrong? Any help is greatly appreciated!
Thanks,
Henry