I built a cheap music controlled RGB LED strip with ESP32 and it’s better than anything bought in a store.


Store-bought RGB LED strips get boring quickly. You install them, download another app, and adjust the effects to see the flash with the music, without proper synchronization or sync. I wanted something better: a strip that actually listens, reacts instantly, and runs without a cloud subscription or a dedicated app.

To build it, I chose a ESP32 (NodeMCU-32S), one WS2812B LED strip, one Raspberry Pi 4 charger and an INMP441 microphone. What followed were hours of debugging, soldering errors, a dead microphone, and searching for the correct settings to make everything work. Here’s everything I learned from those mistakes, so you don’t have to repeat any of them.

ESP32 connected to MAX7219 LED display in a 3D printed case

I built a $15 ESP32 smartwatch that does things no other store-bought one can do

I programmed it with ESPHome and it only took me a few hours from start to finish.

What parts do you really need?

Cheap parts, better results

Components used to make music controlled RGB LED strips

The parts list is short. I used a basic ESP32 board and jumper cables from previous projects. Next, I ordered a 1 meter strip of 5V WS2812B LEDs and the most important component for this project: the INMP441 microphone (I2S digital). For power, I pulled the 15W charger out of a Raspberry Pi 4, which offers 5V/3A output. That’s enough to power 60 individual WS2812B 5V LEDs.

As a rule of thumb, each WS2812B LED draws ~60mA at full white brightness, so 30 LEDs need ~1.8A peak. Size your power supply accordingly (add 20% headroom).

For comparison, Govee’s music test strip costs $35, but it only reacts to volume levels: high means flash, low dims. The Philips WiZ smart strip costs $80 but uses your phone’s microphone through the app to sync music. The Philips HDMI Sync Box is priced at $145 and reads the HDMI output to sync the lights. The premium Nanoleaf Lines cost $179, include a Rhythm box with a built-in microphone, and still have sensitivity issues, as owners report.

My setup costs about $20 total, compared to that. Additionally, I used a Eco M5Stack ATOM Smart speaker to build another music controlled RGB LED strip.

Putting all the components together

Wiring can be a bit complicated

Wiring the INMP441 microphone and RGB LED strip to the ESP32 board

I soldered the DIN (data) of the strip to GPIO 4 of the ESP32 and shared GND between the ESP32, the LEDs and the Pi charger. For power, connect the 5V and GND of the strip directly to the 5V/3A output of the Pi charger, *never* to the VIN of the ESP32.

Power the LEDs with 5V from external charger (minimum 5V/3A for 60 LEDs). The ESP32 VIN/3.3V powers *only* the board itself.

Power Warning: WS2812B strips draw a lot of current. Please use a dedicated 5V power supply (60mA/LED max). Separate power from ESP32 via USB. Common fault: fried regulators due to VIN overload.

I recommend wiring the INMP441 microphone to ESP32 using jumper cables first. I spent hours troubleshooting those pins only to realize the microphone was dead. I accidentally destroyed the sensitive MEMS component by applying excessive soldering heat of 380 degrees, 130 degrees higher than necessary.

This is what my INMP441 microphone to ESP32 wiring looks like:

  • VDD at 3.3V (not 5V)

  • SD (serial data) to GPIO 32

  • WS (word select) to GPIO 25

  • SCK (serial clock) to GPIO 26

  • Earth to Earth

Connecting the L/R pin to GND on the microphone board saves me from using another GND pin on the ESP32 board and makes the connection permanent.

Jumper cables are sometimes frustrating. I spent over an hour troubleshooting the microphone, only to realize that one of the cables connecting to the ESP32’s GND pin had come out.

Choose and update the correct WLED firmware

Not all WLED versions are the same

COUNTRY is an open source firmware for microcontrollers to manage individually addressable LED strips. Recent builds (0.15.x and later) include an AudioReactive module to enable sound-reactive LED effects using a microphone.

The official version 0.15.x includes AudioReactive Usermod, but some users (including me) report microphone detection issues. I downgraded to 0.14.4 through the official server. WLED web installer for stability.

Lunar modules is a community audio-focused fork with improved reactive effects and microphone support, often more reliable than standard. Get builds from your GitHub.

Setting up the WLED is half the battle

One wrong box ruins everything

Once you flash WLED, you will need to configure the exact microphone pins in the Usermods interface after enabling AudioReactive Usermod. Be sure to define the GPIO pin that connects to the DIN of the light strip on the Settings -> LED Preferences.

The Info tab at the top helped a lot in troubleshooting the microphone and adjusting the correct mute and gain settings.

On both of my WLED-enabled strips, I enabled Send UDP on the master device and Sync Receive on the other. Uncheck Receive UDP in Real Time if you don’t plan to use other applications to send effects data to the strips over the network.

Save your presets to retain them at boot. And back up your settings. Settings -> Security & Update -> Backup/Save Settings.

Turn settings off and on every time you make major settings changes. WLED automatically appeared on my Home Assistant via auto discovery. No manual configuration needed.

A person holding a Raspberry Pi and an ESP32.

5 projects that you can do much cheaper with an ESP32 than with a Raspberry Pi

Why spend more on a Raspberry Pi when you can build these interesting projects with an ESP32?

This is what real music-controlled lights look like

The under-$2 INMP441 microphone picks up bass, mids, and treble independently throughout the room, something commercial LED strips don’t do. Avoid cheap analog microphones (MAX4466) that provide inconsistent results.

The Music Controlled RGB LED Strip costs less than $20 if you’re comfortable with basic soldering and troubleshooting with the proper WLED firmware. Next, I need my friend’s help to 3D print a nice Box for this ESP32 device..

A hard-learned lesson is to order a couple of units of each cheap component. You might ruin one, but the spare will help you complete the project.

A transparent representation of the ESP32-WROOM microcontroller

Brand

AITRIP

Connectivity features

USB

The ESP32 is a fantastic development board that combines solid specifications with an affordable price. Despite being cheaper than Arduino and Raspberry Pi Pico, it outperforms most of its rivals. Additionally, the ESP32 even has Wi-Fi and Bluetooth capabilities built into each board, making it ideal for projects where you can’t physically keep the microcontroller connected to your PC at all times.




Source link

Leave a Reply

Your email address will not be published. Required fields are marked *