# Jelamp Carrier PCB — Simplified Schematic Instructions
## XIAO ESP32-S3 Sense · KiCad 8 · Fab Academy Library

---

## What We Are Building

```
Only what the Jellyfish Lamp actually needs:

  ┌─────────────────────────────────────────────────┐
  │                                                 │
  │  7-8.4V battery ──► Power Input ──► Protection  │
  │                          │                      │
  │                    ┌─────┴──────┐               │
  │                    │            │               │
  │               Buck → 5V    VIN_SERVO            │
  │                 │               │               │
  │           ┌─────┤          Servo Bus ×2         │
  │           │     │                               │
  │        XIAO   NeoPixel Strip                    │
  │       ESP32S3  (direct 3.3V drive via R2)       │
  │        Sense                                    │
  │           │                                     │
  │      Expansion Header (spare GPIOs)             │
  │                                                 │
  └─────────────────────────────────────────────────┘

  Total components on PCB: 15
  Board size: ~50 × 40 mm
```

---

## PART 1 — Software & Library Setup

### Step 1.1 — Install KiCad 8

```
Download: https://www.kicad.org/download/
Install and launch to verify it works.
```

### Step 1.2 — Download Fab Academy Library

```bash
cd ~/Documents/KiCad/
mkdir fab_library && cd fab_library
git clone https://gitlab.fabcloud.org/pub/libraries/electronics/kicad.git

# Result:
# kicad/
#   ├── fab.kicad_sym       ← schematic symbols
#   └── fab.pretty/         ← PCB footprints
```

### Step 1.3 — Add Fab Library to KiCad

```
SYMBOL LIBRARY:
  Preferences → Manage Symbol Libraries → Global tab
  → Click folder icon (📁) → Add existing library
  → Select: fab_library/kicad/fab.kicad_sym
  → Click OK

FOOTPRINT LIBRARY:
  Preferences → Manage Footprint Libraries → Global tab
  → Click folder icon (📁) → Add existing library
  → Select: fab_library/kicad/fab.pretty
  → Click OK

VERIFY:
  Open Symbol Editor → search "fab"
  You should see: fab:Res_1206, fab:Cap_1206, fab:LED_1206, etc.
```

---

## PART 2 — Create Project

```
1. File → New Project
2. Name: "jelamp-carrier-v1"
3. Choose your working folder
4. Save

5. Double-click "jelamp-carrier-v1.kicad_sch" to open schematic

6. File → Page Settings:
   Title:    "Jelamp Carrier Board"
   Revision: "v1.0"
   Date:     (today)
   → OK
```

---

## PART 3 — Create XIAO Custom Symbol & Footprint

### Step 3.1 — Create Custom Library

```
1. In KiCad main window → open Symbol Editor (book icon)
2. File → New Library
   → Name: "jelamp_custom"
   → Save to your project folder
   → Select "Project" scope
3. Click OK
```

### Step 3.2 — Create XIAO Symbol

```
1. Select "jelamp_custom" library in left panel
2. File → New Symbol
   → Name: "XIAO_ESP32S3_Sense"
   → Reference: "U"
   → Click OK

3. DRAW THE BODY:
   → Select Rectangle tool (right toolbar)
   → Draw from (-600, -1000) to (600, 1000)

4. ADD LEFT SIDE PINS (select Pin tool):

   Each pin: click to place, then set properties in dialog

   ┌────────────────────────────────────────────────────────┐
   │ Pin  │ Name        │ Number │ X     │ Y     │ Orient  │
   ├──────┼─────────────┼────────┼───────┼───────┼─────────┤
   │  1   │ D0/GPIO1    │ 1      │ -900  │ -600  │ Right   │
   │  2   │ D1/GPIO2    │ 2      │ -900  │ -400  │ Right   │
   │  3   │ D2/GPIO3    │ 3      │ -900  │ -200  │ Right   │
   │  4   │ D3/GPIO4    │ 4      │ -900  │  0    │ Right   │
   │  5   │ D4/GPIO5    │ 5      │ -900  │  200  │ Right   │
   │  6   │ D5/GPIO6    │ 6      │ -900  │  400  │ Right   │
   │  7   │ D6/GPIO7    │ 7      │ -900  │  600  │ Right   │
   └──────┴─────────────┴────────┴───────┴───────┴─────────┘

5. ADD RIGHT SIDE PINS:

   ┌────────────────────────────────────────────────────────┐
   │ Pin  │ Name        │ Number │ X     │ Y     │ Orient  │
   ├──────┼─────────────┼────────┼───────┼───────┼─────────┤
   │ 14   │ 5V          │ 14     │  900  │ -600  │ Left    │
   │ 13   │ GND         │ 13     │  900  │ -400  │ Left    │
   │ 12   │ 3V3         │ 12     │  900  │ -200  │ Left    │
   │ 11   │ D10/GPIO44  │ 11     │  900  │  0    │ Left    │
   │ 10   │ D9/GPIO43   │ 10     │  900  │  200  │ Left    │
   │  9   │ D8/GPIO9    │ 9      │  900  │  400  │ Left    │
   │  8   │ D7/GPIO8    │ 8      │  900  │  600  │ Left    │
   └──────┴─────────────┴────────┴───────┴───────┴─────────┘

   Pin types:
     5V  → Power Input
     GND → Power Input
     3V3 → Power Output
     All others → Bidirectional

6. ADD TEXT inside rectangle:
   → "XIAO ESP32-S3" (centered)
   → "Sense" below it

7. Save: Ctrl+S

   Result:
         ┌──────────────────────────┐
  D0  ──1│                        14│── 5V
  D1  ──2│   XIAO ESP32-S3       13│── GND
  D2  ──3│       Sense            12│── 3V3
  D3  ──4│                        11│── D10
  D4  ──5│                        10│── D9
  D5  ──6│                         9│── D8
  D6  ──7│                         8│── D7
         └──────────────────────────┘
```

### Step 3.3 — Create XIAO Footprint

```
1. Open Footprint Editor (KiCad main window → IC chip icon)

2. File → New Library
   → Name: "jelamp_custom"
   → Save to project folder → "Project" scope

3. File → New Footprint
   → Name: "XIAO_ESP32S3_Sense_TH"
   → Type: Through-hole
   → OK

4. XIAO physical dimensions:
   Module: 21mm × 17.5mm
   Pin pitch: 2.54mm
   Two rows of 7 pins
   Row spacing: 15.24mm center-to-center (600 mil)

5. PLACE LEFT COLUMN PADS (Add Pad tool):

   All pads: Oval, Size 1.7×1.7mm, Hole 1.0mm, Through-hole

   ┌───────┬───────────┬────────────┐
   │ Pad # │ X (mm)    │ Y (mm)     │
   ├───────┼───────────┼────────────┤
   │  1    │ -7.62     │ -7.62      │
   │  2    │ -7.62     │ -5.08      │
   │  3    │ -7.62     │ -2.54      │
   │  4    │ -7.62     │  0.00      │
   │  5    │ -7.62     │  2.54      │
   │  6    │ -7.62     │  5.08      │
   │  7    │ -7.62     │  7.62      │
   └───────┴───────────┴────────────┘

6. PLACE RIGHT COLUMN PADS:

   ┌───────┬───────────┬────────────┐
   │ Pad # │ X (mm)    │ Y (mm)     │
   ├───────┼───────────┼────────────┤
   │ 14    │  7.62     │ -7.62      │
   │ 13    │  7.62     │ -5.08      │
   │ 12    │  7.62     │ -2.54      │
   │ 11    │  7.62     │  0.00      │
   │ 10    │  7.62     │  2.54      │
   │  9    │  7.62     │  5.08      │
   │  8    │  7.62     │  7.62      │
   └───────┴───────────┴────────────┘

   ⚠️ Right column counts DOWN: 14 at top, 8 at bottom
      (matches real XIAO pinout)

7. DRAW OUTLINES:

   F.Fab layer (module body):
   → Rectangle from (-10.5, -9.0) to (10.5, 9.0)

   F.CrtYd layer (courtyard):
   → Rectangle from (-11.0, -12.0) to (11.0, 12.0)

   F.SilkS layer:
   → Text "XIAO" at center
   → Arrow or text "USB↑" at top edge (Y = -9.0)
   → Small dot near pad 1 (pin 1 marker)

8. Save: Ctrl+S

   Result:
          USB-C ↑
    ┌─────────────────────────┐
    │  ●1              14●    │
    │  ●2              13●    │
    │  ●3              12●    │
    │  ●4              11●    │
    │  ●5              10●    │
    │  ●6               9●    │
    │  ●7               8●    │
    └─────────────────────────┘
          Camera ↓
```

---

## PART 4 — Draw Schematic (Component by Component)

### Keyboard Shortcuts Reference

```
A = Add symbol          P = Place power symbol
W = Draw wire           L = Place net label
R = Rotate              M = Move
E = Edit properties     C = Copy
Q = No-connect flag     Ctrl+Z = Undo
```

### Schematic Layout Plan

```
We organize into 4 clear sections:

  ┌──────────────────────┬──────────────────────┐
  │                      │                      │
  │   SECTION 1          │   SECTION 2          │
  │   Power Input        │   XIAO Module        │
  │   + Buck Converter   │   + Power Symbols    │
  │                      │                      │
  ├──────────────────────┼──────────────────────┤
  │                      │                      │
  │   SECTION 3          │   SECTION 4          │
  │   NeoPixel Drive     │   Connectors         │
  │   (resistor only)    │   Servo, NeoPixel,   │
  │   + Bypass Caps      │   Expansion          │
  │                      │                      │
  └──────────────────────┴──────────────────────┘
```

---

### SECTION 1 — Power Input (Top-Left)

#### Step 4.1 — Place Barrel Jack

```
1. Press "A" (Add Symbol)
2. Search: "Conn_01x02" in fab library
   → Select "fab:Conn_PinHeader_1x02"
   → Or KiCad default: "Connector:Barrel_Jack"
3. Place in top-left area of schematic
4. Press "E" to edit → Reference: J1, Value: "DC_7-8V"

   J1
   ┌──────┐
   │  1   │── TIP (positive voltage in)
   │  2   │── SLEEVE (ground)
   └──────┘
```

#### Step 4.2 — Place Polyfuse

```
1. Press "A" → search "fab:Res_1206"
   (polyfuse uses same footprint as resistor)
2. Place to the RIGHT of J1
3. Edit → Reference: F1, Value: "3A PTC"

4. Press "W" (Wire) → draw wire:
   J1 pin 1 ────── F1 pin 1
```

#### Step 4.3 — Place Reverse Protection Diode

```
1. Press "A" → search "fab:Diode" or KiCad "D_Schottky"
2. Place to the RIGHT of F1
3. Edit → Reference: D1, Value: "SS34"

4. Wire:
   F1 pin 2 ────── D1 Anode

5. Press "L" (Net Label) → type "VIN_SERVO"
   → Place at D1 Cathode output

   Complete power input chain:

   J1 pin1 ──── F1 ──── D1(A→K) ──── VIN_SERVO
                         SS34
```

#### Step 4.4 — Place Ground for Power Input

```
1. Press "P" (Power Symbol) → search "GND"
2. Place below J1 pin 2
3. Press "W" → wire J1 pin 2 to GND symbol

   J1 pin2 ──── GND
```

#### Step 4.5 — Place Buck Converter Header

```
We use an external MP1584 buck module connected via 4 pins.

1. Press "A" → search "fab:Conn_PinHeader_1x04"
2. Place below the diode
3. Edit → Reference: J6, Value: "BUCK_MODULE"

4. Wire and label each pin:

   Pin 1: Press "L" → label "VIN_SERVO"    (input +)
   Pin 2: Press "P" → place GND            (input -)
   Pin 3: Press "P" → place +5V symbol     (output +)
   Pin 4: Press "P" → place GND            (output -)

   J6 (Buck Module Pads)
   ┌──────┐
   │  1   │── VIN_SERVO (7-8.4V in)
   │  2   │── GND
   │  3   │── +5V (5V out)
   │  4   │── GND
   └──────┘
```

#### Step 4.6 — Place Output Capacitor for Buck

```
1. Press "A" → search "fab:Cap_1206"
2. Place near J6 output pins
3. Edit → Reference: C1, Value: "100µF"

4. Wire:
   Top of C1 ──── +5V
   Bottom of C1 ── GND

   (Place +5V power symbol at top, GND at bottom)
```

#### Step 4.7 — Place PWR_FLAG

```
KiCad needs PWR_FLAG symbols on power nets to pass ERC.

1. Press "P" → search "PWR_FLAG"
2. Place one connected to +5V net
3. Place another connected to GND net

   +5V ──── PWR_FLAG
   GND ──── PWR_FLAG
```

#### Section 1 Complete — Should look like:

```
   J1            F1          D1
  ┌────┐      ┌─────┐    ┌──|>──┐
  │ 1──┼──────┤ 3A  ├────┤ SS34 ├──── VIN_SERVO
  │ 2──┼──┐   └─────┘    └──────┘
  └────┘  │                  │
         GND            J6 [1] VIN_SERVO
                        J6 [2] GND        C1
                        J6 [3] +5V ───┬───||───┐
                        J6 [4] GND    │  100µF  │
                                     +5V      GND
```

---

### SECTION 2 — XIAO Module (Top-Right)

#### Step 4.8 — Place XIAO Symbol

```
1. Press "A" → search "XIAO"
   → Select "jelamp_custom:XIAO_ESP32S3_Sense"
2. Place in CENTER-RIGHT of schematic
3. Edit → Reference: U1

         ┌──────────────────────────┐
  D0  ──1│                        14│── 5V
  D1  ──2│   XIAO ESP32-S3       13│── GND
  D2  ──3│       Sense            12│── 3V3
  D3  ──4│                        11│── D10
  D4  ──5│                        10│── D9
  D5  ──6│                         9│── D8
  D6  ──7│                         8│── D7
         └──────────────────────────┘
```

#### Step 4.9 — Connect XIAO Power Pins

```
1. Press "P" → "+5V" → place at pin 14 → wire to pin 14
2. Press "P" → "GND"  → place at pin 13 → wire to pin 13
3. Press "P" → "+3V3" → place at pin 12 → wire to pin 12

   These automatically connect to the same-named power nets
   everywhere else in the schematic.
```

#### Step 4.10 — Label XIAO Signal Pins

```
We use NET LABELS to connect XIAO pins to other sections
without drawing long messy wires across the sheet.

Press "L" for each label:

  XIAO Pin 1 (D0/GPIO1): Label → "SERVO_TX"
  XIAO Pin 2 (D1/GPIO2): Label → "SERVO_RX"
  XIAO Pin 3 (D2/GPIO3): Label → "NEO_CTRL"

Wire each label to its pin:

  Pin 1 ──── SERVO_TX
  Pin 2 ──── SERVO_RX
  Pin 3 ──── NEO_CTRL
```

#### Step 4.11 — Handle Unused XIAO Pins

```
Pins going to expansion header — add labels:

  Pin 4 (D3/GPIO4):  Label → "EXP_GPIO4"
  Pin 5 (D4/GPIO5):  Label → "EXP_GPIO5"
  Pin 8 (D7/GPIO8):  Label → "EXP_GPIO8"
  Pin 9 (D8/GPIO9):  Label → "EXP_GPIO9"

Pins we don't use at all — add no-connect flags:

  Pin 6 (D5/GPIO6):  Press "Q" → place no-connect X
  Pin 7 (D6/GPIO7):  Press "Q" → place no-connect X
  Pin 10 (D9/GPIO43): Press "Q" → place no-connect X
  Pin 11 (D10/GPIO44): Press "Q" → place no-connect X

  (Or route these to expansion header too — your choice.
   No-connect flags tell KiCad "I intentionally left this open")
```

#### Step 4.12 — Place 3V3 Bypass Capacitor

```
1. Press "A" → "fab:Cap_1206"
2. Place near XIAO
3. Edit → Reference: C4, Value: "100nF"
4. Wire:
   Top ──── +3V3
   Bottom ── GND
```

#### Section 2 Complete:

```
                ┌──────────────────────────┐
  SERVO_TX ────1│                        14│──── +5V
  SERVO_RX ────2│   XIAO ESP32-S3       13│──── GND
  NEO_CTRL ────3│       Sense            12│──── +3V3
  EXP_GPIO4 ──4│                        11│──X (no connect)
  EXP_GPIO5 ──5│                        10│──X
            X──6│                         9│──── EXP_GPIO9
            X──7│                         8│──── EXP_GPIO8
                └──────────────────────────┘
                                               C4
                                         +3V3──||──GND
                                              100nF
```

---

### SECTION 3 — NeoPixel Drive (Bottom-Left)

```
WHY NO LEVEL SHIFTER:

  The ESP32-S3 outputs 3.3V logic on GPIO pins.
  WS2812B NeoPixels spec minimum logic high = 0.7 × VDD.
  At 5V power: 0.7 × 5V = 3.5V needed (3.3V is slightly below).

  IN PRACTICE: 3.3V direct drive works reliably when:
  → LED strip is short (< 30 LEDs)
  → Wire between PCB and first LED is short (< 30cm)
  → A 330Ω series resistor protects the data line

  This eliminates the 74HCT1G125 level shifter IC and its
  bypass cap — 2 fewer components, simpler layout.

  If you later have NeoPixel reliability issues, you can
  always add a level shifter on a future board revision.
```

#### Step 4.13 — Place NeoPixel Series Resistor

```
A 330Ω resistor between the MCU and the first NeoPixel:
  → Dampens signal reflections in the wire
  → Protects GPIO from voltage spikes on the data line
  → Standard NeoPixel best practice (Adafruit recommends it)

1. Press "A" → "fab:Res_1206"
2. Place in the bottom-left area
3. Edit → Reference: R2, Value: "330Ω"

4. Wire:
   R2 pin 1 ──── Net label "NEO_CTRL"
   R2 pin 2 ──── Net label "NEOPIXEL_DATA"

   Signal path:
   XIAO pin 3 (GPIO3) → NEO_CTRL → R2(330Ω) → NEOPIXEL_DATA → J4 pin2
```

#### Step 4.14 — Place 5V Bypass Capacitor

```
1. Press "A" → "fab:Cap_1206"
2. Place near XIAO 5V pin area
3. Edit → Reference: C5, Value: "10µF"

4. Wire:
   Top ──── +5V
   Bottom ── GND
```

#### Section 3 Complete:

```
   NEO_CTRL ──── R2(330Ω) ──── NEOPIXEL_DATA
                                    │
                               (goes to J4 pin 2)

                  C5
            +5V──||──GND
                 10µF

   That's it! No level shifter IC. 
   Just a resistor protecting the data line.
```

---

### SECTION 4 — Connectors (Bottom-Right)

#### Step 4.15 — Place Servo Connector 1

```
1. Press "A" → "fab:Conn_PinHeader_1x03"
2. Place in bottom area
3. Edit → Reference: J2, Value: "SERVO_1"

4. Wire/Label each pin:

   J2 Pin 1 → GND power symbol
   J2 Pin 2 → Net label "VIN_SERVO"
   J2 Pin 3 → Net label "SERVO_DATA"

   J2 (SERVO_1)
   ┌──────┐
   │  1   │── GND
   │  2   │── VIN_SERVO (7-8.4V direct to servos)
   │  3   │── SERVO_DATA
   └──────┘
```

#### Step 4.16 — Place Servo Connector 2

```
1. Press "A" → "fab:Conn_PinHeader_1x03"
2. Place next to J2
3. Edit → Reference: J3, Value: "SERVO_2"

4. Wire IDENTICAL to J2:
   J3 Pin 1 → GND
   J3 Pin 2 → "VIN_SERVO"
   J3 Pin 3 → "SERVO_DATA"

   (Same net labels = electrically connected. 
    Both servo ports are on the same daisy-chain bus)

   HOW SERVOS CONNECT:
   STS3215 servos have TWO ports (A and B) — signal passes through.
   One cable from J2 feeds the entire chain:

   PCB [J2] ──cable──► Servo 1 ──cable──► Servo 2 ──cable──► Servo 3
                        (ID=1)             (ID=2)             (ID=3)
   PCB [J3] → spare (second chain or backup)
```

#### Step 4.17 — Place Servo Bus Resistor

```
The STS3215 servos use half-duplex UART.
XIAO TX and RX share one data wire.
A 1kΩ resistor on TX prevents bus contention.

1. Press "A" → "fab:Res_1206"
2. Place between XIAO and servo connectors
3. Edit → Reference: R1, Value: "1kΩ"

4. Wire:

   Net label "SERVO_TX" ──── R1 pin 1
   R1 pin 2 ──── Net label "SERVO_DATA"

5. Also connect RX directly:
 
   Net label "SERVO_RX" ──── Net label "SERVO_DATA"
   (Just place both labels — same name = connected)

   OR draw it explicitly with a wire + junction:

   SERVO_TX ── R1(1kΩ) ──┬── SERVO_DATA
                          │
   SERVO_RX ──────────────┘

   How it works:
   → TX drives through 1kΩ (weak drive)
   → Servo drives directly (strong drive, overrides TX)
   → RX reads whatever is on the bus
   → In software: disable TX when receiving
```

#### Step 4.18 — Place NeoPixel Connector

```
1. Press "A" → "fab:Conn_PinHeader_1x03"
2. Place near R2
3. Edit → Reference: J4, Value: "NEOPIXEL"

4. Wire:
   J4 Pin 1 → +5V power symbol
   J4 Pin 2 → Net label "NEOPIXEL_DATA"
   J4 Pin 3 → GND power symbol

   J4 (NEOPIXEL)
   ┌──────┐
   │  1   │── +5V    (NeoPixel power)
   │  2   │── NEOPIXEL_DATA (from XIAO via R2, direct 3.3V)
   │  3   │── GND
   └──────┘
```

#### Step 4.19 — Place NeoPixel Bulk Capacitor

```
NeoPixels can draw sudden current spikes.
A large capacitor smooths this out.

1. Press "A" → "fab:Cap_1206"
   (For 470µF you may need a radial electrolytic footprint.
    If fab library doesn't have it, use KiCad default:
    "Capacitor_THT:CP_Radial_D8.0mm_P3.50mm")
2. Place near J4
3. Edit → Reference: C3, Value: "470µF/10V"

4. Wire:
   + terminal → +5V
   - terminal → GND

   ⚠️ This is polarized! Mark positive side clearly.
```

#### Step 4.20 — Place Expansion Header

```
1. Press "A" → "fab:Conn_PinHeader_1x06"
2. Place at bottom-right
3. Edit → Reference: J5, Value: "EXPANSION"

4. Wire/Label each pin:

   J5 Pin 1 → +3V3 power symbol
   J5 Pin 2 → Net label "EXP_GPIO4"
   J5 Pin 3 → Net label "EXP_GPIO5"
   J5 Pin 4 → Net label "EXP_GPIO8"
   J5 Pin 5 → Net label "EXP_GPIO9"
   J5 Pin 6 → GND power symbol

   J5 (EXPANSION)
   ┌──────┐
   │  1   │── +3V3
   │  2   │── GPIO4  (XIAO pin 4)
   │  3   │── GPIO5  (XIAO pin 5)
   │  4   │── GPIO8  (XIAO pin 8)
   │  5   │── GPIO9  (XIAO pin 9)
   │  6   │── GND
   └──────┘

   Future use: plug in a button, sensor, I2C device, etc.
```

---

## PART 5 — Complete Schematic Verification

### Step 5.1 — Final Schematic Overview

```
Your complete schematic should have exactly these components:

  ┌──────┬──────────────┬──────────────────────────────┬─────┐
  │ Ref  │ Value        │ Description                  │ Qty │
  ├──────┼──────────────┼──────────────────────────────┼─────┤
  │ U1   │ XIAO ESP32S3 │ Main MCU module              │  1  │
  │ R1   │ 1kΩ          │ Servo bus protection         │  1  │
  │ R2   │ 330Ω         │ NeoPixel data series         │  1  │
  │ C1   │ 100µF        │ Buck regulator output        │  1  │
  │ C3   │ 470µF        │ NeoPixel bulk cap            │  1  │
  │ C4   │ 100nF        │ 3V3 rail bypass              │  1  │
  │ C5   │ 10µF         │ 5V rail bypass               │  1  │
  │ D1   │ SS34         │ Reverse polarity protection  │  1  │
  │ F1   │ 3A PTC       │ Overcurrent protection       │  1  │
  │ J1   │ DC_7-8V      │ Barrel jack / 2-pin input    │  1  │
  │ J2   │ SERVO_1      │ Servo bus connector          │  1  │
  │ J3   │ SERVO_2      │ Servo bus connector          │  1  │
  │ J4   │ NEOPIXEL     │ NeoPixel strip connector     │  1  │
  │ J5   │ EXPANSION    │ Spare GPIO breakout          │  1  │
  │ J6   │ BUCK_MODULE  │ External buck converter pads │  1  │
  ├──────┼──────────────┼──────────────────────────────┼─────┤
  │      │              │ TOTAL COMPONENTS:            │ 15  │
  └──────┴──────────────┴──────────────────────────────┴─────┘

  Net labels used:
    VIN_SERVO, SERVO_TX, SERVO_RX, SERVO_DATA,
    NEO_CTRL, NEOPIXEL_DATA, EXP_GPIO4, EXP_GPIO5,
    EXP_GPIO8, EXP_GPIO9

  Power symbols used:
    +5V, +3V3, GND, PWR_FLAG (×2)
```

### Step 5.2 — Visual Check

```
Trace each signal path mentally:

PATH 1 — Battery to Servos:
  J1 → F1 → D1 → VIN_SERVO → J2 pin2, J3 pin2 ✅

PATH 2 — Battery to 5V:
  VIN_SERVO → J6 pin1 → [Buck Module] → J6 pin3 → +5V ✅

PATH 3 — 5V to XIAO:
  +5V → U1 pin 14 ✅

PATH 4 — XIAO to Servos:
  U1 pin1 (TX) → R1 → SERVO_DATA → J2 pin3, J3 pin3 ✅
  U1 pin2 (RX) → SERVO_DATA ✅

PATH 5 — XIAO to NeoPixels:
  U1 pin3 → NEO_CTRL → R2(330Ω) → NEOPIXEL_DATA → J4 pin2 ✅
  +5V → J4 pin1 ✅

PATH 6 — Expansion:
  U1 pin4 → EXP_GPIO4 → J5 pin2 ✅
  (same for GPIO5, GPIO8, GPIO9)
```

### Step 5.3 — Annotate Components

```
1. Menu → Tools → Annotate Schematic...
2. Click "Annotate"
   → This assigns final R1, R2, C1, C3, etc. numbers
3. Click Close
```

### Step 5.4 — Run ERC (Electrical Rules Check)

```
1. Menu → Inspect → Electrical Rules Checker
2. Click "Run ERC"

3. Expected results and fixes:

   ✅ 0 errors → perfect, move on

   ❌ "Power pin not driven"
   → Add PWR_FLAG to +5V and GND if you haven't
   → Press "P" → search "PWR_FLAG" → connect to +5V
   → Repeat for GND

   ❌ "Pin unconnected"
   → Check which pin → either wire it or add no-connect "Q"

   ❌ "Different net names on same wire"
   → You accidentally put two different labels on same wire
   → Remove one

   ⚠️ "Input power pin driven by output"
   → Usually OK for our design → can ignore

4. Keep fixing until 0 Errors
5. Save: Ctrl+S
```

---

## PART 6 — Assign Footprints

### Step 6.1 — Open Footprint Assignment

```
1. Menu → Tools → Assign Footprints... (or the footprint icon)

2. Three-column window opens:
   LEFT:   Libraries (filter by typing "fab")
   CENTER: Your components 
   RIGHT:  Available footprints
```

### Step 6.2 — Assign Each Footprint

```
Double-click each component in CENTER column,
then double-click the correct footprint from RIGHT column:

┌──────┬───────────────────┬──────────────────────────────────────┐
│ Ref  │ Component         │ Footprint                            │
├──────┼───────────────────┼──────────────────────────────────────┤
│ U1   │ XIAO_ESP32S3      │ jelamp_custom:XIAO_ESP32S3_Sense_TH │
├──────┼───────────────────┼──────────────────────────────────────┤
│ R1   │ 1kΩ               │ fab:R_1206                          │
│ R2   │ 330Ω              │ fab:R_1206                          │
├──────┼───────────────────┼──────────────────────────────────────┤
│ C1   │ 100µF             │ fab:C_1206  (if ceramic available)  │
│      │                   │ OR Capacitor_THT:CP_Radial_D6.3mm   │
│ C3   │ 470µF             │ Capacitor_THT:CP_Radial_D8.0mm      │
│ C4   │ 100nF             │ fab:C_1206                          │
│ C5   │ 10µF              │ fab:C_1206                          │
├──────┼───────────────────┼──────────────────────────────────────┤
│ D1   │ SS34              │ fab:D_SMA                           │
│      │                   │ (or Diode_SMD:D_SMA)                │
├──────┼───────────────────┼──────────────────────────────────────┤
│ F1   │ 3A PTC            │ fab:R_1812                          │
│      │                   │ (PTC fuse uses 1812 resistor pad)   │
├──────┼───────────────────┼──────────────────────────────────────┤
│ J1   │ Barrel Jack       │ Connector:BarrelJack_Horizontal      │
│      │                   │ (or fab:Barrel_Jack if available)    │
├──────┼───────────────────┼──────────────────────────────────────┤
│ J2   │ Servo 1 (1×3)     │ fab:PinHeader_1x03_P2.54mm          │
│ J3   │ Servo 2 (1×3)     │ fab:PinHeader_1x03_P2.54mm          │
│ J4   │ NeoPixel (1×3)    │ fab:PinHeader_1x03_P2.54mm          │
├──────┼───────────────────┼──────────────────────────────────────┤
│ J5   │ Expansion (1×6)   │ fab:PinHeader_1x06_P2.54mm          │
├──────┼───────────────────┼──────────────────────────────────────┤
│ J6   │ Buck Pads (1×4)   │ fab:PinHeader_1x04_P2.54mm          │
└──────┴───────────────────┴──────────────────────────────────────┘

⚠️ IMPORTANT: Fab library footprint names vary by version!
   If exact name not found, browse the fab library to find 
   the closest match. Common variants:
     fab:R_1206         fab:Res_1206
     fab:C_1206         fab:Cap_1206
     fab:PinHeader_1x03 fab:Conn_PinHeader_1x03_P2.54mm
```

### Step 6.3 — Apply and Save

```
1. Click "Apply, Save Schematic & Continue"
2. Click OK
3. Save schematic: Ctrl+S
```

---

## PART 7 — PCB Layout

### Step 7.1 — Transfer to PCB Editor

```
1. In Schematic Editor:
   Menu → Tools → Update PCB from Schematic (or F8)

2. Dialog appears listing all components
   → Click "Update PCB"

3. PCB Editor opens
   → All components are clustered together in a pile
   → Thin "ratsnest" lines show which pads must connect
```

### Step 7.2 — Set Board Outline

```
1. In the Layers panel (right side), select "Edge.Cuts"
2. Select Rectangle tool (right toolbar)
3. Draw board outline: 50mm × 40mm

   Click first corner → type exact coordinates:
   Start: X = 100, Y = 80
   End:   X = 150, Y = 120

4. Or use: Place → Drawing → set layer to Edge.Cuts

   Board = 50mm wide × 40mm tall
```

### Step 7.3 — Set Design Rules

```
Menu → File → Board Setup → Design Rules → Constraints

FOR JLCPCB ORDERING:
  ┌────────────────────────────┬──────────┐
  │ Minimum track width        │ 0.25 mm  │
  │ Minimum clearance          │ 0.25 mm  │
  │ Minimum via drill          │ 0.3 mm   │
  │ Minimum via diameter       │ 0.6 mm   │
  │ Minimum hole size          │ 0.3 mm   │
  └────────────────────────────┴──────────┘

FOR FAB LAB MILLING:
  ┌────────────────────────────┬──────────┐
  │ Minimum track width        │ 0.5 mm   │
  │ Minimum clearance          │ 0.5 mm   │
  │ Minimum via drill          │ 0.8 mm   │
  │ (Prefer single-sided — no vias)       │
  └────────────────────────────┴──────────┘


TRACK WIDTH PRESETS:

Board Setup → Design Rules → Net Classes

  ┌────────────┬──────────┬────────────────────────────┐
  │ Net Class  │ Width    │ Nets                       │
  ├────────────┼──────────┼────────────────────────────┤
  │ Default    │ 0.4 mm   │ all signals                │
  │ Power      │ 0.8 mm   │ +5V, +3V3, GND             │
  │ HighPower  │ 1.5 mm   │ VIN_SERVO                  │
  └────────────┴──────────┴────────────────────────────┘

  To assign: In the Net Classes table, add rows and assign
  specific nets to specific classes.
```

### Step 7.4 — Place Components on Board

```
STRATEGY: 
  → Connectors at edges (cables come from outside)
  → XIAO near top (USB-C accessible)
  → Power flow: left to right or top to bottom
  → Keep related parts together

1. Press "M" to move a component
2. Press "R" to rotate before dropping
3. Press "F" to flip to back side (if 2-layer)

PLACEMENT MAP:

  ┌─────────────────────────────────────────────────┐
  │            ↑ USB-C accessible                   │
  │     ┌─────────────────────────┐                 │
  │     │  ●1  XIAO ESP32  14●   │                 │
  │     │  ●2     S3       13●   │                 │
  │     │  ●3    Sense     12●   │     [J5]        │
  │     │  ●4              11●   │   Expansion     │
  │     │  ●5              10●   │   Header        │
  │     │  ●6               9●   │                 │
  │     │  ●7               8●   │                 │
  │     └─────────────────────────┘                 │
  │                                                 │
  │  [R2]       [R1]              [C4] [C5]         │
  │  330Ω       1kΩ              100n  10µ          │
  │                                                 │
  │  [D1]  [F1]     [C1]                            │
  │  SS34   PTC     100µF                           │
  │                                                 │
  │  [J1]      [J6]     [J2]    [J3]    [J4] [C3]  │
  │ Barrel    Buck     Servo1  Servo2  NeoP  470µF  │
  │  Jack    Module                                 │
  └─────────────────────────────────────────────────┘

  All connectors on BOTTOM EDGE → cables route downward
  USB-C on TOP EDGE → programming access
```

### Step 7.5 — Route Traces

```
Press "X" to start routing. Click pads to connect.

═══ ROUND 1: Power Traces (thickest first) ═══

Select track width: 1.5mm (dropdown in top toolbar)

  Route: J1 → F1 → D1 → VIN_SERVO trace
  Route: VIN_SERVO → J2 pin2
  Route: VIN_SERVO → J3 pin2
  Route: VIN_SERVO → J6 pin1

Select track width: 0.8mm

  Route: J6 pin3 → +5V trace
  Route: +5V → U1 pin14
  Route: +5V → J4 pin1
  Route: +5V → C1, C3, C5 (positive pads)


═══ ROUND 2: Signal Traces ═══

Select track width: 0.4mm

  Route: U1 pin1 → R1 → J2 pin3 (servo data bus)
  Route: J2 pin3 → J3 pin3 (connect both servo ports)
  Route: U1 pin2 → junction on servo data bus
  Route: U1 pin3 → R2 pin1 (NeoPixel control)
  Route: R2 pin2 → J4 pin2 (NeoPixel data out)
  Route: U1 pin4 → J5 pin2 (expansion)
  Route: U1 pin5 → J5 pin3
  Route: U1 pin8 → J5 pin4
  Route: U1 pin9 → J5 pin5

Select track width: 0.8mm

  Route: +3V3 → C4, J5 pin1


═══ ROUND 3: Remaining GND connections ═══

  You can route GND traces individually (0.8mm width)
  OR use a ground pour (recommended — next step)

  Key GND connections to verify:
  → J1 pin2
  → U1 pin13
  → J2 pin1, J3 pin1, J4 pin3
  → J5 pin6, J6 pin2, J6 pin4
  → C1, C3, C4, C5 negative terminals


ROUTING TIPS:
  → Press "/" to switch layers (F.Cu ↔ B.Cu)
  → Press "V" during routing to place a via
  → Right-click → change track width while routing
  → Avoid running signal traces parallel to power
  → Keep traces as short as possible
  → 45° angles are better than 90°
```

### Step 7.6 — Add Ground Pour

```
1. Select layer "F.Cu" (front copper)
2. Click "Add Fill Zone" tool (right toolbar)
   → Or menu: Place → Zone

3. Dialog appears:
   Net: GND
   Clearance: 0.3mm
   Minimum width: 0.3mm
   Pad connections: Thermal relief
   → Click OK

4. Click the 4 corners of your board outline
   → Double-click to finish the zone

5. Press "B" to fill all zones

6. ALL remaining empty copper area is now GND ✅

7. OPTIONAL: Repeat on B.Cu (back copper) for better ground
   → Same steps but select B.Cu layer


AFTER GROUND POUR:
  Most GND connections are automatically made through the pour
  The ratsnest lines for GND should disappear
  If some remain → you need to add a via or route manually
```

### Step 7.7 — Add Silkscreen Labels

```
1. Select layer "F.SilkS"
2. Press "T" (Add Text)

Place these labels:

  Near J1:     "7-8V DC"
  Near J2:     "SERVO1" and "G V D" (pin labels)
  Near J3:     "SERVO2" and "G V D"
  Near J4:     "NEOPIXEL" and "5V D G"
  Near J5:     "EXPANSION"
  Near J6:     "BUCK 5V"
  Near U1:     "USB↑" (pointing to USB-C edge)
  Board title: "JELAMP v1.0"
  Author:      "Your Name · 2025"

Also add pin 1 dots near:
  → XIAO pad 1
```

---

## PART 8 — Verify and Check

### Step 8.1 — Run DRC

```
1. Menu → Inspect → Design Rules Checker
2. Click "Run DRC"

3. Fix errors:
   ❌ "Unconnected" → route the missing trace
   ❌ "Clearance violation" → move trace/pad apart
   ❌ "Track too thin" → widen the trace
   ⚠️ "Silkscreen over pad" → move text (cosmetic only)

4. Repeat until: 0 Errors
```

### Step 8.2 — Visual Check in 3D Viewer

```
1. Menu → View → 3D Viewer (or Alt+3)

2. Check:
   □ XIAO module fits in its socket area
   □ USB-C end reaches board edge (accessible)
   □ All connectors are at board edges
   □ No components overlapping
   □ Silkscreen text is readable
   □ Board looks reasonable

3. Rotate the 3D view with mouse to inspect all angles
```

### Step 8.3 — Net Connectivity Check

```
In PCB Editor:
  Menu → Inspect → Board Statistics

  Verify:
  → Unrouted connections: 0
  → Total nets matches your schematic
  → All components present
```

---

## PART 9 — Generate Manufacturing Files

### Option A — For JLCPCB / PCB House

```
GERBER FILES:

1. File → Fabrication Outputs → Gerbers (.gbr)

2. Settings:
   Output directory: ./production/
 
   Check these layers:
   ☑ F.Cu          (front copper)
   ☑ B.Cu          (back copper)
   ☑ F.SilkS       (front silkscreen)
   ☑ B.SilkS       (back silkscreen)
   ☑ F.Mask         (front solder mask)
   ☑ B.Mask         (back solder mask)
   ☑ Edge.Cuts      (board outline)
   ☑ F.Paste        (for stencil)
 
   ☑ Use Protel filename extensions
   ☑ Subtract soldermask from silkscreen

3. Click "Plot"

DRILL FILES:

4. Click "Generate Drill Files"
   Format: Excellon
   ☑ Merge PTH and NPTH
   → Click "Generate Drill File"

PACKAGE:

5. Go to ./production/ folder
6. Select ALL .gbr and .drl files
7. ZIP them → "jelamp-v1-gerbers.zip"

ORDER:

8. Go to jlcpcb.com → "Order Now" → upload ZIP
9. Settings: 2 layers, 1.6mm, HASL, any color
10. ~$2-5 for 5 boards + shipping
```

### Option B — For Fab Lab Milling

```
1. File → Plot
   Format: SVG
   Layer: F.Cu only
   → Plot

2. File → Plot
   Format: SVG
   Layer: Edge.Cuts only
   → Plot

3. Convert SVG to PNG (1000 DPI) using Inkscape:
   → Open SVG → Export → PNG → 1000 DPI
   → Traces: black on white background
   → Outline: separate file

4. Use mods.cba.mit.edu:
   → Programs → SRM-20 → PCB traces
   → Load traces PNG → calculate toolpath
   → Mill with 1/64" end mill (traces)
   → Then load outline → mill with 1/32" end mill (cutout)
```

---

## PART 10 — Soldering Order

```
SOLDER FROM LOWEST TO TALLEST:

  1. R1, R2 — 1206 resistors
     (No polarity — either direction OK)

  2. C4, C5 — 1206 ceramic capacitors
     (No polarity — either direction OK)

  3. D1 — SS34 Schottky diode (SMA)
     ⚠️ CATHODE band faces TOWARD output (VIN_SERVO)

  4. F1 — PTC fuse (1812)
     (No polarity)

  5. Female pin headers (2× 1×7) for XIAO socket
     → PRO TIP: Insert XIAO on the headers first
       to ensure perfect alignment, THEN solder 
       headers to PCB. Remove XIAO after.

  6. J2, J3, J4 — 1×3 pin headers
  7. J5 — 1×6 pin header
  8. J6 — 1×4 pin header
  9. J1 — barrel jack (tallest through-hole)
  10. C1 — 100µF electrolytic capacitor
      ⚠️ POLARITY! Negative stripe → GND
  11. C3 — 470µF electrolytic capacitor
      ⚠️ POLARITY! Negative stripe → GND

  THEN:
  12. Set MP1584 buck module to 5.0V output
      (use trimpot + multimeter BEFORE connecting)
  13. Solder wires from buck module to J6 pads
  14. Plug XIAO into socket (USB-C faces board edge)
```

---

## PART 11 — Testing

```
═══ TEST 1: Before Powering On ═══
  □ Visual check: no solder bridges
  □ Multimeter continuity:
    +5V to GND → should NOT beep (not shorted)
    VIN_SERVO to GND → should NOT beep
  □ Check all diode/cap polarities

═══ TEST 2: Power On Without XIAO ═══
  □ Connect 7.4V battery/supply to J1
  □ Measure J6 pin1: should read ~7.4V (VIN_SERVO)
  □ Measure J6 pin3: should read ~5.0V (buck output)
  □ Measure U1 pad14 area: should read ~5.0V
  □ If anything wrong → power off immediately

═══ TEST 3: Insert XIAO ═══
  □ Power off
  □ Insert XIAO (check orientation: USB-C at top)
  □ Power on → XIAO onboard LED should glow
  □ Connect USB-C → should appear on computer
  □ Upload test sketch → blink XIAO onboard LED

═══ TEST 4: Test Each Output ═══
  □ Servo test: connect one STS3215 to J2 → run servo sweep
  □ NeoPixel test: connect strip to J4 → run rainbow sketch
  □ Both working → JELAMP CARRIER BOARD COMPLETE ✅ 🪼
```

---

## Quick Reference — Complete Net List

```
┌─────────────────┬─────────────────────────────────────────────┐
│ Net Name        │ Connections                                 │
├─────────────────┼─────────────────────────────────────────────┤
│ VIN_SERVO       │ D1 cathode, J2-2, J3-2, J6-1               │
│ +5V             │ U1-14, J4-1, J6-3, C1+, C3+, C5+          │
│ +3V3            │ U1-12, C4+, J5-1                           │
│ GND             │ U1-13, J1-2, J2-1, J3-1, J4-3, J5-6,     │
│                 │ J6-2, J6-4, C1-, C3-, C4-, C5-             │
│ SERVO_TX        │ U1-1, R1 pin1                              │
│ SERVO_RX        │ U1-2, SERVO_DATA                           │
│ SERVO_DATA      │ R1 pin2, U1-2, J2-3, J3-3                 │
│ NEO_CTRL        │ U1-3, R2 pin1                              │
│ NEOPIXEL_DATA   │ R2 pin2, J4-2                              │
│ EXP_GPIO4       │ U1-4, J5-2                                 │
│ EXP_GPIO5       │ U1-5, J5-3                                 │
│ EXP_GPIO8       │ U1-8, J5-4                                 │
│ EXP_GPIO9       │ U1-9, J5-5                                 │
└─────────────────┴─────────────────────────────────────────────┘
```

---

This simplified design has **15 components**, **10 nets**, and does everything your Jelamp needs — servo control, NeoPixel lighting, camera/mic/WiFi via the XIAO — with nothing wasted. 🪼