# Tinker Mission 01 · Intrusion alarm · 3D-printable enclosure (rev 3d: batteries, print-qa fixes)

> **In this download folder**: the 8 parts as 3MF and STL side by side (`tm01_*.3mf`, `tm01_*.stl`), the OpenSCAD source `tm01_alarm.scad`, and `LICENSE-3D.txt`. The `stl/`, `3mf/`, `png/` sub-folders, build and check scripts and fonts mentioned below are not included. To rebuild text parts, install the Space Grotesk font (SIL OFL 1.1).
>
> **Licence**: our own designs, under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/): credit "Tinker Mission", non-commercial use only. See `LICENSE-3D.txt`.

A **main box** on the frame/wall side (receiver, ESP32, buzzer, LED, button, **4×AA battery bay**) and an **emitter holder** on the door leaf (IR emitter + **3×AA holder**). Two main-box versions:

- **Breadboard** (solder-free): the sheet's 830-point breadboard goes in as built.
- **Perfboard** ("make it permanent"): the soldered 157 × 51 mm breadboard-pattern perfboard (electronics spec §4) on 3 standoffs, DevKitC removable on female headers.

Status: **rev 3d (USB slot widened after rev 3c), fit, overhang and layer-island checks pass, back to print-qa, not test-printed.** Target printer: Bambu Lab X1-Carbon (256 × 256 mm plate, Bambu Studio, AMS optional). Every size is a named parameter at the top of `tm01_alarm.scad`; `clr` (default 0.3 mm) is the clearance around every component. Electronics basis: `tm-ir/elec-spec.md` (2026-11-16).

## Files
| File | What |
|---|---|
| `tm01_alarm.scad` | Single parametric source (OpenSCAD 2021.01+). `VARIANT` = `breadboard` / `perfboard`; `PART` = `box`, `lid`, `hatch`, `pusher`, `emitter`, `assembly`, `exploded_box`, `exploded_emitter` |
| `stl/` | `tm01_box_breadboard`, `tm01_lid_breadboard`, `tm01_pusher_breadboard`, `tm01_box_perfboard`, `tm01_lid_perfboard`, `tm01_pusher_perfboard`, `tm01_hatch` (same for both boxes), `tm01_emitter`. Print orientation, single colour |
| `3mf/` | Same parts, one object per file = one plate, **PrusaSlicer-format 3MF**, placed front-left on 256 × 256 (5 mm margin) so the back / right stays free for the **AMS wipe tower**. Box, lid, hatch and emitter: the text (logo, "PACK OFF", pack labels) is a **second part on filament 2** |
| `png/` | 3 views per part (`_iso`, `_top`, `_end`), `assembly_breadboard`, `assembly_perfboard`, `exploded_box_*`, `exploded_emitter`, `usb_end_perfboard`, `assembly_top_beam_alignment` |
| `build.sh`, `make_3mf.py` | Rebuild all STL / 3MF / PNG |
| `check_fit.py`, `check_overhangs.py`, `check_islands.py`, `check/` | Fit test with component dummies, overhang test, layer-island test (`python3 check_islands.py stl/X.stl 0.13`), results |
| `fonts/` | Space Grotesk Bold (site font, SIL OFL 1.1) |

Customise: OpenSCAD > Window > Customizer, or `openscad -D 'VARIANT="perfboard"' -D 'PART="box"' -D 'clr=0.4' -o box.stl tm01_alarm.scad`.

## What changed in rev 3
- **Power bank gone.** Main box: battery bay on the long side, flush with the USB end, for a **switched 4×AA holder** (default Adafruit 830 size, `pack4`). Emitter: cradle for a **switched 3×AA holder** (`pack3`). Both packs labelled ("ESP32 4×AA", "EMITTER 3×AA", spec §5.5) so they are not swapped.
- **Breadboard default is now the 830-point board** (the spec's wiring plan uses rows 1–46). `bb_preset="half400"` still builds (145 × 130 mm) but needs a re-planned layout.
- **New perfboard version**, new long button pusher, new battery hatch.

## What changed in rev 3d
- **USB U-slot** (both boxes): `usb_slot_w` 14 → **15.5 mm**, so 13.4 mm-wide micro-USB plug bodies pass with clearance. Fit check repeated with a 13.4 × 7.5 × 28 mm plug dummy (`check/fit_*_plug13.4.txt`), buzzer clearance included.

## What changed in rev 3c (print-qa)
- **Mid-length lid posts**: the 45° cone (apex on the post axis, 2.7 mm from the wall: ~13 floating layers) is replaced by a **corbel anchored in the wall**: hull of the post and an apex inside the wall at y = `wall`/2, `mid_corbel_drop()` = post_d/2 + (po − wall/2) + `mid_corbel_margin` (0.5) = 7.7 mm below the post, so every flank is steeper than 45°. Layer-island check (`check/islands.txt`, own section-by-section test at 0.2 mm): 0 islands on both boxes (rev 3d control: 2). PrusaSlicer 2.x CLI, auto-support at 45°: no support generated at the mid posts.
- **Buzzer (breadboard lid)**: y offset from the lid centre line 16 → **18 mm** (`buz_y_off`), more clearance to a wider USB plug body.
- **Perfboard lid LED tube**: OD = led_d + 2·clr + **3.2** (wall 1.6, `led_tube_wall`).

## What changed in rev 3d (print-qa)
- **USB slot height (breadboard box)**: slot bottom now from the same formula as the perfboard box, `usb_z − 8` (`usb_slot_margin`), with `usb_z` derived from the breadboard height `bb[2]`: 9.6 mm above the floor bottom for a 10 mm board.
- **USB reach (breadboard box)**: `panel_len` 32 → **20**; the DevKitC micro-USB mouth is now 22.8 mm behind the outer end face (was 34.8). The plug body (12.5 × 7.5) enters the open-top U-slot; a 25 mm plug still sticks out 2.2 mm, a 28 mm plug 5.2 mm. Lid parts moved: LED and buzzer at panel start + 4 mm, button at + 13 mm (buzzer pins point over the breadboard end, 1.5 mm above the DevKitC USB receptacle). Perfboard box: mouth 4.0 mm behind the face (unchanged).
- **Breadboard height** 8.5 → **10 mm** (Adafruit #239 full-size: 16.3 × 5.3 × 1 cm).
- **Fit check**: USB plug dummy now a realistic micro-USB plug (12.5 × 7.5 × 28 mm, `usb_plug`) from the receptacle mouth through the end wall; `check_fit.py` also fails if the shortest plug (`usb_plug_min` = 25 mm) does not come out of the box.
- **Polish**: LED light tube and pusher guide tube walls +0.2 mm (OD +0.4); **mid-length lid screws** on both long walls when the box is longer than 150 mm (`mid_post`): wall-merged posts 10 mm deep with a 45° cone under them (rev 3c: replaced by a wall-anchored corbel), 2 more M3 × 10 screws.

## Design choices
- **Battery bay** (both boxes): the holder lies cover-up on 3 rails that lift it to 0.5 mm under its own **hatch** (2 × M3 screws in thick end walls), so cells are changed without opening the electronics lid. **Switch from outside**: a 22 × 40 mm window in the hatch over the +X end of the holder; put the holder in with its switch at that end. **Wire pass-through**: a 9 × 7 mm notch in the divider top (near row 1 on the breadboard, next to screw terminal J1 on the perfboard). **Vented, never sealed**: floor slots, 5 slots in the outer wall, 10 slots in the hatch, and the switch window. The electronics dissipate < 0.5 W (spec §4.3); nothing traps heat around the cells.
- **USB stays reachable** through the U-slot in the end wall (open at the top: lay the cable in before the lid), now with **"PACK OFF" embossed next to it** (spec §5.4: pack OFF before plugging USB). The switch window is on the same end, so both are seen together.
- **Perfboard version**: board on **3 conical standoffs** (5 mm high ≥ 3 mm for solder tails, 6 mm top = the spec's keep-out circle) at the board holes 3.6 / 78.5 / 153.4 mm from the row-1 edge. `so_type` = `m3_screw` (default, M3 cuts its thread in a 2.6 mm pilot), `m3_insert` (Ø4.0 hole), `m25_screw`, `m25_insert`. Row 1 / DevKitC USB at the end wall: **USB U-slot centred on the DevKitC** (between columns a and i), at its height on 8.5 mm female headers. **IR receiver**: same sleeve and window at `beam_h` as the breadboard box. **Lid**: Ø5.5 mm LED hole over D1 (spec §4.3: x ≈ 78.5 mm from the row-1 edge, 14.5 mm from the a-side edge, `pf_led_xy`, **measure**), with a printed **light-pipe tube** down to 1 mm above the LED, which is soldered flat on the board, **long pusher** (27.9 mm, captive in a guide tube) over the button at e44–f46, sound holes over the buzzer module standing in H3 (h39–h41). **Screw terminals** J1/J2: 12 mm free margin between the j column and the divider for wire entry and a screwdriver from the top (lid off). Interior 36 mm high because an in-line-pin buzzer module stands upright in its header (`buz_upright`).
- **Emitter holder**: IR housing still **snaps** into its sleeve at `beam_h`; 3×AA holder in an open-top cradle (walls 90 % of its height, end stop at −X, **+X end open** for the cable and the switch), one 20 mm strap slot at 28 % of the length (`strap_xf`) so the switch end stays free, 3 vent slots in the end stop. Logo (2 lines) on one side wall, "EMITTER 3×AA" on the other.
- **Same beam height on both parts** (`beam_h` = 12 mm from the mounting surface; `emitter_riser` if the door face is offset).
- **Logo / text, two colours**: lid logo **debossed** (prints face-down), hatch label debossed, "PACK OFF" and emitter texts **embossed** on vertical faces. In the 3MF each is a second part on filament 2 (AMS); single colour: use the STL. `logo_on=false` removes logo and labels; `pack_note=""` removes "PACK OFF".

## Print settings
**Bambu Studio** (X1-Carbon): *Bambu Lab X1 Carbon 0.4 nozzle* · *Bambu PLA Basic* · **0.20 mm Standard** · **4 walls** · 15 % gyroid · **supports off** · no brim. The 3MF files are **PrusaSlicer-format** (also open in OrcaSlicer). In Bambu Studio, if the text loads merged into the body: right-click > **Split > To parts**, set the text part to filament 2. With 2 colours, drag the wipe (prime) tower into the free strip at the back or right of the part (≥ 30 mm on the 216 mm breadboard box).

| Part | Orientation (as exported) | Size (mm) | Time / PLA |
|---|---|---|---|
| `tm01_box_breadboard` | Open side up | 216 × 130 × 32 | ~4 h 25 / ~123 g |
| `tm01_lid_breadboard` | Logo face down | 216 × 60 | ~1 h 15 / ~35 g |
| `tm01_pusher_breadboard` | Flange down, mouse-ear disc (tear off) | Ø6 × 4.7 | 2 min |
| `tm01_box_perfboard` | Open side up | 188 × 144 × 38 | 5 h 20 / 144 g |
| `tm01_lid_perfboard` | Logo face down (tubes up) | 188 × 75 | 1 h 40 / 38 g |
| `tm01_pusher_perfboard` | Flange down, mouse-ear disc. Print 2 side by side (tall thin rod) | Ø4 × 27.9 | 8 min |
| `tm01_hatch` | Label face down | 86 × 69 × 2 | 37 min / 12 g |
| `tm01_emitter` | Base down | 119 × 55 × 18.6 | 1 h 05 / 25 g |

Times: rev 3 PrusaSlicer 2.x (rev 3d breadboard values scaled by length, ~) with an X1C-like profile (0.2 mm, 4 walls, 15 % gyroid, X1C speeds/accelerations); Bambu Studio will be in the same range. Everything fits the 256 mm plate axis-aligned.

Overhang check (`check/overhangs.txt`) + layer-island check (`check/islands.txt`): no support needed in the given orientations, **0 floating islands**. Overhangs: mid-length lid posts sit on a wall-anchored corbel (flanks > 45°, apex inside the wall); short flat bridges: 2 mm tops of vent slots, ≤ 9.5 mm in the debossed letters and countersinks, 5 mm in the hatch label; round holes in walls are teardrops (apex up) or open-top U-slots; standoffs are cones; the strap slot has a 45° roof with a 6 mm flat top. Remaining > 45° area = 0.6 mm undersides of embossed letters (prints fine).

## Parts and screws (beyond the sheet's parts list)
| Qty | Item | Use |
|---|---|---|
| 6 | M3 × 10 flat-head (countersunk) screw, machine or self-tapping | Lid to box (4 corners + 2 mid-length) |
| 2 | M3 × 10 flat-head screw | Battery hatch |
| 3 | M3 × 6–8 pan-head screw (or M2.5; or M3 heat-set inserts + M3 × 6 with `so_type="m3_insert"`) | Perfboard on its standoffs (perfboard version) |
| 2 + 2 | #6 (3.5 mm) countersunk wood screws 20–25 mm (+ wall plugs), or removable mounting strips | Box on the frame, emitter holder on the door |
| 1 | Hook-and-loop strap 20 mm wide, ~25 cm | 3×AA holder in its cradle |
| 6–8 | Female-to-male jumpers 20 cm | Breadboard version only: lid LED, button, buzzer |
| — | Foam pad 1–2 mm (optional) | Under a 4×AA holder that is thinner than 19 mm |

## Assembly
**Breadboard box**: 1) receiver into its sleeve (lens to the window). 2) Breadboard in, USB end towards the U-slot. 3) LED, button, pusher, buzzer into the lid; jumpers to the breadboard (wiring unchanged). 4) 4×AA holder (switch OFF) on the rails, switch end at +X; its leads through the notch to j1 (+, **never a red rail**) and the blue rail (−). 5) USB cable laid in the slot if needed, lid (6 screws), hatch (2 screws). Cells change: hatch only.
**Perfboard box**: 1) Solder the board per spec §4 (LED flat on the board, female headers, terminals), check per §4.5, DevKitC out. 2) Screw the board on the 3 standoffs (do this before plugging the DevKitC: the row-1 screw is under it). 3) Receiver into its sleeve, wires to J2. 4) Plug the DevKitC (USB to the end wall). 5) Holder leads through the notch into J1. 6) Drop the long pusher into the lid's guide tube, fit the lid (its tube sits over the LED), then 6 lid screws and the hatch.
**Emitter**: snap the emitter in, holder in the cradle (switch end at the open +X end), strap, join red to red / black to black (WAGO).

## Fit test (dummies)
`check_fit.py` places every component in assembled position and intersects every pair. Dummies: breadboard or perfboard, DevKitC (PCB, module with antenna overhang, headers, USB receptacle), USB plug, screw terminals J1/J2, perfboard screw heads, receiver, LED (with legs), tactile switch, pusher, buzzer module (lid-mounted or upright in H3), 4×AA holder with switch knob, 3×AA holder, emitter, lid, hatch. **Results rev 3d: PASS** (overlaps and USB reach) for breadboard 830 (`check/fit_breadboard830.txt`), breadboard 400 (`check/fit_breadboard400.txt`) and perfboard (`check/fit_perfboard.txt`). Control test: interior 30 mm + LED raised 24 mm on the perfboard correctly flags lid × buzzer and lid × LED. Wires are not modelled.

## Dimension sources
| Part | Value used | Source |
|---|---|---|
| 4×AA holder with switch, Adafruit 830 | 2.75 × 2.5 × 0.75 in ± 0.1 in = 69.9 × 63.5 × 19.1 mm, 6 in leads with 0.1 in header ends, snap cover, on/off switch | https://www.adafruit.com/product/830 (fetched 2026-11-16). **Switch position not stated: measure.** Generic boxes vary ±3 mm: measure (`pack4`, `pack_clr` = 1 mm) |
| 3×AA holder with switch | Generic enclosed box ≈ 67 × 48 × 18 mm | **Assumed, measure** (`pack3`). Adafruit 3287 (3×AA, switch, JST, belt clip): 78 × 49 × 29 mm, https://www.adafruit.com/product/3287 — use `pack3=[78,49,29]` |
| Perfboard, Adafruit Perma-Proto full-size 1606 | 157 × 51 × 1.6 mm, 3 holes Ø3.2, 2.95 in (74.9 mm) apart | https://www.adafruit.com/product/1606 via elec spec §4.1 [S10]. **Hole positions 3.6 / 78.5 / 153.4 mm, row-1 offset 3.57 mm and gap 7.62 mm are derived: measure with calipers** |
| ESP32-DevKitC V4 | 48.26 × 27.94 mm, headers 25.40 mm apart, antenna 6.04 mm past the PCB, micro-USB at the row-1 end | Espressif dimensions drawing, elec spec §4.3 [S6] |
| Female header height, buzzer module, screw terminals | 8.5 mm; PCB 15 × 18.5 + Ø12 × 9.5 can; 5.08 mm, 10 mm high | **Typical, measure** |
| IR break-beam pair, Adafruit 2168 | Housing 20 × 10 × 8 mm | https://www.adafruit.com/product/2168. Lens face **assumed** on a 10 × 8 end: measure |
| 830-point breadboard | 165.1 × 54.6 × 10 mm | Adafruit #239 full-size breadboard, "16.3 cm x 5.3 cm x 1cm", https://www.adafruit.com/product/239 (fetched 2026-11-16). The sheet lists a generic 830-point board (8.5–10 mm high): **measure** (`bb`) |
| Micro-USB cable plug | 12.5 × 7.5 mm body, 25–32 mm incl. strain relief (`usb_plug`, `usb_plug_min`) | **Typical, measure your cable** |
| 5 mm LED, 6 × 6 × 5 tactile switch | Ø5 / 5.8 flange / 8.6 high; 6 × 6 × 3.5 + Ø3.5 × 1.5 stem | **Typical** |

Third-party models: none used; everything is our own geometry.

## Measure with calipers before printing
1. **4×AA holder**: L × W × H, **where its switch is** (it must sit under the +X window) and the **gap holder top → hatch** (0.5 mm target; foam pad if thinner); `pack4`, `pack_sw_len`, `pack_sw_w`, `pack_top_gap`.
2. **3×AA holder**: L × W × H, switch end; `pack3`. If it is the Adafruit #3287: `pack3=[78,49,29]` (product page: 78.0 × 49.0 × 29.0 mm).
3. **Perfboard**: hole positions from the row-1 edge and from the long edge, row-1 offset, LED D1 centre (x, y); `pf_holes`, `pf_row1`, `pf_gap`, `pf_led_xy`.
4. **Female header height** and DevKitC USB height above the perfboard (`fh_h`), so the USB slot lines up; **breadboard height** (`bb`) for the breadboard box slot.
5. **USB cable plug** length and body size (`usb_plug`).
6. **Buzzer module**: pin direction and size (upright in H3 needs ~34 mm interior; `in_h_pf`).
7. **IR housing** lens face and size; **breadboard** size; **door/frame offset** (`emitter_riser`).
Test prints (~20 min each, Bambu Studio Cut tool): hatch corner with the switch window over your holder; emitter sleeve (x < 30 mm); perfboard standoff corner. Too tight: `clr` 0.4; too loose: 0.2.
