How To Make Diy Music Reactive Rgb Led Ring (ws2812b)

About the project

In this tutorial we are going to make music reactive lights with Arduino Nano ESP32 board with Neopixels LED ring & microphone using Visuino

Project info

Difficulty: Easy

Platforms: AdafruitArduinoSparkFunVisuino

Estimated time: 1 hour

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

Breadboard (generic) Breadboard (generic) x 1
SparkFun Electret Microphone Breakout SparkFun Electret Microphone Breakout x 1
Jumper wires (generic) Jumper wires (generic) x 1
Adafruit NeoPixel Ring: WS2812 5050 RGB LED Adafruit NeoPixel Ring: WS2812 5050 RGB LED x 1
Arduino Nano ESP32 (or any other board) Arduino Nano ESP32 (or any other board) x 1

Software apps and online services

Visuino Visuino
Arduino IDE Arduino IDE

Story

Every time the sound is detected the LEDs will move and randomly change colors.

In case you do not have the microphone module I will also add a step at the bottom to make the project without it.

Watch the Video!

Step 1: What You Will Need

1 / 6

  • Arduino Nano ESP32 (or any other board)
  • Microphone module (Optional)
  • Neopixels LED ring
  • Breadboard
  • Jumper wires
  • Visuino program: Download Visuino

Step 2: The Circuit

  • Connect LED Ring pin [VCC] to Arduino pin VBUS or 5V]
  • Connect LED Ring pin [GND] to Arduino pin [GND]
  • Connect LED Ring pin [IN] or (DI) to Arduino digital pin [6]
  • Connect Microphone module pin [VCC] to Arduino pin [VBUS or 5V]
  • Connect Microphone module pin [GND] to Arduino pin [GND]
  • Connect Microphone module pin [DO] to Arduino digital pin [2]

Step 3: Calibrate the Microphone

Slowly rotate the trimmer until the second LED is off, and turns ON only if you make a sound.

Step 4: Start Visuino, and Select the Arduino Nano ESP32 Board Type

1 / 2

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino Nano ESP32" as shown on Picture 2

Step 5: In Visuino Add Components

1 / 3

  • Add "Clock Multi Source" component
  • Add "Random Color" component
  • Add "NeoPixels" component

Step 6: In Visuino Set Components

1 / 2

  • Double click on the "NeoPixels1" and in the "PixelGroups" window drag "Running Color" to the left
  • On the left side of the "PixelGroups" window then select "RunningColor1" and in the properties window set "Count Pixels" to 12 or 16 (Depends on how many LED your LED ring is having)
  • Close the "PixelGroups" window

Step 7: In Visuino Connect Components

1 / 2

  • Connect Arduino digital pin [2] to "ClockMultiSource1" pin [In]
  • Connect "ClockMultiSource1" pin [0] to "RandomColor1" component pin [Clock]
  • Connect "RandomColor1" pin [Out] to to "NeoPixels1" >RunningColor1 component pin [Color]
  • Connect "ClockMultiSource1" pin [1] to to "NeoPixels1" >RunningColor1 component pin [Step]
  • Connect "NeoPixels1" component pin [Out] to Arduino digital pin[6]

Step 8: Generate, Compile, and Upload the Project

  • In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Step 9: Play

After uploading the project to the Arduino Nano ESP32 the RGB LED ring will start to randomly change colors according to the detected sound by the microphone module.

Congratulations! You have completed your LED project with Visuino. Also attached is the Visuino project, that I created for this Tutorial. You can download and open it in Visuino: https://www.visuino.com

Step 10: Project Without the Microphone

1 / 2

Add "Pulse Generator" component and connect pin [Out] to "ClockMultiSource1" pin [In]

Select "PulseGenerator1" and in the properties window change the "Frequency" value to adjust the speed

Step 11: Tips

Place the microphone module near the speaker of a radio, phone or TV.

Schematics, diagrams and documents

Visuino File

Visuino File without the microphone

Code

Visuino File

Credits

Photo of Ron

Ron

Arduino Developer

   

Leave your feedback...