README.md
# Lamp Clip — 60 mm head PCB with automatic charging detection
> **v0.4.6 · M12 assembly · 3 November 2026:** Stock cable/plug models and sourcing list updated. Engineering prototype; the complete assembly is **not yet fully source-selected or physically qualified**.
## Assembly sourcing status
Most purchased parts have catalog links in the [sourcing list](base-shopping-list.html)
([CSV](base-shopping-list.csv)). **The exact 6/4 mm gooseneck has no selected
purchase SKU.** The eight-wire head harness still needs threading, termination
and strain relief; no stock finished harness has been selected. Exact retention
materials are also pending. The 22 printable parts are custom prints, with STL
files supplied.
The catalog spring needs grip/travel/load testing. The battery has a 45°C charge
limit versus the board's approximately 50°C cutoff, and camera/J2 mating remains
unqualified. Catalog availability does not establish assembled fit or electrical
qualification. See [the complete sourcing status](assembly-sourcing-status.json).
## Prototype fabrication corrections — 28 October 2026
Moved the two overly close ground vias apart and raised the board's via drill-edge
clearance to **0.20 mm**. The closest remaining pair is **0.20318 mm** apart.
Vias remain 0.30 mm drill / 0.45 mm copper and span all four layers.
J2 now uses **FH19SC-24S-0.5SH(09), C6947608**, with repaired signal/ground-tab
copper and its supplier footprint and 3D assets. Duplicate thermal traces were
removed; the retained exposed-pad spurs are 0.30 mm wide. Small custom silk
labels were increased to 1 mm. No DRC checks or parts-engine checks are disabled.
Run `bun run check:manufacturing` in addition to DRC and **all-layer** shorts.
The independent check rejects the old published drill spacing. See
[fabrication instructions](fabrication-notes.txt) for the required stackup,
filled/capped via-in-pad process, stencil and sourcing instructions. Firmware,
USB power/current behavior, physical camera mating and thermal/RF/audio behavior
still require prototype measurements. The nominal ribbon fits; the maximum
published tail width fails the slot-envelope check, so shipped-tail width/mating
remains a hold. These corrections do not certify a production-ready device.
## M12 stock cables and catalog-parts base — 3 November 2026
The printed housing, clip, cradle and shelf stay printable. Purchased hardware
now has named catalog parts and drawing-based models: Adafruit 2011 battery,
1445 momentary button, 1442 latching button, 1152 push-on leads, WAGO 222 lever
splices, the ordered Same Sky speaker and a stock prewired Semitec 103AT-11, WB Jones torsion spring
and standard M4 hinge hardware. **No base PCB.** Case: **64 × 92 × 42 mm**.
[Shopping list with clickable purchase links](base-shopping-list.html) ([CSV](base-shopping-list.csv)) ·
[Model sources and dimensions](base-catalog-parts.json) ·
[Assembly and terminal guide](base-parts-and-assembly.txt).
The battery reserve uses the manufacturer's **38.5 × 62 × 8.5 mm maximum**,
including PCM, rather than the smaller retail dimensions. A **103AT-11 prewired thermistor** now fits beside the cell. Its factory leads
replace the two custom extension joints required by the raw 103AT-2. The
stock **Adafruit 3814 male PH2 pigtail** replaces the 500 mm battery extension. The button leads need trimming
and stripping; head XH contacts still require proper crimping/prepared harness.
**Latched power button = OFF/charge; open = ON.** Its LED is unused. Each WAGO
block joins **one** net; never put battery + and − in the same block.
Battery body, full 100 mm leads and factory PH2 plug now move together in the
exploded view. The speaker likewise includes its whole 120 mm factory cable and
51021 connector. Stock button leads use red/black colors and all WAGO entries
show the stripped conductors. See [cable inventory](mechanical/cable-inventory.json).
The already-owned 103AT-2 remains a bench alternative requiring prepared leads;
103AT-11 is an optional new purchase to remove those custom solder joints.
Current base solids/wire poses have no detected intersections, and all printed
parts have closed manifold meshes. Models follow supplier envelopes and key
interfaces; they are **authored references, not certified vendor CAD**. Wire
bend/OD, spring force/travel, the generic neck's load capacity, retention and
real samples remain unqualified. This is a prototype fit study.
**Battery charging hold:** the selected pack permits 0–45°C charging while the
existing TS circuit permits approximately 0–50°C. Correct/qualify that cutoff
before charging the pack. The separate camera/J2 maximum-width hold remains.
The head PCB copper, pinout and head enclosure are unchanged. These M12 notes
supersede older base dimensions, connectors and solder-lug switch instructions.
Open `bun run enclosure:preview` for the base close-up. Regenerate GLB/STL and
collision reports with `bun run enclosure:export`; its nonzero exit for the
existing camera hold is intentional. `bun run check:base:catalog` checks the
base independently without suppressing the camera failure.
Editable tscircuit engineering design for a book-mounted reading light with camera, microphone, Wi-Fi and spoken responses. **Prototype under review; not a manufacturing release.** This package is hardware source, not tested hardware or finished Muse firmware.
**Camera connector update:** J2 now uses Hirose FH19SC-24S-0.5SH(09), JLC C6947608, specified for the shorter contact/stiffener lengths. Shipped-tail width and physical mating still need qualification. The M5 model establishes enclosure space for the camera, heatsink and folded ribbon; it does not validate connector mating. See the [camera fit notes](mechanical/camera-fit-notes.txt).
## Automatic wall-adapter charging
The head now includes **BQ24392 BC1.2 detection (U14)** and **TUSB320LAI USB-C
current detection (U15)**. A recognized charging adapter, or a USB-C source
advertising 1.5 A / 3 A, selects the BQ24074's **500 mA input mode** without
waiting for the ESP32 to boot. Unknown sources and unconfigured ordinary USB
computer ports retain the 100 mA startup mode. No USB-PD voltage negotiation.
U18 supplies the detection logic directly from USB, so detection and charging
work with the base switch in OFF/charge. U16/U17 combine hardware permission
with the existing GPIO21 host-enumeration permission. R1/R2 are removed because
U15 provides the CC sink resistors. The USB data path passes through U14 before
R3/R4 and the ESP32. All five new ICs use exact JLCSearch footprints and CAD.
The battery charge setting remains about 500 mA; the system shares that input
budget, so actual battery current can be lower. The small detector supply is
additional USB current outside the charger's limit. USB current, attach/detach,
charge-only, host enumeration/suspend and thermal behavior still need physical
testing. Read [the electrical policy and test matrix](./usb-power-policy.txt)
and run `bun run check:charging` after building. This resolves the missing
charger detector; it does not close the other fabrication-review findings.
## Flat rear housing — M9
The whole rear surface is now flat at **Z=15.5 mm**, the previous maximum JST
pocket height. The roof is **2 mm thick**, with a uniform inner ceiling at
Z=13.5 mm. The shell remains **72 mm diameter × 32.7 mm deep**; the local
antenna and cable bulges have been removed. The Light button extends 1.5 mm
beyond the rear shell and is not included in that shell-depth dimension.
PCB and antenna tray supports now meet the higher ceiling. The Light plunger
and both indicator pipes are longer, while their PCB contact locations stay
fixed. The antenna has **4 mm** clearance to the inner roof. Three rear-entry
**M2 × 16** screws retain their original seats in deeper 4.4 mm-diameter access
wells; their heads are 5.7 mm below the back. Use a suitably narrow screwdriver.
Reprint the rear housing, Light cap and two indicator pipes together.
## M3 PCB mounting — M8
Four **3.2 mm non-plated clearance holes** now share their coordinates with the
rear enclosure posts through `pcb-mounting.ts`. Positions in mm from PCB centre:
| Hole | X | Y |
| --- | ---: | ---: |
| H1 | -21 | -16 |
| H2 | -20 | 19 |
| H3 | 21 | -16 |
| H4 | 20 | 19 |
Use four **M3 × 6 button-head screws**, maximum head diameter 5.7 mm and head
height 1.65 mm. These install from the exposed page side of the PCB **inside the
open enclosure**, before the front bezel is fitted. The exterior case continues
to use its separate three rear-entry M2 × 16 screws. No external front-face
fastener openings have been added.
Rear posts are now 5.6 mm OD with 2.5 mm blind pilots: finish/tap these M3 after
printing. Nominal thread engagement is 4.4 mm and tip clearance is 1.6 mm. Check
printed thread strength and assembly torque on a sample; do not substitute a
longer screw or force an M3 machine screw into an untapped pilot. Internal bezel
reliefs clear the screw heads. Outer enclosure dimensions remain 72 mm diameter
and 32.7 mm maximum shell depth are retained.
Both PCB surfaces have 3 mm-radius copper/component keepouts at each mount.
R5, R8, R23, R19, C37, U12 and C29 move to clear the hardware. Affected routes
were regenerated; unchanged routes remain guarded against input geometry/net
changes. The 0.30 mm drill / 0.45 mm pad via rule is retained.
`bun run check:mounting` checks the **built** PCB drill positions, surface trace/via
clearance and enclosure support/head/pilot geometry. See
[mechanical mounting report](mechanical/pcb-mounting-checks.json) and
[assembly collision report](mechanical/geometry-checks.json). All four mounting
axes, 108 component envelopes and 50 assembly parts pass geometry checks.
Build, placement and Gerber shorts checks on all four copper layers pass.
Existing camera connector mating qualification remains open.
## Plug-in assembly requirement
Use the catalog base and preparation sequence in
[the current assembly guide](base-parts-and-assembly.txt). The head PCB should
arrive assembled, including J3. Both base buttons use stock push-on leads;
the prewired thermistor needs only trimming/stripping; head-plug contacts still
need proper crimping/prepared leads.
There is only one custom PCB. No custom switch wiring assembly is required.
## External antenna and slimmer front — M7
ANT1 is now **Ezurio 001-0014**, a 2.4 GHz, 50-ohm, 2 dBi FlexPIFA with
its supplied 100 mm overall cable assembly and MHF1/U.FL plug.
[Order from DigiKey US](https://www.digikey.com/en/products/detail/ezurio/001-0014/4732758)
· [Manufacturer drawing and installation rules](https://www.ezurio.com/documentation/datasheet-24-ghz-flexpifa).
Use **001-0014**, not the MHF4L version 001-0022.
The plug connects to the RF socket already on U1 (ESP32-S3-WROOM-1U).
No extra PCB socket, GPIO RF connection or etched antenna is required. The host
PCB copper remains unchanged. The schematic MCU sheet identifies ANT1.
A dimensioned antenna, coax route, plug, removable 1.5 mm dielectric tray and
internal M1.6 x 3 tray screws are included in the tscircuit assembly.
The radiator faces the rear, with its adhesive ground face toward the PCB.
The flat plastic roof is 4 mm above it; geometric checks enforce the manufacturer's
3 mm plastic / 10 mm metal top clearance and 2 mm plastic / 5 mm metal long-side
clearance. These are **3D enclosure reservations**, not a missing keepout under U1.
The uniform M9 rear roof reaches Z=15.5 mm over both antenna and harness.
Use unfilled nonmetallic plastic; 1.5 mm polycarbonate is the antenna maker's preferred
mounting surface. Install the antenna on the tray, then fit the tray from the open
front of the rear cup before the PCB. Keep the cable below the tray and away from
the radiator; secure slack with nonmetallic tape, without pulling on the RF plug.
The front face moves from Z=-18 to **-17.2 mm**, reducing the bezel cup depth
from **14.8 to 14.0 mm**. The complete printed front-bezel height, including its
internal lip and microphone duct, is **16.1 mm**, down from **16.9 mm**. M9 shell depth is uniformly **32.7 mm**, matching the former maximum
depth at the harness pocket (33.5 mm before the front-bezel reduction). The camera,
7 mm heatsink and 2.415 mm ribbon fold radius stay in place. The lens remains
0.5 mm recessed nominally, or 0.3 mm allowing the published 0.2 mm body tolerance.
Greater reduction needs a revised camera/flex/thermal stack. Rear-entry case screws
remain. Reprint the front bezel and revised rear housing; the diffuser shape is
unchanged and only its assembled position moves 0.8 mm.
See [antenna assembly notes](mechanical/antenna-fit-notes.txt) and
[measured geometry report](mechanical/geometry-checks.json). These are mechanical
clearance checks, not measured Wi-Fi performance. Cable OD/bend radius and RF plug
seating remain packaging assumptions; test the exact antenna in the assembled lamp.
The existing camera connector fabrication hold still applies.
## Removable head harness — M6
The gooseneck cable now unplugs from **J3, JST B8B-XH-A(LF)(SN)** (JLCPCB **C157972**). The board uses the exact imported 2.50 mm-pitch footprint and supplier 3D model. One **XHP-8** cable housing and eight **SXH-001T-P0.6** crimp contacts carry all eight wires; J4 has been removed. Pin 1 is the square pad; its equal-axis imported pill is expressed as an identical circular hole with square copper to avoid a core null-ID bug. The mating cable model is a dimensioned reference, not manufacturer CAD.
- [Board connector / JLCSearch](https://jlcsearch.tscircuit.com/components/list.json?search=B8B-XH)
- [JST XH specifications and dimensional drawings](https://www.jst-mfg.com/product/pdf/eng/eXH.pdf)
- [XHP-8 cable housing / DigiKey search](https://www.digikey.com/en/products?keywords=XHP-8)
- [SXH-001T-P0.6 contacts / DigiKey search](https://www.digikey.com/en/products?keywords=SXH-001T-P0.6)
JST rates XH at 3 A with AWG 22 wire. Use qualified flexible AWG 22 battery leads and AWG 28 signal leads with insulation compatible with the contact (0.9–1.9 mm OD); the reference fit uses 1.1 mm OD battery leads and 0.9 mm OD other leads in the 4 mm bore. Validate actual current, wire temperature, voltage drop, bend life and pull strength. Thread unterminated wires through the neck first, then crimp and insert them into the housing. The assembled plug cannot pass through the neck.
Disconnect battery and USB before unplugging J3; it is not a hot-plug interface. Hold the plastic housing, not the wires. The flat rear shell provides a uniform 13.5 mm inner ceiling (15.5 mm rear extent, 2 mm roof) for the 9.8 mm mated connector height and wire bend. The Light button shifts to (24, -8) mm to clear the plug. Remove the rear housing to service J3. No additional base PCB is needed.
## Open and edit
Toolchain updated on 19 October 2026: **tscircuit 0.0.2953**, core
**0.0.2174**, CLI **0.1.2372**, and capacity-autorouter **0.0.988**.
The lockfile records the installed dependencies. With explicit routing now authorized,
the board uses native `<pcbtrace>` and full-stack `<via>` elements from
`explicit-pcb-routes.tsx` / `explicit-pcb-routes.json`. The reviewed copper was
revalidated with the current toolchain. `routeRemaining={false}` keeps the router
from replacing it; all normal DRC checks remain enabled. There is no custom
algorithm or phase solver. `verify-explicit-routing.py` rejects stale pad geometry,
net/trace bindings, endpoint IDs, unexpected copper counts, and incorrect vias.
Run it after every build; the build and release scripts include it.
**Latest routing validation (19 October): zero core DRC errors, zero unconnected
pins, and zero Gerber shorts across all four layers.** See
`routing-validation-latest.json` and `routing-notes.txt`. This resolves routing
errors, not the separate camera connector fabrication hold at the top of this file.
The earlier automatic solve (78 DRC errors / 38 shorts) remains archived outside
this package in `../lamp-drc-investigation/baseline/` for upstream investigation.
Install Node.js and Bun, then in this directory. Install the local dependencies before starting dev: otherwise the global CLI can fall back to a different bundled browser runtime:
```sh
bun install --frozen-lockfile
bun install --cwd mechanical-tools --frozen-lockfile
bun run dev
```
The entry point is `index.circuit.tsx`. For this version of the PCB viewer, right-click the board and choose **Rendering Engine → Canvas**; the experimental WebGPU renderer cannot display through-pad traces. Dependencies are pinned to the tool version used here. Components with nonstandard footprints are defined in the adjacent TSX files; imported land patterns are stored locally in `imports/`. All thirteen IC/module definitions (U1–U13), Q1 and D1 use local JLCSearch/EasyEDA imports. `component-provenance.csv` records the exact supplier IDs, import paths and documented corrections. The build does not depend on a live component search service.
```sh
bun run typecheck
bun run check:netlist
bun run check:schematic
bun run check:placement
bun run placement
bun run build
bun run check:shorts
```
`check:schematic` (also `check:schematic:style`) resolves the **latest** official
schematic analyzer on tscircuit's CDN, rebuilds the circuit, and runs every rule
across every sheet. It fails on findings or a failed latest-version lookup.
The standalone bundle avoids changing the pinned PCB dependencies. The report
at `checks/schematic-style/report.json` records version, bundle/input hashes,
all rule counts and findings. After an existing build, use
`bun run check:schematic:style --built` to analyze it without rebuilding.
`check:schematic:placement` retains the CLI's bundled analyzer for comparison.
`placement` compiles without automatic routing. `build` renders the explicit copper, runs core DRC, writes `dist/index/circuit.json` plus PCB/schematic PNGs, and verifies route bindings. `reroute` rebuilds the same explicit design with additional diagnostics; it does not regenerate the manual paths. The 20-minute worker timeout is retained. Run `check:shorts` after building. Inspect check results: a rendered image alone does not confirm electrical validity.
## What is in the head
| Function | Selected implementation |
|---|---|
| Main board | 60 mm circular, 4 layers, 1.6 mm; top = rear electronics, bottom = page side |
| Wi-Fi / processor | ESP32-S3-WROOM-1U-N16R8, 16 MB flash / 8 MB PSRAM; Ezurio 001-0014 external antenna |
| Camera | Seeed 114993115 OV5640 autofocus camera on 24-contact flex |
| Microphone | INMP441 digital I2S, bottom acoustic port; obsolete R7 prototype selection |
| Audio output | MAX98357A amplifier in the head; 8-ohm speaker in the clip base |
| Reading light | Six warm-white XL-3216WWC LEDs, constant-current series string, nominal 15 mA |
| Charging | USB-C 5 V, BQ24074 power path and remote cell temperature sensing |
| Logic power | TPS63021 3.3 V buck-boost |
| Controls | Ask, light and hardware on/charge-only switch; USB programming/recovery pads |
This has one custom main PCB plus the purchased sensor/lens assembly on flex. J2 is a Hirose FH12-24S-0.5SH(55), imported from JLCSearch C202112 with its 3D model. Camera rails and level conversion live on the main board: U9 supplies 1.8 V I/O; U8 supplies 2.8 V analog/autofocus after the R34/C32 enable delay. The camera uses its internal 1.5 V core regulator; J2 pin 10 connects only to decoupling capacitors C24/C25. U10/U11 are SN74AXC8T245 dual-supply translators, U12 drives 1.8 V controls, and U13 translates SCCB. Pin 23 is autofocus ground. See `camera-pinout.csv` for every contact.
## Source the camera
Order **Seeed SKU 114993115: OV5640 Camera for XIAO ESP32S3 Sense (With Heat Sink)** from the [Seeed Studio store](https://www.seeedstudio.com/OV5640-Camera-for-XIAO-ESP32S3-Sense-With-Heat-Sink-p-5739.html). This is the sensor/lens assembly on flex with a heat sink; the lamp PCB contains its power supplies and signal conversion. Purchase the exact SKU, not an arbitrary 24-pin OV5640 camera.
Alternative US ordering: [DigiKey 1597-114993115-ND](https://www.digikey.com/en/products/detail/seeed-technology-co-ltd/114993115/21277047).
The electrical mapping follows Seeed's **MJY5OAF-F3M-V1 drawing dated 2023-06-20**, page 3 of the [module datasheet](https://files.seeedstudio.com/wiki/OV5640_for_ESP32S3_sense/OV5640_Datasheet.pdf). Seeed provides [ESP32-S3 camera and autofocus examples](https://wiki.seeedstudio.com/xiao_esp32s3_camera_usage/). The schematic supports this published interface; physical mating, rail timing and autofocus at the lamp's reading distance still require a sample test. Earlier Kai Lap cameras use different power/ground assignments and must not be fitted to this revision.
## What stays in the clip base
The protected battery, cell-mounted thermistor, speaker, **Chat pushbutton SW1 and latching OFF/charge button SW3** live in the clip base. **No base PCB is required**: both switches mount through the lid and use stock push-on leads. The head retains the Light button SW2. Eight conductors pass through the gooseneck:
| Head terminal | Connection |
|---|---|
| J3.1 | Battery positive |
| J3.2 | Battery negative / ground |
| J3.3 | Cell thermistor |
| J3.4 | Thermistor return / ground |
| J3.5 | Speaker positive, amplifier output |
| J3.6 | Speaker negative, amplifier output |
| J3.7 | Chat switch; momentary connection to J3.2 ground |
| J3.8 | Power control; grounded = OFF/charge, open = ON |
**Speaker negative is not ground.** Keep the speaker pair together and physically separated from the microphone wiring/acoustic path. Use strain relief and wire gauges suitable for measured peak battery current. The gooseneck must not be used as the electrical return.
## Mechanical assumptions
The Seeed drawing specifies a 70.5 mm flex assembly, an 8.5 × 8.5 mm camera body and approximately 5.4 mm total height. The supplied heat sink requires additional enclosure clearance. Provide a gentle fold/storage path for the longer flex; do not crease the bond at the lens. The page-side FPC faces inward to keep the ribbon inside the head. Allow latch/tool access and a nonconductive lens support. The 9 mm silkscreen box is a provisional alignment guide. The M5 enclosure provides a saddle, open retaining frame, a 7 × 6 × 7 mm heatsink model and a length-preserving folded ribbon; it is a dimensioned reference, not supplier CAD. Confirm those dimensions against a physical sample before printing for final fit.
Four 3.2 mm M3 clearance holes are provided; see M8 mounting dimensions above. USB-C faces the left edge; the charge-only switch is now on the base. M1 adds matching mounting posts, access openings, a microphone passage and a socket for a nominal 6 mm gooseneck. M3 includes the hollow neck, eight-wire harness, panel controls and battery/speaker clip base. These are fit-study models with unqualified load capacity and component dimensions. The selected ESP32 module needs a suitable external 2.4 GHz antenna; the M7 tray establishes antenna placement; RF performance must be tested in the plastic enclosure. A privacy shutter is not included as CAD.
## Muse integration boundary
Use the [Muse Gadget SDK](https://github.com/facebookincubator/muse-gadget-sdk) as the firmware starting point. Its ESP32 foundation, voice recording and camera backend are relevant, but this board needs a custom hardware definition, camera driver/configuration, I2S mapping and power policy. The proposed interaction is press Ask, capture the page, record the question, obtain the assistant response and play audio.
Do not assume the current voice-message path automatically includes a photo or returns synthesized speech. Image/voice association and text-to-speech playback still require implementation and end-to-end testing. See `firmware-and-assembly.txt` and `pin-map.csv` for the actual wiring and integration work.
## Before an assembled prototype
- Finish the routing and manufacturability review documented in `validation.txt`; verify USB pair geometry, camera clock/data timing, converter current loops and thermal returns against manufacturer layouts.
- Select exact passive part numbers, including capacitance after DC bias. SW2 uses E-Switch TL3305AF160QG with audited manufacturer lands and contact pairs; confirm assembly orientation and enclosure actuator fit. The imported INMP441ACEZ-R7 is an obsolete prototype selection and must be replaced/qualified before a production design.
- Review all custom land patterns, the bottom FPC orientation and latch access, microphone acoustic pad and exposed-pad paste/thermal-via treatment with the assembler. The intentional thermal vias in exposed pads require a filled/capped via-in-pad process (or a reviewed redesign). `isViaInPadAllowed` declares that manufacturing choice; copper clearance and short checks remain enabled.
- Qualify the new automatic USB charging-source detector on hardware. Recognized BC1.2 adapters and USB-C 1.5 A / 3 A sources select 500 mA; unknown sources stay at 100 mA. Validate enumeration, suspend, unplug timing and total port current using `usb-power-policy.txt`.
- Replace or qualify the prototype VBUS presence detector for valid voltage thresholds and detach timing; test suspend behavior in all power states, including charge-only mode.
- Test power rails first from a current-limited supply, then programming, camera, microphone, speaker and light independently. Test cell temperature cutoff, low-battery handling, charging, thermal rise and fault recovery before enclosure trials.
No battery-life, reading-distance, audio-quality or manufacturing-cost measurement is claimed. A useful next physical milestone is one electrically reviewed engineering assembly with its exact camera, battery, antenna and speaker, followed by firmware bring-up.
## Files
- `index.circuit.tsx`: main board and net connections.
- `*-parts.tsx`, `usb-connector.tsx`, `imports/`: audited/corrected component definitions.
- `schematic-layout.tsx`: ten annotated functional schematic sheets; preserves PCB coordinates.
- `bill-of-materials.csv`: procurement list with selected, generic and pending parts explicitly marked.
- `component-provenance.csv`: JLCSearch references and exact footprint adaptations.
- `pin-map.csv`: physical module pad / GPIO / net mapping.
- `firmware-and-assembly.txt`: camera setup, harness, firmware boundary and bring-up.
- `power-audit.txt`, `usb-power-policy.txt`: detailed design review and known limits.
- `validation.txt`: final tool results and release status.
- `enclosure-viewer.html`: local assembly review; current PCB/schematic images are in `dist/index/`.
- `schematic-sheets/`: one SVG and PNG per numbered sheet.
- `schematic.svg`: all ten sheets stacked into a single overview.
Primary component documentation is linked in the source files, BOM and audit. Earlier development-module guides are not the wiring instructions for this custom PCB.
## Seeed camera revision (0.3.0)
The 60 mm board uses Seeed SKU 114993115, 1.8 V camera I/O and 2.8 V analog/autofocus. U9 is TLV75518PDBVR (JLC C2877863); U10/U11 are SN74AXC8T245PWR (C882718). Their exact JLCSearch land patterns and CAD models are stored in `imports/`. A=3.3 V MCU, B=1.8 V camera, DIR1=DIR2=LOW selects B-to-A for every channel; CAM_PWDN disables the outputs. U12 remains SN74LVC125A, powered at 1.8 V with 3.3 V-tolerant inputs. The external core regulator has been removed in favor of the camera's internal 1.5 V regulator.
Annotated schematic sheets cover all functional blocks. J1 uses `<connector standard="usb_c" />`. ESP32 GPIO assignments are preserved. J3 is the keyed eight-pin base harness. All connections are freshly routed, except the three explicit short thermal-pad-to-via links specified in the board design. Run `python3 verify-camera-interface.py` after building to audit the Seeed connector and ESP32 pin assignments.
## Via size update (0.2.1)
All vias use a 0.30 mm hole and 0.45 mm outer copper diameter. These dimensions apply to all 438 through vias, including the four thermal vias. Validate the generated copper on all four layers.
## Cloud build entrypoints (0.2.4)
`includeBoardFiles` selects `index.circuit.tsx` and the camera fit study. Cloud builds render the same native explicit copper as local builds. The worker timeout remains 20 minutes. `cloud-build-investigation.txt` describes an earlier release and its former saved-routing workflow; it is historical, not the current configuration.
## Indicator polarity fix (0.2.5)
LED7 is XINGLIGHT XL-1608SYGC-06 (JLC C965805, yellow-green) and LED8 is XL-1608UOC-06 (C965800, orange). Both use pin 1 cathode and pin 2 anode, explicit JLCSearch imports and CAD models. The orange import’s pad numbering is corrected against the manufacturer drawing to agree with its cathode mark. Both are placed at 180 degrees. Four trace endpoints were updated to the selected footprints and all four layers checked for shorts. Normal builds now keep supplier checks enabled; `bun run check:release` independently rejects circuit error records and audits both LED polarities.
## Schematic sheets and validation (M11)
The project uses **tscircuit 0.0.2839** with ten fixed ANSI B schematic sheets.
Titles, notes and footers occupy reserved bands inside the drawing border.
Schematic-only offsets center each functional block; PCB geometry and net
connections are preserved.
`bun run check:schematic` builds fresh, fetches the latest official style
analyzer, and checks both style and sheet containment. Analyzer **0.0.60**
includes the chip-label containment rule. U10/U11 use 2.55-unit schematic
heights to keep their inner labels inside the chip boxes. A separate project
check adds text-aware sheet bounds because upstream's style rules omit them
and core's boundary warnings omit text. `bun run test:schematic-bounds` includes
the original title/footer overflow as a regression fixture.
The dev server's **Run Style Analysis** button uses the upstream analyzer;
the additional boundary guard runs in the project's command above. See
[the root cause and verification notes](work-schematic-m11/findings.txt).
## Head enclosure
The main entry now wraps the PCB in `<assembly.device>` and adds the round head
using `<assembly.cadassembly>`, following the [tscircuit assembly docs](https://docs.tscircuit.com/elements/assembly-cadassembly).
The 72 mm diameter enclosure includes a front bezel, rear housing, board posts,
camera saddle and retainer, six diffuser inserts, a microphone duct, USB access,
indicator light pipes and a captive Light cap. Chat and power access now sit
on the base; their old head openings are closed. SW2 retains its audited
footprint and nominal 3D switch reference. The shell is 28 mm deep, or 29.5 mm including the button caps.
The yellow rear cap operates **SW2 / Light**, the reading-LED control; its sun
icon distinguishes it from the base Chat and power controls. Color is cosmetic.
From revision M4 onward, **three M2 × 16 case screws enter from the rear** into blind
front-bezel bosses. Their modeled 4 mm heads sit 0.2 mm below the rear surface
in 4.4 mm counterbores. The camera/LED face has no case-screw holes. The bosses
provide 4.8 mm nominal engagement and leave 8.8 mm of solid material before the
front face. Screw models are references; the 1.7 mm pilots and purchased head
dimensions need a fit check before assembly.
Run `bun run dev` and choose **3D** for the native assembly. Run
`bun run enclosure:preview` for the local interactive review at
[127.0.0.1:3021](http://127.0.0.1:3021), with assembled, see-through and exploded
views. Print files and [assembly notes](mechanical/assembly-notes.txt) are in
`mechanical/`. The editable geometry is `enclosure-geometry.ts`.
This is a fit prototype. The shipped Seeed revision, nominal 6 mm neck, flex
bend durability, antenna, optical, thermal and acoustic fit remain physical checks. The M10 base assembly is included separately in the native assembly.
## Seeed camera and ribbon fit study (M5)
**J2 now uses FH19SC-24S-0.5SH(09).** Its specified 2.5 +/-0.3 mm contact area, >=3.5 mm stiffener and 0.30 mm tail thickness fit the camera's nominal short tail. See the [Hirose connector and catalog](https://www.hirose.com/en/product/p/CL0580-0511-9-09). The camera permits a wider tail-width tolerance than Hirose recommends; incoming width inspection and a physical mating test remain necessary. The insertion model is a packaging reference.
The [Seeed 114993115 product](https://www.seeedstudio.com/OV5640-Camera-for-XIAO-ESP32S3-Sense-With-Heat-Sink-p-5739.html)
includes a **7 × 6 × 7 mm camera heatsink** and a separate 14 × 14 × 7 mm heatsink.
The camera model uses the small one. The previous 12 × 12 × 2 mm placeholder was
not the supplied heatsink: the actual stack interferes with the PCB in the old
22 mm head. M5 increases the front depth by 6 mm to **28 mm total shell depth**,
moves the camera forward and replaces the strap with an open retaining frame.
The PCB and rear-entry case screws stay at their existing coordinates.
The [module drawing, page 3](https://files.seeedstudio.com/wiki/OV5640_for_ESP32S3_sense/OV5640_Datasheet.pdf)
sets 70.5 mm overall length, 8.5 mm camera width, 6 mm flex width and 0.12 ± 0.03 mm
flex thickness. Therefore **62 mm runs from camera edge to connector tip**.
The model retains that length through two cylindrical bends with the updated connector pose (see `cameraFold` for the calculated radius),
ending in a straight 4 mm × 12.5 mm stiffened tongue with 24 contacts at 0.5 mm pitch.
That radius is an engineering assumption: Seeed does not publish an allowable
bend radius or fatigue rating in this drawing. Contacts face toward the PCB;
verify pin 1 and insertion against a physical module before powering it.
`camera-mechanical.ts` is the camera/flex source. The native 3D assembly shows
all four camera parts. Select `camera-fit.circuit.tsx` for an isolated ribbon/heatsink
view without the PCB and covers. [Camera fit notes](mechanical/camera-fit-notes.txt) and
[measured clearances](mechanical/camera-fit-checks.json) record the folding pose,
source dimensions, tolerance checks and connector-envelope exception. The test
checks the full heatsink envelope and maximum specified ribbon thickness against
the enclosure and 108 component envelopes. This establishes a geometric trial,
not assembly tolerance, electrical, optical or thermal qualification.
## Complete lamp assembly M6
The native **3D** tab now includes a hollow corrugated gooseneck leading from
the head to a spring clip base. Its centreline is approximately 244 mm long,
with a nominal 6 mm outside diameter, 4 mm wire bore and 60 mm bend radius in
the shown pose. Eight separately colored wires follow the J3 terminal order:
red VBAT, black battery ground, yellow NTC, white NTC return, blue speaker +,
purple speaker −, green Chat and orange power control. Both switches share
battery ground through a labeled WAGO 222-415 inside the base. Speaker − remains
isolated from ground.
The current M12 base is **64 × 92 × 42 mm** and reserves the actual battery
maximum, retains the ordered speaker and includes stock spring/hinge hardware.
The jaw pose has a 12.6 mm pad gap; grip force, motion and fatigue are unqualified.
`base-assembly-geometry.ts` is editable; `bun run enclosure:export` refreshes
models used by the native tscircuit assembly. There are 22 printable parts,
including TPU pads and a spring guide. See [current assembly notes](base-parts-and-assembly.txt).
## Base controls — wiring and sourcing
- **SW1 Chat:** [Adafruit 1445](https://www.adafruit.com/product/1445), momentary NO, 16 mm panel mount.
- **SW3 OFF/charge:** [Adafruit 1442](https://www.adafruit.com/product/1442), latching, 16 mm panel mount. CLOSED/latched means OFF with this PCB; its LED tabs are unused.
- Both use [stock 1152 push-on leads](https://www.adafruit.com/product/1152), trimmed and stripped into WAGO 222 terminals. Printed panel holes are 16.2 mm; test dry-contact behavior on the logic inputs.
R35/C36 filter the remote Chat input (1k/10nF); R18 supplies its 10k pull-up.
R36/C37 filter the power-control input (1k/100nF). R25 now pulls SYS_EN up to
SYS through 100k. Grounding J3.8 disables the regulator; an open control lead
turns it on. At SYS=4.4 V, nominal grounded EN is 44 mV; normal startup has
about a 10 ms RC time constant. These are circuit calculations, not measured
results. OFF keeps charging available and does not physically isolate the cell.
The models use drawing-based dimensions; actual button and terminal samples
still need trial fitting. Head filtering and connector pinout are unchanged.
See [base control wiring](base-controls-wiring.csv) and the current assembly guide.
## Programmable RGB status LED (local revision, 2026-11-02)
LED9 is a low-current red/green/blue status indicator. U19 (NXP PCA9632DP1,
JLC C2802665) supplies independent PWM control over the existing 3.3 V camera
control bus: GPIO39 = CAM_SCL, GPIO40 = CAM_SDA, 7-bit address **0x62**.
OV5640 uses 0x3C. The connection is on the MCU side of U13, never the 1.8 V
FPC side. R46/R47 provide 4.7 kohm pull-ups even while camera RESET disables
U13. No ESP32 boot/PSRAM pin is repurposed.
LED9 is XL-1615RGBC-RF (C965840): pin1 red cathode, pin2 common anode to
V3V3, pin3 green cathode, pin4 blue cathode. The exact supplier drawing p8
was used to correct catalog pads3/4; an older manufacturer PDF conflicts.
Use the specified supplier revision and confirm sample orientation before assembly.
R43 = 1 kohm (red), R44/R45 = 330 ohm (green/blue); these limit each color's
current. C45 = 100 nF decouples U19. LED3 output of U19 is intentionally NC.
The rear cover has a third clear light pipe at PCB coordinates (13.3, -23.8 mm).
LED7 remains the always-on green power light; LED8 remains the orange charge light.
LED9 stays off after power-up until firmware configures it. The standalone
[Arduino RGB test](firmware/rgb-bringup/rgb-bringup.ino) cycles red, green,
blue and off. For integrated camera/Muse firmware, share one I2C controller
and a lock; do not separately reinitialize the same pins. Start at 100 kHz
and verify bus rise times before increasing speed. Write MODE1=0x00, wait
at least 500 us, MODE2=0x01 (open drain), PWM0/1/2 values, LEDOUT=0x2A.
Do not broadcast PCA9632 software resets on a shared bus.
A color change verifies firmware execution and the I2C/indicator path; it does
not by itself verify Wi-Fi, camera or audio. Low-current green/blue brightness,
white balance and the printed light pipe require physical qualification.
The firmware example has not been flashed onto hardware. Existing camera-tail
mating and assembly/CAM holds still apply. Previous dated fabrication ZIPs
pre-date this RGB change and must not be used for the updated board.