Turning a Wooden Safe into a Smart Object: When 3D Printing Meets Apple HomeKey
2024
The connected safe in real use
TL;DR : Connected Safe
The Project:A decorative wooden safe turned into an Apple HomeKey lock, controlled by iPhone or Apple Watch.
Stack:Raspberry Pi Zero, NFC, Apple HomeKey (reverse engineering), CAD, 3D printing.
The Challenge:Picking apart the Apple HomeKey crypto protocol to emulate a certified HomeKit lock from scratch.
The Result:The safe opens with an Apple Watch. No buttons, no app. Just wood.
A decorative wooden safe. Useless. Perfect for a technical challenge. I modeled a gear mechanism in 3D, wired up a Raspberry Pi with an NFC reader, and reverse-engineered the Apple HomeKey protocol. Result: the safe opens when I bring my Apple Watch close.
01.The Concept
It starts with something lying around. A little wooden toy safe. Purely decorative. Its manual lock was seriously lacking in style.
What if I could open it just by holding my iPhone or Apple Watch near it? Like a high-end smart lock, but on a piece of wood.
Let's be clear: security is not the point here. You could break this safe open with your bare hands. The interest is 100% technical. A perfect excuse for a full-stack challenge: marry raw mechanical constraints (gears, motor) with an ultra-locked-down proprietary protocol. Garage-level hardware talking to Apple's walled garden.
02.The Software
The real challenge wasn't spinning a motor. It was figuring out how to trigger it, natively, without opening an app, using the Apple HomeKey feature.
The brain of the operation: a Raspberry Pi Zero W paired with an NFC reader. Apple HomeKey is a closed protocol, so there's no plugging in without help. I picked up and adapted the open-source project apple-home-key-reader by kormax, a brilliant piece of reverse engineering work.
This program emulates a certified HomeKit lock. When an Apple device gets close to the NFC reader, a cryptographic handshake kicks off. I dug into the code to tweak the software response: the moment the Apple ecosystem validates the authentication, a precise signal fires on the Raspberry Pi's GPIO pins. Unlock instruction sent.
That's my favorite moment in projects like this: a wireless cryptographic check turning into a raw electrical pulse. Pure digital making metal move.
03.The Hardware
The locking mechanism
On the mechanical side, clean slate. I tore out the original lock entirely and started from zero.
For the Pi to physically open the safe, I needed moving parts. I modeled a custom gear system and hinge from scratch. 3D printing let me iterate fast. The mechanism had to be compact enough to fit inside the lid, but smooth enough to never jam.
Parts printed, servomotor housed inside, wired straight to the Raspberry Pi Zero. The NFC reader? Tucked away behind the wooden panel. Wood lets NFC waves through without a hitch. The outside of the safe stays perfectly smooth, true to its original look. No LEDs. No buttons. Just wood.
Useful? No. Technically rich? Absolutely.
This project took me through 3D modeling, embedded electronics, and wrangling proprietary protocols at the core of Apple's ecosystem. A full chain, from CAD drawings to low-level code.
That's what makes a tech profile interesting, I think: not staying behind the screen. Knowing how to get down into the hardware and make the digital world talk to the physical one. And honestly, opening a wooden safe with your Apple Watch delivers a kind of satisfaction that very few lines of code can match.