The YX5300 MP3 Player Module is a compact and versatile audio playback module manufactured by Yuanze Semiconductor. It is designed to simplify the integration of audio functionality into electronic projects. The module supports MP3 and WAV audio formats and features a built-in microSD card slot for audio file storage. It can be controlled via UART serial communication, making it compatible with microcontrollers like Arduino, Raspberry Pi, and other embedded systems.
The following table outlines the key technical details of the YX5300 MP3 Player Module:
Parameter | Specification |
---|---|
Operating Voltage | 3.2V to 5.0V |
Communication Interface | UART (9600 bps default baud rate) |
Audio Formats Supported | MP3, WAV |
Storage | MicroSD card (up to 32GB, FAT16/FAT32) |
Output | Stereo audio output, built-in amplifier |
Power Consumption | < 20mA (idle), < 100mA (playback) |
Dimensions | 45mm x 36mm x 7mm |
The YX5300 module has a total of 6 pins. The table below describes each pin:
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply input (3.2V to 5.0V). Connect to the 5V pin of your microcontroller. |
2 | GND | Ground connection. Connect to the ground of your circuit. |
3 | TX | UART Transmit pin. Sends data to the microcontroller. |
4 | RX | UART Receive pin. Receives data from the microcontroller. |
5 | SPK1 | Speaker output 1. Connect to one terminal of a speaker. |
6 | SPK2 | Speaker output 2. Connect to the other terminal of a speaker. |
VCC
pin to a 5V power source and the GND
pin to ground.TX
pin of the YX5300 to the RX
pin of the microcontroller.RX
pin of the YX5300 to the TX
pin of the microcontroller.SPK1
and SPK2
pins.Below is an example of how to control the YX5300 module using an Arduino UNO:
#include <SoftwareSerial.h>
// Define RX and TX pins for SoftwareSerial
SoftwareSerial mp3Serial(10, 11); // RX = Pin 10, TX = Pin 11
void setup() {
mp3Serial.begin(9600); // Initialize serial communication with the module
Serial.begin(9600); // Initialize serial monitor for debugging
delay(500); // Allow the module to initialize
// Send command to play the first track
playTrack(1);
}
void loop() {
// Add your logic here (e.g., play next track, pause, etc.)
}
// Function to send a command to play a specific track
void playTrack(uint16_t trackNumber) {
uint8_t command[] = {0x7E, 0xFF, 0x06, 0x03, 0x00,
(uint8_t)(trackNumber >> 8),
(uint8_t)(trackNumber & 0xFF), 0xEF};
sendCommand(command, sizeof(command));
}
// Function to send a command to the YX5300 module
void sendCommand(uint8_t *command, uint8_t length) {
for (uint8_t i = 0; i < length; i++) {
mp3Serial.write(command[i]);
}
}
playTrack()
function sends a command to play a specific track by its number.No Sound Output:
SPK1
and SPK2
.Module Not Responding to Commands:
Audio Playback is Distorted:
MicroSD Card Not Recognized:
Q: Can the YX5300 play audio files in formats other than MP3 or WAV?
A: No, the module only supports MP3 and WAV formats.
Q: What is the maximum number of tracks the module can handle?
A: The module can handle up to 255 tracks in a single folder.
Q: Can I use the YX5300 with a 3.3V microcontroller?
A: Yes, but you should use a level shifter to safely interface the UART pins.
Q: Is it possible to control the volume programmatically?
A: Yes, the module supports UART commands to adjust the volume.
Q: Does the module support playback from USB drives?
A: No, the YX5300 only supports playback from microSD cards.