Source: https://mokxi.com/learn/path/escape-box
Updated: 2026-11-20

All paths

# Build an escape-room puzzle box

A keypad, a magnet key, an RFID card, a tilt sequence and a light puzzle, each one a lesson, then the whole box with its lock.

Arduino Mega 2560 Free 7 lessons 4 h 3 chapters 2,462 XP Maker · Advanced +250 XP

0 of 7 done

Start the course free A keypad code lock Build it as a kit Retails for about $95, free on Mokxi. Lesson plan for teachers

What you will build

## 3 projects, built step by step

7 lessons in 3 chapters, about 4 hours on a simulated Arduino Mega 2560. Free, in your browser, every step checked by the simulator.

Chapter 1 project

### A magnet for a key

A reed switch hidden in the box opens to a magnet held in the right place for two seconds: a lock with no keyhole.
Open it in the simulator

Chapter 2 project

### Three flashes of light

A photoresistor module counts flashes, with two thresholds so a flickering light is never counted twice. Three flashes light the fifth lamp.
Open it in the simulator

Chapter 3 project

### Escape the box

All five puzzles in one box against a ten-minute clock, with hints that cost 30 seconds and a servo lock that opens only at the end.
Open it in the simulator

The map

## Chapter by chapter

Each lesson opens when the one before it is done, and each chapter ends in a project.

Chapter 1

## Locks without keys

A code on a keypad and a magnet nobody can see.

Open 250 XP

### A keypad code lock

Sixteen keys on eight wires: how a 4 x 4 keypad is scanned, and a code lock that lights the first lamp for the right year.

0 of 5 steps

Start What is in it

Project Locked 500 XP

### A magnet for a key

A reed switch hidden in the box opens to a magnet held in the right place for two seconds: a lock with no keyhole.

0 of 5 steps

Chapter 2

## Puzzles that sense

A card, a tilt and a flash of light, each read by a different sensor.

Locked 250 XP

### Only the right card

An MFRC522 reader on the SPI pins reads each card's UID, and only the card that ends in A7 opens the third lock.

0 of 5 steps

Locked 212 XP

### A tilt sequence

An MPU-6050 feels which way gravity points, so the box knows how it is tipped. Left, right, then forward lights the fourth lamp.

0 of 4 steps

Project Locked 424 XP

### Three flashes of light

A photoresistor module counts flashes, with two thresholds so a flickering light is never counted twice. Three flashes light the fifth lamp.

0 of 4 steps

Chapter 3

## Lock it and escape

The clock, the hint and the lock, then all five puzzles at once.

Locked 250 XP

### The clock, the hint and the lock

A one-minute clock on the LCD and the five lamps, a hint button that costs time, and a servo lock with a game master's release.

0 of 5 steps

Project Locked 576 XP

### Escape the box

All five puzzles in one box against a ten-minute clock, with hints that cost 30 seconds and a servo lock that opens only at the end.

0 of 6 steps

Syllabus

## Every lesson in the course

All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.

Chapter 1

### Locks without keys

- A keypad code lock Sixteen keys on eight wires: how a 4 x 4 keypad is scanned, and a code lock that lights the first lamp for the right year.
- A magnet for a key A reed switch hidden in the box opens to a magnet held in the right place for two seconds: a lock with no keyhole.

Chapter 2

### Puzzles that sense

- Only the right card An MFRC522 reader on the SPI pins reads each card's UID, and only the card that ends in A7 opens the third lock.
- A tilt sequence An MPU-6050 feels which way gravity points, so the box knows how it is tipped. Left, right, then forward lights the fourth lamp.
- Three flashes of light A photoresistor module counts flashes, with two thresholds so a flickering light is never counted twice. Three flashes light the fifth lamp.

Chapter 3

### Lock it and escape

- The clock, the hint and the lock A one-minute clock on the LCD and the five lamps, a hint button that costs time, and a servo lock with a game master's release.
- Escape the box All five puzzles in one box against a ten-minute clock, with hints that cost 30 seconds and a servo lock that opens only at the end.

Kits

## Build it on your bench too

Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.

The kit for this course

### Escape Box Kit

A Mega, a keypad, a reed switch, a card reader, a motion sensor, a lock servo and a clock.
Open the kit

Have a kit already?

### Find your kit

Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.
See every kit

Questions

## About Build an escape-room puzzle box

Is Build an escape-room puzzle box free?

Yes. All 7 lessons of Build an escape-room puzzle box are free and run in your browser, with nothing to install and no parts to buy before you start.

Do I need a real Arduino Mega 2560?

No. Every lesson runs on a simulated Arduino Mega 2560 with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.

How long does Build an escape-room puzzle box take?

About 4 hours: 7 lessons in 3 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.

What will I build?

Each chapter ends in a project that puts it together: A magnet for a key, Three flashes of light and Escape the box.

Where do I start?

With "A keypad code lock", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.
