DIY Smart LED strip with Sound reactive effects using ESP8266 ESP32 WiFi

DIY Smart LED strip with Sound reactive effects using ESP8266 ESP32 WiFi DIY Smart LED strip with Sound reactive effects using ESP8266 ESP32 WiFi

Intro:

Do you want smart LED strip lights for your home interior, exterior or for any of the decoration purpose? But you found to spend lots of money for the controller which provides lots of RGB effects with sound reactive, music reactive, lots of customization with Wi-Fi operated web server, mobile control and android app. Don’t worry we are here with you to make a very cheap and very easy RGB Neopixel LED controller which fulfills all the above needs with no coding required.

What you learn?

In this detailed tutorial learn how to build an easy and cheap music reactive, ambient smart LED strip lights controller through which you can control various pixel LED models easily and customize the lighting effects from a huge library of ambient light effects and sound reactive effects all through web browser, mobile app or PC wirelessly through Wi-Fi. You can customize each and every setting of our DIY Neopixel LED controller remotely through Wi-Fi connected device.

Concept of building

We are using WLED project created and developed by Aircoookie, Atuline and few contributors in a very creative way by combining lots of LED effects libraries to make rich features to implement it on ESP32 or ESP8266 webserver, to control wide range of Neopixel LEDs and SPI based LEDs which are addressable.

Features of WLED Project:

  • Project contains more than 50 noise effects and Palettes from FastLED library.
  • Integrated with WS2812FX library for more than 100 special effects.
  • Audio reactive effects with sync
  • Has full support for RGBW LED strips
  • Configure the LED data output and sound input pins through web server interface
  • OTA full software updates through (HTTP + ArduinoOTA)
  • Password protectable
  • Automatic Brightness configuration to prevent the LED lights from over malfunction and burning.
  • Modern and Easy user friendly interface for web server for easy operation.
  • Timer function which dims the brightness as the time runs works as a night light.
  • Supports Alexa voice control with brightness, color controls and turning on and off.
  • Supports sound reactive effects where we need to include sound sensor module to ESP.
  • Supports IR remote where we need to include IR receiver module to ESP.
  • And more…

Now lets build the Neopixel LED controller and then discuss about its effects and features.

DIY Sound reactive smart LED controller with ESP8266 NodeMCU Wi-Fi

Components required for Sound reactive LED controller

  • ESP8266 NodeMCU board (We can use Wemos D1 also)
  • Sound sensor module (I’m using KY-037 analog/digital sound sensor module)
  • 330 ohm resistor (optional)
  • 100uf capacitor (optional)
  • Few connecting wires.

Download files required:

Download all the required files from below links. All the files are developed by their own respective creators.

For ESP8266 or NodeMCU:

  • NodeMCU flasher: Download
  • Sound reactive WLED for ESP8266 Ver-0.12 binary file: Download

Flashing WLED binary file to ESP8266 NodeMCU

After downloading the files required for the ESP8266 from the above links, first extract the NodeMCU flasher from it ZIP archive. After extraction open NodeMCU-flasher folder and then open WIn32/Win64 folder according to your operating system 32bit/64bit next open Release folder, where you can see ESP8266Flasher.exe file. Double Click on it to open. Then you can see the following interface as shown in the below image.

nodemcu flasher idle interfaceNow follow the steps carefully listed below to flash sound reactive WLED binary file to ESP8266 NodeMCU

Note:

If your are connecting NodeMCU first time to your PC and if it has CP210x chipset you need to install a driver to make it connect or else you may get an error showing “USB device not recognized”. To avoid it Download and install this driver : CP210x driver download link

  • Connect NodeMCU to the PC
  • After connecting you can see COM port number
  • Now click on Config menu tab and click on gear symbol to choose the bin file in first row.
  • Now go the downloads and choose the downloaded bin file “soundReactive_WLED_0.12.0_ESP8266.bin” and click on open.
  • Now comeback to Operation menu tab and hit Flash(F) blue button.
  • Then you can see the progression bar moving from left to right and AP MAC and STA MAC values this means a green signal our NodeMCU is flashing.
  • Do not disconnect the board while flashing, until a green tick mark appears on bottom left of the flasher window.

steps nodemcu flashing for wled led controllerThat’s it your NodeMCU is ready to be used as a Neopixel LED controller. You just need to connect the power supply, NeoPixel LEDs and sound sensor to NodeMCU as shown in the below circuit diagram and you are ready to ROCK.

Circuit/Connection Diagram

Now lets make a final Smart led strip by interfacing NodeMCU LED controller with NeoPixel LEDs and Sound sensor module as shown in the below image.

interfacing nodemcu esp8266 with neopixel and sound sensor for smart ledAs you can see from the above image NodeMCU ESP8266 is powered with 5Volts power supply, and WS2812b Neopixel LED strip is connected to 5V power supply as 5v/Vin is connected to +terminal and GND of LED strip is connected to -terminal of the power supply. The current capacity(Amps) of the power supply is chosen according to the requirement of WS2812 Neopixel led’s which depends on number of LEDs attached to the strip.

Data pin Din from Neopixel is connected to D4(GPIO2) of NodeMCU and a resistor of 330 ohms(220 to 470 ohms) is connected in series with the data connection which acts as a protection to the first LED incase when there is a over voltage fluctuation in the data signal. A 100Uf capacitor is connected in parallel which also works as a protection across the power supply.

The Analog output from the sound sensor A0 is connected to the A0 pin on NodeMCU. And + and GND pins of sound sensor are connected to the 3v3 and GND pins of NodeMCU respectively.

That’s it, cool our Cheap smart LED Strip with ESP8266 is ready to use. To know how to use it and play with all its effects skip to the end.

Learn: How Neopixel LEDs work

DIY Sound reactive smart LED controller with ESP8266 NodeMCU Wi-Fi

Components required for Sound reactive LED controller

  • ESP32 board with WiFi
  • Sound sensor module (I’m using KY-037 analog/digital sound sensor module)
  • 330 ohm resistor (220-470ohms)
  • 100uf capacitor (100-1000Uf )
  • Few connecting wires.

Download files required:

Download all the required files from below links. All the files are developed by their own respective creators.

For ESP32:

  • ESPHome Flasher: Download
  • Sound reactive WLED for ESP32 Ver-0.12 binary file: Download

Flashing WLED binary file to ESP32

Download and open ESPHome-Flasher-1.3.0-Windows-x64 from the above link which leads you to the interface looks as below.

esphome flasher interface to flash wled smart led controller with esp32Now follow the below steps to flash the WLED sound reactive led controller binary to ESP32 WiFi microcontroller.

  • Connect ESP32 to the PC.
  • Open ESPHome Flasher and click on refresh icon
  • Select the COM port where ESP32 is connected
  • Click on Firmware “Browse” button and choose the Downloaded .bin file from downloads.
  • Then hit Flash ESP button.
  • The process continues and Flashes the binary to ESP32 successfully.
  • That’s it now our ESP32 is converted in to smart LED controller.

steps to flash WLED smart controller binary to esp32 using esphome flasherAfter you hit flash ESP the process of flashing starts and don’t remove the connected ESP32 with PC until all the flashing process is completed, doing so can leads to damage in the ESP32.

esp32 flashing complete wled

That’s it your ESP32 board is ready to be used as a Neopixel LED controller. You just need to connect the power supply, NeoPixel LEDs and sound sensor to ESP32 as shown in the below circuit diagram and you are ready to ROCK.

Circuit/Connection Diagram

Now lets make a final Smart led strip by interfacing ESP32 LED controller with NeoPixel LEDs and Sound sensor module as shown in the below image.

interfacing esp32 with neopixel and sound sensor for smart ledThis connection is nearly same as we done with esp8266 here we just changed the pin numbers as the data pin from Neopixels is connected to D2(GPIO2) of ESP32. The resistor and capacitor are connected same to protect against over voltage data signal to prevent the first LED from malfunction.

The analog output pin A0 from the sound sensor is connected to the VP(GPIO36) pin of ESP32.

That’s it you are ready to go…

Related project: Sound Reactive RGB LED strip with ESP8266 with screen reactive

Connecting, configuring and using DIY Smart LED strip using WLED project.

once you done with the above things, your device throws access point connection. Now open wifi setting on your mobile phone or PC and look for “WLED-AP”. If you find it click on it to connect using default password wled1234 .

Once you connected a popup or WiFi sign in window appears on mobile devices. If not then open any browser on mobile or PC and type http://4.3.2.1 to get WLED welcome home screen. Where you can see WLED welcome logo and two button with WIFI SETTINGS and TO THE CONTROLS!

WIFI SETTINGS:

This page has all the configuration settings related to WIFI and connectivity. Where you can change the Access point name, password, connect to the internet to access the device remotely, change the local DNS address to access it through named URL instead of 4.3.2.1. as you can see from the below image screenshots

wled welcome and wifi settings pageTO THE CONTROLS!

Config:

wled config page with led setup and software updates pageConfig page: When you click on config present at the top right of the window the list of options appears as shown in the screenshot 1.

Screenshot 2:(LED preferences) It shows all the settings related to LEDs and hardware where user can choose number of LEDs to function, the amount of current in mA to allot for each LED.

Selecting the Neopixel strip model and color order like RGB,GRB,BGR,GBR, can also configure to which pin the data pin of Neopixel strip to be connected to microcontroller and also for the pins for button, IR remote and relay pin.

Screenshot 3: (LED preferences) You can adjust the time delay in the effects, maximum brightness of the LEDs with the range of 0-255

Screenshot 4: (Software update) in this window you can set the password for OTA software update, Erase everything to Factory reset and also has a facility to manually update the software.

wled menu with all featuresFrom the above image you can see all the menu contents which you can customize. lets take a look in detail

Colors: In this you can change the Default main color, secondary color and third colors which can we used in effects panel.

Effects: This is the panel for everyone to get attracted, it has huge collection of lighting effects including Sound reactive effects in the beginning whose names start with * symbol which also include most popular VU meters. We cant explain how beautiful those effects are so explore them by your own and have fun and joy.

Segments: In this you can divide the number of LEDs into segments and can apply custom colors, effects and more.

Favorites: You can create and save your favorite colors, effects with brightness levels and save them for faster access.

Info: Info page has the details of software version, build, WiFi signal strength, Device uptime, estimated current usage, FPS of LEDs, Mac address, memory usage, device name and has the options to refresh and reboot WLED.

wlead info pageThanks for learning from CircuitSchools. We are happy to serve you. If you found this project helpful, please share with your friends and follow our Facebook page for more interesting project updates. Visit our site CircuitSchools for more projects and tutorials.

WLED official Wiki page: link

3 comments
  1. Hi, i have build exaxtly like you. But it response very poor to sound. Only when i directly speak to the mic there is a response. Is there a way to make it more responsive?

  2. Have followed this tutorial using ESP8266, it’s working OK but the sound reactive effects don’t function, the lights switch off when selecting sound reactive modes. Is there something I’m missing here?

Leave a Reply

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