Example Code for Arduino-UART Control
Last revision 2025/12/30
This page provides example code for Arduino-UART control.
Hardware Preparation
- DFR0112 Player
- Arduino board (for serial monitor)
- TTL/USB converter (to connect player to computer)
- Micro SD card (1 GB, FAT formatted)
- USB cable (for Arduino and TTL/USB converter)
Software Preparation
- Arduino IDE (for serial monitor, any version)
- Serial communication assistant (e.g., window terminal, optional)
- Baud rate: 19200 (for UART communication)
Wiring Diagram

Steps
Step1:
- The sd card must be formated at FAT format.
- YOU MUST Create a "sound" directory
- put mp3/wav/midi files under the SD card
- make sure the length of file name do not exceed 8 letters.
Step2:
- Put jumper to UART mode.
- Connect the player directly to computer via TTL-USB converter.
Sample Code
We can use any serial communication assistant to send commands, or use Arduino serial monitor. The baud of communication is 19200 if not changed.
For serial communication assistant (ASCII HEX code):
- Next song: 5C 3A 6E 0D 0A
- Previous song: 5C 3A 75 0D 0A
- Pause: 5C 3A 70 0D 0A
- Start: 5C 3A 73 0D 0A
- Volume set: 5C 3A 76 20 (32 35 35) 0D 0A (32 35 35 is ASCII HEX code of "255"; adjust for desired volume, 200-255 recommended)
- Song choice mode: 5C (...) 0D 0A (replace (...) with HEX code of the song name, eg: "sky" = 73 6B 79)
For Arduino serial monitor:
- Next song: :n
- Previous song: :u
- Pause: :p
- Start: :s
- Volume set: :v 255
- Song choice mode: \xxxxxxx (xxxxxxx is the song name)
Result
-
For serial communication assistant:
Send commands in ASCII HEX code (e.g., next song: 5C 3A 6E 0D 0A). The player will execute the command (e.g., play next song). A screenshot of a window terminal test is provided:
-
For Arduino serial monitor:
- Open the serial monitor with baud rate 19200 and "Both NL & CR" selected.
- Send commands like :n (next song) or :v 255 (set volume). The player will execute the command (e.g., :n will play the next song).
Additional Information
NOTE: You must choose the "Both NL & CR" choice in the Serial monitor(the drop-down menu beside the baudrate choice menu)。 After this step you command will be transmitted with "\r\n"(The new line command bytes).
Was this article helpful?
