Contents
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 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.
The baseline board layout inherited from Week 6.
Choosing the Amplifier & Speaker
Amplifier: tiny class-D breakout (VIN, GND, IN, OUT+, OUT−).
Speaker: 8 Ω mini speaker.
Audio Source: ESP32 PWM/DAC pin.
Early layout where I made room for the amp and speaker pads.
Schematic Changes
Added an amplifier symbol (IN, VIN, GND, OUT+, OUT−).
Connected an ESP32 PWM/DAC pin → IN.
Added 1 µF and 0.1 µF decoupling capacitors near VIN.
Added large THT pads for the speaker wires.
Tracing the audio path from the XIAO to the amplifier input.
Routing & Power Integrity
Default track width: 0.4 mm; power rails: 0.7–0.8 mm.
Large ground plane on F.Cu and B.Cu, tied to GND.
Short, clean trace for amp input.
Decoupling capacitors placed tight to VIN.
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 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 preview used for milling.
Assembly & Bring-Up
Soldered headers & amplifier.
Attached speaker wires with strain-relief.
Continuity-tested all nets.
Powered via USB and verified amplifier current draw.
Debugging Notes
Empty drill files? Caused by SMD headers → fixed by switching to THT.
No ground plane? Must assign zone to net GND.
Noise risk: Keep amp input short; decouple VIN aggressively.
Next Steps
Generate a tone via PWM or DAC.
Map Week 8 capacitive pads → play/pause/volume.
Check SNR, hiss, grounding.