Introduction: A Quarantine Escape (the Boredom) Box
This project has been my personal Arduino Quarantine Project. I worked on it steadily for the first several weeks into quarantine, but then I ran into some problems using servo motors that I couldn’t easily solve, so I set it aside for a few weeks. But now with our state starting to open up again, I decided: No more procrastinating; it’s time I finished this up!
I'm a computer programmer and database consultant by day, but I've got a fascination with escape rooms and puzzles. Though I have no interest in building Arduino projects that fulfill needs that have already been addressed commercially (Why would I build a light sensor night light when I can buy one for a couple dollars at the store?), when I decided to build my own homegrown escape room for friends late last year, learning to use an Arduino in custom escape room puzzles suddenly became something that I was interested in. That said, I'm not at all an electrical engineer, and learning to solder and use electrical components correctly has often been a challenge! Thank goodness for the plethora of Arduino examples and documentation on the internet!
So about a week before South Carolina was locked down. I was trolling the aisles at my local Goodwill store, and I came across a wooden box object with shelves and a door and some hooks. It wasn’t immediately clear to me what the box was designed for, but I thought with an Arduino in it, it might make a good prop in the homemade escape room that I was planning for some friends in the near future. After I got it home, though, I finally recognized it for what it was: an over-sized charging / mail / key station.
Within a week of that shopping trip we were told to "stay at home," and I took another look at the box. I thought that maybe it might be able to become more than I had originally thought. I thought with all the sides and separate compartments, maybe it could be turned into a multi-step puzzle box that could be shared with friends or children during quarantine in lieu of an actual, close-contact escape room.
Since the box itself is basically particle board with a pretty finish, I wanted to design something that required minimal alterations to the box so that it wouldn't need touch-ups or paint to cover holes or scratches. Therefore I needed my puzzles to work with the existing architecture of the box’s sides. I also wanted to design enough puzzles to feel like every side of the box was involved in at least one puzzle. So I looked at it for a couple days and brainstormed...
In each section below I’ll share my initial thoughts, plans, and ultimate solutions for the various sides of the box. The last section will sum the beginning to end play sequence and provide my Arduino code.
Ultimately I was able to squeeze in 8 distinct puzzles on the box, which I felt was a decent number for a smallish box.
Hopefully if this is the type of thing you're interested in, my notes and pictures might give you some ideas for designing your own.
Various Arduino Components Including:
ELEGOO MEGA 2560 R3 Board (off-brand Arduino Mega)
6 Volt Solonoid Latch
2 or 3 Non-Latching Hall Sensors
3 10mm UV LED Bulbs
2 Red Lasers
VISDOLL WS2801 Pixel LED String Lights (Individually-addressable)
3 Push Button Switches (12/17mm Waterproof Lockless Switches)
HiLetgo mp3 Player Mini (DFPlayer)
6 Photoresistors / Light Dependent Resistors 5mm
Tolako 5 Volt Relay Module
AuBreey Digital Load Cell Weight Sensor 5Kg
Anker PowerCore Charger (to power lights and arduino)
9 Volt Battery (to power solonoid)
Wire (as needed)
Adapters (as needed)
Jumper Wires (as needed)
PCB Boards (as needed)
Various Resistors (as needed)
Small Combination Locks
Small Zipper Bags (that can be locked with locks above)
Plastic Film of Different Colors or Darknesses
Small Dentist-type, Telescoping and Pivoting Mirrors
Washers and Nuts
UV (Invisible Ink) Pen
Small Token or Character Used to Hold Magnet (I used an empty lip balm container shaped like a fox)
Rare Earth Magnets
Step 1: The Hooks Side of the Box
My box contained a side with two hooks. I could have removed them completely, but as mentioned, the box itself was particle board, and I was trying to keep it as scar-free as possible.
So what could the hooks on the side be used for? The obvious answer was to hang something from them. But how could hanging something from them be turned into a puzzle? I decided it could be some sort of weight puzzle.
Originally I planned to attach each hook to an individual scale, but after investigating weight and strain sensors, I realized that I probably did not have room for two sensors in the box and just using one would make the programming and electrical work much simpler. So even though I knew that only one of the hooks would actually be working, I didn't want the player to realize that himself. I planned to make several items of various weights. The player would have to use some logic or guesswork to figure out how to divide these items evenly between the two hooks.
It would have been nice to have cute but weighty little metal characters or items on necklaces, but I went a cheap route and settled for various washers and nuts on twine. Each twine loop of hardware is marked with a weight in grams. The player must divide the hardware into two even sets and hang each set on a separate hook to solve the puzzle.
The weight sensor I used is a 5 kg HX711 Load Cell Weight Sensor. Its weight range is probably really too big for the job, but it works well enough when calibrated. It took me a good while to figure out how to put the weight sensor into the box so that one hook could pull on the sensor and it could register weight.
Finally I came up with the pictured configuration. The static side of the sensor is connected to a block that is screwed into the inside of the box. The other side of the sensor has a smaller block attached to its top that the hook from the outside of the box is screwed into (all the way through the box side). This required using a longer screw and making the hole that the hook was initially screwed tightly into from the outside much larger so as to give the hook's screw a little give so that strain on it could be sensed by the weight sensor.
From the outside, the hook looks normal, but it does move enough to put some pressure on the interior weight sensor and give an accurate reading (when calibrated).
Step 2: The Tall Mail Pocket Side of the Box
For the side of the box containing a tall mail pocket, I went through a number of ideas. Finally I decided I wanted to use lasers somewhere on the box, and this is where they were finally placed. Since the tall compartment is inset, I was able to add two lasers at the top, and two photoresistors on the left side. The player must determine that he needs to find a way (with mirrors) to direct a laser at each sensor simultaneously.
Other than just giving players two hand-held mirrors, I wanted players to be able to find a way to position mirrors individually that didn’t require using both hands to hold the mirrors. I thought about what might work to do this for a long while. Finally I realized that pivoting dentist mirrors might do what I wanted. I thought if their shafts could be held still, their telescoping and pivoting functions could be used to direct the laser beams at the sensor independently.
I drilled a piece of wood using a drill bit just barely over the diameter of the mirror shaft into a scrap piece of wood that I put in the bottom of the side pocket. Thus the mirrors are supported upright while the player adjusts their heads to aim the lasers.
The small, telescoping mirrors also have the advantage of being short enough to fit horizontally below the top of the pocket, so it isn't immediately evident that there are mirrors in the side.
Step 3: The Front Shelved Side of the Box
The front of the box had two sloping shelves on it. I knew I wanted to use the two shelves for different puzzles.
I decided one puzzle would use a black light to illuminate invisible, UV ink, and the other puzzle would use several light sensors (photoresistors) in a row.
After experimenting with a single UV light bulb that came from the end of a invisible ink pen, I found its light beam unsatisfactory. Instead I ordered larger bulbs (10mm) and used three of them to illuminate the top shelf on which I had drawn a traditional tangram puzzle design in UV ink. I wired each light individually to an Arduino output pin with a 100K resistor (wired in series would have required more than the 5 volts I was supplying my Arduino with). Unknown to the player, a hall sensor (which senses the presence of a strong magnet) is wired to a resistor and hot glued to a particular spot behind the back panel.
When the black lights are illuminated, the player must use wooden tangram pieces he has been supplied with to complete the tangram design. The square tangram piece has an embedded rare earth magnet in it, and when it’s placed on the right spot (on top), the puzzle is completed. Ultimately, I was pleased with how this puzzle turned out.
For the lower shelf, I had the idea of creating a puzzle that would require a player to read some clues and, from them, to place four characters in the correct order from left to right. I thought I could create characters (cut out with my Silhouette Cameo) that had transparent film windows in them of various shades.
Not knowing too much about photoresistors, I thought if the characters were placed in the correct order, their films would reliably affect the light readings on each of the light sensors. I found several different colored plastic films, and I tested them to determine which four film colors were the most distinct from each other. But this idea worked better in theory than in actuality.
Light sensors aren’t ultimately that reliable, and I found that the slightest difference in installed angles also greatly affected the reading each sensor gave even if the light shining on them all was exactly the same. That being said, I was determined to make this work, and I found a way to order the characters and their films over the sensors that would 1) never allow the puzzle to be solved by accident and 2) could reliably be solved in a room with sufficient light every time.
These light sensors are wired exactly the same way as the sensors used with the lasers on the tall mail side (with a resistor splitting off the non-positive one leg to a negative and input pin). There’s plenty of documentation on how to wire these things out there.
Because I didn’t know how much light would be around when players attempted this puzzle, instead of checking for specific values or differences between measurements, I just check to make sure my lightest film had a higher reading than the next lightest film, and that film had a higher reading than the next, and so on.
My ordering clues, with Covid-19 references for fun, are pictured.
Another thing I had initially looked forward to doing with this box was to have some hidden compartments above the shelves that would automatically open when a player solved a puzzle to provide him with supplies for the next puzzle. There’s a significant amount of space above each shelf to do this. So I installed two hinges panels and did some experimentation in trying to use small servo motors to push open the panels, but I’m no mechanical engineer, and I just couldn’t get it to work well. I put the project aside for a few weeks in frustration.
After a few weeks, I decided that I order to bring this project to an end, it was best to scrap the idea of moving doors. To solve the issue of getting supplies to the player, I came up with a much simple solution described in The Top of the Box Step below.
Step 4: The Top of the Box
The top of the box has a lid that opens. Originally I planned to lock the lid and only make the lid unlock and open when some puzzle was completed successfully. But after my auto-opening secret compartments idea proved too difficult for me to implement in a reasonable amount of time, and I realized I needed a more simple solution. I decided to keep the top unlocked and just use it to store the “supplies” that the player would be awarded with when completing each puzzle.
But how could I limit the players to only the supplies they were supposed to receive when they completed each puzzle?
My simple answer was to have small bags with padlocks. Each time a player solves a puzzle that has a reward, the combination of the corresponding lock is announced and the player can test the locks to figure out which bag he can open.
This was an easy solution, and it greatly simplified the mechanics of the box without compromising the puzzle-solving fun too much. And it enabled me to finally get the box finished!
Ultimate the top of the box also ended up storing a fair amount of electrical components from the lights, buttons, and lasers.
Step 5: The Back Door Side of the Box
I have always thought the back door of the box would hold the “prize” for solving all the puzzles of the box. As it turned out, though, there are SO many wires and chargers and other electrical components in there that there isn’t much room for much anything else.
For the puzzle on this side, initially I thought I’d like to have a plywood grid that fit over the back of the door through which a token with a magnet in its base would make its way around a maze, but I had no way of cutting a wooden grid, and I decided that a maze on a piece of paper or fabric might work just as well even if it wasn’t quite as cool looking.
In the end I didn’t even make an actual maze. I just made a simple path using iron-on vinyl on a piece of linen fabric. The fabric attaches to the door with magnets (recessed into the back of the door). The player moves his token (containing a magnet in the base) from "start" to "end" and in the process triggers a hall sensor to successfully complete the puzzle and unlock the solenoid lock on the door. (To make it a little more difficult to "cheat" at [or go directly to the end], I was going to add a second hall sensor somewhere on the route, but since the path is so simple anyway, it seemed like overkill.) My "token" is just an old lip balm container that fit a rare earth magnet in its base.
The solenoid is powered by a 9 volt battery and connected to the Arduino through a 5 volt relay.
Though the puzzle is simple, hopefully the challenge for some players will be that it’s not immediately evident what should be done with the fabric, token, and magnets when found in the supply bag.
Step 6: Lights, Buttons, and Sounds
I knew I wanted the puzzle box to have lights and sounds. I also thought that if I had buttons I’d have a lot more flexibility with the puzzles I could create.
I decide to add the buttons and lights around the top of the box to keep it as neat as possible. I drilled 4 holes on each side. The lights used are 9 individually addressable, multicolored LEDs on a single string. They require additional battery power from outside the Arduino, but they’re easy to program. This was my first experiment with Arduino buttons. The buttons required resistors wired onto them as well. There’s plenty of documentation regarding buttons out there.
The sound was provided by a DFPlayer mp3 player hooked up to a cheap single speaker that I took out of a cheap docking speaker. I had some issues with referencing the files by names or even numbers (see code), but ultimately it wasn’t too hard to figure out how to get it to work.
With three lights and 1 button on each of three sides (left, right, and front), I tried to come up with ideas for puzzles. Finally I decided on a color puzzle, a blinking light puzzle, and a listening story puzzle.
For the color puzzle, the two outside lights on each side are set to primary colors. The inner light is initially off. The player pushes the button to turn on and change the light’s color to the correct secondary color. For example, if the two outside are Red and Blue, the inner light needs to be set to Purple.
For the blinking puzzle, I have the two outer lights on each side of the box blink the number of time corresponding to their position. From left to right, 1,3,4,6,7,9. The middle light on each side has to be synchronized with its position by pushing its button that number of times. Ultimately the puzzle is won by the light at position 1 blinking once, light at position 2 blinking twice, all the way up to the light at position 9 blinking 9 times.
For the listening puzzle, a recorded story is read out. The story contains the words LEFT and RIGHT multiple times. The left and right buttons must be pushed in the same order as the story to complete the puzzle.
In addition, the lights and sound are both used to denote that the player successfully has completed certain puzzles, to give the player the combinations to the supply bags, and to let him know he has solved the entire box.
Step 7: The Play Sequence and Code
The box play is sequential. The 8 puzzles must be solved in order. And though there are numerous possibilities for ordering the puzzles, this is what I finished with:
The puzzle box starts up by player (or box guide, AKA me) pushing the left and right button simultaneously.
The color puzzle lights are illuminated and player must determine that he needs to set the center lights on each of the 3 sides with the correct secondary color (orange, green, purple).
After setting the colors correctly, the lasers over the mail pocket are turned on, and the player must find the out-of-sight mirrors and use them to direct the laser beams onto the laser sensors.
Next the blinking lights puzzle starts. The player pushes the button so that the middle light on each side blinks the correct number of times, and on completion, 1) a number is read out for the combination of one of the supply bags and 2) the UV lights are illuminated.
The first bag contains the wooden tangram pieces. The player sees the UV-illuminated outline of the tangram puzzle and completes the shape with the wooden pieces. When the top piece is placed, the puzzle is solved, and a message plays basically telling the player to push the front button to continue.
When the player pushes that front button, the puzzle starts the LEFT-RIGHT story. He can replay the story again by pushing the front button again. Eventually he realizes he needs to push the left or right buttons every time the story says one of the directions.
When he has completed the LEFT-RIGHT button sequence correctly, another message is announced with the combination of another supply bag. This time the bag contains the weighted twine loops. The numbers on the loops give the player hints that he needs to divide them into equal piles. When the same weight is put onto each hook (actually it's just the right hook that measures, though), another combination is announced.
This time the supply bag contains the characters with colored film and the clues to instruct the player how to order the characters. The player places them in the correct order, and finally the announcement is made for the last supply bag combination.
The last bag contains the linen fabric with start->end line, 5 tiny magnets, and a token with a magnet hidden in the base. The player moves the token from start to finish, and the rear door is finally unlocked and lights and sounds announce that the player is the Big Winner.
With so many input sensors and outputs, I needed more pins than the Arduino Uno or Nano could provide. Ultimate I used an off-brand Mega. I used a combination of 1) soldering directly to sensors and positive and negative wires and 2) jumper pins pushed directly into the Mega. I didn't particularly like how the jumper pins feel in the Mega (kind of of loose), so I used some hot glue to give them a little more support. And for now it works, and I’m looking forward to having more people play it!
Let me know if you have any specific questions about supplies or methods I used to complete this box, and I’ll do my best to answer.
If you like the idea of using an Arduino to create Escape Room type puzzles, I recommend subscribing to Playful Technology on YouTube. The host, Alastair, is my Arduino hero!
If you found this at all interesting or helpful, please vote for me in the Finish it Already contest. Thanks for reading!
Participated in the
Finish It Already Speed Challenge
Question 2 months ago on Step 7
viens de voir votre projet, superbe projet, j'aimerais le faire pour
un événement pour le géocaching
mais si il y avait moyen d'avoir le schéma pour faire les
connections de la carte et les capteurs - les leds ....... car je ne
suis pas sûr de pouvoir faire tout ces montages sans le
déjà fait plusieurs boîtes puzzles mais pas si compliqué.
d'acheter le matériel, j'aimerais avoir le circuit sur fritzing si
vous souhaitant mes meilleurs vœux pour 2023.