Lessons and the learning game

Build a networked escape room

Three Unos on radios run a three-room escape game: puzzle nodes that report to a game master, and the protocol that keeps them honest.

What you build

One circuit carries the whole course. The two puzzle nodes always run their finished firmware; each lesson changes the game master's sketch:

  • Radios: one nRF24L01 per board, on the SPI pins (CE 7, CSN 8) and 3.3 V. In Mokxi every radio on the canvas shares the air, so no wire joins them.
  • The game master: an Arduino Uno with three WS2812 status lights, one per room.
  • The Lab: a node with a keypad. The puzzle is a four-digit code.
  • The Vault and the Study: one node with an MFRC522 RFID reader for a key card and a reed switch that closes when a magnet hidden in a book goes back on its shelf.

How it works

Messages. Every message is the same eight bytes: its kind (SOLVED, STATUS, RESET, HINT, PING, LOCK, UNLOCK), who sent it, which room, the sender's message number, and one byte of data.

Addresses. Each radio listens on its own five-byte address: GMSTR for the game master, NODE1 for the Lab, NODE2 for the Vault and the Study. Every radio hears every packet and keeps only the ones addressed to it.

Acks and retries. The receiving radio acknowledges each packet by itself, and the sender's chip resends a few times if no ack comes. On top of that, a node keeps a message that matters and tries again every half second until it is acknowledged. Message numbers let the receiver throw away a repeat, so a message arrives at least once and is acted on exactly once.

State sync. The game master keeps a table of what it believes about every room. Nodes push news as it happens, and a ping makes every node report its state, so the table can be checked, not just trusted.

Hints and resets. Each node keeps three hints per room, each more direct than the last; the game master only sends the room and the number. A reset goes to every node, each puts its own puzzles back, and a ping confirms it worked.

The game. Only the game master knows the order: the Lab, then the Vault, then the Study. It locks the later rooms, unlocks each as the one before is solved, runs a 60-minute clock, charges two minutes per hint (three at most), and prints the escape time.

The course

Build a networked escape room takes six lessons:

  1. Puzzle nodes: a keypad code, a key card and a hidden magnet.
  2. Messages between nodes: eight bytes, addresses, acks, retries and repeats.
  3. A game master panel: a room table, status lights and a ping.
  4. Hints: sent to the right node, counted, getting more direct.
  5. Resets: one command for every room, acknowledged and checked.
  6. Project: a three-room game: rooms in order, a clock and an escape time.

Every step but the last is checked against the running boards.