Building a Puzzle Box

Many people read my puzzle box stories and wonder whether it would be possible to make one of their own.  Well, I’ve got to tell you that it’s not easy, but if you’re patient, energetic, and a little bit clever, it can be done.  It also helps if you have some background in woodcraft, electronics soldering, mechanics, and/or C++ programming, though with a little work you can acquire enough of those missing skills to create a basic single-use box.

If fabricating your own doesn’t sound so appealing after all, I should remind you that I am actively building a number of interesting Reverse Geocache™ boxes on commission.  These include the famous “engagement ring” boxes, which have been used for their nominal purpose at least three times now, “fretwork” boxes, and other custom varieties.  Mine come with a warranty and are designed to be owner-reprogrammable.  That means that once your friend has completed the fabulous quest you created for her, you can organize a brand new one for someone else.  This doesn’t require any special skill beyond attaching a USB cable to a PC and launching some special (free) configuration software that I wrote.

Building your own box can be very rewarding.  The remainder of this article will be devoted to helping those who have made the decision to try.  I highly recommend that you use a prototyping shield or, better yet, one of my custom Reverse Geocache shield PCBs.  It makes the assembly much easier.

(Note: This article is still “under construction”.)

Acquire Components

To start of with, you’ll need to acquire quite a box and quite large number of components.  The box should have a flat lid and room for the display, the button hole, and the Arduino USB port to stick out.  The lid needs to have a certain depth to it to hold the assembly.  It’s probably better if you wait to buy/build this until after you see how big that assembly turns out.

Arduino Uno microcontroller $29.95
GlobalSat EM-406A GPS module $59.95
Topway LMB0820DFC LCD display $5.95
SWT101A2B Pushbutton w/ Blue LED $6.50
My “Reverse Geocache” shield PCB $9.99
Hitec HS-55 servo motor $9.99
Pololu low voltage power switch $5.95
Pololu 5V boost regulator $6.95
4-pin jumper cable for button $3.00
2-AA battery back-to-back holder $0.74
JST Connector for GPS $0.61
straight male headers for display/mating $0.19
right angle headers for button/servo $0.50
220ohm resistors $0.02
0.1 microfarad caps $0.20
2×8 pin 200mm dual ribbon cable $1.68

Assemble the shield

  • Place the Arduino on a table top and insert 4 banks of straight header pins (8, 8, 6, 6) into the female header sockets, “long end down”.  Mate the shield to the tops of the pins and solder the pins to the shield.
  • Solder the 11-pin Pololu switch module to the shield PCB using 11 straight header pins.
  • Solder the 3-pin Pololu boost regulator module to the shield PCB using 3 straight header pins.
  • Solder the tiny 6-pin GPS JST connector to its position at the edge of the shield.  This is the trickiest part and may require some work with a solder wick to remove excess solder.
  • Solder 2 8-pin headers for the display connector to the shield PCB.  For the version 1.1x versions of the shield, which have the display connector on the side, these pins extrude (point) downward, so that the ribbon cable is actually snapped to the underside of the shield.  This make the assembly somewhat narrower.
  • Solder the 3-pin right-angle servo motor connector.
  • Solder 2 8-pin rows to the display.
  • Solder a 4-pin straight (or angled) header for the button.
  • Snip one end off the 4-pin cable and solder to button terminals.  If you look at the terminals as a smiley face, the connections are, #1 (LED+) red, #2 NC, #3 (btn) black, #4 (btn2) yellow, #5 (LED-) white.
  • Solder the 220 ohm resistor to the shield (this is the LED current limiter)
  • Solder two 0.1 microfarad caps to the appropriate spots on the shield.
  • Solder the batter holder terminals to the battery connector.
  • Connect the servo to the 3-pin connector.
  • Connect the 4-pin cable to the 4-pin connector (pin 1 is LED+)
  • Connect the 2×8 display ribbon cable to the display at one end and the shield on the other.

Completed assembly, with 1.11 shield.

Completed assembly - before mounting.

Assemble the latch

This is where things get a little touchy-feely.  There’s room for lots of creativity here.  I use two basic latch designs, the “piston” design, in which a dowel rod is driven into a hole, or the “cabinet latch” where an ordinary hook is rotated into place.

All my designs use a hobby servo motor to latch and unlatch the box from the interior.  Remember that a servo motor can be electronically turned only to an angle between 0 and 180 degrees.  The “piston” design translates that rotary motion into linear motion.  When extended, the dowel/piston engages an L-hook or eye-hook or some other protrusion in order to lock the box.  The cabinet latch uses the rotation directly to move a latch hook into place.

Modify and upload the software

I’ve written a short sample sketch to help you get started building a puzzle box.  It’s just a skeleton outline, without any of the automatic configurability or extra features of real Reverse Geocaches have, but it should prove a sufficient framework for a basic box.  The code is licensed under the Creative Commons 3.0 by-nc-sa license.  By downloading it, you agree to the license terms and that you will not use the code commercially.  You further acknowledge that “Reverse Geocache” is a trademark referring specifically to my designs, and that some of the technology shared here is patent pending.

I agree/acknowledge

Mount the electronics and latch

<TBD>

Notes

Reverse Geocache™ is a trademark of Mikal Hart.

These instructions and the sample source code and licensed under the terms of the Creative Commons “Attribution Non-Commercial Share Alike” license, version 3.0, which grants the limited right to use or modify it NON-COMMERCIALLY, so long as appropriate credit is given and derivative works are licensed under the identical terms. See here for license details.

The Reverse Geocache Puzzle and some of the technologies described here are patent pending.

Page last updated on March 29, 2011 at 10:43 pm
125 Responses → “Building a Puzzle Box”

  1. E.G.

    7 months ago

    I would like to add a time component to this, but I lack the programming skills. Can anyone point me in the right direction?

    Essentially I would like the box to first determine the current date, and display how many days left until you can begin to work on the puzzle. I’m guessing tinyGPS has a way to call up the current date, but I’m not sure how to use it.

    Any help is appreciated!


  2. Ray B.

    7 months ago

    Mikal,

    I’m learning a lot about what it takes to make a design robust. :) It’s taking a while for me to get everything working, but I’m making progress. It’s surprising how many little things you have to work out when using the Arduino Pro Mini as opposed to a regular Arduino. Right now I’m working on how to isolate the two possible power supplies, the battery and the power jack, so the higher voltage from the power jack doesn’t cause problems with the buck/boost board I’m using with the battery.

    I had to abandon my keyboard idea for this particular box. I realized I didn’t have enough pins left on the Arduino Mini Pro to add one, so I decided to see what I could do about providing another way to reset the destination, counter, and radius. I’m working on an extension to the software that allows you to make such changes with a few easy command lines. This way, once the box is opened, the owner can plug into the USB port and use a terminal program to reconfigure the box. I’ll post it once I’ve got it complete and working.

    Ray


  3. Mikal

    7 months ago

    Hi Elton,

    You can get the date and time from tinygps with the crack_datetime() method. It returns everything you need to calculate the current date/time.

    M


  4. Ronald B

    7 months ago

    Like you wrote in assemble message describing how something is to be done — Solder the tiny 6-pin GPS JST connector to its position at the edge of the shield. This is the trickiest part. That’s 100 % grade AAA true!

    I give zillion thanks for contributing to the fulfillment of a need!


  5. Elton

    7 months ago

    The date is all solved! Thanks!

    What do you think is the best way to implement multiple locations in the code? The idea is that once you reach the first location, the box does not open but resets the loop with a second location saying you are X km away.

    Is there a problem once the system is shut off “remembering” that the first location has already been unlocked?


  6. Elton

    7 months ago

    Is self modifying code the right way to go for multiple destinations in order? How would self modifying code work in this system?


  7. Mikal

    6 months ago

    @Elton,

    I’ve helped people make multi-destination boxes before. For N destinations what you’ll need to do is create N-1 new “persistent variables” in the EEPROM that record whether you’ve already visited destinations 1, 2, 3…N-1. I wouldn’t try any self-modifying code. Write if you want a clearer explanation.

    Mikal


  8. Steven

    6 months ago

    This has been my first Arduino project (along with a friend) and every thing has gone surprisingly smoothly, though we have one final issue and I’m hoping you may have some insight into what is wrong. The program runs through successfully to the point where it goes to power off. At the point where it sets the switch off, the whole program reboots and starts all over again instead of actually turning off. I can power the board on/off with the button just fine though. I also tried setting the switch_off pin to HIGH at the beginning of the program (instead of low like it should be) and it does successfully turn off the board. The only part not on your parts list is our servo (http://www.bphobbies.com/view.asp?id=A0720165&pid=T544969) since we already had it lying around. Any ideas? on what is causing this?


  9. Mikal

    6 months ago

    Hi Steven–

    I’m glad to hear that your build has gone smoothly. I’ve helped more than 100 people build boxes now, and while I would say that they mostly go well, roadblocks do appear sometimes.

    In your case I would definitely consider replacing the servo with a real HS-55. The power requirements of this circuit are already such that the boost regulator can just barely supply enough current to power everything. The motor is one of the biggest power hogs, and I know from experience that substituting a different servo can present difficulties similar to those you describe. For example, I tried both a real HS-311 and an HS-55 lookalike. Both proved to draw too much power, and the primary symptom of a microprocessor circuit that draws too much power is unexpected resets. Go buy a real HS-55 and see if that fixes your problem. You can sometimes get them on sale for $8 at Tower Hobbies.


  10. Steven

    6 months ago

    Mikal,

    Further testing today led me to the same conclusion. I don’t know of too many hobby stores near me that carry servos (never heard of Tower Hobbies), so I went ahead and ordered the HS-55 from the link provided above. Thanks for the help.


  11. Kevin

    6 months ago

    Hi Mikal,

    Are you going to expand this tutorial with more detailed pictures?

    Also, i currently have a arduino duemilanove, can this be used instead of the Arduino one?
    Will your shield PCB fit and are the other connection mentioned still the same?


  12. Ronald

    5 months ago

    Greetings Mikal…

    When I fired up Arduino today… Notice of update given. Download update however not install… If done, what can be expected by way of your libs needing updating then or ?


  13. Peter Harkess

    4 months ago

    What would it cost for you to make a puzzle box for me please?


  14. Rhianon

    3 months ago

    Hi Mikal

    I’m in completely new to electronics and I’m the process of buying all the parts I need to make this puzzle box. The only part I am stuck on is one of the ones from Digi Key. It’s going to cost me $39 for a part that would cost $0.61. I’m hoping you can help me with where else I can get the part from.

    The JST connector is the part I am after. Is there somewhere else I can get this part?

    Thanks


  15. Mikal

    3 months ago

    @Ronald, my libraries have now all been ported to Arduino 1.0.


  16. Mikal

    3 months ago

    Hi there, Rhianon. Are you writing from Europe or Asia? I know Digikey charges a lot for shipping overseas. I will be happy to include one of those connectors if you are thinking of buying a shield (http://sundial.com/shop). I usually do that for overseas people, because I know what an expense it is. 

    Mikal


  17. Marc Hockey

    3 months ago

    Hi Mikal,

    I do not have the appropriate knowledge, time nor nessisary skill to complete this project. Your post above said that you have been building a few on commission? Can this be done and at what cost? I would like to have three built to bring my best friends to one place to meet. A complex multi cache if you will. Can you please provide me with a response weather interested or not.

    Thank you Marc Hockey
    mapexman86@hotmail.com


  18. Ronald Bryson

    3 months ago

    Greetings…

    Updating went like clock work. Your new needed files along with Arduino update software is good…

    Question….

    How many numbers should be after decimal point for DEST_LATITUDE = 30.xxxxxx, DEST_LONGITUDE = -81.xxxxxx ?

    I have meters to miles / feet.. On that… How many numbers should be after decimal point for distance_feet = distance_meters*3.2808399 ?

    Please do let me know… and zillion thanks…. Ron


  19. Mikal

    3 months ago

    Ron, I like to use six decimal digits for lat/long. Depending on your application, you probably wouldn’t need many decimal digits on the distance. It doesn’t make sense to measure hundredths of a foot, when the GPS is only accurate to +/- 10 meters anyway.


  20. Mikal

    3 months ago

    @Marc Hockey,

    Hi Marc,

    I hope you have had a chance to review your email. Yes, we have done quite a number of commissions. Your project seems very exciting. Let’s talk.

    Mikal


  21. Ronald

    2 months ago

    The Arduino Uno has a new R3 version as noted at sparkfun.com. That means Reverse Geocache PCB shield being update or purchase older Arduino Uno?


  22. Mikal

    2 months ago

    @Ronald,

    I haven’t tried the R3 yet, but I would be very surprised if it were anything but 100% compatible with the RG shield.


  23. Paul

    4 weeks ago

    Hi Mikal

    I’ve finally got around to documenting my geo box which I finished late last year. Many thanks to you for the idea and the NewSoftSerial library. https://sites.google.com/a/mandell.org/arduino/projects/lego-geo-box

    Cheers

    Paul


  24. Mikal

    4 weeks ago

    Love it, Paul! Thanks for sharing! :) Such innovative use of Lego.

    Mikal

1 Trackbacks For This Post
  1. Interessante Arduino-Setups | wer bastelt mit

    [...] the-reverse-geo-cache-puzzle [...]

Leave a Reply