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. Mikal

    13 years ago

    Hi James–

    The problem isn’t in your soldering. As Ryan mentions below, the sample source doesn’t include any code to enable the button LED, but you can easily add it..

    Mikal


  2. James

    13 years ago

    Thanks Ryan. That fixed my issue also.


  3. James

    13 years ago

    Mikal, two more questions:
    – I am seeing very poor battery life. Is there anything in the sample source that might be responsible for this?
    – Do I need a square hole in the box for the GPS antenna?


  4. Jens

    13 years ago

    Mikal

    Display issue – resolved.

    My box is today complete. The code problem I encountered with pin assignments for the display arose from using the code listed on http://makezine.com/25/puzzlebox/ which only supports the 1.0 shield. It may save someone some time later if that link was pointed to your updated code. The same goes for the picture on makezine showing v1.0. In the process I burned one display (inverted header), but got a couple of new ones from http://www.mouser.com in three days in stead of waiting for Singarpore mail for 3 weeks. They are reflective green and not as fancy but do the job. The painful part with those is that you have to insert a potmeter to adjust the LCD contrast for pin3.

    Thanks for a real fun project. Now I am just waiting for the perfect opportunity to use it…

    Jens


  5. Rex Thomen

    13 years ago

    @Noj. Have you solved your power issue? I am using Arduino UNO, with 1.1 shield. Everything works when using the USB cable, but not with the 2 batteries. I am at a loss on how to troubleshoot this, how did you resolve your issues?

    Rex


  6. Rex Thomen

    13 years ago

    Found my problem. Poor connection in the switch. Quick job of soldering, and everything is working perfectly. Gotta finish the woodwork. Thanks Mikal, this has been great!

    Rex


  7. Ken

    13 years ago

    Mikal,

    I finished my box but have an interesting issue. I’m not using your handy shield so I currently have wires everywhere. It works just fine when I plug in power from the Pololu switch in either the 5V and Vin line when powered by 4AA rechargeable batteries. That’s just as expected. I found that when I plug it into my USB port, everything will still works fine when I have power plugged into the 5V port but if I have it plugged into the Vin port, the LCD goes completely bright and you can’t see anything anymore. It still seems to be working just fine because I can get in through the back door still but I’m curious as to what could be causing issues with the LCD.
    Thanks. I should be handing it off to a friend today to see what they think of it.


  8. Eric

    13 years ago

    @Ken – try it with 2 AA batteries instead.
    I did the same thing – used 4 AA batteries where the 1.1 stuff uses only 2. There’s a photo somewhere in all the stuff describing this project that shows a 4 AA battery holder, so I ran with it without reading the docs carefully.


  9. Ken

    13 years ago

    I can’t use just 2 AA batteries. I’m not using a shield or the board that boosts the 3V to 5V so I’m stuck with using the 4 AA batteries instead. Maybe I’ll eventually move to using the other Pololu board but I was trying to put this together using the least amount of money possible to begin with before I did anything else with it.


  10. Mikal

    13 years ago

    @Ken,

    My very first box used 4 AA batteries. 6V is just at the lower limit of what’s allowed for Arduino, and indeed later I read that they recommend 7V minimum. You should never drive the 5V line directly with the output from the battery though! 6+ V is too high! Always route to Vin so that you can use the onboard regulator to regulate that down to 5V.

    All my recent designs use 2 AA batteries regulated up using the Pololu boost regulator. This output IS routed to the 5V line, because, well, it’s 5V.

    Mikal


  11. Rex Thomen

    13 years ago

    My puzzle box is complete as of today. I will be presenting it today. What an awesome project. This was my first stab at it, and expect to make another for my next deployment overseas. I had no soldering, electronic, or programming skills, and yet produced an amazing gift. I have several Halloween projects I am going to start on now. Thanks Mikal for you help and patience.

    Rex


  12. Ken

    13 years ago

    Mikal,

    I’m actually using rechargeable batteries so under load, it’s more like 4.8V but it seems to be working fine. I just couldn’t figure out what the problem was using 4 alkaline batteries in Vin because it didn’t work properly. I may just stick a 9V battery on it instead to make things easier and route it into Vin and take care of it. It’ll be more compact that way too.
    I do have another question. How do you typically mount the GPS to the box? Currently, I have it mounted with some hot glue and it is just glued to the top of the box and seems to work fine.
    I delivered the box to my first victim, er, friend, and if he weren’t an engineer, I think it would have taken him some time to figure out. They just need to go out on a drive now. It was fun watching their reaction when their oldest hit the button using up another attempt. I think this will be a hit with the friends.


  13. David Opland

    13 years ago

    Mikal,

    Im an old man in a young person’s world.
    When compiling, I get the message “NewSoftSerial does not name a type.” Same for PWMServo. Both show “no such file.” Any thoughts?
    The box will contain my daughter’s wedding present.


  14. Mikal

    13 years ago

    Hi old man, :)

    In Arduino-land, you’re provided with a number of built-in libraries in the /libraries folder. Others, like NewSoftSerial and PWMServo, must be downloaded and installed separately. Download them from this website and install them alongside EEPROM and LiquidCrystal and the others. Then restart Arduino and recompile.

    Mikal


  15. Mikal

    13 years ago

    @Ken,

    9V is cool, but in my experience 9V batteries don’t have enough capacity to reliably last for a complete puzzle box session.

    I think hot glue is a great tool for sticking the GPS module to the box lid. Make sure the ceramic antenna is glued directly to the wood.

    Let us know how it turns out…!

    Mikal


  16. Craig

    13 years ago

    Mikal

    After a failed attempt at soldering the JST connector onto the 1.1 shield I managed to ruin the connectors while cleaning up the connection. As you may have noticed I bought a new shield from you and have started over. I’m glad to say that this time everything went perfectly! That is until I got to running the first test. It works fine while plugged into USB but when left to its own power source it seems to get stuck in an infinite loop. It states “access granted!” and then immediately starts over at the beggining of the code without opening the latch. Yet it doesn’t do this over USB, when given external power it states “Access Granted!” and then proceeds to open the latch and (attempt, as it can not turn off USB power) to power off. Any ideas as to what is happening that would cause it to start over immediately? I copied and pasted your sample code directly only changing the Lat/Lon position and Open/Close angle.

    Thanks!
    Craig


  17. trimard

    13 years ago

    hi there,
    does anybody have any idea if the parts are all available in Europe? I am planning to build a box!
    Thanks.


  18. Anna

    13 years ago

    I’m looking for somewhere to buy a box that’s already built, just one I can program to the right location and put inside what I want. Is there anywhere I can find these?


  19. Mikal

    13 years ago

    Craig, my guess is that there is a short somewhere, or, likely, the servo is drawing too much power. Are you using an HS-311 or HS-55 servo? These are the ones I use. I ask because I tried a cheaper servo once only to discover that it drew too much power. That can easily cause the kind of brown-out resets you are seeing.

    Mikal


  20. Mikal

    13 years ago

    trimard,

    I feel pretty sure these standard parts are easily obtained in Europe. I see that Pololu ships to Europe, and so does Sparkfun. Most of the other parts come from China anyway. :)

    Good luck, and make sure you let us know how it all turned out!

    Mikal


  21. Mikal

    13 years ago

    Anna,

    For commissioned work, please write me directly @mikal@arduiniana.org.

    Thanks!

    Mikal


  22. Craig

    13 years ago

    Mikal

    I’m using the HS-55, in fact all the parts i’m using are from the links you’ve provided, so i’m not confident that the servo itself is the problem. I’m not too sure how the shield is laid out but it appears that the capacitor nearest the servo connection has something to do with it. Is is possible the capacitor isn’t storing up enough power to operate the servo?

    Craig


  23. Craig

    13 years ago

    Mikal,

    I’ve determined that it is in fact a problem with the servo in some fashion. I manually moved the servo to a new position and upon startup the box attempted to reset to the closed position as is called for in the code. the servo moved incrementally causing continuous brown outs until the closed position was reached. I hope this gives you a better idea of what is happening.

    Craig


  24. Craig

    13 years ago

    Mikal, I’m embarrased to say that it was the batteries all along, they were near dead. In any case, my box works great now and this has been an awesome project! I’ll definately spread the word about it and can’t wait to drive all my friends crazy with Reverse Geocaches! Thanks again for all your help!

    Craig


  25. Mikal

    13 years ago

    Ha! I’m delighted to hear that, Craig. Don’t feel bad. We all make mistakes like that. Let us know what the reaction to your box is…!

    Mikal


  26. Sajo

    13 years ago

    Please help me troubleshoot the box. I’m using all the parts from the list except GPS module.I have copied and pasted code that was published http://makezine.com/25/puzzlebox/.LCD lit up but there are no characters.

    Couple questions:

    1.Am I missing any libraries? Which one I need to run skeleton program?
    2.Is LCD incompatibilty( as mentioned on seeded studio) addressed in sample code ?
    3. Do I need to add 10K pot to reduce brightness for LCD?
    4. Can i check individual components with sh Reverse Geocache Shield 1.0 plugged in? For example run ‘hello world” sketch…

    I would like to complete the project for Saturday 14th, so any help is appreciated…

    Thanks,

    Sajo


  27. Mikal

    13 years ago

    Sajo, are you using my version 1.1 shield? If so, you ought to get the updated code (with new pin assignments) from this page. Answering questions:

    1. If you can compile, you are probably not missing anything.
    2. I saw that “incompatibility” notice on SeeedStudio, but I think it’s wrong or outdated. I’ve used dozens of these LCDs successfully.
    3. You can, but the best setting is so close to GND it hardly makes a difference in my experience.
    4. Sure. Unplug the servo and the GPS and upload a simple “Hello world!” sketch. Just make sure to use the correct pin assignments.

    Is your LCD oriented correctly? I have seen one, maybe two people “fry” an LCD by connecting it upside down or backwards. I hope that’s not you!

    Mikal


  28. Alan Watson

    13 years ago

    Hi Mikal,

    Thanks again for this great project!

    Question for you:

    I’ve got everything built and it’s working just fine, but I had to use 2 parts different than those specified in the MAKE article; I got a pushbutton WITHOUT an LED, and I got a 16×2 Blue Backlit LCD.

    How will this affect the power consumption?

    I’m experiencing the same kind of issue that Craig describes 12 posts above after about 10 attempts using standard Duracell Coppertops.

    I picked up some Energizer Advanced Lithium AA batteries that start at 1.79 V

    Do you think that will be enough for the full 50 tries?

    Much Obliged,
    Alan


  29. Mikal

    13 years ago

    Hi Alan,

    I can’t tell you about the LCD. It may require much more power than my little blue one. Lithium batteries are better than standard or alkaline, but in my designs alkaline batteries are perfectly usable for 50+ attempts. I’m not sure whether your consumption pattern can be explained by weak batteries, a circuitry mistake, or a power consuming display.

    Good luck!


  30. Mrm

    13 years ago

    Just a suggestion: You should move the “LED_pin” to a PWM output for cool effects.


  31. Mikal

    13 years ago

    @Mrm,

    You’re quite right. Also the led backlight should be a PWM pin. Next rev! :)

    Mikal


  32. Juan Gonzalez

    13 years ago

    Hi Mikal,
    I am having some issues with the code and I have not really dealt with adding libraries to the Arduino. I believe I have added all of them to the libraries but still get these errors

    “sketch_may13a.cpp:2:22: error: PWMServo.h: No such file or directory
    sketch_may13a.cpp:3:27: error: NewSoftSerial.h: No such file or directory
    sketch_may13a:43: error: ‘NewSoftSerial’ does not name a type
    sketch_may13a:47: error: ‘PWMServo’ does not name a type
    sketch_may13a.cpp: In function ‘void setup()’:
    sketch_may13a:64: error: ‘servo’ was not declared in this scope
    sketch_may13a:70: error: ‘nss’ was not declared in this scope
    sketch_may13a.cpp: In function ‘void loop()’:
    sketch_may13a:124: error: ‘nss’ was not declared in this scope
    sketch_may13a:140: error: ‘servo’ was not declared in this scope
    sketch_may13a.cpp: In function ‘void PowerOff()’:
    sketch_may13a:187: error: ‘servo’ was not declared in this scope”

    D: Help please? It would be greatly appreciated!


  33. Mikal

    13 years ago

    Juan, that means that you have not installed the libraries correctly. They should be at the same directory level as the built-in libraries like EEPROM and LiquidCrystal.


  34. Max

    13 years ago

    So i do not know what ive done i completely slaughtered my first shield configuration so i ordered a new one and made it all up. When i was finished the GPS worked but the screen didnt power on. So i flipped the screen to the underside of the 1.1 board and flipped the number in code for the 1.1 shield (i had forgotten before) and now the screen works but the GPS wont turn on. any thoughts on what i might have done, or need to do?


  35. Russ

    13 years ago

    Hi Mikal, i was wondering if you sell the whole configuration for the box, im new to this and by reading all the problems some people are having (they know more then me by far) i think for my best interest is for me to see if you do sell the whole configuration since i would like to make the box myself,if not i guess ill wing it and see if i can do it my self. Thanks for your time!


  36. Mikal

    13 years ago

    @Russ, I wish I were equipped to sell you a completed kit, but I’m just not right now. Hopefully this will change someday. Sorry!


  37. Ryan

    13 years ago

    Figured I’d throw this up here… If you want miles instead of KM, you’ll have to put in another interger and some conversions…Here are the conversions:

    float distance_yards = distance_meters * 1.09361329833771;
    lcd.print((int)(distance_yards / 1760));
    lcd.print(” miles”);

    Note—this is just the part of the code that converts it so you don’t have to do the legwork of figuring it all out.


  38. Russ

    13 years ago

    So i was ordering all my parts only to find out the button is out of stock any suggestions on a replacement or should i just wait???


  39. Allen

    13 years ago

    Working on a box for my scout unit and it occurred to me that it would be nice if I could also give a compass heading with the distance. Then the next step would be for a series of points, each that could be verified by GPS, with a heading and distance that could be used as an interactive compass course. If they’re wrong it sends them back to start and if they finish they receive what’s in the box. I could probably figure out the latter, haven’t dug into the tinyGPS library yet.


  40. Russ

    13 years ago

    are you going to have any pcb shields up for sale again for the arduino uno? right now you only have one for the nano -.-


  41. Russ

    13 years ago

    I have a simple question, now should the gps be able to transmit through the wood of my box, or should i make a small port hole ?


  42. Harry's Dad

    13 years ago

    Mikal,

    Great Project. Easy instructions. Everything worked first time! Hardest part was getting it in the box. Keep up the good work. Really enjoyed putting this together.

    James


  43. Mikal

    13 years ago

    Harry’s Dad,

    Glad to hear it. Post photos when you get a chance!

    Mikal


  44. Russ

    13 years ago

    i get the following errors when trying to upload any of the libraries from this site, any ideas on whats going on?

    core.a(main.cpp.o): In function `main’:
    /Users/RussellFyock/Desktop/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/main.cpp:7: undefined reference to `setup’
    /Users/RussellFyock/Desktop/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/main.cpp:10: undefined reference to `loop’


  45. Michael B.

    13 years ago

    This is very addicting. My wife is quite cross… Anyway, I just had a quick (theoretical) question. Why is the boost regulator necesaary? Why can’t 4 batteries be used and the pololu switch circuitry lead into the arduino to be regulated down to 5v and the gps module feed directly off an arduino pin?(If this is a dumb question, please excuse my ignorance) Thanx for the inspiration!


  46. Ray B.

    13 years ago

    First, thanks for a great idea for a project. I’m doing mind kind of independently of your design because I’m learning electronics and thought it would be more educational that way. The end product is meant as a gift for my friend’s autistic boy.

    I’m using a Arudunino Pro Mini 3.3V, partially because I am using a 3.3V GPS unit and I happen to have a 3.3V 16×2 LCD display. I’m hoping to run it all off a LiPo battery pack.

    I started working it out with a regular Arudino before the Pro Mini arrived and had established communications with the GPS chip, but I had a lot of comm problems, bad checksums mostly. Then, when I moved to the Pro Mini, I couldn’t seem to talk to the GPS Chip anymore.

    Upon examining the NewSoftSerial library and TinyGPS code, there seem to be some tight timing requirements and I wonder if that might be why the slower 8MHz Mini Pro isn’t working.

    Any ideas?

    Thanks, Ray


  47. Mikal

    13 years ago

    @Ray B.,

    I can’t wait to hear about how your gift is received. It sounds like an outstanding project.

    How fast is the GPS baud rate? If it’s 4800, I think I would expect it to work.

    If you’re getting bad checksums, that either means the characters are getting corrupted or lost. At high speeds (38K+), especially on the slower 8MHz Arduino, either is possible, though the latter is more likely. One quick way to check is to repeatedly check the nss.overflow() function. If it returns true, that means you are not processing the incoming GPS characters rapidly enough.

    To resolve this problem, remove any unnecessary coding from your loop. If you’re printing a lot of diagnostic messages, for example, see if you can cut some of those out until the overflow goes away.

    M


  48. Ray B.

    13 years ago

    Mikal,

    Your suggestions did the trick. I lowered the baud rate to 9600 and set the GPS to send messages only one every fix fixes, which translates to twice per second, and I limited the messages to only the ones I most needed. That appears to have worked just fine.

    BTW, I reworked the initial GPS quicktest program to use the NewSoftSerial library so it doesn’t talk to the GPS and the PC using the same port. It’s a pretty easy fix.

    That code follows:

    #include

    const byte LEDPin = 13;
    boolean triggered = false;

    // used to set up the sentences you want from the GPS and change
    // baud rate to 9600
    const char * SETUP_CMD_STR = “$PMTK314,5,5,0,5,0,5,0,0,0,0,0,0,0,0,0,0,0*28”;
    const char * SETUP_BAUD_RATE = “$PMTK251,9600*17”;

    NewSoftSerial gps(2,3);

    void setup() {
    gps.begin(57600);
    gps.println(SETUP_CMD_STR);
    gps.println(SETUP_BAUD_RATE);
    gps.end();
    gps.begin(9600);
    Serial.begin(115200);
    pinMode(LEDPin, OUTPUT);
    digitalWrite(LEDPin, LOW);
    }

    void loop() {
    if (gps.available()) {
    if (!triggered) {
    digitalWrite(LEDPin, HIGH); // blink led to show things are working
    triggered = true;
    }
    Serial.print(gps.read(), BYTE);
    }
    }

    Thanks,
    Ray


  49. Rben13

    13 years ago

    I’m thinking about adding a keypad on the inside of the box that will allow the owner to program in a new destination, adjust the counter, or reset the box. The people I’m giving the box to might be nervous about editing the code for the box, so I figure a keypad might be just the ticket. The only problem is that you can’t see the LCD display when you’re looking at the underside of the box. Hmmm.

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

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

Leave a Reply