SKU: OT4011 Číslo položky: NA087 EAN: 8720618827739
Modul DFPlayer Mini (clone) je kompaktní a výkonný MP3 přehrávač, ideální pro audio aplikace v projektech jako Arduino nebo jiné mikrokontroléry. Tento modul dokáže přehrávat MP3 soubory přímo z microSD karty nebo USB flash disku, bez potřeby dalšího hardwaru.
Hlavní vlastnosti:
DFPlayer Mini je všestranné řešení pro všechny vaše audio projekty, ať už chcete do svého návrhu přidat zvukové efekty, nebo postavit kompletní audio systém!
POZOR: Toto není originální čip YX5200. Stávající kód pro čip YX5200 může být nutné upravit pro správnou funkci.
Takto připojíš DFPlayer Mini (clone) MP3 modul s MicroSD slotem k Arduino UNO nebo ESP32, s ukázkovým sketchem, který můžeš hned nahrát.
Tento projekt ukazuje, jak přehrávat MP3 audio soubory pomocí modulu DFPlayer Mini a Arduino Uno. Ujistěte se, že je vaše karta microSD naformátovaná na FAT32 a že je soubor MP3 umístěn ve složce 'mp3' (nebo v kořenovém adresáři s názvem 0001.mp3). Po zapnutí Arduino inicializuje přehrávač, nastaví hlasitost přehrávání a spustí přehrávání první audio stopy.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : DFPlayer Mini MP3 Player Demo
* Board : Arduino UNO (arduino:avr:uno)
* Parts : DF Player Mini
* Libraries : DFRobotDFPlayerMini 1.0.6
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
#include <SoftwareSerial.h>
#include <DFRobotDFPlayerMini.h>
// Arduino pin 10 connects to DFPlayer TX, pin 11 connects to DFPlayer RX
SoftwareSerial dfSerial(10, 11);
DFRobotDFPlayerMini myDFPlayer;
void setup() {
Serial.begin(115200);
dfSerial.begin(9600);
Serial.println(F("Initializing DFPlayer Mini..."));
if (!myDFPlayer.begin(dfSerial)) {
Serial.println(F("Unable to begin DFPlayer Mini:"));
Serial.println(F("1. Recheck wiring"));
Serial.println(F("2. Insert formatted micro SD card with MP3 files"));
while (true) {
delay(100);
}
}
Serial.println(F("DFPlayer Mini online."));
// Set volume (0 to 30)
myDFPlayer.volume(20);
// Play the first MP3 file on the micro SD card
myDFPlayer.play(1);
Serial.println(F("Playing track 1..."));
}
void loop() {
// Print status messages if received from the player
if (myDFPlayer.available()) {
uint8_t type = myDFPlayer.readType();
int value = myDFPlayer.read();
if (type == DFPlayerPlayFinished) {
Serial.print(F("Track finished: "));
Serial.println(value);
}
}
}
Potřebné knihovny: DFRobotDFPlayerMini 1.0.6
Wiring diagram and example code generated by Codey.online — https://www.codey.online
Tento projekt propojuje ESP32 s modulem DFPlayer Mini MP3 pro přehrávání audio tracků z micro SD card přes připojený speaker. DFPlayer Mini je napájen z 3.3V a ESP32 s ním komunikuje pomocí hardware Serial2 na GPIO 16 (RX2) a GPIO 17 (TX2). Naformátujte svou micro SD card na FAT32 a umístěte audio files do složky 'mp3' (např. 0001.mp3), aby se přehrávání spustilo.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : ESP32 DFPlayer Mini MP3 Player Demo
* Board : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
* Parts : DF Player Mini
* Libraries : DFRobotDFPlayerMini 1.0.6
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
#include <DFRobotDFPlayerMini.h>
DFRobotDFPlayerMini myDFPlayer;
void setup() {
Serial.begin(115200);
// Serial2: RX on GPIO 16, TX on GPIO 17
Serial2.begin(9600, SERIAL_8N1, 16, 17);
Serial.println(F("Initializing DFPlayer Mini..."));
if (!myDFPlayer.begin(Serial2)) {
Serial.println(F("Unable to begin. Check SD card and wiring!"));
while (true) {
delay(500);
}
}
Serial.println(F("DFPlayer Mini online."));
myDFPlayer.volume(20); // Set volume (0 to 30)
myDFPlayer.play(1); // Play track 0001.mp3
}
void loop() {
// Play next track every 10 seconds
delay(10000);
Serial.println(F("Playing next track..."));
myDFPlayer.next();
}
Potřebné knihovny: DFRobotDFPlayerMini 1.0.6
Wiring diagram and example code generated by Codey.online — https://www.codey.online