The YX5300 MP3 Player Module, manufactured by Yuanze Semiconductor, is a compact and versatile audio playback module designed for seamless integration into electronic projects. It supports MP3 and WAV audio formats and features a built-in amplifier for direct audio output. The module is controlled via a simple UART serial interface, making it ideal for use with microcontrollers such as Arduino, Raspberry Pi, and other embedded systems.
The YX5300 MP3 Player Module is designed to provide reliable and high-quality audio playback with minimal external components. Below are its key technical details:
Parameter | Specification |
---|---|
Manufacturer | Yuanze Semiconductor |
Part ID | YX5300 |
Supported Audio Formats | MP3, WAV |
Communication Interface | UART (9600 bps default baud rate) |
Operating Voltage | 3.2V to 5.0V |
Current Consumption | 20mA to 30mA (typical) |
Audio Output | Stereo (via 3.5mm jack or speaker pins) |
Storage Media | MicroSD card (up to 32GB, FAT16/32) |
Built-in Amplifier | Yes |
Dimensions | 45mm x 36mm x 12mm |
The YX5300 module has a straightforward pin layout for easy integration. Below is the pin configuration:
Pin Number | Pin Name | Description |
---|---|---|
1 | VCC | Power supply input (3.2V to 5.0V) |
2 | GND | Ground connection |
3 | TX | UART Transmit pin (connect to RX of microcontroller) |
4 | RX | UART Receive pin (connect to TX of microcontroller) |
5 | SPK+ | Positive terminal for speaker output |
6 | SPK- | Negative terminal for speaker output |
7 | DAC_R | Right channel audio output (line-level) |
8 | DAC_L | Left channel audio output (line-level) |
The YX5300 MP3 Player Module is easy to use and requires minimal setup. Follow the steps below to integrate it into your project:
VCC
pin to a 3.2V–5.0V power source and the GND
pin to ground.TX
pin of the module to the RX
pin of your microcontroller, and the RX
pin of the module to the TX
pin of your microcontroller.SPK+
and SPK-
pins.DAC_R
and DAC_L
pins to connect to an external amplifier or headphones.The YX5300 module is controlled via UART commands. Below is an example of how to use the module with an Arduino UNO:
#include <SoftwareSerial.h>
// Define RX and TX pins for communication with the YX5300 module
SoftwareSerial mp3Serial(10, 11); // RX = Pin 10, TX = Pin 11
void setup() {
// Initialize serial communication with the YX5300 module
mp3Serial.begin(9600); // Default baud rate for the module
Serial.begin(9600); // For debugging via Serial Monitor
// Send initialization command to the module
sendCommand(0x3F, 0, 0); // Command 0x3F: Initialize the module
delay(500); // Wait for the module to initialize
// Play the first track on the MicroSD card
playTrack(1);
}
void loop() {
// Add your main code here
}
// Function to send a command to the YX5300 module
void sendCommand(byte command, byte param1, byte param2) {
byte checksum = 0xFFFF - (0xFF + 0x06 + command + param1 + param2) + 1;
// Construct the command packet
byte packet[] = {0x7E, 0xFF, 0x06, command, 0x00, param1, param2,
(byte)(checksum >> 8), (byte)(checksum & 0xFF), 0xEF};
// Send the command packet to the module
for (byte i = 0; i < 10; i++) {
mp3Serial.write(packet[i]);
}
}
// Function to play a specific track
void playTrack(int trackNumber) {
sendCommand(0x03, 0x00, trackNumber); // Command 0x03: Play track
}
No Audio Output:
Module Not Responding to Commands:
Distorted Audio:
MicroSD Card Not Detected:
Q: Can the YX5300 module play audio files in a specific order?
A: Yes, the module plays files in the order they are stored on the MicroSD card. You can also use UART commands to play specific tracks.
Q: What is the maximum supported MicroSD card size?
A: The module supports MicroSD cards up to 32GB.
Q: Can I control the volume programmatically?
A: Yes, you can adjust the volume using UART commands.
Q: Is the module compatible with 3.3V microcontrollers?
A: Yes, but you may need a level shifter for reliable UART communication.