🌈 ESP32-S3 Rainbow: ZX Spectrum Emulator Board! Get it on Crowd Supply →
View All Posts
read
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi

ESP32-S3 as a USB Audio Device

That’s right, folks – it’s time for an audio project.

I’ve been testing out my new boards - so far everything is going well.

First Tests – LEDs, Sensors, and Battery Charging

So far, so good:

  • The RGB LED needed a small ninja fix. I put in a common cathode LED when it should have been common anode (or was it the other way round? Either way… fixed!).
  • The accelerometer and gyroscope worked nicely, letting me build a digital twin of the board.
  • The battery charger worked perfectly – no wires required while moving the board around for testing.

With that out of the way, it was time for the fun part: microphone and speaker tests.

Testing the Microphone

The board has:

  • An I²S PDM microphone
  • An I²S PCM amplifier
  • A tiny speaker

Board with microphone and speaker

My first thought: make it into a Bluetooth audio device. Unfortunately, the ESP32-S3 only supports Bluetooth Low Energy, not Bluetooth Classic – and BLE doesn’t do audio streaming.

BLE Only

Need to check what the ESP32-S3 can and can't do? I've built an interactive reference with the full specs, radio support, and pinouts for every Espressif chip and module: see the ESP32-S3 chip details or the ESP32-S3-WROOM-1 module page.

So instead, I pushed audio over USB serial. Turns out you can send a lot of data that way – around 7 Mbps in previous tests. For audio, I only needed ~32.2 KB/s (16 kHz, 16-bit samples).

And it worked beautifully.

I even had AI generate a little Web Serial Audio Studio for me:

  • Oscilloscope
  • Gain control
  • Spectrogram (looks pretty, not sure it’s correct…)
  • A glorious 1980s-style bar chart
  • Pitch tuner

Web Serial Audio Studio

Hooking up a piano confirmed the pitch tuner was picking up notes correctly. Microphone test: ✅

Pitch Detection

Moving to USB Audio (UAC)

Sending audio over serial worked fine, but then I remembered – the ESP32-S3 has native USB.

So why not make it into a USB Audio Class (UAC) device, like a USB headset or speaker?

And yes, it turns out you can.

The API gives you callbacks for:

  • Output
  • Input
  • Mute
  • Volume

The only catch: I couldn’t get the Arduino libraries to work. I had to switch over to ESP-IDF.

Thankfully, the ESP-IDF VS Code plugin makes that a lot easier with its explorer, build, and flash tools.

Limitations: Mac vs Windows

One big drawback:

  • Tick “Support macOS” → Works on Mac, but not Windows.
  • Untick it → Works on Windows, but not Mac.

Mac or Windows - take your pick!

Pretty annoying, but let’s see how it performs anyway.

Microphone Over USB

Switching back to my audio studio, the ESP32-S3 appeared as a new USB UAC device.

Connected up, the audio streamed in just fine:

USB UAC Microphone!

I recorded a test, pulled it into Audacity, and amplified it a bit (these microphones are sensitive, so raw audio often looks quiet).

Result: very clean! 🎤

USB UAC Audio

Speaker Over USB

The speaker was a different story.

At first, it worked – but the sound was very crackly when streaming via USB UAC. After a lot of head scratching, I still couldn’t fix it.

So I went back to basics: playing a WAV file directly from SPIFFS over I²S.

That sounded perfectly clean:

So clearly the hardware is fine – it’s the USB UAC speaker code that’s the problem. Microphone = great. Speaker = not quite there yet.

Final Verdict

So where are we?

  • ✅ LED fixed
  • ✅ Sensors working
  • ✅ Battery charging fine
  • ✅ Microphone excellent (both serial + USB)
  • ⚠️ Speaker fine via I²S, but problematic via USB UAC

That’s good enough for me – this board has passed quality assurance.

There’s a full video here where you can listen to the audio: YouTube Link

Related Posts

This number does nothing - Ever wondered about the ubiquitous 'Serial.begin(115200);' in your Arduino projects? It turns out, with boards like the ESP32-S3 offering native USB support, this baud rate doesn't really matter when streaming data. My tests even showed surprising results with different speeds using Arduino and ESP-IDF, highlighting potential in USB full-speed capabilities. I dove into raw performance testing, and saw deviations from expected UART limits. Check out the full video and explore the results if you're curious about maximizing your data transfer speeds!
ESP32 Audio Input - MAX4466, MAX9814, SPH0645LM4H, INMP441 - In this blog post, I've delved deep into the world of audio input for ESP32, exploring all the different options for getting analogue audio data into the device. After discussing the use of the built-in Analogue to Digital Converts (ADCs), I2S to read ADCs with DMA, and using I2S to read directly from compatible peripherals, I go on to present hands-on experiments with four different microphones (MAX4466, MAX9814, SPH0645, INPM441). This comprehensive look at getting audio into the ESP32 should be a valuable resource for anyone hungry for a deep-dive into ESP32's audio capabilities, complete with YouTube videos for an even more detailed look!
ESP32 TV Version 3 - In the latest board revision, I've successfully resolved some key issues, including a USB interface conflict between the USB2244 and the ESP32 and a risky battery charging mistake—no more direct USB 5V to the battery! Plus, I managed to wrap this up without any clumsy bodge wiring. I've even introduced a new feature: a microphone is now on board, setting the stage for some exciting future projects. Stay tuned for what's coming!
E32-S3 no DAC - No Problem! We'll Use PDM - In this post, I tackle the lack of a DAC on the ESP32-S3 by demonstrating how to use Pulse Density Modulated (PDM) audio with Sigma Delta Modulation to achieve analog audio output. I explore the simplicity of creating a PDM signal and its reconstruction into an audio signal using a low pass filter, even an RC filter, though a more sophisticated active filter is recommended. I guide through using both a timer and the I2S peripheral on the ESP32 for outputting PDM data, noting the quirks and solutions for each method. And I wrap up with how straight PDM signals can drive headphones or work with various amplifiers, including the MAX98358 or SSM2537, exhibiting the versatility of PDM in audio applications with the ESP32-S3.
ESP32-S3 Dev Board Assembly - I finally assembled our ESP32-S3 dev boards—used a stencil for easy SMD work, fixed a few tiny USB solder bridges with flux, and even hand-built one for fun. The EPAD isn’t required (per the datasheet), power LEDs look good, and on macOS you can spot it under /dev before flashing. A quick boot-button dance and the blink sketch runs great—full build and walkthrough in the video.

Related Videos

ESP32-S3 USB UAC Audio Device - does it work? - Time for an audio project: I took my PCBWay ESP32‑S3 board for a spin—fixed the common anode/cathode LED mix‑up, verified the IMU and battery charger, then tested an I2S PDM mic and tiny speaker with a Web Serial Audio Studio (scope, spectrogram, tuner). I also turned it into a USB UAC device in ESP‑IDF: the mic is clean, but speaker over UAC is crackly (Mac/Windows toggle oddity); direct I2S WAV playback is perfect, so the hardware passes QA.
I Turned an ESP32 into a Thermal USB Webcam - Last time I made an ESP32 pretend to be a webcam; this time it’s a real USB UVC cam streaming MJPEG. Then I go further: I bolt on a tiny 32x24 infrared sensor, scale it up to 320x240 with nearest-neighbor or bilinear, JPEG it, and stream it like any normal webcam. Along the way I show why ESP32-CAM won’t work (no native USB), dive into I2C gremlins (run a scanner first, check pull-ups), and fix a flaky 3.3V regulator solder job. Quick hardware tour: onboard 2.2K pull-ups, ME6212 LDO, and an AT32F415 MCU. Audio can wait—today’s all about making thermal video look good over UVC.
Stop Using printf() - Debug ESP32 the Right Way - Right, let’s give this a go. Instead of drowning in printf()s and blinking LEDs, I show how the ESP32-S3’s built‑in USB JTAG lets you hit Debug in the Arduino IDE (or PlatformIO) and actually step through code. We set breakpoints, add watch expressions, use conditional breakpoints, and even edit variables live with a simple FizzBuzz/LED demo. It’s quick, it works, and it beats “works on my machine”—just mind real‑time code and ISRs. Works on ESP32s with native USB.
Three ESP32 Rainbow Boards Failed QA — Can we fix them? - I’m assembling another batch of ESP32 Rainbows: PCB house does the boards, UV silkscreen and some parts, and I finish assembly and QA here in Scotland. I run through three QA fails—no sound, dodgy keyboard, and no USB—then fix two: the audio fault was lifted pads on the headphone jack, so I bodged it back with flux and solder (speaker and headphones now work, but it’s a spares board). The no‑USB issue was an ESD protection IC sitting off its pad; I reflowed it on a mini hot plate, cleaned up with IPA, verified continuity, and it now enumerates and flashes perfectly. On to the keyboard next—oh, and Happy New Year!
We don't need a DAC - ESP32 PDM Audio - In this video, I've made some fascinating explorations with the ESP32 S3 chips and TinyS3 boards from Unexpected Maker. Intriguingly, even without a DAC converter, S3 chips can produce an audio waveform. I've played around with a basic RC filter to reconstruct the analogue audio signal from a PDM signal. The result was quite impressive for a board without a native DAC! I also discussed the possibility of creating a simple amplifier using just a MOSFET as a switch. Finally, I gave a peek into some of my new boards from PCBWay and looked at how Delta Sigma modulation can be played with to recover original data. It's all quite a fun foray into the world of circuitry and audio signals!
HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
Blog Logo

Chris Greening


Published

> Image

atomic14

A collection of slightly mad projects, instructive/educational videos, and generally interesting stuff. Building projects around the Arduino and ESP32 platforms - we'll be exploring AI, Computer Vision, Audio, 3D Printing - it may get a bit eclectic...

View All Posts