Say Friend And Have This Box Open For You

The octagonal wooden box described in the project. On the left, outer surface of the box is shown, with "Say Friend And Come In" inscription, as well as a few draings (presumably from Lord of The Rings) and two metallic color stars that happen to serve as capacitative sensor electrodes. On the right, underside of the lid is shown, with all the electronics involved glued into CNC-machined channels.

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

  1. 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!”

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

  2. 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?

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

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

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

Leave a Reply to EwaldCancel 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.