Lesson plan

Build an escape-room puzzle box lesson plan

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.

3 chapters, 7 lessons, about 4 hours, on the Arduino Mega 2560. Every lesson runs in the browser, with nothing to install.

The unit

Objectives and materials

By the end, students can

  • A code on a keypad and a magnet nobody can see.
  • A card, a tilt and a flash of light, each read by a different sensor.
  • The clock, the hint and the lock, then all five puzzles at once.

Materials for the whole unit

  • Accelerometer and gyroscope, MPU6050
  • Arduino Mega 2560 R3
  • Character LCD, 20x4, with I2C backpack
  • Full-size breadboard
  • Hobby servo
  • Keypad, 4x4
  • LED x 5
  • Photoresistor sensor module
  • Piezo speaker
  • Pushbutton
  • Reed switch
  • Resistor x 5
  • RFID reader, MFRC522

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 1 h 10 min

Locks without keys

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

LessonTimeWhat students do
A keypad code lockSixteen 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.35 min
  1. The first puzzle
  2. Press a key
  3. A wrong guess
  4. Crack the code
  5. Clear a mistake
A magnet for a keyA reed switch hidden in the box opens to a magnet held in the right place for two seconds: a lock with no keyhole.35 min
  1. A lock with no keyhole
  2. Bring the magnet close
  3. Too quick
  4. Hold it there
  5. The second lamp

Materials

  • Arduino Mega 2560 R3
  • Character LCD, 20x4, with I2C backpack
  • Full-size breadboard
  • Keypad, 4x4
  • LED
  • Piezo speaker
  • Reed switch
  • Resistor

Check for understanding

Each student finishes "A magnet for a key" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "The second lamp".

Chapter 2. About 1 h 35 min

Puzzles that sense

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

LessonTimeWhat students do
Only the right cardAn MFRC522 reader on the SPI pins reads each card's UID, and only the card that ends in A7 opens the third lock.35 min
  1. The reader
  2. Read a card
  3. The wrong card
  4. The right card
  5. The third lamp
A tilt sequenceAn MPU-6050 feels which way gravity points, so the box knows how it is tipped. Left, right, then forward lights the fourth lamp.30 min
  1. A sense of down
  2. Tip it left
  3. The wrong order
  4. Left, right, forward
Three flashes of lightA photoresistor module counts flashes, with two thresholds so a flickering light is never counted twice. Three flashes light the fifth lamp.30 min
  1. A light sensor
  2. One flash
  3. Two thresholds
  4. The fifth lamp

Materials

  • Accelerometer and gyroscope, MPU6050
  • Arduino Mega 2560 R3
  • Character LCD, 20x4, with I2C backpack
  • Full-size breadboard
  • LED
  • Photoresistor sensor module
  • Piezo speaker
  • Resistor
  • RFID reader, MFRC522

Check for understanding

Each student finishes "Three flashes of light" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "The fifth lamp".

Chapter 3. About 1 h 15 min

Lock it and escape

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

LessonTimeWhat students do
The clock, the hint and the lockA 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.35 min
  1. Locked
  2. The clock on the lamps
  3. Ask for a hint
  4. The game master's release
  5. Time is up
Escape the boxAll 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.40 min
  1. The keypad
  2. Take a hint
  3. The magnet
  4. The card
  5. The tilt
  6. Escape

Materials

  • Accelerometer and gyroscope, MPU6050
  • Arduino Mega 2560 R3
  • Character LCD, 20x4, with I2C backpack
  • Full-size breadboard
  • Hobby servo
  • Keypad, 4x4
  • LED x 5
  • Photoresistor sensor module
  • Piezo speaker
  • Pushbutton
  • Reed switch
  • Resistor x 5
  • RFID reader, MFRC522

Check for understanding

Each student finishes "Escape the box" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Escape".

Your class

Teach this unit as a class

Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.