muse/book-reading-clip-lamp
A Wi‑Fi/USB‑C ESP32‑S3 reading lamp with OV5640 camera, microphone, speaker amplifier, rechargeable Li‑Po power management, six-LED boost light, USB protection/charging detection, and a clip/gooseneck enclosure with external FlexPIFA antenna.
- Version
- 0.4.3
- License
- unset
- Stars
- 0
README.md
# Lamp Clip — 60 mm head PCB with automatic charging detection
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 hold:** J2's specified contact/stiffener lengths do not match the Seeed ribbon tail. Replace or qualify J2 before PCB fabrication. 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
Final assembly should use **prewired, connectorized subassemblies**: battery and
cell temperature sensor, speaker, Chat switch, power switch and the neck harness.
Order the head PCB fully assembled, including J3. Bare solder-lug switches in
the existing BOM are the underlying mechanisms, not complete plug-in assemblies.
E-Switch offers [factory wiring and connector assembly](https://www.e-switch.com/support/get-wired-with-e-switch/).
See [plug-in assembly specification](plug-in-assembly.txt) for the preserved
pinout, procurement requirements and neck threading sequence. The existing 3D
base still shows direct wiring; final connector selection and packaging are
pending the harness-only versus base connector-board choice.
## 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 8 October 2026: **tscircuit 0.0.2774**, CLI 0.1.2267,
core 0.0.2112 and runframe 0.0.2934. Runframe includes **3D viewer 0.0.617**;
that published viewer artifact still displays `0.0.616` in its version badge.
The lockfile records the installed dependencies. The routing generator stays
on its existing 0.0.919 version; normal builds use the reviewed saved routes.
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 routing. `build` replays the saved, corrected route through normal tscircuit validation and writes `dist/index/circuit.json`, PCB and schematic PNGs. The saved route is guarded against any changed geometry or netlist. To change placement or wiring, run `bun run reroute`, inspect and correct its results, then recapture the routing source as described in `routing-notes.txt`. Fresh autorouting can take several minutes. Inspect all output and the process exit status; a render can exist even if a check fails. Do not confuse a successful image export with an electrically valid design.
## 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 power toggle SW3** live in the clip base. **No base PCB is required**: both switches mount through the lid and use solder lugs. 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.
- `preview.html`: local design review page, with board views and a selector for all ten schematic sheets.
- `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.
Nine annotated schematic sheets cover all functional blocks. J1 uses `<connector standard="usb_c" />`. ESP32 GPIO assignments are preserved. The base-controls revision adds R35/R36 and C36/C37; the M6 harness revision replaces J3/J4 solder lands with one keyed eight-pin J3 and requires a fresh routing snapshot. The M10 charging revision now uses 259 preserved and 93 new/repaired replay routes, plus three explicit thermal links. Normal core DRC and Gerber short checks validate the result; see validation.txt. The old Kai Lap routing snapshot is invalid. Run `python3 verify-camera-interface.py` after building to audit the Seeed connector, translation directions, decoupling-only core and every ESP32 pad.
## Via size update (0.2.1)
All vias use a 0.30 mm hole and 0.45 mm outer copper diameter. Both board minimums and explicit/saved-route via sizes are updated. Routing follows the existing checked paths; the revised copper is rebuilt and checked for shorts on all four layers.
## Cloud build entrypoints (0.2.4)
`includeBoardFiles` explicitly selects `index.circuit.tsx`. The cloud builds and validates the saved, reviewed routing. `reroute.circuit.tsx` is an opt-in engineering tool invoked by `bun run reroute`; it is not part of normal CI. The worker timeout remains 20 minutes. See `cloud-build-investigation.txt` for measured timings and the v0.2.3 failure diagnosis.
## 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 battery/speaker clip base is not part of this head enclosure.
## Seeed camera and ribbon fit study (M5)
**J2 mating remains unresolved.** The current Hirose FH12 recommends a 3.5 mm
contact region and 4.5 mm stiffener; Seeed supplies 2.5 mm and 4 mm respectively.
The earlier mechanical-match claim was incomplete. Select/qualify a connector
for Seeed's shorter tail and rerun the mating/fold check before fabricating the
PCB. The modeled insertion is a packaging placeholder, not validated mating.
See the [Hirose catalog, page 10](https://www.hirose.com/en/product/series/FH12/documents?path=/api/v1/series/FH12/documents/product_series_catalog/content?lang%3DEN).
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 of **2.415 mm 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 an insulated splice inside the base. Speaker − remains
isolated from ground.
The base enclosure is 58 × 92 × 26 mm, with a removable grille lid, a protected
1S pouch-pack reference (40 × 50 × 8 mm plus protection-tab allowance), the
existing 35 × 25 × 7.7 mm speaker candidate envelope, an NTC on the cell,
hinged lower jaw, metal pin, torsion spring and soft grip pads. The clip is
shown open with a 12.6 mm pad gap. These models specify space and arrangement;
they do not select or qualify a battery, load-rated neck or spring.
`base-assembly-geometry.ts` is the editable source. Run `bun run enclosure:export`
after changes; this refreshes the GLBs and `base-cad-models.ts` imports used by
the native assembly, avoiding repeated Boolean geometry work in the browser.
There are 15 printable parts; the removed head Chat cap is no longer included. Battery, speaker,
neck, wires, spring, pin and silicone pads are modeled purchased/reference parts,
not plastic-print substitutes. [Assembly notes](mechanical/assembly-notes.txt)
describe retention, harness routing and the remaining physical checks.
## Base controls — wiring and sourcing
- **SW1 Chat:** [E-Switch PV5S24011G](https://www.digikey.com/en/products/detail/e-switch/PV5S24011G/4028817), momentary normally-open, gold contacts, solder lugs. Connect one lug to J3.7 and the other to J3.2 ground. The PV5 family drawing defines a 12 mm panel cutout and 17.5 mm bezel; the printed hole is 12.2 mm and needs sample fit checking.
- **SW3 power:** [E-Switch 100SP1T1B1M1REH](https://www.digikey.com/en/products/detail/e-switch/100SP1T1B1M1REH/378820), maintained SPDT, gold contacts, solder lugs. Common terminal 2 goes to J3.8; terminal 1 goes to J3.2; terminal 3 is unused and insulated. Verify terminal numbers and lever direction with a meter before marking ON/OFF. The printed mounting hole is 6.5 mm for the nominal 6.35 mm bushing.
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 panel switches are dimensioned reference models, not supplier STEP models.
Their lugs are wired directly; there is only one custom PCB. Use insulated
solder joints, a removable service loop and strain relief. Confirm real switch
fit and actuation, and exercise the controls during loud playback/Wi-Fi traffic
to qualify interference and firmware debounce. See [base control wiring](base-controls-wiring.csv).