Build an Escape Room Puzzle Prop: RFID-Triggered ESP32 Relay Locks and Sequence Logic
A home escape room — for a kid's birthday party, a family game night, or just because building elaborate puzzle boxes is fun — gets a lot more convincing once physical props actually respond to what players do, instead of relying on paper clues and honor-system locks. This build uses an ESP32, RFID/NFC tag readers, and relay-driven electronic locks to create a prop that only unlocks when the right physical tokens are presented in the right combination, with a small display or LED strip giving players feedback as they get closer to solving it.
Project Concept
The core idea generalizes to a lot of different puzzle designs: hide RFID tags inside physical objects (props, cards, small trinkets), place RFID readers at "check points" around the room, and have the ESP32 track which tags have been scanned and in what order or combination. When the correct sequence or set is detected, the ESP32 fires a relay that releases an electronic lock — a solenoid lock on a prop box, or a relay controlling power to an electromagnetic lock on a door or drawer. This same framework supports a huge range of specific puzzles: a "scan these three items in the right order" sequence puzzle, a "find all five hidden tags" collection puzzle, or a "scan this one master key" simple final-lock puzzle.
Wiring
ComponentESP32 Connection RFID/NFC reader (MFRC522, SPI)SPI pins (MOSI/MISO/SCK/SS), 3.3V, GND — note the MFRC522 is a 3.3V-only module, don't feed it 5V Relay module (for solenoid lock or electromagnetic lock)One GPIO per relay channel, plus 5V and GND for the relay module's logic side Solenoid lock or electromagnetic lockPowered through the relay from a separate, appropriately rated power supply — do not power a solenoid lock directly from the ESP32 or its 5V regulator Status LEDs or a small LED strip (WS2812B)One GPIO for a data-driven LED strip, or individual GPIOs with resistors for simple status LEDs Optional buzzer for audio feedbackAny free GPIO through a transistor if driving a larger buzzer/speaker, or directly for a small piezo buzzerBuilding the Logic
- Get a single RFID reader and a handful of tags working first — read each tag's unique ID over serial and confirm you can reliably distinguish between them before building out the full puzzle logic.
- Decide on your puzzle logic: a simple set-based puzzle (any order, all N tags must be scanned) is the easiest starting point; a sequence-based puzzle (specific order matters) adds a small state machine that resets or fails the sequence if a tag is scanned out of order.
- If you're using multiple RFID readers at different physical locations, each reader typically needs its own SPI chip-select line, since only one SPI device can be active on the bus at a time — plan your GPIO budget accordingly, and consider an ESP32 with more available pins if you're running several readers.
- Write the relay trigger logic: on a successful solve, energize the relay for enough time to release the lock and let a player open the prop, then de-energize it (most solenoid locks are not meant to be held continuously energized — check your specific lock's duty cycle rating).
- Add feedback: LEDs that light up progressively as each correct tag is scanned, a distinct "wrong sequence" indication (a red flash, a specific buzzer tone) if a player scans out of order, and a clear "solved" indication when the lock releases.
- Add a reset mechanism — a hidden button or a way to power-cycle the ESP32 between game sessions — so you can quickly reset the puzzle state for the next group without physically re-wiring anything.
Prop Design Ideas
- Hidden tag objects: embed small RFID tags inside 3D printed or laser-cut props — a fake book, a small box, a prop key — so the tag itself is invisible to players and the physical object is what they search for and bring to the reader.
- Sequence lock box: a laser-cut or CNC-routed box with a single RFID reader mounted in the lid, requiring several tagged tokens to be scanned in the correct order before a solenoid-locked lid releases.
- Final door lock: mount an electromagnetic lock on a room door or a large prop, released only after all sub-puzzles report their solved state back to a central ESP32 (via WiFi/ESP-NOW if the puzzles are spread across a room, or wired GPIO if everything's close together).
Safety Notes
- Never trap a room's actual exit door behind a puzzle without a manual, immediately accessible override. A prop lock should always be an addition to a room people can freely leave, not the only way out — this is a genuine safety requirement, not just good practice, especially with kids or anyone who might have anxiety in an enclosed space.
- Size the lock's holding force appropriately for a fun prop, not for actually securing anything valuable — this is entertainment hardware, not a home security system, and shouldn't be relied on as one.
- Keep solenoid lock power separate from your ESP32's logic supply, and use a flyback diode across the solenoid coil if your relay module doesn't already include one, to protect the relay contacts and nearby electronics from the voltage spike a solenoid generates when de-energized.
- Supervise young kids around any electromagnetic or solenoid lock hardware — moving parts and any exposed contacts should be kept out of reach behind the prop's enclosure.
This kind of build scales really well from a single simple prop up to a whole-room multi-puzzle experience, and because the core building blocks (RFID reader, relay, lock) are the same regardless of the specific puzzle, it's easy to design a new puzzle concept for next time by just rearranging the same electronics into a new physical prop.
Related Guides
- Build a Standalone RFID Access Control Reader with a PN532 and ESP32
- How to Hack RFID and NFC with the Flipper Zero: LF, HF, MIFARE, and iButton
- Cloning and Emulating RFID/NFC Cards with Flipper Zero
- Tying It Together: Pi + ESP32 + Flipper Home Automation Hub
- MQTT and Node-RED on Raspberry Pi: Visual Automation for ESP32 Sensor Networks
- Homebridge on Raspberry Pi: Bringing Non-HomeKit Devices and DIY ESP32 Sensors into Apple Home
- Build a Battery-Powered ESP32 Smart Mailbox Notifier
- Build an ESP32 Auto-Watering System with Soil Moisture Sensing and WiFi Reporting