MilikMilik

Build a Wireless MP3 Player and PWM Controller with Simple Microcontrollers

Build a Wireless MP3 Player and PWM Controller with Simple Microcontrollers
Interest|Open-Source Hardware

What You’re Building and Why It’s Worth Your Time

Building a wireless-style RP2040 MP3 player and an ATtiny13A PWM controller is a practical way to learn two core microcontroller skills: audio playback from on-board storage and safe, adjustable motor or load control with soft-start and soft-stop, using inexpensive, hobby-friendly parts and open-source designs.

Think of this as a paired project: on one side, a 4-button RP2040 MP3 player that uses LittleFS storage and a MAX98357A amplifier instead of an SD card; on the other, an ATtiny13A PWM controller that adds features you won’t get from a basic NE555 module, such as soft start, soft stop, voltage compensation, protection, and hysteresis. If you’ve wired a few LEDs or motors before and are comfortable flashing Arduino sketches, you’re ready. The only real prerequisite is the patience to troubleshoot wiring and file placement, because most problems here come down to a wrong pin, a missing pull-up, or a typo in an MP3 file name.

When you’re done, you’ll have a compact RP2040 MP3 player that plays different sounds when you press each button, and a PWM controller that can run a DIY cyclone dust collector for your CNC without needing dedicated industrial hardware. Both builds use minimal, affordable components that hobbyists and makers can source easily, and both include open-source code and design files so you can adapt them to your own projects.

RP2040 MP3 Player: From Buttons to High-Quality Audio

The RP2040 MP3 player is a multi-button soundboard built around a Raspberry Pi Pico, a MAX98357A I2S digital audio amplifier, and LittleFS storage for MP3 files. Instead of streaming from an SD card, the project puts a handful of tracks into the Pico’s internal flash: song1.mp3 through song4.mp3 inside a dedicated Data folder, alongside the main.ino sketch in a Code folder. That means less wiring, fewer parts, and faster, more reliable access to audio than a traditional SD setup. The MAX98357A converts the digital I2S audio from the Pico into analog output that drives a small speaker with impressively clear sound for such a simple circuit.

Functionally, the Pico scans four push buttons, each with INPUT_PULLUP enabled so you only need a button from GPIO to ground. When a button changes from HIGH to LOW, it stops any current playback, opens the corresponding MP3 file from LittleFS, decodes it, and streams it out over I2S to the MAX98357A. Only one song plays at a time, which keeps the logic simple and makes this ideal for interactive toys, smart greeting cards, escape room props, museum installations, and other microcontroller audio projects where each button triggers a specific sound. The key gotchas here are wiring the I2S pins correctly and ensuring your MP3 files are named exactly as expected—“song1.mp3” through “song4.mp3”—since names are case-sensitive.

According to the project author, the RP2040 MP3 player demonstrates how to build a compact and reliable multi-button MP3 player using the Raspberry Pi Pico and the MAX98357A amplifier, with LittleFS eliminating the need for an SD card and simplifying the hardware. Once everything is wired and flashed, the expected result is straightforward: press Button 1 and you hear Song 1, press Button 2 for Song 2, and so on through Button 4. From there, you can extend it with displays, volume controls, or wireless triggers, but even the base build gives you a clean, stand-alone RP2040 MP3 player that’s perfect for experimenting with LittleFS storage and I2S audio.

ATtiny13A PWM Controller and DIY Cyclone Dust Collector

The ATtiny13A PWM controller tackles the other side of practical electronics: controlling power to motors, lamps, or heaters with smarter behavior than a simple NE555 board. Built around the ATtiny13A microcontroller, it works with brushed DC motors, high-power LEDs and halogen lamps, and DC heating elements, all using the same hardware and changing only the load. Power limits depend on the MOSFET and diode you choose, so you can scale from a few watts to several hundred without redesigning the control logic. What sets this design apart is that it adds soft start, soft stop, voltage compensation, protection, and hysteresis—the features that keep motors from jerking to life and protect your components when supply voltage or load changes.

One practical application shown is pairing the controller with a cyclone dust collector made from a supermarket jar and a mattress pump blower. That combination keeps a CNC machine clean without buying a dedicated dust collection system, showing how a small microcontroller can solve a very physical workshop problem. The whole process is documented with KiCad files, laser engraving, etching, soldering, and testing, and the firmware and hardware are released under an MIT license on GitHub, which means you can clone, modify, and integrate the ATtiny13A PWM logic into your own boards and enclosures. The main gotcha here is respecting your power path: choosing suitable MOSFETs and diodes for your load and heat management, because the controller’s capabilities scale only as far as those parts allow.

In practical use, this ATtiny13A PWM controller gives you fine-grained speed or brightness control plus the gentle ramps and protections that basic PWM modules lack. That makes it more appropriate for workshop tools like dust collectors, as well as for lighting and heating where abrupt changes can shorten component life. Combined with the RP2040 MP3 player, you now have one project focused on sound and another focused on motion and power—bridging audio playback and motor control, two fundamental microcontroller applications you’ll encounter in many embedded builds.

Build a Wireless MP3 Player and PWM Controller with Simple Microcontrollers

Step-by-Step: How to Build and Integrate Both Projects

You can treat these as separate builds or as parts of a larger interactive system—for example, an RP2040 soundboard that plays alerts while an ATtiny13A controller ramps a motor up or down. While the exact wiring and code details live in the original project files, the overall flow is straightforward if you approach it methodically and keep the most common mistakes in mind: miswired GPIO pins, missing pull-ups, and wrongly named MP3 files. Use the sequence below as a guide and lean on the published Arduino and KiCad resources when you reach the specifics.

  1. Gather the core parts: Raspberry Pi Pico (RP2040), MAX98357A I2S amplifier, four push buttons, speaker, and a computer with the Arduino IDE and LittleFS support for the RP2040 MP3 player; plus an ATtiny13A, MOSFET, diode, and suitable motor, lamp, or heater load for the PWM controller.
  2. Prepare your audio files and code: create a project with a Data folder containing song1.mp3, song2.mp3, song3.mp3, and song4.mp3, and a Code folder with main.ino for the RP2040 MP3 player; download the ATtiny13A PWM controller code and KiCad design files from the provided GitHub repository.
  3. Wire and flash the RP2040 MP3 player: connect the MAX98357A to the Pico’s I2S pins and power rails as specified, wire each button between its GPIO and ground with INPUT_PULLUP enabled in code, mount LittleFS, then upload your sketch and data so that pressing each button plays the assigned MP3 file through the MAX98357A amplifier.
  4. Assemble and program the ATtiny13A PWM controller: build the power stage around your chosen MOSFET and diode according to the documented schematic, connect the ATtiny13A and any control inputs, flash the PWM firmware so that it provides soft start, soft stop, voltage compensation, protection, and hysteresis for your motor or other load.
  5. Test each project separately, then combine them: verify that Button 1 plays Song 1 and so on through Button 4 on the RP2040 MP3 player, then confirm that the ATtiny13A PWM controller can ramp your dust collector or other load smoothly; once both are stable, decide whether to run them side by side or link them with control signals to build an integrated audio-plus-motion system for your workshop or interactive installation.

While following these steps, watch for the known pitfalls. If a button doesn’t work, double-check the GPIO number, wiring, and that INPUT_PULLUP is enabled. If an MP3 refuses to play, confirm that it exists in LittleFS and that the file names are typed exactly as expected, since they are case-sensitive. On the PWM side, treat the MOSFET and diode ratings as hard limits and design your wiring and cooling accordingly, because the controller’s safe operating range depends entirely on those components. Once you’ve ironed out these details, both builds tend to run reliably and are easy to tweak thanks to their open-source code and documented hardware.

Is Combining Audio and PWM Control Worth It?

Putting a RP2040 MP3 player next to an ATtiny13A PWM controller gives you a small but meaningful slice of embedded systems: one project speaks through sound, the other moves air, light, or heat in a controlled way. You learn how to store and stream MP3 files from LittleFS without an SD card, how to push clean I2S audio into a MAX98357A amplifier, and how to add soft-start, soft-stop, and protective behavior to PWM control of motors, lamps, and heaters. Both designs are beginner-friendly while leaving plenty of room for customization, and both are released with source code and design files that the community can modify and extend.

The main things to watch for are attention to detail and load choices: correct pin mapping, proper LittleFS file placement, and honest power ratings for your MOSFET and diode. If you respect those constraints, these projects are worth building even if you never use them in production—because they bridge two fundamental microcontroller applications, microcontroller audio projects and motor or load control, in a way that feels tangible and useful on your bench. From here, you can add wireless control, sensors, or networked behavior, but the core experience of pressing a button to hear a sound while a motor spins up smoothly will stay the same, and it’s a satisfying combination for any maker.

Milik earns a commission when you shop through our links, at no extra cost to you. Editorial content is independently selected by our team.

Related Products

You May Also Like

Comments
Say something...
No comments yet. Be the first to share your thoughts!