กลับไปหน้ารวมไฟล์
nodemcu-mp3-player-with-display-and-buttons-cabb4b.md

The story behind...

It was Tuesday and my kids, wife and dog were asleep.

I've wanted to do something with the components I've been ordering for a long time. You could build an MP3 player.

The beginnings were made quickly. Stinky and dirty radio play packed on an SD and the first tests started. The resistors were quickly used up and hardcoding is no fun.

Code written, tested, code rewritten, tested... You know that.

When everything was running, the display fell into my hands and most of the code had to be rewritten.

The MP3 player is now running and consumes just 60mA at its peak.


🛠️ เจาะลึกเบื้องหลังการทำงาน (Deep Dive / Technical Analysis)

While an Arduino can easily generate simple beeps and "Happy Birthday" using the tone() function, it cannot play high-quality vocals or MP3 audio files natively. The NodeMCU MP3 Player solves this using a dedicated audio decoding chip.

Heavy Lifting: The DFPlayer Mini

The secret to this project is the DFPlayer Mini module.

  • It has its own Micro SD card slot.
  • It contains a dedicated hardware MP3 decoder chip.
  • It has a built-in 3-Watt amplifier, meaning you can plug a small speaker directly into it!
  • The NodeMCU doesn't process any audio; it simply acts as the "remote control." It sends commands over Serial to the DFPlayer like myDFPlayer.next(); or myDFPlayer.volume(15);.

Building the Graphic Interface

With the audio handled off-board, the NodeMCU can use its processing power to draw the UI.

  1. You use an I2C OLED Screen to create a menu.
  2. Push Buttons allow the user to scroll through track numbers (e.g., Track 001, Track 002).
  3. The NodeMCU updates the screen with a "Now Playing" icon and a pause symbol when toggled.

Parts Checklist

  • ESP8266 NodeMCU or Arduino Nano.
  • DFPlayer Mini MP3 Module.
  • 0.96" OLED Display.
  • Micro SD Card (formatted to FAT32, with MP3s named 001.mp3, 002.mp3).
  • 3W 8-Ohm Mini Speaker.

ข้อมูล Frontmatter ดั้งเดิม

title: "NodeMCU MP3 Player with Display and Buttons"
description: "Ever wanted to build an MP3 player yourself? It's easy. Put the parts together, flash the code, and be happy."
author: "maximus1"
category: ""
tags:
  - "mp3 player"
  - "nodemcu"
  - "ssd1306"
  - "mp3-tf-16p"
  - "dfrobotdfplayermini"
views: 6213
likes: 1
price: 1499
difficulty: "Easy"
components:
  - "1x NodeMCU ESP8266 Breakout Board"
  - "1x Jumper wires (generic)"
  - "1x 6x6x4.30mm Buttons"
  - "1x DFPlayer Mini"
  - "1x 0,91 Zoll OLED I2C Display 128 x 32 Pixel"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles: []
documentationLinks: []
passwordHash: "33296ee5e66b855d89ffe3a0e442e94f9c03b8a684c5931bd365e7bececf74f4"
encryptedPayload: "U2FsdGVkX19pOfC4k6sdJUOmQ23M+K++zMOmSL9zKqXcLGeps5UGNKD0BjrQsXlr/xKtLvksjEi7vq1rer+0T5XhIPXTCWHd+jxlSACo17I="
seoDescription: "Build your own NodeMCU MP3 Player with Display and Buttons. Easy DIY project: assemble parts, flash code, and enjoy your music!"
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/nodemcu-mp3-player-with-display-and-buttons-cabb4b_cover.jpg"
lang: "en"