Transforming a wooden safe into a smart object — When 3D printing meets Apple HomeKey
2024
How do you turn a simple wooden toy into a hub of contactless technology? The story of a 'useless therefore indispensable' project, at the crossroads of mechanical design, 3D printing, and software reverse engineering.
01.The Concept
It often starts with an object lying around. In my case, it was a small wooden toy safe. Its only purpose was decorative, and its manual locking mechanism severely lacked magic.
The idea quickly took shape: what if I could open it simply by bringing my iPhone or Apple Watch close to it, exactly how you'd unlock a high-end smart lock?
The goal obviously wasn't security—we're talking about a wooden box you could break open bare-handed. The challenge was purely technical. It was the perfect excuse to tackle a comprehensive challenge: linking physical hardware constraints (gears, motors) with a complex proprietary software protocol. A blend between garage tinkering and Apple's highly closed ecosystem.
02.The Software
The real challenge of this project wasn't just spinning a motor, but deciding how to trigger it. I wanted native integration without needing a third-party app, taking advantage of the Apple HomeKey feature.
To achieve this, the brain of the operation is a Raspberry Pi Zero W, paired with an NFC reader. Since Apple HomeKey isn't an open protocol, I had to rely on the open-source community. I used and adapted the excellent reverse engineering project apple-home-key-reader by kormax.
This program emulates a certified HomeKit lock. When an Apple device approaches the NFC reader, a cryptographic handshake occurs. I had to dive into the code to adapt the reader's software response: as soon as the NFC authentication is validated by the Apple ecosystem, the script sends a precise signal to the GPIO pins of the Raspberry Pi to trigger the unlocking action.
That's where the software magic happens: turning a wireless cryptographic validation into a concrete electrical pulse.
03.The Hardware
On the physical side, I had to clear things out. I completely dismantled the original locking mechanism to start from a blank slate.
For the Raspberry Pi to open the safe, I needed a mechanical action. So I custom-modeled a gear system and a new hinge. 3D printing allowed me to iterate quickly to find the perfect ratio: the mechanism had to be compact enough to fit inside the lid, yet smooth enough not to jam.
Once the parts were printed, I housed a servomotor inside, directly connected to the Raspberry Pi Zero. As for the NFC reader, it was hidden right behind the wooden panel. Since wood easily lets proximity waves pass through, the exterior of the safe remains completely smooth and true to its original look. No LEDs, no buttons. Just wood.
This project perfectly illustrates what drives me in engineering: the ability to master an end-to-end value chain. On paper, building a connected wooden safe has no real utility. But technically, it allowed me to explore 3D modeling, embedded electronics, and the manipulation of complex software protocols within the iOS ecosystem. This is what makes a well-rounded tech profile today: not being limited to the screen, but knowing how to dive into low-level code to interact with the physical world. And honestly, unlocking a wooden safe with your Apple Watch brings a level of satisfaction that few lines of code can match.