Handcrafted gifts are special, and this one’s no exception. [John Pender] made a Tolkien-inspired box for his son and shared the details with us on Hackaday.io. This one-of-a-kind handcrafted box fulfills one role and does it perfectly – just like with the Doors of Durin, you have to say ‘friend’ in Elvish, and the box shall unlock for you.
This box, carefully engraved and with attention paid to its surface finish, stands on its own as a gift. However, with the voice recognition function, it’s a project complicated enough to cover quite a few fields at once – woodworking, electronics, and software. The electronics are laid out in CNC-machined channels, and LED strips illuminate the “Say Friend And Come In” inscriptions once the box is ready to listen. If you’re wondering how the unlocking process works, the video embedded below shows it all.
Two solenoids keep the lid locked, and in its center is a Pi Zero, the brains of the operation. With small batteries and a power-hungry board, power management is a bit intricate. Two capacitive sensors and a small power management device are always powered up. When both of the sensors are touched, a power switch module from Pololu wakes the Pi up. It, in turn, takes its sweet time, as fully-fledged Linux boards do, and lights up the LED strip once it’s listening.
[John] didn’t want to go for any cloud-based voice recognition service – such a gift requiring a pre-established WiFi connection would be no fun at all. Instead, he set up and used PocketSphinx for offline voice recognition. The box is a surprise for his son, thus, [John] couldn’t quite ask for voice samples. Thankfully, PocketSphinx recognizes phrases without pre-training. There’s also a contingency mechanism – the electronics aren’t accessible until you open the box. The secret is to apply voltage to two pads, which will unlock the solenoids directly, just in case the battery dies or the Pi glitches out.
We don’t quite know what awaits when the box is opened, but we can only hope that the son’s name isn’t Balin. We thank [John] for documenting the details, as a reminder that our hacker skills let us build unique and beautiful things for the people we value. Hacker-built gifts are great – we’ve seen guestbooks for weddings, couple’s proximity sensing LED badges, ESP32-based CTFs, and even meteorite turntable display stands.
13 thoughts on “Say Friend And Have This Box Open For You”
It’s all good until you get a pair of drunk Scots burglars.. “Wheesht, stop yer banging around Angus, wha’ if it’s alarmed, ye’ll trigger the bell, och!”
As long as no one says “friend” in Elvish it’s difficult to understand your concern.
It’s not “Just make some kind of noise with your voice”. That’s the “recognition” part.
“Oi, mate, Iŕhava bite of that wha you bring, tha melon”
Really nice design, but I’m just wondering, if the default state of the solenoids are “locked”, and the battery compartment is inside the box, what happens if the battery runs out whilst the box is closed?
ah, then there’s the contingency mechanism mentioned in the end of the second-to-last paragraph ^__^
I bet you could put in a wireless charging pad, too.
I’m sorry to be “that guy” but it’s “speak friend” not “say friend”. That small distinction makes the difference between a riddle and instructions.
Gandalf originally translates the inscription as “speak, friend, and enter” and gets nowhere. Some time later, Gandalf realizes (in the book) that a better translation would be “say ‘friend’ and enter” and that works great. “Those were happier times,” he says afterward.
Hello, I am assuming you used black epoxy for the lettering? I guess the LED’s are soo bright they shine through the epoxy?? BTW Great work!
I mixed small plastic beads in with the epoxy to create a lot of scatter without absorbing the light. That way you wouldn’t be able to actually see the LEDs when they were off, and the letters would be better filled with the LED light.
I routed shallow recesses for the letters and filled with clear epoxy. Then I flipped the piece over and routed wider recesses down to the clear epoxy windows. I mixed plastic beads into the epoxy to create a lot of scatter and used the mixture to fill. That way the LED color isn’t affected but you can’t see the actually LED when you look into the letters. Look at the photo of the back side near the LED arc and you can see the scattery epoxy.
Fun project and beautifully made. As for the wait for the Pi to boot, esp32’s can do speech recognition, so that might be an option to speed things up
Which software package works on ESP32?
Please be kind and respectful to help make the comments section excellent. (Comment Policy)