Sound Level Detector using Arduino Nano and Analog Sound Sensor Module
Components Required
- Arduino Nano
- Analog Sound Sensor Microphone Module
- WS2812 8 Bit RGB LED (Straight)
- Breadboard
- Jumper Wires
- USB to Type-C Cable
About Components
Arduino Nano

The Arduino Nano is a compact, breadboard-friendly microcontroller based on the ATmega328P, now upgraded with a modern Type-C interface.
- Operating Voltage: 5V
- Input Voltage (VIN): 7V to 12V
- Microcontroller: ATmega328P (8-bit AVR)
- Clock Speed: 16 MHz
- Flash Memory: 32 KB (2 KB used by bootloader)
- SRAM / EEPROM: 2 KB / 1 KB
- Digital I/O Pins: 14 (out of which 6 provide PWM output)
- Analog Input Pins: 8 (10-bit resolution)
Sound Sensor Module

This module uses a high-sensitivity capacitive electret microfphone and an LM393 comparator for real-time sound detection.
- Operating Voltage: 3.3V to 5V
- Output Type: Dual Output (Analog & Digital)
- AO (Analog Output): Real-time voltage signal from the microphone.
- DO (Digital Output): High/Low signal based on the sound threshold.
- On-board Features: Integrated potentiometer (sensitivity adjustment knob) to set the sound threshold.
- Comparator: LM393 low-power voltage comparator.
WS2812 8 Bit RGB LED Strip

The WS2812 is an intelligent, individually addressable LED light source that integrates the control circuit and RGB chip in one package.
- Operating Voltage: 5V DC
- LED Type: 5050 RGB LEDs with built-in WS2811 driver IC.
- Interface: Single-wire communication (One data pin controls all 8 LEDs).
- Data Transfer Speed: 800 Kbps
- Color Depth: 24-bit (8-bit per channel, providing 16.7 million color combinations).
- Brightness: Each color has 256 levels of brightness adjustment.
Working
- Microphone picks up sound
- Arduino reads the sound signal
- It checks how strong the sound is
- According to sound level, LEDs turn on
- Color changes from:
-
- Green → low sound
- Yellow → medium
- Red → high sound
Analog Signal
Sound sensor gives an analog signal, which means the voltage keeps changing continuously based on sound.
Arduino reads this using analogRead(), which converts the voltage (0–5V) into a value from 0 to 1023.
Since sound keeps changing, the code takes the difference between highest and lowest values (peak-to-peak) to find how strong the sound is.
More value = louder sound → more LEDs turn on.
Circuit Connections

Fig. Circuit Diagram

Fig. Schemetic Diagram
Sound Sensor
- VCC → 5V
- GND → GND
- OUT → A0
LED Strip
- VCC → 5V
- GND → GND
- DIN → D8
Code Explanation
Libraries Used
Purpose of Library
- Adafruit_NeoPixel → Controls WS2812/NeoPixel LED strip and manages color + brightness
Pin Definitions
- Microphone connected to analog pin A0
- LED strip data connected to digital pin 8
- Total LEDs defined for scaling output
Sensitivity Configuration
- Defines how long sound is sampled
- Filters background noise
- Controls sensitivity range
Smoothing Variables
- Prevents flickering
- Creates smooth LED transitions
Setup Function
- Initializes serial communication
- Starts LED strip
- Sets brightness level
- Turns off LEDs initially
Reading Sound Signal
- Captures time window
- Tracks max and min signal
Collecting Data
- Reads multiple samples
- Finds peak and lowest values
- Represents sound amplitude
Sound Level Calculation
- Calculates signal strength
- Higher value → louder sound
Mapping to LEDs
- Converts sound into LED count
- Ensures value stays within limits
Smoothing Output
- Fast rise, slow fall behavior
- Eliminates jitter
Result
System converts real-time sound input into a dynamic LED bar. Louder sound increases LED count, while silence gradually reduces it. Output remains stable due to smoothing and threshold filtering.

Real-Life Applications
- Audio Visualizer — Real-time music visualization
- Noise Monitoring — Detect loud environments
- Interactive Installations — Sound-reactive lighting systems
- Signal Strength Indicator — Analog signal visualization concept
- Educational Demonstration — Analog signal processing and mapping
Checkout the full video tutorial:
