Week 9: On Painting with Output Devices

This week I added an audio output path to my custom XIAO ESP32-S3 board: a tiny class-D amplifier driving an 8 Ω speaker. The focus was on hardware design—schematic edits, routing, power integrity, and fabrication—so I can program it next.

Week 9 icon showing headphones and speaker
Week 9 system: audio amp + speaker + circular board.

Assignment

Add an output device to a microcontroller board you designed, and program it to do something.

I implemented the hardware path first (MCU → amplifier → speaker). Firmware comes next.

Starting Point: Week 6 Board

I reused the circular ESP32-S3 board from Week 6. It already had: stable power, XIAO footprint, and generous routing space.

Circular PCB test layout
The baseline board layout inherited from Week 6.

Choosing the Amplifier & Speaker

Board shape for amplifier and speaker pads
Early layout where I made room for the amp and speaker pads.

Schematic Changes

  1. Added an amplifier symbol (IN, VIN, GND, OUT+, OUT−).
  2. Connected an ESP32 PWM/DAC pin → IN.
  3. Added 1 µF and 0.1 µF decoupling capacitors near VIN.
  4. Added large THT pads for the speaker wires.
KiCad routing view
Tracing the audio path from the XIAO to the amplifier input.

Footprints & Mechanics

Footprint alignment screenshot
Header geometry and footprint alignment check.

Routing & Power Integrity

Traces top layer rendering
Final top-layer routing: audio trace short and isolated.

Speaker Integration

The class-D amplifier outputs a differential pair. I routed SPK+ and SPK− to large through-hole pads and left room for strain-relief heatshrink.

Speaker routing area
Speaker pad area with stout traces from OUT+ / OUT−.

Downloadable PNGs for Mods

These are the fabrication PNGs I exported at high DPI for Mods:

Fabrication Files

The final board was exported as Gerbers and drills for manufacturing.

Gerber outline view
Gerber outline preview used for milling.

Assembly & Bring-Up

  1. Soldered headers & amplifier.
  2. Attached speaker wires with strain-relief.
  3. Continuity-tested all nets.
  4. Powered via USB and verified amplifier current draw.

Debugging Notes

Next Steps

Files