This project creates a real-time audio visualization on an 8x8 LED matrix using an ESP32 (LilyGO T-Display) and Python for audio processing.
/arduino: Contains the.inofirmware for the ESP32./python: Contains theaudio_to_leds.pyscript and virtual environment setup.handout.md: Original project instructions and technical specs.
| LED Matrix | ESP32 Pin | Wire Color |
|---|---|---|
| VCC | 5V | RED |
| GND | GND | BLACK |
| DIN | G13 | YELLOW |
| CLK | G17 | GREEN |
| CS | G15 | BLUE |
Note: If the matrix does not display data, consider moving CLK to G14 as G17 can sometimes conflict with internal PSRAM on specific LilyGO boards.
- Open
arduino/esp32_max7219_matrix.inoin Arduino IDE. - Install library:
MD_MAX72XX. - Board:
ESP32 Dev Module(or LilyGO T-Display specific). - Hold the BOOT button on the ESP32 while clicking Upload. Release when "Connecting..." appears.
- Navigate to the project folder.
- Create and activate virtual environment:
python3 -m venv venv source venv/bin/activate pip install pyserial numpy scipy sounddevice
- Activate venv:
source venv/bin/activate - Run script:
python3 python/audio_to_leds.py - Ensure your Mac volume is up. The script currently uses the MacBook Pro Microphone to capture audio from your speakers.
- Falling Peaks: Professional audio visualization effect.
- Auto-Smoothing: Prevents flickering for a clean look.
- Frequency Analysis: Uses Fast Fourier Transform (FFT) to split music into 8 distinct frequency bands.
- No Output: Check G17/G13/G15 wiring. Ensure RED is on 5V.
- Serial Error: Ensure the Arduino Serial Monitor is CLOSED before running the Python script.
- Quiet Visualization: Increase your Mac volume or get closer to the mic.