AI1 0 1 1 0 1 0 0 1 1 0 10 1 0 0 1 1 0 1 0 1 1 0 1Ai Me Bro

Escape-room puzzle box with a keypad, RFID and a servo lock

A printed puzzle box that only opens when players solve three stages: find a hidden magnet spot, tap the right RFID card, then enter a code on the keypad. An ESP32 shows clues on an OLED, beeps, and releases a servo latch. A hidden mechanical release always opens it.

IntermediateBuild time: 8-12 hours (plus ~28 h printing)Parts: $60-753D print
Illustration of Escape-room puzzle box with a keypad, RFID and a servo lock
Illustration. An artist's impression, not a photo of a finished build. Your build will look different.

Safety first

  • Always build in a hidden mechanical release (a pin or slot that pushes the bolt back) and tell the game host where it is. Never lock anything important, or anything a child or pet could get trapped in.
  • Neodymium magnets must be glued in so they cannot come loose; swallowed magnets are dangerous for children.
  • The RC522 module runs on 3.3 V; do not connect it to 5 V.

Parts

PartQtyApprox. eachSubtotal
Espressif ESP32-DevKitC-32E (DevKitC V4) development boardOfficial Espressif 38-pin DevKitC V4 with ESP32-WROOM-32E (4 MB). Micro-USB port, not USB-C. Buy only the official 38-pin Micro-USB board, not a USB-C or 30-pin clone. Primary listing: Mouser 356-ESP32-DEVKITC32E, $10.20, 1,701 in stock on Nov 12, 2026, per Findchips (https://www.findchips.com/search/ESP32-DEVKITC-32E). The Mouser US page itself returned 403 to a direct fetch, so click-confirm the US storefront before you order. Mouser Netherlands listed 1,622 in stock at €8.60 the same day. Do not use DigiKey as the default today (search snippets showed 0 in stock / long lead time). Official Amazon listing https://www.amazon.com/dp/B09MQJWQN2 was still unavailable; use it if it returns. Amazon search for the official board: https://www.amazon.com/s?k=ESP32-DevKitC-32E. Adafruit #3269 remains $15.00 and was out of stock (https://www.adafruit.com/product/3269). Typical $10-16.Mouser1$10.20$10.20
RC522 RFID reader module with cards and tagsTypical $5-10, no verified link.Amazon (search)1$7$7
4x4 membrane keypadTypical $4-8, no verified link.Amazon (search)1$6$6
MG90S metal-gear micro servoDrives the latch bolt. Typical $4-8, no verified link.Amazon (search)1$5$5
Magnetic reed switch (normally open, pack)Typical $5-10, no verified link.Amazon (search)1$7$7
Neodymium disc magnets 10x3 mm (pack)Typical $6-11, no verified link.Amazon (search)1$8$8
5 V active buzzer module (pack)Typical $4-8, no verified link.Amazon (search)1$6$6
UCTRONICS 0.96-inch SSD1306 I2C OLED (128x64)Price seen $6.99 in our parts catalog (Nov 12, 2026). Typical $5-9.Amazon1$6.99$6.99
10 k ohm resistorExternal pull-up for the reed switch on input-only GPIO34. Typical $0.1-1, no verified link.Amazon (search)1$0.20$0.20
4x AA battery holder with switch6 V for the servo and the ESP32 VIN. AA cells not included. Typical $4-7, no verified link.Amazon (search)1$5$5
40-pin 20 cm female-to-female jumper wiresCatalog ASIN. Typical $4-8.Amazon1$5.50$5.50
Estimated total (parts only)$66.89

Typical US prices, checked 2026-11-12. Prices change and multi-packs are often cheaper per piece.

As an Amazon Associate I earn from qualifying purchases. Prices change; check the store.

Filament

PLA (1.75 mm): about 500 g (167.8 m), roughly 28 h of printing.

PLA, 0.2 mm layers, 15-20% infill, 3 walls; print the box walls flat and the lid separately with a hinge.

AI agents you'll use

  • Code helper (ChatGPT, Claude, Gemini or Grok): Writes the ESP32 state machine: magnet stage, RFID stage, keypad stage, clues on the OLED, unlock and relock.
  • Puzzle designer: Writes a story, clue cards and a hint ladder for the age group you give it, and checks that each clue leads to exactly one answer.

Tools

  • Soldering iron
  • Small screwdrivers
  • Hot glue gun
  • USB data cable

What you'll learn

  • Writing a multi-stage puzzle as a state machine
  • Reading RFID cards and a matrix keypad
  • Servo latches and safe overrides
  • Designing puzzles with an AI helper

A box that only opens for people who solve it. Make one for a birthday, a classroom challenge or a home escape room, and let the AI help you write the story and clues.

What you'll build

An 18 cm printed box with a hinged lid held by a servo-driven bolt. Stage 1: slide a magnet along the lid until the hidden reed switch clicks. Stage 2: tap the one correct RFID card out of several. Stage 3: type the code found from the clue. The OLED shows the story and the next clue, the buzzer gives feedback, and after the last stage the servo pulls the bolt back.

The cost range is $60-75 for the parts listed below, allowing about 10% either way for price swings.

Print the parts

Print the box, lid, hinge and a latch bolt that the servo arm can slide. Leave a small hidden hole for a mechanical override pin that pushes the bolt open. Ask the AI helper to help you design it, or credit any designer you remix.

Wiring

From To Notes
RC522 3.3V / GND ESP32 3V3 / GND 3.3 V only.
RC522 SDA(SS) / SCK / MOSI / MISO / RST ESP32 GPIO5 / 18 / 23 / 19 / 4 VSPI bus.
Keypad rows 1-4 ESP32 GPIO13, 12, 14, 27 GPIO12 must be HIGH or floating at boot on some boards; if it fails to boot, move that row.
Keypad columns 1-4 ESP32 GPIO26, 25, 33, 32
Reed switch ESP32 GPIO34 with an external 10 k pull-up to 3V3 GPIO34 is input-only with no internal pull-up.
Servo signal ESP32 GPIO15 Servo power from the 6 V battery pack.
OLED SDA / SCL ESP32 GPIO21 / GPIO22
Buzzer ESP32 GPIO2, 5 V, GND
4x AA pack + Servo red and ESP32 VIN Common GND for everything.

Step-by-step

  1. Write the story and clues with the puzzle designer first.
  2. Wire each part on a breadboard and test it with a library example.
  3. Build the state machine: locked, stage 1, stage 2, stage 3, open.
  4. Print the box and latch; test the mechanical override before anything else.
  5. Hide the reed switch under the lid and mark nothing on the outside.
  6. Play-test with someone who has not seen the clues, and add hints where they get stuck.

Code

Arduino-ESP32 with the MFRC522, Keypad, Adafruit SSD1306 and ESP32Servo libraries (all in the Arduino Library Manager).

Prompt for the code helper:

Write an Arduino-ESP32 puzzle-box sketch as a state machine: LOCKED -> MAGNET (reed switch on GPIO34 LOW) -> RFID (only UID <paste> accepted, via MFRC522 on SS GPIO5, RST GPIO4) -> CODE (4x4 keypad rows 13,12,14,27 cols 26,25,33,32, code from a constant) -> OPEN (servo on GPIO15 to UNLOCK_ANGLE).
Show story text and the current clue on an SSD1306 OLED, beep on right and wrong answers, lock out for 30 s after 5 wrong codes, and add a secret keypad combo for the host to reset and relock.

Troubleshooting

  • ESP32 will not boot with the keypad wired: GPIO12 is a strapping pin. Move that keypad row to another free pin.
  • RFID reads nothing: Check 3.3 V power and the SS/RST pins; keep the antenna away from metal.
  • Servo jitters and the ESP32 resets: Batteries are low or the servo shares the ESP32 3.3 V. Power the servo from the pack.

Last checked 2026-11-12. Double-check parts against your own board and seller listings before you buy.

Escape-room puzzle box with a keypad, RFID and a servo lock: parts, filament and AI agents | Ai Me Bro