# Wiring plan – head unit

Every wire inside the housing, in soldering order. Pin names are written as printed on the boards.
Lengths are taken from the 3D model (routed along the walls and the floor) **plus 15% and 15 mm**, rounded up to 5 mm.
Trim the excess at the end, but do not cut them shorter.

## Wire

| For | Type |
|---|---|
| Signal wires (display, amplifier) | thin, flexible silicone wire, 28–30 AWG (or Kynar/wire-wrap 30 AWG) |
| 5V, GND, 3V3 | the same, or 26–28 AWG if available |
| Touch pads | 0.15 mm enamelled copper wire (CWW15) or 30 AWG |

Suggested colours: **GND black**, **3V3 red**, **5V orange**; the rest as you like, but note down each colour.

## What is where in the housing

```
top view (from the lid)            rear  ←───────────────────────→  front (towards the eye)

  inner wall (temple side):  [ AMPLIFIER, header holes forward ]
  XIAO right pin row:          5V  GND  3V3  D10  D9  D8  D7      (D10 SDA, D9 BLK, D8 SCK, D7 RES)
  XIAO (USB-C at the rear)     ════════════ XIAO ════════════          DISPLAY MODULE
  XIAO left pin row:           D0  D1   D2   D3   D4  D5  D6           (holes on top)
  outer wall:                  [hook button]          touch pad B   touch pad A  (next to the display)
```

- **XIAO ESP32-S3:** at the rear of the housing, USB-C at the back, components facing up. The **left pin row (D0–D6)** faces the outer wall, the **right pin row (5V, GND, 3V3, D10, D9, D8, D7)** faces the inner (temple-side) wall. In both rows the first pin (D0 and 5V) is closest to the USB-C.
- **Display module:** at the front, in the slot; the 7 holes are on **top** of the module, soldered from the back.
- **MAX98357A amplifier:** on the inner wall next to the XIAO, its back glued to the wall. Orient the module so that the **header holes face forward** (towards the display) and the **speaker outputs (+ and −) face backward**, towards the earphone hole. The lengths assume **Vin is at the bottom**.
- **Touch pads:** on the outer wall, next to the display; the rear one is **B** (page back), the front one is **A** (page forward). The wire comes in through a Ø1 mm hole drilled in the middle of the pad (the model has no hole; drill it afterwards).
- **Hook:** its shaft, the spring and the stop run across the housing at X ≈ −58…−46 mm, Z ≈ 22…34 mm (above the XIAO and the amplifier). The stop moves 6 mm towards the head when pressed. Keep wires away from here: route every wire below it, close to the floor.
- **Stiffener:** at X = −38 mm (between the hook and the touch pads) there is a solid wall with a V-shaped top edge: only 3.5 mm high in the middle, 25 mm at the walls. The touch pad and display wires pass **in the middle, through the dip of the V** to the XIAO (the display wires also fit along the top of the inner wall, above 25 mm).
- **Earphone cable:** comes in through the Ø2.4 mm hole in the rear wall.

## Soldering order

Solder everything **before** putting the XIAO into the cradle and the amplifier onto the wall; the modules go in together with their wires.

### 1. Preparing the amplifier (MAX98357A)

| # | What | Where | Notes |
|---|---|---|---|
| 1 | 100 kΩ resistor | between the module's **GAIN** and **Vin** holes | 3 dB gain (hearing protection). Bend its legs into the holes on the component side; the supply wire also goes into the Vin hole, in the same solder joint. |
| 2 | 150 Ω resistor | module **+** (speaker output) | the other leg is free; one earphone wire will go here |
| 3 | 150 Ω resistor | module **−** (speaker output) | the other leg is free; the other earphone wire will go here |

Insulate the legs of the two 150 Ω resistors with heat-shrink tubing. Do not solder in the pin header or the terminal block; they are not used.

### 2. Touch pads → XIAO

| # | From | To (XIAO) | Cut | Notes |
|---|---|---|---|---|
| 4 | touch pad **A** (front) | **D0** | **110 mm** | the 560 Ω SMD resistor right at the D0 pin: XIAO D0 → 560 Ω → wire |
| 5 | touch pad **B** (rear) | **D1** | **90 mm** | likewise, 560 Ω at the D1 pin |

Thread the wire through the pad hole from outside and fold its end flat under the pad (with aluminium foil, tin it and clamp it under the foil). Run the two touch wires along the outer wall, **not next to the display and amplifier wires**, and not tightly next to each other.

### 3. Display module → XIAO

The module pins, in order as printed: **GND, VCC, SCK, SDA, RES, DC, BLK**.

| # | Display | XIAO | Cut |
|---|---|---|---|
| 6 | **GND** | **GND** | **140 mm** |
| 7 | **VCC** | **3V3** | **135 mm** |
| 8 | **SCK** | **D8** | **125 mm** |
| 9 | **SDA** | **D10** | **125 mm** |
| 10 | **RES** | **D7** | **115 mm** |
| 11 | **DC** | **D6** | **125 mm** |
| 11/b | **BLK** | **D9** | **125 mm** |

- **BLK → D9:** the brightness is set from the PC (PC app slider → WiFi → the firmware drives BLK with PWM). On the module BLK controls a transistor with a pull-up: until the firmware sets the pin (at power-up) the backlight is at full brightness; high = on, low = dark.
- The module has no CS pin; with this, every XIAO pin is used.
- Bundle the seven wires behind the module (e.g. with a strip of Kapton tape) and route them back along the **inner** wall of the housing.
- **DC** is the only one that goes to the **outer** pin row of the XIAO (D6): take it across behind the rear end of the XIAO, along the floor.

### 4. Amplifier → XIAO

| # | Amplifier | XIAO | Cut |
|---|---|---|---|
| 12 | **Vin** | **5V** | **45 mm** |
| 13 | **GND** | **GND** | **45 mm** |
| 14 | **SD** | **D2** | **60 mm** |
| 15 | **DIN** | **D3** | **65 mm** |
| 16 | **LRC** | **D4** | **70 mm** |
| 17 | **BCLK** | **D5** | **70 mm** |

- Two wires go to the XIAO **GND** pin (display and amplifier): solder them together.
- **Connect by the labels, not by position:** depending on the module version, the order of the holes may differ (e.g. LRC after DIN, then BCLK). LRC → D4, BCLK → D5; that is why both are 70 mm.
- The four signal wires (SD, DIN, LRC, BCLK) go to the **outer** pin row of the XIAO: take them over the top of the XIAO shield or behind its rear end; keep them away from the touch wires and cross them at a right angle.
- Solder the **Vin** wire next to the leg of the 100 kΩ resistor.

### 5. Earphone

| # | What | Where | Length |
|---|---|---|---|
| 18 | thread in the earphone cable | from outside through the Ø2.4 hole in the rear wall | **30 mm inside**; outside, measure up to your ear (approx. 5–8 cm) |
| 19 | one wire of the right speaker | the free leg of the 150 Ω resistor on the amplifier **+** output | – |
| 20 | the other wire of the right speaker | the free leg of the 150 Ω resistor on the amplifier **−** output | – |

- Connect only the **two wires of the right speaker**. The earphone's “ground” wire **must not go to GND** – the amplifier is a bridge-tied output, it would be a short circuit.
- Burn off or scrape the enamel of the strands before soldering.
- Tie a knot in the cable just inside the hole (or use a drop of hot glue), so a pull does not load the solder joints.

### 6. Not wires

- **USB-C:** the power bank cable plugs straight into the XIAO socket.
- **Antenna:** plugged into the U.FL connector of the XIAO and stuck under the lid (not behind the touch pads or the amplifier).

## Checks before powering up

1. With a multimeter: no short between **5V–GND** and **3V3–GND**.
2. The amplifier **+** and **−** outputs must not touch GND.
3. The touch wires must not touch each other or any other wire (the enamel may get damaged at the hole).
4. Only then plug in the USB-C.
