Using an Arduino Nano, the sound reactive LED lights project is the best electronic project for a hobby electronic enthusiast. The LED lights will be on and off based on the music or sound. This project uses a condenser microphone to detect the audio signals and dynamically adjust the LED brightness and patterns based on the intensity and frequency of the sound. Whether it’s for creating an engaging music visualization setup, enhancing home decor, or building an interactive art installation. This project’s circuit diagram and programming code are given in this article.
Sound Reactive LED Lights Using Arduino Nano

Components Required
| Component | Specification/Description | Quantity |
|---|---|---|
| Arduino Nano | Microcontroller board | 1 |
| WS2812 LED Strip | Neopixel individually addressable LEDs | 1 |
| BC547 Transistor | NPN Bipolar Junction Transistor (BJT) | 1 |
| Condenser Microphone | Sound sensor for detecting audio signals | 1 |
| 10kΩ Resistor | 1/4 watt Fixed value resistor | 2 |
| 100kΩ Resistor | 1/4 watt fixed value resistor | 1 |
| 104 Capacitor | 100nF (0.1µF) ceramic capacitor | 1 |
| 5V DC Power Supply | Provides power to the circuit | 1 |
| Wires & Connectors | For making electrical connections | As needed |
Connection
In this given sound reactive LED light circuit, a BC547 transistor is used to amplify the audio signal received from the condenser microphone. The amplified audio signal will be detected by the Arduino nano through the Pin A5.
The collector pin of the transistor is connected to the A5 of Arduino Nano. The emitter pin is connected to the ground connection. A 100kΩ resistor is placed between the collector of the transistor and the audio signal input to regulate the current flow.
The 10kΩ resistor is connected between the transistor’s collector pin and ground to stabilize the input signal. A 104 pf disc capacitor is used to filter unwanted noise from the microphone input.
The microphone’s one terminal is connected to the 5V supply voltage through a 10kΩ resistor. The ground pin of the microphone is also connected to the common ground of the circuit.This circuit will work when the condenser mic detects the audio signals. Then, the signal is amplified by the transistor, and it is transferred to the Arduino. The Arduino then turns on and off the WS2812 LED strip based on the audio signal.
Sound Reactive LED Lights Programming Code
// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// Released under the GPLv3 license to match the rest of the
// Adafruit NeoPixel library
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
// Which pin on the Arduino is connected to the NeoPixels?
#define PIN 14 // On Trinket or Gemma, suggest changing this to 1
// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 50 // Popular NeoPixel ring size
#define rg 20
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
#define DELAYVAL 500 // Time (in milliseconds) to pause between pixels
int color,a,b,c,d;
uint32_t colort;
void setup() {
// These lines are specifically to support the Adafruit Trinket 5V 16 MHz.
// Any other board, you can remove this part (but no harm leaving it):
#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
clock_prescale_set(clock_div_1);
#endif
// END of Trinket-specific code.
pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
pixels.clear();Serial.begin(9600);}
void loop() {
a=0;
for(int i=0; i<10; i++) if(analogRead(A5)>a)a=analogRead(A5)-170;
if(a<0) a=0;
b+=a;
if(b>850){b=0;c+=20;color=random(0,1200);}
if(c>120)c=0;
if(color<0)color=0;
Serial.print("\t output = ");
Serial.println(a);
// The first NeoPixel in a strand is #0, second is 1, all the way up
// to the count of pixels minus one.
pixels.clear();
if(a>0){
d=map(a,0,500,0,50);
for(int i=0; i<d; i++) { // For each pixel...
if(color<=100)colort=pixels.Color(0, 0, 200);
else if(color>100&color<=200)colort=pixels.Color(0, (color-100), 200);
else if(color>200&color<=300)colort=pixels.Color(0, (color-100), 400-color);
else if(color>300&color<=400)colort=pixels.Color(0, 200, 400-color);
else if(color>400&color<=500)colort=pixels.Color(0, 200, 0);
else if(color>500&color<=600)colort=pixels.Color((color-500), 200, 0);
else if(color>600&color<=700)colort=pixels.Color((color-500), 800-color, 0);
else if(color>700&color<=800)colort=pixels.Color(200, 800-color, 0);
else if(color>800&color<=900)colort=pixels.Color(200, 0, 0);
else if(color>900&color<=1000)colort=pixels.Color(200, 0,(color-900));
else if(color>1000&color<=1100)colort=pixels.Color(1200-color, 0,(color-900));
else if(color>1100&color<=1200)colort=pixels.Color(1200-color, 0,200 );
// pixels.Color() takes RGB values, from 0,0,0 up to 255,255,255
// Here we're using a moderately bright green color:
pixels.setPixelColor(i,colort ); }
pixels.show();
// Send the updated pixel colors to the hardware.
delay(20);
// Pause before next pass through loop
} else{ delay(10); a=analogRead(A5)-170;if(a>0){for(int i=d-1; i>0; i--) {
d=0;
pixels.clear();
pixels.setPixelColor(i+1,colort );
pixels.show();
delay(10);
}}}
}
Also Check: Simple vu meter – LM3915 vu meter circuit diagram



