ESP32 Projects
Start a build
Markdown

Spectrum Analyzer for ESP32-WROOM-32

An ESP32 display project for ESP32-WROOM-32 involving OLED display, Microphone.

ESP32-WROOM-32ArduinoUnrated
Parts and source

Before you start

Check the exact OLED display, Microphone configuration against the upstream wiring or parts list.

Upstream README

ESP32 Audio Spectrum Analyzer

A real-time audio spectrum analyzer built on the ESP32, featuring a custom-designed PCB. Captures audio via an I2S MEMS microphone, runs FFT processing on-chip, displays a live 16-bar frequency spectrum on an OLED display, and streams real-time FFT data over WiFi to a browser-based visualizer via WebSockets.


Demo Videos

Analyzer reacting to noise:

https://github.com/JadenS180/spectrum-analyzer/raw/main/media/spectrum-DemoNoise.MOV

Analyzer in a quiet environment:

https://github.com/JadenS180/spectrum-analyzer/raw/main/media/spectrum-DemoQuiet.MOV


Web Dashboard

Reacting to noise

Dashboard Noise

Quiet environment

Dashboard Quiet


Photos

Full Breadboard Build

Breadboard

Side Views

Side View 1 Side View 2 Side View 3

Components
ESP32 Front ESP32 Back
ESP32-WROOM-32 (front) ESP32-WROOM-32 (back)
INMP441 Front INMP441 Back
INMP441 Microphone (front) INMP441 Microphone (back)
OLED Front OLED Back
SSD1306 OLED (front) SSD1306 OLED (back)
PCB

PCB Front PCB Back


Features

  • Real-time FFT using 512-sample windows at 44,100 Hz
  • 16 frequency bars mapped across the audible spectrum
  • Hann windowing to reduce spectral leakage
  • Peak hold indicators on each bar
  • DC/low-frequency noise suppression via bin offset
  • Custom 2-layer PCB designed in KiCad and manufactured by JLCPCB
  • WiFi streaming via WebSockets to a browser-based canvas visualizer

Hardware

Component Description
ESP32-WROOM-32 Microcontroller
INMP441 I2S MEMS microphone
SSD1306 0.91" I2C OLED display (128x32)
AMS1117-3.3 3.3V LDO voltage regulator
USB-C Receptacle Power input
Pin Mapping
Signal ESP32 GPIO
I2S SCK 26
I2S WS 25
I2S SD 33
I2C SDA 21
I2C SCL 22

Firmware

Written in Arduino C++ using the Espressif ESP32 package (v3.3.10).

Dependencies:

To flash:

  1. Open firmware/spectrum_analyzer.ino in Arduino IDE
  2. Set your WiFi credentials in the firmware
  3. Select board: ESP32 Dev Module under Espressif Systems
  4. Connect ESP32 via USB and select the correct port
  5. Upload

Web Dashboard

The dashboard is a single HTML file in the dashboard/ directory. Open it in a browser while the ESP32 is powered and connected to WiFi. Update the WebSocket IP in index.html to match your ESP32's IP address.


PCB Design

Designed in KiCad. The board is a 2-layer FR-4 PCB with a filled GND copper pour on F.Cu and a keep-out zone over the ESP32 antenna. Manufactured by JLCPCB.

KiCad schematic, PCB layout, and Gerber files are in the hardware/ directory.


Repository Structure

spectrum-analyzer/
├── firmware/
│   └── spectrum_analyzer.ino
├── hardware/
│   ├── spectrum_analyzer.kicad_pro
│   ├── spectrum_analyzer.kicad_sch
│   ├── spectrum_analyzer.kicad_pcb
│   └── gerbers/
├── dashboard/
│   └── index.html
├── media/
│   ├── (photos)
│   └── (videos)
└── README.md

Author

Jaden Smiles — github.com/JadenS180