A Secret Magnetic Gesture Is the Key to This Hidden Lock
By Nick Bild
A lock isn't much good if anyone can open it, but what if a would-be thief couldn't even figure out where the lock was, let alone how to open it? That's the idea behind a clever project by Stephen Cass, who built a wooden lockbox that has no visible keyhole, keypad, or other obvious means of opening it. Instead, the box can only be unlocked by tracing a secret pattern across its surface with a magnet. Cass has long been fascinated by locks and lockpicking, and wanted to try building something a little different. Magnetic locks seemed like a promising option, since they can be completely concealed behind a surface. But conventional designs have a significant weakness: once someone discovers where the lock is hidden, practically any sufficiently strong magnet can open it. Cass wanted to add another layer of security by requiring a specific magnetic gesture rather than simply detecting the presence of a magnet. The key to making this work is SparkFun's Magnetic Imaging Tile. This board contains an 8×8 array of Hall-effect sensors capable of measuring the strength and polarity of magnetic fields. By continuously monitoring the sensors, the system can track a magnet as it moves across the surface and recognize a particular pattern. The board communicates over SPI and can produce readings hundreds or even thousands of times per second, which is more than sufficient for tracking movements made by hand. Cass connected the Magnetic Imaging Tile to a Teensy 4.1 microcontroller, which comes equipped with a 600 MHz processor and 1 MB of RAM. He wrote the main control software himself, but used Claude to develop two supporting libraries. One records gestures and saves them to nonvolatile storage, while the other compares new gestures against the stored pattern using an adjustable matching threshold. To put the system to the test, Cass modified a wooden craft box by removing its original latch and installing a servo-operated locking mechanism. A rotating beam engages with a notch attached to the lid, preventing it from opening until the correct gesture is detected. The electronics also include a battery pack, a button for entering gesture-recording mode, an indicator LED, and a pair of NPN transistors to interface the Teensy's 3.3 V outputs with the servo's 5 V control input. One unexpected challenge was the Magnetic Imaging Tile's small sensing area, which measures just 3 centimeters square. Performing a repeatable gesture without knowing exactly where the sensors were located was difficult. Of course, marking the location on the outside of the box would defeat the purpose of hiding the lock in the first place. Cass came up with a creative solution by decorating the box with a Celtic knotwork pattern. The design doubles as a disguised reference grid, allowing him to guide a magnetic stylus through the correct gesture without revealing the sensor's location. The finished lockbox works as expected, although there are still some issues to work out. Most importantly, a dead battery would leave the box locked with no way to open it without breaking something. Cass suggests that adding a hidden inductive charging coil could solve this problem. For more details on this unusual project, be sure to check out the full write-up .The SparkFun Magnetic Imaging Tile (📷: SparkFun) The lockbox design (📷: James Provost) Just a few components are needed (📷: James Provost)
↑ Back to top
Originally published by
Hackster News ↗
· rebuilt here from its own full-text RSS feed · all rights
remain with the publisher, please read and support them there.