Building a Puzzle Box

sundial.com

New Website!

The process for building your Reverse Geocache™ Puzzle box just got a lot easier with the unveiling of The Sundial Group’s new website http://sundial.com, which promises to be a “community” site for all things relating to the fascinating device.

Builders

Builders will be especially interested in Sundial’s new Notes for Builders section, which offers kits and instructions to make the build process simpler than ever.

Buyers

People who want to buy Quest Boxes can now do so directly at the Sundial Shop.

Page last updated on March 1, 2013 at 8:55 pm
148 Responses → “Building a Puzzle Box”

  1. E.G.

    12 years 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.

    12 years 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

    12 years 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

    12 years 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

    12 years 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

    12 years 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

    12 years 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

    12 years 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

    12 years 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

    12 years 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

    12 years 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

    12 years 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

    12 years ago

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


  14. Rhianon

    12 years 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

    12 years ago

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


  16. Mikal

    12 years 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

    12 years 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

    12 years 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

    12 years 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

    12 years 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

    12 years 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

    12 years 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

    11 years 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

    11 years ago

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

    Mikal


  25. Ronald

    11 years ago

    With a new update for Arduino 1.0 -> 1.0.1 available now. In a write of what’s new… The SoftwareSerial class has been reimplemented, using the code originally written for the NewSoftSerial library by Mikal Hart. This allows for multiple simultaneous instances, although only one can receive at a time. Any thing we gotta do on our side beside up Arduino software?


  26. Mikal

    11 years ago

    Ronald, the only thing you need to do is change all the NewSoftSerial references to SoftwareSerial.

    Thanks,


  27. Ted

    11 years ago

    I’m looking into finally getting around to making one of these boxes. I have been interested in it for sometime but just haven’t had the time to do it. I would like to incorporate a RFID reader for the back door but not sure how exactly to do that. My question is if the new version of the ardunio micro controller capable of this?


  28. Mikal

    11 years ago

    @Ted,

    If you are going to add a serial RFID reader, I think I would connect it to the hardware serial port (pins 0/1), because it would be tricky to monitor a software serial RFID and the software serial GPS at the same time. Please keep us posted on how your project works out. It’s a great idea that I have been eager to try for a long time!


  29. Mikal

    11 years ago

    @Ted,

    If you are going to add a serial RFID reader, I think I would connect it to the hardware serial port (pins 0/1), because it would be tricky to monitor a software serial RFID and the software serial GPS at the same time. Please keep us posted on how your project works out. It’s a great idea that I have been eager to try for a long time!


  30. Mike C.

    11 years ago

    Hello there Mikal,
    I just wanted to know just off the bat what would be the price of the box if we were to ask for a pre made one?


  31. Mikal

    11 years ago

    @Mike,

    The ones I make are between $600 and $800.


  32. Eric

    11 years ago

    Mikal,

    I just delivered my second anniversary treasure box, such a brilliant idea!
    http://vimeo.com/48678211

    On this box I added a switch to the lid so after the box was opened, if the button was pressed again, the Arduino could check if the box was closed and lock it up again. Then solving the puzzle required going to a different location. This way, my folks could put a treat in the box and share the adventure with their friends too.

    -Eric


  33. Todd

    11 years ago

    Mikal,

    In your parts list you show a 2 -AA battery holder but in the photo it looks like a larger container, i believe the pololu has an operating voltage: 0.8 V to 5.0 V. what are you actually using now as the battery compartment (I was originally going to use a 4 -AA holder until I realized with fresh batteries I would be at 6+ Volts.) :~/


  34. Todd

    11 years ago

    Ok disregard the last question as I have read back and saw that with the 1.1 shield you are now recommending the 2 – AA holder.

    A second question is I would like to modify the code to save the coordinates to the eprom at every button press. I don’t have all my parts yet, so I can’t test and I have added the following code after it figures out the current position.

    /* Write current location to eprom */
    float curr = lat, lon;
    EEPROM.write(attempt_counter, curr);

    Does this look right??

    Once i get there I am going to display it after the back door is opened so I can map where they went….


  35. Mikal

    11 years ago

    @Eric,

    Fabulouso! Thanks for sharing.


  36. Mikal

    11 years ago

    @Todd,

    I like the 2-AA battery holder because of its compact size. My very first box used a 4xAA holder (and the normal on-board step-down regulator), but that’s pretty bulky AND 6V is right at the limit of the Arduino regulator spec.

    A 3-AA holder ought to work fine with my current shield.

    The EEPROM code is close, but the problem is that EEPROM.write only write a single byte, while lat and lon are both 4-byte float values. You’ll have to allocate 8 bytes for each attempt to store the lat and lon. Maybe something like this:

    // untested
    int offset = 8 * attempt_counter;
    // write lat at offset
    for (int i=0; i<4; ++i)
    {
      EEPROM.write(offset + i, ((uint8_t *)&lat)[i]);
    }
    // write lon at offset + 4
    for (int i=0; i<4; ++i)
    {
      EEPROM.write(offset + 4 + i, ((uint8_t *)&lon)[i]);
    }
    

  37. Lawrence Northup

    11 years ago

    I would very much like to purchase one of your reverse Geocache puzzle boxes. I have done several searches and have not found a link to purchase one.


  38. Bosque

    11 years ago

    I have almost everything working except the LCD. I am using the LMB0280, but can not get it to work in 4-bit mode. Did you use the LCD library that come with the Arduino IDE or did you install the library from Seed Studios?


  39. Mikal

    11 years ago

    @Bosque,

    Yep, I use the standard Arduino library.


  40. Bosque

    11 years ago

    Is there a way to change the contrast on the LCD when I am using your 1.11 shield? I am geting 8 white boxes on the first line and nothing on the second line. The LCD driver seems to be powering on in single line mode. Is there a way to change this?


  41. Mario

    11 years ago

    Love this concept!! I would like to commission 1 box for me. It’s for a birthday happening in April.
    Can you contact me for details?

    Thanks and great idea!


  42. Scott

    11 years ago

    Mikal, your advice was incredibly helpful. Having completed a puzzle box, I thought I’d post a few of the things I learned so others might benefit.

    1. I would not use the particular battery pack listed. The compact size is great, but the wires are on the stiff side and the solder connections to the holder aren’t great — so they broke off during testing after relatively little use, and I had to repair them at the last minute with solder and hot glue.

    2. Instead of the GlobalSat EM-406A GPS, I used the Adafruit Ultimate GPS Breakout, which appeared to have some advantages, including lower power consumption and higher accuracy, and it’s under $40. If you go this route, you’ll find that it too will work with the TinyGPS library. Make sure to change the baud rate in the puzzle box code from 4800 to 9600 bps. You just need the Tx, Rx, GND and Vin (5V) connections, which you can pick up easily from Mikal’s shield without having to use the SMT pads (you don’t need the JST connector either). Remember that the GPS’s Tx connects to the shield’s Rx, and the GPS’s Rx connects to the shield’s Tx.

    3. The sample code here initializes the pinout for the pushbutton LED, but never makes use of it. I decided to make it light up when the GPS gets a fix. To make it light up, use:

    digitalWrite(LED_pin, HIGH); // replace HIGH with LOW to turn it off

    4. All of the parts in the list from futurlec.com can also be had at digikey, so you can consolidate your sourcing a bit.

    5. If you decide to use a different LCD, you may need to make provisions for a resistor/pot or voltage divider between the shield and the LCD’s contrast pin. The blue Topway one in the list above doesn’t need one, however.

    6. For the box, I used a nice wooden cigar box from my local tobacco shop, and painted it. They sell empties for only $2-$3 apiece.


  43. Mikal

    11 years ago

    Scott, it was a pleasure helping your work through the last few details of your build. I appreciate that you took the time to share your suggestions. I agree with all of them. Now’s a good time to mention that we hope soon to unveil a new website and board design that rectifies all of the points you address. Thanks for the excellent feedback and keep in touch.


  44. Scott

    10 years ago

    On my second round of setting up a puzzle box for a new quest, I included a simple code mod that was quite useful. It allows a couple of test attempts before the first real one, which is then numbered attempt 1 without any resetting required. The two lines to change are as follows, and the change is the insertion of “-2″ in both places:

    if (attempt_counter-2 >= DEF_ATTEMPT_MAX) /* allow for 2 test attempts before counter reaches 1 */
    .
    .
    lcd.print(attempt_counter-2) // allow for 2 test attempts

    (You can use a number other than 2 for however many test attempts you want).

    What this does is number the first test attempt “-1″, the second “0″, and then the first real attempt “1″. I chose to do it this way rather than have values of attempt_counter start at -1, as negative values cannot be stored in the EEPROM.

    Just make sure you use up the test attempts before presenting the box to the subject.


  45. Mikal

    10 years ago

    Superb suggestion, Scott. I may incorporate this test feature myself. Good idea!


  46. Aaron Hall

    9 years ago

    Hi I have a question that is kind of unrelated. I have built a Reverse Geocache box. However I am having trouble with my Pololu Switch set up. I did not purchase a shield kit from you. But I have the pololu switch directly wired. The problem is my switch does not power on the Arduino everytime. The light on the Pololu switch will flicker when I press the button but not power on the arduino. I was wondering if this might be a noise issue and if so what your thoughts were on fixing it (capacitor, resistor,ect.)

    Thanks Aaron Hall


  47. Ronald Bryson

    9 years ago

    The other day I had no problems uploading to arduino like I’ve been doing for many moons however now when I do. I get the following – avrdude: stk500_getsync(): not in sync: resp=0×00 I’ve only change some program lines. Compiled correctly. I get that error msg when I upload. What could be wrong?

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

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

Leave a Reply