Esp32 Waterfall Frequency Demo






An ESP32 dev board with a built-in microphone and TFT screen setup.
For another project I'm working on, I needed an ESP32, a microphone (to wake it up with a clap), and a high-quality TFT screen. This breakout does all of that and more!
sound
The microphone uses I²S (eye-squared-see), specifically the ICS-43434 mic. I²S listens to your voice, converts the sound to digital, and sends it to the ESP32. I²S makes working with sound easy but you must have a board that supports it. Some common boards that support I²S are the ESP32 and STM32.
screen
The TFT screen is similar to the LCD TV screens we have at home. It’s controlled with SPI and can handle almost movie quality animations.
others
Built with a Neo pixel (WS2812B-2020), USB-B connector, and 9 GPIO pins available (not including the ones used for the display and sound)
Supplies


For these supplies, I used a hot plate, a custom PCB, and a stencil. The info in parentheses matches up with the schematic and PCB.
dev board
- USB Micro-B Connector — 1x
- LED Resistors, 1kΩ — 2x (R3, R4 size: 0603)
- SMD Push Buttons — 2x (S1, S2)
- Power Orange LED — 1x (D2 size: 0805)
- Voltage Regulator, AP2112K-3.3
- Filter Capacitors, 10µF — 3x (C3, C4, C7 size: 0603)
- WS2812B-2020 RGB LED — 1x (D12)
- Microphone Resistors, 47kΩ — 2x (R5, R7 size: 0603)
- Filter Capacitors, 0.1µF — 4x (C1, C2, C6, C8 size: 0603)
- Filter Capacitors, 1µF — 2x (C5, C9 size: 0603)
- Diode, MBR120 — 1x (D1)
- ESP32-S3 Module — 1x
- Pull-up Resistors, 10kΩ — 2x (R1, R2: 0603)
- Microphone Signal Resistor, (68-100)Ω — 1x (R6 size: 0603)
- MEMS Microphone (ICS-43434) — 1x
- Green LED — 1x (D3 size: 0805)
Tft screen
The Build




Order the board and stencil here
custom pcb and stencil
Solder Tools I Use:
- 110V 850W hot plate (mine’s big, a smaller one is fine)
- Solder paste, flux, squeegee, plastic tipped tweezers
Assembly Notes:
Align the stencil, apply solder paste, place components (watch silkscreen for chip orientation), and melt the solder on the hot plate (I place the assembled board when the plate is off and remove the board when the plate reaches 215 °C).
Watch the diode orientation(s) and for the WS2812B-2020 RGB LED. On the PCB, there are two lines around the WS2812B's area. One line has an extra 90-degree bent tip. The side with the bent line should face the “dot” side of the WS2812B. See included pictures.
Microphone orientation should be easy. Align the hole in the MEMS microphone with the hole in the PCB
FFT Demo


This project will be used for another purpose (notice the many opened gpio pins), but I did spent way too much time on this FFT waterfall demo and think it's neat and worth sharing.
I²S Code
I²S is very powerful and easy to implement in hardware, but the software side of things can get a little more involved. I'll admit, a lot of the parameters and settings I just pulled from other open-source demos. I don’t fully understand all of them. The code is also overly complex if you need just out-of-the-box I²S. For this FFT visualization, I added a high-pass filter, minimum volume cutoff, etc., but it could be a good starting point for a custom ESP32 I²S board.
TFT Code
The TFT_eSPI.h library is used and found here TFT_eSPI. This is a great library but it can be hard to set up. I'll include my ST7789 driver setup files for this build.
FFT
The FFT (Fast Fourier Transform) is one of my favorite algorithms (original, right?), but it really is remarkable. Basically, by checking how well different frequencies match up to the original signal, with a frequency sweep, you get high responses for frequencies actually present in the signal. For instance, you can have a really complicated messy signal, but if there’s a strong 200Hz tone in there, the FFT will find it.
Of course, the FFT is way more mathematical than just a frequency test. One cool consequence of the FFT is the mathematical answer to the question “what’s the frequency of a clap or snap?”. The answer is every frequency, or infinite frequencies. A statement like that might sound meaningless, but once you dive into the math behind the FFT, you realize that’s actually the only acceptable answer :)
In my demo, you can see that when I snap my fingers, a blanket (almsot ∞) frequency response shows up!
Thanks for checkout out my instructables!