- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| build | ||
| scripts | ||
| step_files | ||
| .gitignore | ||
| .python-version | ||
| DESIGN.md | ||
| DESIGN_R3.md | ||
| enclosure.py | ||
| enclosure_r3.py | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
README
Revision 3: PETG prototype with four recessed enclosure screws, three rear PCB posts, RESET access, an LCD keeper and keychain loop. BOOT access is intentionally omitted. Latest update: all PCB mounts are on the back; reload both shell STLs before printing.
Interior views with the PCB mounts, corner screw posts, screen retainer and keychain loop:
See DESIGN_R3.md for printing and assembly instructions.
The snap-based revision remains in enclosure.py and build/r2/.
Combination AGENTS.md and README file.
Commit often.
Reference STEP files exist in ./step_files. The user confirmed that the PCB
STEP is current and authoritative. The old enclosure is for an earlier PCB
revision: its USB opening and one mounting hole are wrong. Do not use the old
case geometry to locate current hardware.
- bonkgotchi_pcb.step: The PCB step file exported from KiCad
- case-Back.step: Backside of the reference enclosure
- case-Front.step: Front of the ref enclosure
- bonkgotch_joystick_cap.step: Joystick component that friction fits over the joystick switch
The old enclosure used tape for both the closure and LCD retention. The screen position relative to the joystick is unchanged. The battery attaches to the PCB with double-sided 3M foam, confirmed to be about 2 mm thick uncompressed. The screen plugs into the back of the PCB and is "upside down" with the ribbon cable routed over the top of the PCB.
Components
-
PCB: See STEP file
-
Battery:
- Digikey PN: 1528-1841-ND
- Mfg PN: 1578
- Datasheet: https://cdn-shop.adafruit.com/product-files/1578/C1854+PKCell+Datasheet+Li-Polymer+503035+500mAh+3.7V+with+PCM.pdf
-
Joystick:
- Digikey PN: 3746-TSSJ5TR-ND
- Mfg PN: TSSJ 5
- Datasheet: https://mm.digikey.com/Volume0/opasdata/d220001/medias/docus/6727/Knitter_Switch_Catalog.pdf
-
Screen:
- Digikey PN: 425-2903-ND
- Mfg PN: LS013B7DH03
- Datasheet: https://mm.digikey.com/Volume0/opasdata/d220001/medias/docus/929/LS013B7DH03_Spec.pdf
-
ESP32 module:
- Digikey PN: 5407-ESP32-S3-WROOM-1-N8R2CT-ND
- Mfg PN: ESP32-S3-WROOM-1-N8R2
- Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-s3-wroom-1_wroom-1u_datasheet_en.pdf
Goal
Design a better enclosure for this project for STL export and 3D printing (either resin or FDM). We have various length self tapping screws (think M1.5-M2) that can be used.
Python / CAD environment
Use CadQuery to work with the reference STEP geometry, build parametric parts,
and export STEP or STL files. Dependencies are managed by uv in a local
.venv; do not install packages into the system Python.
From the repository root, with uv installed:
uv sync --locked
uv run python -c "import cadquery as cq; print(cq.__version__)"
The project uses Python 3.12 for compatibility with CadQuery's native
dependencies. uv will download that Python version if needed. uv.lock
records the resolved dependencies; use uv add <package> to add dependencies.
Run CAD scripts with uv run python path/to/script.py. Put generated exports
in build/, keeping step_files/ as the reference inputs. Generated files are
ignored by Git except for the two PNG previews shown above.
PCB-driven enclosure, revision 3
enclosure_r3.py builds the screwed prototype using the current PCB geometry,
four M2 × 8 mm shell screws and three M2 × 4 mm PCB screws. Optional tapered
plugs cover the recessed rear heads. It retains the glue-secured LCD keeper,
protected antenna bay, relocated USB opening and top keychain loop.
The obsolete enclosure STEP files are not imported.
uv run python enclosure_r3.py
uv run python scripts/check_exports.py
blender --background --threads 6 --python scripts/render.py
uv run python scripts/package.py
Print-ready STL files, individual STEP files, an assembly STEP and validation
results are written to build/r3/. See DESIGN_R3.md for hardware,
printing, assembly, the optional Blender render command, and reference
clearance assumptions. Proceed to the full case print; additional coupons are not requested.

