Arduino MKR WiFi 1010 - Mini Mp3 Player Module
The Arduino MKR WiFi 1010 combines WiFi and BLE connectivity with a compact MKR form factor, all running at 3.3V. Its dedicated Serial1 port makes it straightforward to interface with UART peripherals such as the DIYables Mini Mp3 Player module.
This tutorial takes you through each step:
- Wiring the Mini Mp3 Player to the MKR WiFi 1010 — no resistor needed.
- Formatting the micro SD card and organizing mp3 files.
- Writing sketches to play, pause, resume, stop, and skip tracks.
- Adding volume control with physical buttons.
- Configuring looping, shuffling, and folder-based playback.
- Querying the module for playback status in real time.

Hardware Preparation
| 1 | × | Arduino MKR WiFi 1010 | |
| 1 | × | Micro USB Cable | |
| 1 | × | DIYables Mini Mp3 Player module | |
| 1 | × | Micro SD Card | |
| 1 | × | Speaker | |
| 1 | × | Breadboard | |
| 1 | × | Jumper Wires |
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (30 sensors/displays) | |
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Because the MKR WiFi 1010 runs at 3.3V, no resistor is needed between the board and the module.
Mini Mp3 Player Module at a Glance
The DIYables Mini Mp3 Player module is a compact mp3 decoder board based on the YX5200-24SS chip. It reads mp3 files from a micro SD card and drives a small speaker (up to 3W) directly via its onboard amplifier — or you can route audio through the DAC pins to an external amp.
The module accepts commands over UART at 9600 baud and offers:
- Full transport: play, pause, resume, stop, next, previous
- Volume from 0 (silent) to 30 (loudest)
- Six EQ presets: Normal, Pop, Rock, Jazz, Classic, Bass
- Repeat modes: single track, folder, all tracks, or random shuffle
- Folder-based playback for organized audio libraries
- Advertisement interrupts (play a clip, then resume the original track)
- On-demand status queries (current track, volume, play state, etc.)
Module Pins
| Pin | Function |
|---|---|
| VCC | Power input (3.2V – 5.0V) |
| GND | Ground |
| RX | Serial data in (from MKR TX) |
| TX | Serial data out (to MKR RX) |
| SPK_1 | Speaker + (built-in amp, 3W max) |
| SPK_2 | Speaker − |
| DAC_R | Right channel line output |
| DAC_L | Left channel line output |
| BUSY | LOW during playback, HIGH when idle |
| IO_1 | Short press → previous track; long press → vol down |
| IO_2 | Short press → next track; long press → vol up |

Wiring Diagram
The MKR WiFi 1010 has Serial1 on pin 13 (RX) and pin 14 (TX). Both run at 3.3V, matching the module's logic level — so you can connect the lines directly.
| Mini Mp3 Player | MKR WiFi 1010 | Notes |
|---|---|---|
| VCC | VCC (3.3V) | |
| GND | GND | |
| RX | Pin 14 (Serial1 TX) | Direct — 3.3V logic match |
| TX | Pin 13 (Serial1 RX) | Direct |
| SPK_1 | Speaker + | |
| SPK_2 | Speaker − |

This image is created using Fritzing. Click to enlarge image
Note: Do not supply 5V to the module from the MKR board's VCC pin — it outputs 3.3V. If you need 5V for louder speaker output, use an external 5V source for the module's VCC while keeping GND shared.
SD Card Setup
- Format the micro SD card as FAT16 or FAT32.
- Copy mp3 files to the root directory with zero-padded names:
- For folder-organized playback:
Keep in mind:
- Track numbering starts at 1, not 0.
- The module assigns track numbers by the order files are copied, not by filename. Format the card first, then copy each file individually in sequence.
- Folder names: 2 digits, zero-padded (01–99). Files inside: 3 digits (001–255).
Installing the Library
- Connect the MKR WiFi 1010 to your computer via micro USB.
- In the Arduino IDE, select Arduino MKR WiFi 1010 and the correct port.
- Open the Libraries panel on the left sidebar.
- Search for "DIYables_MiniMp3" and install the library by DIYables.

No additional dependencies — the library is completely self-contained.
Base Code Template
The MKR WiFi 1010 provides hardware Serial1, so SoftwareSerial is not required:
MKR WiFi 1010 — Play One Track
Getting It Running
- Load the SD card with mp3 files, insert it into the module, and wire as shown.
- Select Arduino MKR WiFi 1010 in the IDE and upload.
- Track 001.mp3 plays through the speaker.
Playback Methods Overview
| Method | Purpose | Usage |
|---|---|---|
| play(n) | Play a specific track | mp3.play(1) |
| playNext() | Jump to next track | mp3.playNext() |
| playPrevious() | Jump to previous track | mp3.playPrevious() |
| pause() | Pause the current track | mp3.pause() |
| resume() | Resume paused playback | mp3.resume() |
| stop() | Stop playback entirely | mp3.stop() |
MKR WiFi 1010 — Play Multiple Tracks
Getting It Running
- Make sure the SD card has at least 3 tracks. Upload and the board cycles through them every 5 seconds.
MKR WiFi 1010 — Pause/Resume Toggle
MKR WiFi 1010 — Loop a Track
Repeat & Shuffle Methods
| Method | Behavior | Usage |
|---|---|---|
| loopTrack(n) | Repeat track n endlessly | mp3.loopTrack(1) |
| loopFolder(f) | Repeat every track in folder f | mp3.loopFolder(1) |
| loopAll() | Repeat all tracks on the card | mp3.loopAll() |
| stopLoop() | Cancel any active repeat mode | mp3.stopLoop() |
| shuffle() | Play all tracks in random order | mp3.shuffle() |
MKR WiFi 1010 — Folder Playback
Folder Methods
| Method | Description | Usage |
|---|---|---|
| playFolder(f, t) | Play track t from folder f (up to 99 folders, 255 tracks) | mp3.playFolder(1, 1) |
| playLargeFolder(f, t) | Extended capacity (15 folders, 3000 tracks) | mp3.playLargeFolder(1, 1500) |
| playFromMP3Folder(t) | Play from the dedicated /mp3 folder | mp3.playFromMP3Folder(1) |
MKR WiFi 1010 — Serial Monitor Control
| Input | Action |
|---|---|
| 1–9 | Play that track number |
| + / − | Adjust volume |
| p | Pause |
| r | Resume |
| s | Stop |
| n | Next track |
| b | Previous track |
| ? | Show current status |
EQ Presets
| Constant | Value | Character | ||
|---|---|---|---|---|
| DIYables_MiniMp3 | EQ_NORMAL | 0 | Flat / neutral | |
| DIYables_MiniMp3 | EQ_POP | 1 | Pop | |
| DIYables_MiniMp3 | EQ_ROCK | 2 | Rock | |
| DIYables_MiniMp3 | EQ_JAZZ | 3 | Jazz | |
| DIYables_MiniMp3 | EQ_CLASSIC | 4 | Classical | |
| DIYables_MiniMp3 | EQ_BASS | 5 | Bass emphasis |
Status Queries
Each call blocks briefly (up to 100 ms) while waiting for the module's response. A return value of −1 means the module did not reply in time.
| Method | Returns | What You Learn |
|---|---|---|
| isPlaying() | bool | Whether audio is actively playing |
| getVolume() | int16_t | Current volume level (0–30) |
| getEQ() | int16_t | Active equalizer preset (0–5) |
| getTrackCount() | int16_t | Total mp3 files on the SD card |
| getCurrentTrack() | int16_t | Track number currently playing |
| getFolderCount() | int16_t | Number of folders on the card |
| getTrackCountInFolder(f) | int16_t | Number of tracks in folder f |