Week 5: On painting with wires, or dreaming them up

This week we explored the world of electronics design and fabrication.

I learned how to create custom circuit boards using KiCad and then sanity-check behavior with simulation. Next week we’ll solder and mill to see them truly take shape. As a physicist, I’ve always found PCB design a bit intimidating; the big win this week was simply not being afraid of the PCB anymore.

Ok—let’s jump in.

Assignment

The work split into a group assignment and an individual assignment.

Group assignment

We used the Architecture Lab test equipment to observe the operation of a microcontroller and documented the process here: arch lab week 5.

Individual assignment

Goals:

I scoped my individual work toward my final project: earring–earphones. For a wearable, I want the board small and “jewelry-friendly,” with:

Designing the Circuit

My final project aims for earrings that double as wireless earphones, ideally with kinetic energy harvesting to assist charging. This week I built a first circuit foundation toward that goal.

Power management is the hardest piece, especially as a newcomer, so I began by getting a simple, working platform before shrinking it.

Picking a Processor

Constraints: tiny footprint, capacitive touch inputs, Bluetooth for wireless audio, and a path to battery charging.

The Seeed XIAO ESP32-S3 fits well: compact, BLE 5.0, and enough GPIO for touch + RGB + I²S. I also explored piezoelectric energy harvesting (see milestones) to capture motion energy from the earrings.

Microcontroller Comparison

Part / Board Core / Family Form factor Dimensions (mm) GPIO Bluetooth Other notes Ref
Seeed XIAO ESP32-S3 ESP32-S3 (Xtensa) Module ≈ 21 × 17.8 ~11 BLE 5.0 Tiny; Wi-Fi 2.4 GHz; deep sleep support Wiki
Seeed XIAO ESP32-C3 ESP32-C3 (RISC-V) Module ≈ 21 × 17.5 ~11 BLE 5.0 Wi-Fi 2.4 GHz; low power; onboard charger Wiki
Seeed XIAO SAMD21 ATSAMD21G18 (M0+) Module ≈ 21 × 17.8 14 No Arduino-friendly; external BT needed Wiki
Seeed XIAO RP2040 RP2040 (dual M0+) Module ≈ 21 × 17.8 ~11 No Great toolchain; no radio Wiki
Raspberry Pi Pico W RP2040 (dual M0+) Board 51 × 21 26 BLE 5.2 Wi-Fi 2.4 GHz; larger footprint Product brief

From this comparison, the XIAO ESP32-S3 stood out. First step in KiCad: add the XIAO symbol and footprint to the schematic.

Seeed XIAO ESP32-S3
Adding Seeed XIAO ESP32-S3 footprint in KiCad (from Seeed Wiki)

Adding Capacitive Touch Pads

In the PCB editor:

  1. OAdd Footprint → Footprint Library Browser
  2. Library: TestPoint
  3. Pick a single-pad footprint (TestPoint_Pad_D6.0mm, D8.0mm, or D10.0mm)
  4. Place three pads (TOUCH1/2/3)
  5. Edit Pad (E): Type SMD; Layers F.Cu + F.Mask (disable F.Paste); Diameter 6–10 mm; Mask clearance +0.3–0.5 mm
  6. (Optional) Add silk labels

Schematic → PCB flow

I first tried editing only in the PCB editor and hit “Update Schematic from PCB” limits. KiCad’s source of truth is the schematic:

  1. Draw schematic
  2. Assign footprints
  3. Update PCB from schematic
  4. Place/route on the PCB

Working in KiCad: From Schematic to PCB

1) Build the schematic

Core blocks: XIAO ESP32-S3, RGB LED (common-anode + 3 resistors), three capacitive touch pads, optional MAX98357A I²S amplifier, JST-PH battery input, and decoupling capacitors.

Why these components?

I labeled I²S nets (DIN, BCLK, LRCLK) and placed decouplers close to VDD pins. Remember: define everything in the schematic first.

2) ERC (Electrical Rules Check)

After a few iterations, ERC was clean (aside from the expected exposed-pad note).

3) Assign footprints

4) PCB layout

Update PCB from schematic → place components. Amp near speaker connector; keep OUTP/OUTN wide (~1 mm). Place decouplers within a few mm of VDD with short GND returns. Ground pour both layers + stitching vias. Touch pads on the edge for usability.

5) DRC (Design Rules Check)

First pass flagged seven items (courtyards, silk over edge, a couple of missing nets). Fixes:

DRC errors
DRC errors in KiCad

After fixes, DRC ran cleanly.

Simulation

Full ESP32-S3 + I²S isn’t practical to SPICE, so I split validation:

simulation blocks
Simulation blocks in Wokwi
  1. Firmware logic (Wokwi): buttons standing in for touch pads drive an RGB LED (solid, slow blink, fast blink). This confirmed GPIO logic and common-anode behavior.
    Try it: wokwi project
  2. Analog subcircuit (ngspice in KiCad): planned but not completed in time. I intended to pulse 3.3 V into LED+R to verify current; I’ll revisit when adding power-harvesting and more analog.

Note: I initially assumed common-cathode and wondered why the LED seemed “always on.” Switching to common-anode logic fixed it.

Audio & Power

For an earbud driver, I chose the MAX98357A I²S Class-D amplifier:

References: Adafruit breakout · Datasheet (Digi-Key)

Battery: I broke out a 2-pin JST-PH for a 1-cell LiPo so I can add charging/power management in a later rev.

PCB layout top
PCB layout top

Hiccups & real-life

Mid-work, I had an unexpected power outage and a couple of computer crashes. One crash cost me a chunk of unsaved KiCad edits (ouch). The silver lining: better save discipline and using ERC/DRC early to recover faster.

power outage
Power outage during layout—when electrons revolt.

Downloads

Explore the files:

Tip: right-click → “Save link as…” if a download doesn’t start.