Skip to the content
2 layers130 × 75 mmTreasure box main, the printed circuit board in 3D

Build along with a knock-to-unlock toy chest: firmware, KiCad files, parts lists and a parent checklist.

Size
130 × 75 mm
Copper layers
2
Thickness
1.6 mm
Parts
39
Nets
47
Pads
146
Tracks, vias
284, 42
Pours
1
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
24 Oct 2026
Updated
24 Oct 2026

Overview

Treasure box main is an open-source printed circuit board by mtrunzo12, from the mtrunzo12/TreasureBox-build repository on GitHub. It is a 2-layer board of 130 × 75 mm with 39 parts on 47 nets, routed with 284 tracks and 42 vias.

It is built around the ATMEGA328P-PU, CH340C and S8050. Its parts include 10 capacitors, 9 connectors, 8 resistors, 3 diodes and 2 ICs. It belongs with the AVR (ATmega, ATtiny) boards of this library.

Main components

3

README

README.md

Knock-to-Unlock Treasure Chest

Build a toy chest with a saved knock rhythm, keypad PIN, servo claw, lights and music. This folder is a curated snapshot of Mark and Liam's build. Start small: get the inputs working on a breadboard before ordering boards.

Start here

  1. Install Claude Code or Codex, plus Arduino IDE and KiCad.
  2. Download and unzip this build kit. Open the whole treasure-chest folder in your AI coding app. From GitHub, use Code → Download ZIP; no terminal or Git knowledge is required. Forking is optional and gives you your own place to save changes.
  3. Paste the prompt from START-HERE.md. Ask the assistant to explain the next small step, then stop for your measurements or a photo. Do not ask it to order parts or fabricate a board before the checks below.

What is included

  • firmware/treasure_box/: current v8.5 sketch and its two required headers. Keep all three files in this folder.
  • firmware/USER_MANUAL.md: using the toy and recording knock/PIN/music settings.
  • firmware/DEVELOPER.md: exact pin map, dependencies, programming workflow and mechanical limits.
  • treasure_box_main/: main-board schematic, layout, KiCad project and original exported BOM.
  • treasure_box_frontpanel/: panel-board schematic, layout, KiCad project and original exported BOM.
  • Each board folder includes the historical A0 Gerber/drill package and individual fabrication files.
  • PARTS.csv: combined exported PCB component lists (44 placements across both boards). These are design values/footprints, not a verified supplier cart. The off-board parts are listed below.
  • KNOWN-ISSUES.md: read this before spending money.
  • CHECKLIST.md: a build sequence for a parent and child.
  • SOURCE-MANIFEST.json: snapshot and source hashes. No family photographs, device backups, EEPROM dumps, credentials, local history or old build logs are included.

Ordering the boards

This is the as-built A0 design, not a newly reviewed production release. The owner reports a backwards USB-C design; the build uses a removable ATmega328P programmed in a compatible DIP Uno. Resolve and review that issue before treating this as a plug-in USB design.

  1. Open the .kicad_pro in each board folder. Check component orientation, connector pin numbering, footprint fit, board outline and hole locations against your parts and chest.
  2. Run KiCad's electrical and PCB design-rule checks. Review their findings; a clean result alone does not prove the connector or physical wiring is correct.
  3. Decide whether you are intentionally reproducing A0 with the Uno programming workaround or correcting the hardware first. If changed, regenerate Gerber and drill files from that exact saved revision. Do not order the historical ZIP for a revised board.
  4. Upload one ZIP per board to JLCPCB. Confirm both copper layers, masks, silkscreen, board outline, drill holes and displayed dimensions in the preview. Use the JLCPCB KiCad export guide.
  5. Choose bare PCB fabrication if you want to solder it yourselves. This package is not a turnkey assembly order; it does not include verified supplier part numbers or placement data. Check quantity, material, thickness and finish against the actual design before paying.
  6. Check the delivered bare boards for obvious defects and shorts before populating them.

Off-board parts to plan for

A wooden chest; piezo knock disc; reed switch and magnet; tilt switch; 4×4 keypad; passive speaker; illuminated arm button; red, green and blue lights with the appropriate wiring/resistors; four-AA holder and cells; main power switch; matching 16-way ribbon connectors/cable; keypad harness; wire, mounting hardware and strain relief. The installed claw is ServoCity 3219-0002-0002 with a goBILDA Proton Torque 2002-0180-0002 servo. Verify all electrical ratings and connector pitches before buying.

Tools: soldering iron, solder, ventilation, wire cutters/strippers, multimeter, breadboard/jumpers, and a compatible socketed ATmega328P Uno for the documented programming workaround. An adult handles soldering and initial powered claw tests. Keep fingers clear of the mechanism.

Firmware

Open firmware/treasure_box/treasure_box.ino in Arduino IDE. The documented target is Arduino Uno / ATmega328P, Arduino AVR Boards 1.8.8 and Servo 1.3.0. Use the developer guide for the correct BENCH_WIRING choice; the custom PCB uses false, even when its removable chip is programmed in an Uno. Review the actual pin map before loading it onto a different breadboard arrangement.

An unprogrammed ATmega328P may need its bootloader and fuse configuration prepared first. Do not assume every purchased chip arrives Uno-ready. Power everything off before transferring a socketed chip, and check its notch orientation.

The code was built and tested on the original setup. Knock sensitivity, mechanical endpoints, wake behavior and battery draw still need testing on your own assembled chest. This is a toy latch, not a security lock.

Parts

39
QtyValueFootprintReferences
6100nFCapacitor_THT:C_Disc_D3.0mm_W1.6mm_P2.50mmC3, C4, C5, C6, C9, C10
4MountingHole_3.2mm_M3MountingHole:MountingHole_3.2mm_M3H1, H2, H3, H4
210kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR1, R6
21N4007Diode_THT:D_DO-41_SOD81_P10.16mm_HorizontalD1, D2
222RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR3, R4
222pFCapacitor_THT:C_Disc_D3.0mm_W1.6mm_P2.50mmC1, C2
25.1kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR7, R8
1100uFCapacitor_THT:CP_Radial_D6.3mm_P2.50mmC8
116MHzCrystal:Crystal_HC49-4H_VerticalY1
11MResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR5
11N5819Diode_THT:D_DO-41_SOD81_P10.16mm_HorizontalD3
11kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR2
1470uFCapacitor_THT:CP_Radial_D8.0mm_P3.50mmC7
1ATmega328P-PUPackage_DIP:DIP-28_W7.62mm_SocketU1
1BATTTerminalBlock:TerminalBlock_MaiXu_MX126-5.0-02P_1x02_P5.00mmJ6
1CH340CPackage_SO:SOIC-16_3.9x9.9mm_P1.27mmU3
1LOGOsomething:PikaPCBG***
1PANELConnector_IDC:IDC-Header_2x08_P2.54mm_VerticalJ9
1PIEZOTerminalBlock:TerminalBlock_MaiXu_MX126-5.0-02P_1x02_P5.00mmJ2
1PWR_SWTerminalBlock:TerminalBlock_MaiXu_MX126-5.0-02P_1x02_P5.00mmJ7
1REEDTerminalBlock:TerminalBlock_MaiXu_MX126-5.0-02P_1x02_P5.00mmJ3
1S8050Package_TO_SOT_THT:TO-92_InlineQ1
1SERVOTerminalBlock:TerminalBlock_MaiXu_MX126-5.0-03P_1x03_P5.00mmJ5
1SPKRTerminalBlock:TerminalBlock_MaiXu_MX126-5.0-02P_1x02_P5.00mmJ1
1TILTTerminalBlock:TerminalBlock_MaiXu_MX126-5.0-02P_1x02_P5.00mmJ4
1USB_C_Receptacle_USB2.0_14PConnector_USB:USB_C_Receptacle_HRO_TYPE-C-31-M-12J8

More from mtrunzo12/TreasureBox-build

1
  • 2 layers70 × 55 mmTreasure box frontpanel, the printed circuit board in 3D

    Treasure box frontpanel

    mtrunzo12/TreasureBox-build

    Build along with a knock-to-unlock toy chest: firmware, KiCad files, parts lists and a parent checklist.

    15 parts

Similar boards

  • 2 layers13.7 × 21.4 mmZ2m partner, the printed circuit board in 3D

    Z2m partner

    smarthomefans/z2m_partner

    Hardware module for iobroker.zigbee

    52 parts186
  • 4 layers43 × 49 mmEsppdp, the printed circuit board in 3D

    Esppdp

    Spritetm/esppdp

    ESP32-based PDP11 simulator, based onSimH

    55 parts141
  • 2 layers85 × 56 mmHB RF ETH, the printed circuit board in 3D

    HB RF ETH

    alexreinert/PCB

    Some of my PCBs

    96 parts104
  • 4 layers62.5 × 60 mmUnijoysticle2 c64, the printed circuit board in 3D

    Unijoysticle2 c64

    ricardoquesada/unijoysticle2

    Bluetooth gamepad support for the Commodore 64 / Atari / Amiga, etc.

    58 parts62
  • 2 layers125 × 55 mmPicsy hw, the printed circuit board in 3D

    Picsy hw

    Jana-Marie/PICSY

    A smol and simple pixel-art-camera

    114 parts12
  • 4 layers100 × 100 mmNif T, the printed circuit board in 3D

    Nif T

    SharKingStudios/Nif-T

    An all in one smart home automation board!

    115 parts11MIT
  • 4 layers89 × 58 mmHALMET, the printed circuit board in 3D

    HALMET

    hatlabs/HALMET-hardware

    Hat Labs Marine Engine & Tank interface hardware design files

    227 parts8CC-BY-4.0
  • 2 layers62 × 72 mmMsx joyblue v2-build2, the printed circuit board in 3D

    Msx joyblue v2-build2

    herraa1/msx-joyblue-v2

    Use bluetooth joysticks with your MSX computer

    64 parts5GPL-3.0

Questions

How big is the Treasure box main PCB?

It measures 130 × 75 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Treasure box main use?

39 parts, built around the ATMEGA328P-PU, CH340C and S8050. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Treasure box main KiCad files?

From the mtrunzo12/TreasureBox-build repository on GitHub, at the commit this page was made from: the board is treasure_box_main/treasure_box_main.kicad_pcb and its schematic treasure_box_frontpanel/treasure_box_frontpanel.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Treasure box main design in my own project?

Its repository states no licence, so its author keeps all rights: ask mtrunzo12 before reusing the design.