π ESP32 Real-Time FFT + Waterfall Visualizer This project implements a real-time frequency spectrum analyzer using FFT (Fast Fourier Transform) and a waterfall display on an ESP32 with an ILI9341 TFT screen. It captures audio or analog signals through the internal ADC, performs spectral analysis, and visualizes the result graphically.
π§ Requirements ESP32
ILI9341 TFT display
Arduino libraries:
arduinoFFT
Adafruit_ILI9341
Adafruit_GFX
π Specifications Sampling rate: 512 samples at 44 kHz
FFT resolution: 512-point FFT (covers up to 22 kHz)
Display outputs:
Real-time FFT bar graph
Waterfall (scrolling color-based frequency map)
Color mapping: blue β cyan β yellow β red, based on signal intensity
Adjustable gain: via fftGain_dB
Optional noise subtraction (simple spectral background filtering)
ADC sampling via analogRead(), synchronized with micros() timer
π Default Pinout Signal ESP32 Pin Description ADC_IN GPIO35 Analog input (ADC1_CH8) DAC_OUT GPIO25 DAC output (optional use) TFT_CS GPIO15 Chip Select for TFT TFT_DC GPIO2 Data/Command for TFT TFT_RST GPIO4 TFT Reset
π₯οΈ Display Interface FFT view: vertical green bars representing signal magnitude
Waterfall view: scrolling spectral heatmap with colors for intensity
Colors are calculated with the intensityToColor() function for a smooth gradient.

π Key Functions captureSamples() β Samples analog data at precise intervals
drawFFTLine() β Draws vertical spectrum bars on screen
drawWaterfallLine() β Draws and scrolls new waterfall lines
intensityToColor() β Maps signal intensity to RGB color
smoothMagnitude() β Applies simple smoothing to FFT bins
π§ͺ Options & Features Set useNoiseSubtraction = true to enable simple background noise filtering.
Adjust fftGain_dB to scale the FFT intensity (useful for visual tuning).
π· Demo (Insert a GIF or image of the waterfall + FFT display here)
π Related Projects If you have other similar versions (e.g., DMA-accelerated, I2S ADC, ILI9488 support), you can reuse this structure and update:
Sampling method (analogRead() vs I2S)
Screen resolution and type
FFT size or frequency range