Build a real-time audio spectrum analyzer in an afternoon: ESP32, a touch display and a handful of passives
Build a real-time audio spectrum analyzer in an afternoon: ESP32, a touch display and a handful of passives
There is a reason spectrum analyzers became the poster child of maker electronics: they are the rare project where the hardware is nearly free, the maths is genuinely interesting, and the result is something you will actually keep on a shelf. The latest entry in the genre is Mircemk's DIY ESP32 Audio Spectrum Analyzer, a real-time stereo frequency visualiser built on an Elecrow CrowPanel 3.5-inch HMI ESP32 display, featured in September 2026 and carrying his usual hallmark — a bill of materials so short it fits in one paragraph.
This is the kind of build worth understanding properly, not just flashing. The signal path teaches you how analog audio meets a microcontroller's ADC, what a fast Fourier transform actually does to a stream of samples, and why even a visually excellent build is — in the author's own words — not a precision instrument. If you already own a display board, the whole thing costs you an afternoon and a couple of resistors.
The hardware: a display board that is secretly a development board
CrowPanel-style HMI displays are ESP32 modules with an integrated IPS touch LCD, a USB interface for programming, and a nice enclosure-ready footprint. That is the appeal: you are not building a display driver circuit, soldering jumpers to a bare TFT, or worrying about the SPI bus wiring. The display board is the microcontroller board, the same philosophy behind our 4.3-inch ESP32-S3 touch display — a larger sibling that runs the same class of firmware with more headroom.
The input circuit is where the build gets interesting, because the CrowPanel's ESP32 analog pin is not an audio input by design. Mircemk taps the signal into GPIO35 and biases it to 1.6 volts through two 100K resistors. That bias is the part beginners always miss: an analog-to-digital converter on the ESP32 can only read voltages between ground and its reference — it has no idea what a negative voltage is, and feeding it one is a good way to get garbage readings or a damaged pin. Audio swings both sides of zero, so you lift the whole signal up to sit centred at mid-rail, and the incoming waveform oscillates around that bias point instead of around zero.
A capacitor in series blocks any DC component already present in the source audio, and a 1K series resistor protects the input from signals that should not be there. That is the entire analog front end. No op-amp, no dedicated codec chip, no external ADC. The quality ceiling is accordingly modest, but for a visualiser it is entirely sufficient.
The FFT: what the bars are actually showing
The software is where the word "analyzer" earns its keep. The firmware samples the audio, chops the sample stream into windows, and runs a fast Fourier transform — the algorithm that converts a signal sampled over time into its constituent frequencies. If you have never worked through it, the Wikipedia article on the FFT is a reasonable starting point, but the practical intuition is simpler: any sound you feed in is a mixture of pure tones, and the FFT is a machine that takes the mixture apart and tells you how much of each frequency is in it. Heavy bass content piles energy into the bins at the left of the display; a whistling kettle will light up one narrow band.
Mircemk's firmware ships in two flavours: a 32-bar version that splits the 20 Hz to 20 kHz range into two separately processed halves, and a standard 24-bar version. That split matters more than it sounds. A linear FFT spreads its bins evenly across the sample bandwidth, which means low frequencies — where music carries most of its perceptible energy — get crammed into a handful of bins while the top end sprawls across dozens. Splitting the processing lets the display give bass a fair share of screen real estate, which is exactly how commercial analyzers fake their way to a balanced look.
Rendering goes through the TFT_eSPI library, Bodmer's widely used driver for SPI displays on ESP32 boards, and the author is explicit that you should use the exact version he specifies because the display configuration for these panels is fiddly and library updates occasionally break it. Bar movement, fall speed and colour mapping are all controlled by variables at the top of the sketch, so tuning the display's behaviour is a matter of editing constants rather than touching the DSP code.
Honest limitations
It is worth being straight about what this is not. The author states plainly that this is not a precise audio instrument — it is an interesting visual addition to an audio system. That honesty is refreshing, and the reasons are structural. The ESP32's ADC is noisy by instrumentation standards; the input network has no calibrated attenuation, so loud sources clip and quiet sources drown in quantisation noise; and the FFT windowing parameters are chosen for visual appeal rather than measurement accuracy. If you need to actually measure harmonic distortion or characterise a filter, you need real test gear, and even a modest bench analyzer will outclass this by orders of magnitude.
But for a large class of genuine uses — checking whether your amplifier is actually reproducing bass, hunting a mains hum pickup in a cable run, tuning a speaker enclosure by eye, or simply teaching yourself what a spectrum looks like — honest-visual is the right tool. The shortcoming that matters most in practice is level accuracy, not frequency accuracy. Frequencies come from sample rate and FFT size, which the ESP32 can hold precisely. Levels depend on analog gain, which nothing here calibrates.
Building it yourself
If you want to reproduce it, the parts list is: a CrowPanel-class ESP32 display, two 100K resistors, a coupling capacitor, a 1K resistor, and an audio source. The project page links the full schematic, both firmware variants, the library list and a demo video, and the author's earlier stereo VU meter project documents the same input section in more depth if the biasing needs explaining.
For Australian readers assembling rather than buying a display module, the same firmware pattern runs happily on any ESP32 with a compatible SPI panel, and our ESP32 dev starter kit covers the controller side with breadboard-friendly pinout for wiring the input network. One practical warning: this is a wired audio-input project. Do not be tempted to substitute a microphone module and claim the same result — a mic plus the ESP32's ADC will show you a spectrum, but room acoustics, ambient noise and the mic's own response will smear it badly. Line-level input gives you the clean picture the demo videos show.
There is also a genuinely useful upgrade path once you have the display running. Because the FFT is just code, you can point it at other sources entirely: an SDR receiver's audio output, the IF output of a scanner, or a function generator. A display board that shows you what is happening across a band turns from a toy into a troubleshooting tool the first time you watch a filter's response curve move live. For radio work at that level, our guide to SDR receiver options covers the receiver side that pairs naturally with a visualiser like this.
Why this genre keeps trending
Audio spectrum analyzers show up on Hackaday a few times a year, and they trend reliably for the same reason beginners' telescope kits do: the result is immediately, visibly gratifying, and the effort-to-impression ratio is hard to beat anywhere in electronics. But there is a second-order benefit that is less often pointed out. This project quietly teaches three things that transfer everywhere — DC biasing for ADC inputs, the practical realities of sampling real-world signals, and how a transform turns time-domain data into frequency-domain insight. Those are exactly the concepts you need when you later build any radio-adjacent project, from a weather station's barometric filtering to a software-defined radio waterfall.
The crowpanel ecosystem is expanding quickly because these integrated display boards remove the hardest part of any visual project: getting pixels on glass. Once the display is a solved problem, the interesting engineering is all signal and software — which is where the learning lives. An afternoon, two resistors and a capacitor is a small price for that.
If you build it, do yourself one favour: feed it a song you know intimately and watch where the energy sits. When you can predict which bars move before they do, you have internalised the FFT, and the display has done its real job.