A Locking Chest With A Musical Key


[Basil Shikin] was thinking about different types of locks, and was trying to come up with a locking solution that he had yet to see. It dawned on him that he had never come across a lock triggered by music, so he set off to construct one of his own.

He ordered a wooden chest online, then proceeded to piece together the electronics required for the locking mechanism as well as the music detecting logic. Using an Atmega328P paired with an electret mic, his system listens for a particular tune (the Prelude of Light from the Ocarina of Time) to be played , which triggers a tiny servo to undo the latch. To do this, he implemented a version of the Goertzel Algorithm on the Arduino, allowing him to accurately detect the magical tune by frequency, regardless of what instrument it is played on.

Be sure to check out the video below to see his musical lock in action.


31 thoughts on “A Locking Chest With A Musical Key

  1. Check out an episode of Stargate Atlantis (cannot remember the season). Room unlocked by series of musical notes. Rodney and Daniel looking for a hidden laboratory.

  2. It’s a cute trick. Tis deserving of being a gift. I could see this being used as a garage door opener or closet lock or even to start coffee in the morning.

    Yet I am duty bound by my post here: http://hackaday.com/2012/04/15/a-glorious-mechanical-seven-segment-display/#comments to point out something.

    To unlock this without damage:

    1. Hold vertically with the right side pointing down. Firmly hitting it on a surface while light pressure on the lid. It causes the servo to move out of the way via momentum.

    2. Merely get a thin piece of music wire or shim stock and push the latch out of the way from the left side.

    To make it more better:

    1. Use a box with a lipped lid AND

    2a. Use two locking detainers in opposite directions. Not necessarily need two servos to do this.

    2b. Use a wide arc rotation for locking. A minimum of 90 degrees to open would suffice.

    I apologize for my unhealthy focus.

  3. Does anyone remember the old point ad click game “Loom”? This reminds me of Loom, where the point of the game was to use a magical music staff to manipulate your environment by playing the right tone sequences. One tune would make you invisible, one tune would move an object, I think it had tunes to open doors like this. Great game, nice to be reminded of it.

    Good hack.

  4. When I saw this post, I was really hoping he would have used the melody from “Endearing Young Charms” for the unlock key. (Hint: think Bugs Bunny and Yosemite Sam)

  5. Most things have been done before… 1985… Macgyver. Season 1 episode 5 “the heist”. 4 tones were required to open a vault. . He beat it using some wine glasses. Pretty cool to see one built :-). Good stuff.

    1. “Done before” in the article was meant to relay that he had not seen a musically-controlled lock in real life. While I was certain they had been featured in TV, Movies, and video games over the years – it was the first time I had seen a real, functioning musical lock.

  6. How sensitive is it to frequency? Any marching band vet will tell you that temperature can have a huge affect on tuning. Even humidity, for some woodwinds. Also, some people don’t use “standard” A=440 tuning.
    Anyway, cool project!

    1. I haven’t looked closely at the project, but if it were mine, I’d use the first note as the basis for checking the remainder of the tune, +/- a percentage for poor tuning on subsequent notes.

      That way, if you’re just whistling the tune, as long as you have decent pitch from note to note, only the relation to the starting pitch is relevant, not the actual frequency of each note.

  7. nvm, I see your code, but I am confused about how you put it on the atmega chip. I was hoping to modify this to detect dtmf tones and put it in an arduino sketch. Is there any chance you could port this to an arduino .pde or .ino? I’d super appreciate it!

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.