Introduction: The Arcade Puzzle Box (or Asobimasu Box)

Use Microsoft's MakeCode Arcade running on an Adafruit PyBadge to create the ultimate configurable and programmable lock box! I call this an Asobimasu Box which literally translates from Japanese to mean "CREATE or PLAY without boundaries".

The Adafruit PyBadge is a single board programmable device with a built-in LCD display, push buttons, light changing LEDs (neopixels), sound, light sensor, and tilt/shake sensor. It also has a number of digital and analog ports which makes it ideal for controlling the servo used in this project. MakeCode Arcade from Microsoft is an online tool that allows you to very easily create old-style video games which can be easily downloaded and played on the PyBadge.

I thought it would be really cool to see what would happen if you used a computer gaming device as the front end of an electronic puzzle box and that's how I ended up with this project! This makes a wonderful gift box for the techie person in your life (which might even be you) or a great addition to any escape room.

Supplies

Adafruit PyBadge Starter Kit (includes PyBadge hardware, USB cable, and LiPo rechargeable battery)

Asobimasu Box Hardware Kit which includes:

  • micro servo with servo mount
  • 1/2" wood cube
  • (3) brass screw hooks
  • 3-wire servo extension cable
  • (4) M3 Male to Female Thread Brass Hex Pillars Standoff Spacers and screws
  • wooden chopstick
  • mounting screws

Wood box (you can purchase the same box we use in this project here or use your own)

Because of the tight dimensions of the box, it will be helpful to have a mini hand-twist drill. You will also need an Internet connected laptop to access https://arcade.makecode.com

If you wish, you can also purchase an assembled and pre-tested Asobimasu Box here.

(Sorry, I realize that I'm showing one extra and unnecessary brass screw hook in the parts photo.)

Step 1: Attach the Servo to PyBadge

First attach the servo extension cable to the underside of the PyBadge as shown. One end of the cable has pins bent at a 90 degree angle. This is the end that will be inserted into pins on the Feather expansion connectors on the underside of the PyBadge. The other end of the cable plugs into the servo. Note the colors on the servo cable. Brown is ground. Red is servo power. Yellow is servo control.

Connect the servo power to pin 2 on the Feather connector closest to Speaker end of the PyBadge. Connect servo ground to pin 4 of that connector. Connect the servo control to pin labeled 5 (which is D5) on the Feather connector closest to the Battery end of the PyBadge.

Step 2: Download Test Code Into the PyBadge

Instructions on using MakeCode Arcade with your PyBadge are beyond the scope of this instructable but there is an excellent step-by-step tutorial on the Adafruit website to get you oriented. For building and testing your Asobimasu box, you will be using the simple lock program located here. This code is also a simple example that will allow you to modify any MakeCode Arcade game to control your Asobimasu Box. Load this code into MakeCode Arcade at https://arcade.makecode.com/S17496-47639-73924-68601 and download it into your PyBadge.

You can also directly download code that can be dragged and dropped into your PyBadge at:

https://github.com/reachandteach1/makecode/raw/main/arcade-simple-lock-2.uf2

After you load your code onto the board, you should see the lock graphic on the LCD screen as shown. The left and right arrow buttons on the PyBadge will unlock (left button) and lock (right button). If everything is working, you should see and hear the servo move as you push the left/right buttons. Servo commands are output to port D5 on the PyBadge board.

I've included a screenshot of the code for the simple lock. You can see that it is pretty easy and straightforward. It will require you to load the Feather (Adafruit feather pinout) extension if you are creating this code from scratch. You can find that as a standard extension under the Extensions menu.

We will later install a more interesting puzzle into your PyBadge but the Simple Lock code will continue to be helpful as you build and test your box.

This would be a great time (if you haven't already done so) to connect your LiPo battery to your PyBadge and check to make sure it works. You may need to recharge the battery with your USB cable attached to your laptop or power outlet.

Step 3: Mount PyBadge Board

Drill four holes for the brass standoffs and a hole for passing the servo extension cable and battery cable through. Secure the standoffs to the box with M3 screws and anchor the PyBadge board to the standoffs with hex nuts.

Step 4: Build a Chopstick Latch

The chopstick latch design for this box is based on Mikal Hart's original design for a Reverse Geocache Puzzle Box which you can check out here.

Cut a chopstick down to a length of 2-3/8" and drill a hole into the wider end of the chopstick that is larger than the screw you will be using to secure the chopstick to your plastic servo horn. You will be screwing the chopstick into the underside of the servo horn as shown. It is important that the chopstick can freely move.


Step 5: Mount the Servo and Chopstick Latch

Screw the servo into the servo mounting bracket. Screw the mounting bracket into the box where shown. Mount the chopstick latch assembly onto the servo. Mount two brass screw hooks so that the chopstick latch is positioned as shown for the open and closed positions. Screw the third screw hook into the 1/2" wooden cube and mount it in the upper lid so that it is aligned in between the other two hooks when the box is closed. The wood cube should be glued into the lid and a small screw is used to securely mount it. Tack the cables in the box to the box with a glue gun. Close the box and check that the mechanics of the box work properly by using the Simple Lock code to unlock and lock the box.

Step 6: Houdini Puzzle Box

Now let's try something more interesting and fun! The Houdini Puzzle Box code was inspired by the book "The Houdini Box" by Brian Selznick. Load the code into MakeCode Arcade from https://arcade.makecode.com/S62249-62192-23086-69660 . From here you can download the code into the Asobimasu Box's PyBadge.

Alternatively, you can directly download the binary code from:

https://github.com/reachandteach1/makecode/raw/main/arcade-houdinibox.uf2

and drag and drop this file into your PyBadge.

Try to open the box using the following hints!

  1. The quote shown at the beginning of the puzzle may not be EXACTLY correct. (Try searching on the Internet)
  2. Who is E.W.?
  3. The book "The Houdini Box" by Brian Selznick could be helpful


SPOILER ALERT: The solution to the puzzle follows...

The puzzle opens with the hint: "My birth is the key that sets you free." -- E.W. Erich Weiss is Harry Houdini's real name. His birthdate is therefore a key to this puzzle. The puzzle opens with a Simon Says sequence. You must correctly enter this sequence using the arrow buttons. Once you are successful, a keypad appears where you must enter 0324 (Houdini was born on March 24). The tone sequence "Shave and a Haircut" plays. You need to shake the box twice to complete the puzzle and the box will unlock.

Step 7: What Else Can You Do With an Asobimasu Box?

One of the easiest changes you can make is to take the Houdini Puzzle Box code and change the hint and the entry password. You can also easily change the message that appears at the end when you are successful at opening the box. This makes the box a perfect gift for an anniversary, birthday, retirement party, marriage proposal, or other special event. This can also be a useful prop in an escape room or haunted house.

You can also modify any existing MakeCode Arcade game to open and close the Asobimasu Box. You can use the sample code screen shot in Step 2 as a guide. Very briefly:

  1. Add the Feather extension to the game code.
  2. Create and set two variables in the on start block: CloseBox=45 and OpenBox=120
  3. Add the command "servo write pin D5 to CloseBox" to the on start block
  4. Add the command "servo write pin D5 to OpenBox" in the game code right before the "game over WIN" instruction

Write your own game to open the box when you win the game. For a challenge, make a puzzle box that can interpret Morse code and will open when you successfully tap the message "open sesame" on the box.

Combine an adventure game with a real-life scavenger hunt where hints you find and collect get you past various obstacles in the adventure game until you can finally discover how to open the box. Alternatively, tie the adventure game to hints awarded with the successful completion of chores around the house. Just make sure that the reward inside the box is worth the time spent doing the chores!

Additional external sensors can be plugged into the front connectors of the PyBadge board as inputs. Create something that can help with physical therapy by using a hand squeeze ball to control a game (with chocolates in the box being the reward for a successful therapy session.)

Attach a temperature sensor and create a biofeedback/mindfulness device or game that senses your stress and helps you to relax.

Links to additional puzzles developed for the Asobimasu Box


I hope you will build my Asobimasu Box. I appreciate any and all comments about this project.