🌈 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
#AUDIO STREAMING #BLE #DIY ELECTRONICS #EMBEDDED #ESP-IDF #ESP32-S3 #I2S #MAC VS WINDOWS #PCM AMPLIFIER #PDM MICROPHONE #QUALITY ASSURANCE #UAC #USB AUDIO #WEB SERIAL

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

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

#AUDIO STREAMING #BLE #DIY ELECTRONICS #EMBEDDED #ESP-IDF #ESP32-S3 #I2S #MAC VS WINDOWS #PCM AMPLIFIER #PDM MICROPHONE #QUALITY ASSURANCE #UAC #USB AUDIO #WEB SERIAL

Related Posts

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!
Vibing a PCB - surprisingly good - In my latest adventure, I challenged AI to design a working ESP32-S3 development board from scratch using Atopile and Claude. The idea was as simple as vibe-coding actual hardware without diving into the code. It was a chaotic yet fascinating journey, with some misses like unwired components and a forgotten capacitor. After a few prompts, the AI delivered a surprisingly functional board featuring USB-C, an AMS1117 regulator, and status LEDs. While not yet perfect, vibe-coding feels like a glimpse into the future of hardware design.
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!
Minimalist Microcontroller: Building a Bare-Bones Dev Board - In a thrilling DIY endeavour, I attempted to build the most minimalist ESP32 dev board possible. Diving deep into the schematic of the ESP32 S3 WROOM module, I chopped out the non-essentials and whittled our needs down to bare bones. The experiment saw me juggling USB data lines and voltage regulators, waving goodbye to an array of capacitors and connectors and boldly embracing the simplicity of direct connections. Despite a few hitches, the miniature Frankenboard came alive, proving that sometimes less is more...at least in the world of microcontrollers.

Related Videos

ESP32-S3 Audio Test - Serial Audio and USB UAC Audio! - 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.
ESP32-TV Version 3 - Is it done? - In today's project update, I'm excited to share that my ESP32-TV boards, fresh from PCBWay, are operating flawlessly! We've successfully dealt with the USB2244 conflict with the ESP32, and the battery charging issue is now a thing of the past. We've also made some awesome additions like a microphone to our board. The real MVP though, is the USB2244 chip that’s given us significantly improved read/write speeds - making it perfect for handling video files. Next on the agenda, figuring out a solution for the non-standard display connector. As ever, there’s progress, there’s problems, and there's David Bowie animated gifs!
ESP32 Audio Output with I2S DMA and the MAX98357A Class D Amplifier - Learn how to use the MAX98357A breakout board with an ESP32 to output audio, create a digital audio path, configure the I2S interface, and read WAVE files from SPIFFS in this engaging tutorial.
ESP32 Audio Input Using I2S and Internal ADC - Learn how to effectively capture audio data using an ESP32 device and analog-to-digital converters in this detailed tutorial. Discover the power of I2S peripheral with DMA controller and optimize your system's audio performance with the MAX 4466 and MAX 9814 microphone breakout boards.
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