Ordinato entro le 14:00 nei giorni lavorativi = spedito in giornata 30 giorni per il recesso Garanzia di 1 anno
← Torna alla panoramica

La riproduzione carica il video da YouTube.

Schema di collegamento ed esempio di codice

Ecco come collegare il Modulo MP3 DFPlayer Mini (clone) con slot per scheda MicroSD a un Arduino UNO o ESP32, con uno sketch di esempio che puoi caricare subito.

Demo del lettore MP3 DFPlayer Mini

Questo progetto mostra come riprodurre file audio MP3 utilizzando il modulo DFPlayer Mini e Arduino Uno. Assicurati che la tua scheda microSD sia formattata in FAT32 e che un file MP3 sia inserito in una cartella 'mp3' (oppure nella root con nome 0001.mp3). Quando viene alimentato, Arduino inizializza il player, imposta il volume di riproduzione e avvia la riproduzione della prima traccia audio.

Schema di collegamento: Modulo MP3 DFPlayer Mini (clone) con slot per scheda MicroSD su un Arduino UNO
Schema di collegamento · Clicca per ingrandire
Tabella di collegamento: Modulo MP3 DFPlayer Mini (clone) con slot per scheda MicroSD su un Arduino UNO
Tabella di collegamento · Clicca per ingrandire
DFPlayer_Mini_MP3_Player_Demo.ino · compilato e testato
/*
 * ==================================================================
 *  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);
    }
  }
}

Librerie necessarie: DFRobotDFPlayerMini 1.0.6

Wiring diagram and example code generated by Codey.online — https://www.codey.online

ESP32 DFPlayer Mini MP3 Player Demo

Questo progetto collega un ESP32 a un modulo DFPlayer Mini MP3 per riprodurre tracce audio da una scheda micro SD tramite un altoparlante collegato. Il DFPlayer Mini è alimentato a 3.3V e l'ESP32 comunica con esso tramite Serial2 hardware su GPIO 16 (RX2) e GPIO 17 (TX2). Formatta la tua scheda micro SD in FAT32 e inserisci i file audio in una cartella 'mp3' (ad es. 0001.mp3) per avviare la riproduzione.

Schema di collegamento: Modulo MP3 DFPlayer Mini (clone) con slot per scheda MicroSD su un ESP32 DevKit V1
Schema di collegamento · Clicca per ingrandire
Tabella di collegamento: Modulo MP3 DFPlayer Mini (clone) con slot per scheda MicroSD su un ESP32 DevKit V1
Tabella di collegamento · Clicca per ingrandire
ESP32_DFPlayer_Mini_MP3_Player_Demo.ino · compilato e testato
/*
 * ==================================================================
 *  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();
}

Librerie necessarie: DFRobotDFPlayerMini 1.0.6

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Visti di recente

Portabatterie doppio 18650

Portabatterie doppio 18650

€ 1,00
Diodo 1N5408 700V / 3A

Diodo 1N5408 700V / 3A

€ 0,55
Modulo infrarossi per evitamento ostacoli

Modulo infrarossi per evitamento ostacoli

€ 2,35
Trimpot Potenziometro 101 100

Trimpot Potenziometro 101 100

€ 0,50
Kit robot bionico bipede ACEBOTT ESP32

Kit robot bionico bipede ACEBOTT ESP32

€ 39,00