Skip to the content
2 layers61.5 × 50.3 mmSpectrum analyzer, the printed circuit board in 3D

Reactive LED matrix music visualizer: Arduino + 74HC595 multiplexed display driven in real time by laptop-side MP3 audio analysis over serial

Size
61.5 × 50.3 mm
Copper layers
2
Thickness
1.6 mm
Parts
16
Nets
23
Pads
53
Tracks, vias
124, 0
Pours
1
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
29 Jun 2026
Updated
28 Aug 2026

Overview

Spectrum analyzer is an open-source printed circuit board by VinayBhagavath, from the VinayBhagavath/LEDMusicVisualizer repository on GitHub. It is a 2-layer board of 61.5 × 50.3 mm with 16 parts on 23 nets, routed with 124 tracks and 0 vias.

It is built around the 74HC595. Its parts include 6 diodes, 5 resistors, 2 transistors, 1 capacitor and 1 IC. It belongs with the lEDs and displays and audio and music boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

1

README

README.md

LED Matrix Music Visualizer

A 6-LED (2 row × 3 column) matrix driven by an Arduino Uno R3, reacting live to an MP3 played from a laptop — no microphone involved. The laptop analyzes the actual audio data as it plays and streams a volume level to the Arduino over serial, which displays it as a bar graph across the matrix.

Originally built and verified on a breadboard, then redesigned as a custom 2-layer PCB in KiCad for a permanent build. Both versions use identical Arduino pin connections and the exact same code.

Circuit Diagram

Top-down LED circuit

Hardware

  • Arduino Uno R3
  • 74HC595 shift register (drives the 3 columns)
  • 2× NPN transistor (2N2222 or similar, drives the 2 rows)
  • 6× LED + 220Ω resistors (columns)
  • 2× 1kΩ resistors (transistor bases)
  • 100nF bypass capacitor across the 74HC595's power pins (PCB build only — not present on the original breadboard, added as standard practice when moving to a permanent board)
  • Breadboard + jumper wires, or the custom PCB (see below)

Pinout

SignalArduino PinNotes
74HC595 RCLK (latch)D11ST_CP / chip pin 12
74HC595 SRCLK (clock)D12SH_CP / chip pin 11
74HC595 SER (data)D10DS / chip pin 14
Row 1 transistor baseD2via 1kΩ resistor
Row 2 transistor baseD3via 1kΩ resistor

Column wiring (confirmed via bit-scan test)

Column74HC595 output
Column 1Q1 (bit 1)
Column 2Q2 (bit 2)
Column 3Q3 (bit 3)

Q0 is unused — not a problem, just means that output pin isn't wired to anything.

How it works

The display uses multiplexing: since the shift register can only hold one column pattern at a time, each row is lit for a couple of milliseconds and cycled fast enough (~250Hz) that persistence of vision makes both rows look lit simultaneously. This logic lives in refreshDisplay() in the Arduino sketch and doesn't change regardless of what's driving the pattern — hardcoded test frames, or live audio, both just write into the same grid[][] array.

Pipeline:

  1. play_and_visualize.py loads an MP3, plays it through your speakers, and in ~50ms chunks computes the volume (RMS) of the audio as it plays.
  2. Each chunk's volume is scaled to a number 0–6 and sent over serial as a single byte, timed to match playback.
  3. music_visualizer.ino reads that byte and lights that many LEDs as a left-to-right bar (both rows per column), using the existing multiplexed display loop.

Files

  • music_visualizer.ino — Arduino sketch. Upload this to the board.
  • play_and_visualize.py — Laptop script. Plays the audio and sends levels over serial.
  • spectrum_analyzer.kicad_sch / .kicad_pcb / .kicad_pro — KiCad project files for the PCB (schematic, board layout, project).
  • spectrum_analyzer.csv — Bill of materials exported from KiCad.
  • gerber/ — Manufacturing files (Gerbers + drill files) submitted to JLCPCB for fabrication.

Setup

Arduino

  1. Wire the board per the pinout table above (breadboard or PCB — same pins either way).
  2. Upload music_visualizer.ino via the Arduino IDE.
  3. Close the Serial Monitor afterward — only one program can hold the serial port at a time, and the Python script needs it.

Laptop

  1. Install dependencies:
bash
   pip install pydub numpy pyaudio pyserial
  1. Install ffmpeg (required by pydub to decode MP3s):
bash
   brew install ffmpeg        # macOS

This can take 10–20+ minutes on a first install since it pulls in a long chain of codec dependencies — that's normal, not a hang. If a fresh terminal still can't find ffmpeg/ffprobe after install, run source ~/.zshrc (or your shell's config file) to refresh your PATH. 3. In play_and_visualize.py, set:

  • MP3_PATH to your audio file
  • SERIAL_PORT to your Arduino's port (find it via ls /dev/tty.* on macOS/Linux, or Device Manager on Windows, while the board is plugged in)
  1. Run it:
bash
   python play_and_visualize.py

Testing history / verification steps

These were used to confirm the hardware before wiring up audio, and are worth re-running if something stops working:

  • Individual LED test — lights each of the 6 LEDs one at a time in sequence, confirming every row/column/transistor path is wired correctly.
  • Bit-scan test — cycles through all 8 shift-register output bits with both rows held high, used to find which physical column each bit actually controls (this is how the Q1/Q2/Q3 mapping above was determined).
  • Hardcoded animation test — a bouncing-dot pattern across both rows, used to confirm the multiplexed refresh loop runs without flicker.

Tuning

  • CHUNK_MS in the Python script controls responsiveness: smaller values react faster but look jumpier, larger values look smoother but laggier.
  • The volume-to-level scaling uses the 95th percentile of the whole track's loudness (not the true max), so a few loud peaks don't make the rest of the song look artificially quiet by comparison.

PCB build

The breadboard circuit was redesigned as a 2-layer through-hole PCB in KiCad and ordered from JLCPCB, keeping the circuit itself unchanged — same components, same values, same Arduino pins — just moved onto a fixed board instead of a breadboard. The only addition is a 100nF bypass capacitor across the 74HC595's power pins, standard practice for a permanent board that wasn't strictly necessary on the breadboard version.

Board specs

  • 2-layer, FR-4, 1.6mm thickness
  • 61.5mm × 50.34mm
  • Bottom-layer ground plane (copper pour) tied to GND
  • All through-hole components, hand-soldered

PCB Photos & Demo

PCB Soldering Reference

Back of the populated board, showing solder joints:

PCB back / solder joints

PCB-Arduino Wiring

Full setup — Arduino wired to the PCB via J1:

Full setup - Arduino wired to PCB

J1 pinSignalArduino Pin
1Row 1 transistor baseD2
2Row 2 transistor baseD3
374HC595 SER (data)D10
474HC595 RCLK (latch)D11
574HC595 SRCLK (clock)D12
6+5V5V
7GNDGND

Demo Video

Music-reactive LEDs running on the finished PCB:

https://github.com/user-attachments/assets/d333de99-bf11-4e3e-b501-384f226c006d

Possible next steps

  • Split into frequency bands (bass/mid/treble) via FFT instead of a single overall volume level, if scaling to more LEDs/columns.
  • Scale up to the original 8×6 (48-LED) matrix design — the multiplexing logic doesn't change conceptually, just its size.
  • Add a physical enclosure and diffuser so individual LEDs blend into a smoother visual.

Parts

16
QtyValueFootprintReferences
6LEDLED_THT:LED_D5.0mmLED1, LED2, LED3, LED4, LED5, LED6
3220Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P5.08mm_VerticalR1, R2, R3
21kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P5.08mm_VerticalR4, R5
22N2222Package_TO_SOT_THT:TO-92_InlineQ1, Q2
1100nCapacitor_THT:C_Disc_D5.0mm_W2.5mm_P2.50mmC1
174HC595Package_DIP:DIP-16_W7.62mmU1
1Arduino_UnoConnector_PinHeader_2.54mm:PinHeader_1x07_P2.54mm_VerticalJ1

Similar boards

  • 2 layers45.7 × 31.8 mmLEDx16 board, the printed circuit board in 3D

    LEDx16 board

    tardate/LittleArduinoProjects

    a collection of "Little Electronic & Arduino Projects", most involving electronics or an Arduino in one way or another!

    36 parts803MIT
  • 2 layers228.6 × 100 mmMongus48, the printed circuit board in 3D

    Mongus48

    ChrisChrisLoLo/beyblock20

    The magnetic, modular, 20-key macropad that can join together to form an ortholinear board

    124 parts335GPL-3.0
  • 2 layers245.1 × 160 mm8-Bit CPU 32k, the printed circuit board in 3D

    8-Bit CPU 32k

    slu4coder/Minimal-64x4-Home-Computer

    My DIY TTL home computer with VGA and PS/2 and 4x the processing power of a Commodore C64 or Apple II.

    139 parts326
  • 2 layers100 × 95.1 mmProtoboard-6x4-breakout, the printed circuit board in 3D

    Protoboard-6x4-breakout

    electroniceel/protoboard

    Advanced protoboard layout with 1.27mm pitch for smd parts

    4,745 parts311CC-BY-4.0
  • 4 layers140 × 100 mmDc usv, the printed circuit board in 3D

    Dc usv

    TobleMiner/DC-UPS

    A small DC UPS, designed to keep small appliances like consumer network equipment running during power outages

    351 parts223CERN-OHL-P-2.0
  • 2 layers100.5 × 218.3 mmTraktorino, the printed circuit board in 3D

    Traktorino

    silveirago/traktorino

    The open-source DIY MIDI Controller for DJs.

    96 parts220
  • 2 layers287.8 × 126.7 mmNoName, the printed circuit board in 3D

    NoName

    AlaaSaadAbdo/battoota

    Keyboards

    267 parts188
  • 2 layers100 × 100 mmTommyPROM32-595, the printed circuit board in 3D

    TommyPROM32-595

    TomNisbet/TommyPROM

    Simple Arduino-based EEPROM programmer

    36 parts187

Questions

How big is the Spectrum analyzer PCB?

It measures 61.5 × 50.3 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Spectrum analyzer use?

16 parts, built around the 74HC595. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Spectrum analyzer KiCad files?

From the VinayBhagavath/LEDMusicVisualizer repository on GitHub, at the commit this page was made from: the board is spectrum_analyzer.kicad_pcb and its schematic spectrum_analyzer.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Spectrum analyzer design in my own project?

Its repository states no licence, so its author keeps all rights: ask VinayBhagavath before reusing the design.