[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.
[youtube=http://www.youtube.com/watch?v=EpMhZ3Fbm5g&feature=player_embedded&w=470]
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.
Also done in the original Star Trek (don’t remember name of episode) in which a giant repulsor beam deflected an incoming asteroid. It was trigrered by musical notes.
Seriously cool. I wonder how hard it is to rewrite to work with a different tune. Always thought Prelude of Light was the worst tune in OoT.
*one of the best songs in OoT.
Different tune is really easy: there is an array with notes. Like this:
Note s_pattern[] = { NoteD5, NoteA4, NoteD5, NoteA4, NoteB4, NoteD5 };
Goertzel on Arduino is cool. I did one as part of a software defined radio once for DTMF detection.
I really think he needs to use:
G, A, F, (octave lower) F, C
That’s good for unlocking, how about B flat, C, A flat, (octave lower) A flat, E flat to lock it?
Open:
E C E D
To close, open backwards:
D E C E
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.
3a Get punched by the person who diligently made a very nice project.
Are you planning to put your family jewels in this box?
Really should’ve been Zelda’s Lullaby…
Or Song of Storms…
Actually, any Zelda tune would do. They’re all great. Song of Storms is just my personal choice…
There’s that lock in Willy Wonka too. Any takers for a project?
Goonies!!
There was music based lock on a safe in an episode of It Takes A Thief as well.
And then there was the lock in Moonraker…
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.
I do (see my previous comment in reply to Galane)
whargarbl! I’ve been writing something like this in processing for a while now!
Mine doesnt work though (yet..)
Hm? You don’t mean processing.js, do you?
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)
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.
Quite honestly I have not watched Macgyver. But is sounds like the guy really knew how to hack things!
“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.
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!
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.
Should have used G, F#, D#, (-1 octave) A, G#, (up octave) E, G#, C.
(The ‘puzzle solved’ jingle)
have you posted the code anywhere? I would love to take a look at it.
Great work btw!
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!