Building a Gadget Cache: Step by Step

I enjoy building complex caches (and series), but I’m thinking most of my caches don’t have a broad appeal. I’m going to try and change that with a straight-forward traditional gadget cache. Spoilers follow! You may want to skip this article if you live in/near Massachusetts.

Inserting Shave and a Haircut into an Ammo Can

So here’s the spoiler: in order to open this cache, you must knock a certain pattern on the side of the ammo can.  Nothing too complicated, but the geocacher is given no hint on the cache’s page that this is what you need to do.  The title of the cache, “Shave and a Haircut“, is the only hint until you get to the cache location (GZ).

Once at the cache, there is an LCD screen which provides hints the longer you stay there.  I’m going to go through each step of creating this gadget cache, including the electronics, program, and container.

Wiring the Circuit

This circuit has two components: a piezo buzzer and an LCD screen. I have never used an LCD screen before, and I have only used a piezo buzzer to create sounds, not to detect them. So both components were going to need to be experimented with.

There is sample code for an LCD screen built into the Arduino programming tool, so I gave that a shot first.  I followed the wiring diagram and used the exact code.  It worked great.  The only thing I noticed is I had to turn the potentiometer (pot) all the way off, so I ended up getting rid of it and connected pin 3 on the LCD directly to ground.

There is also a simple “knock” tutorial from Arduino.  I hooked it up as shown, and installed the code.  It all worked as expected.

At this stage, I was curious how much power I was going to need to run the LCD screen and buzzer.  Based on previous power supply tinkering, I figured either 1 or 2 AAs with a boost converter should do the trick, but this was a good chance to measure how many amps the components are pulling.  There is no easy way to measure the amps being pulled over a USB cable connected to a computer, so I decided to cut a spare USB cable I had and hook it into a mini breadboard.  There were four wires, plus bare ground.  I tested with the “hot” red wire and the black ground.  I didn’t use the green and white wires, which are used to transmit and receive data.

Using a multimeter, I was able to see that my computer was supplying 5.14V and 0.047A to my circuit.  Multiply those numbers together, and it appears my circuit uses about 0.24 Watts of power.  This means a single rechargable AA battery (1.2V) would need to supply roughly 200mA (0.24W ÷ 1.2V).  Most AA batteries can supply  300mA (or even a bit more), so it looks like just one AA battery for this cache will be enough!

As you can see in the photos above, I measured the volts and amps the battery was supplying out of  curiosity.  It looks like my rechargable is a bit depleted because it’s only supplying 0.968V.  To make up for that, the circuit is pulling 0.307A, for a total power of 0.297W supplied.  Even with a depleted AA battery, this is still within acceptable range.  These numbers also mean that the boost converter is about 80% efficient (0.24W ÷ 0.297W × 100%) in this case.  It’s not crucial to know this, but may help with estimates in future caches.

Here is a Fritzing diagram of my completed circuit:

Fritzing Diagram of Shave and a Haircut

Fritzing Diagram of Shave and a Haircut

And here is a parts list (I have no affiliation with Adafruit or the eBay sellers):

  • half-size breadboard [Adafruit]
  • Arduino Nano 5V [eBay]
  • 16×2 LCD Screen [Adafruit]
  • single aa battery holder with wires [eBay]
  • 5v dc-dc boost converter [eBay]
  • large piezo buzzer [Adafruit]
  • resistor – 1M ohm [eBay]
  • resistor – 220 ohm [eBay]
  • Male/Male jumper wires [Adafruit]
  • capacitor in diagram is not required


Writing the Code

I took the basics of the code from two sources.  First, and from where the idea for this cache germinated, was this article about a secret-knock gumball machine from Make magazine.  This code does a lot more that I needed.  I don’t have indicator LEDs or servos, and I didn’t need to be able to program a new knock into the Arduino.  So, I stripped it down to just the loop which checks for a successful knock, and the success and failure methods.  In particular, the method which normalizes a fast or slow knock to a standard speed for comparison was especially useful.

Next, I needed to program the LCD screen.  This was my first experience with an LCD, so I stuck with the tutorial from Arduino.  I then wrote a method (LCDMessage) which would accept a simple message and split it over two lines and center it.  Click the gray bar below to see the code.


So, here it is: the circuit programmed with the above code.  I’ve shown a few bad knocks followed by the correct knock to demonstrate how it works.  The combination of the actual cache is not 1234.


Building the Container

Now that I’ve confirmed I can build the circuit and get the code to work the way I want, it’s time to build the container.  My last gadget cache was a birdhouse-style container, so for this one I wanted to try something different.  I had picked up an ammo can at the Army Surplus store in Kenosha, Wisconsin.  It was fun flying home with it, but that’s another story.  I took some measurements and decided I could put my gadget cache in there, since it will certainly be weatherproof.  A small part of the ammo can will contain the chip, wires, and LCD screen, while the rest of it will be left open for the cache log and swag.

Once inside, the electronics would be very difficult to get out, but I’m not sure that’s a bad thing.  I found the perfect width of plywood in my shop – it fit exactly into the ammo can.  Who cares if it’s cherry veneered?  I’ve had it for a few years now (from a TV console I built for my parents), and I figure it’s not going to get much other use.  Once it’s spray-painted, no one will notice.  Here are a few of the steps:


Putting It All Together

I had some concerns about this cache’s ability to withstand the abuse of being in an ammo can that people were going to be knocking on.  In my last Arduino cache, I just left the assembled breadboard inside, and soldered the wires to all the sensors.  That wouldn’t work this time.  In speaking with fellow gadget geocacher th10gt, he gave me the idea to hot-glue everything in place.  This has worked amazingly well.

With the circuitry all glued in place, it was time to carefully fit everything into the ammo can.  I tripled checked everything because it is such a pain to remove, and this is the only way I can gain access to the electronics.  I ran caulking all around the edge once it was inserted, to ensure maximum difficulty in accessing the electronics and destroying the cache.


Installing the Cache On Site

I’ve been populating a town-owned orchard with caches for several year now (with permission).  I’m just about out of space, but did find an open location just about 50 feet of the trail through the woods behind some apple trees.  Because this will be a non-premium traditional cache, I decided to lock it down.  I installed an eye-bolt in the back of the ammo can and bought a bicycle lock.  I loosely wrapped the lock’s cord around a good-sized tree, looped it through the bolt, and buried what I could.  I gave it a quick test, and everything seemed good. The exposure is a bit wonky, and I covered up the combination, but here it is!

3 Comments on Building a Gadget Cache: Step by Step

  1. It’s not 100% necessary, but can help smooth out the power. I used a 470μF capacitor here.

  2. What values with 470μF capacitor?

Leave a comment

Your email address will not be published.