Magnetic Lock Opens By Magic

Over on IEEE Spectrum, [Stephen Cass] has a project that would probably have seemed like a magic a few centuries ago. Imagine a box that uses a magnetic device to holds a locking bolt, requiring a magnet to disengage it. The only problem is that any strong magnet can open the box. [Stephen], instead, used an array of 64 Hall-effect sensors developed by [Peter Jansen] to look for a specific magnetic gesture.

Inside is a Teensy that can read the 8×8 grid of sensors. A magnetic stylus allows you to draw an unlock pattern. The system lets you train the gesture you want. There are a few problems. The sensor covers a small area, so it is hard to reliably produce the gesture. Putting an obvious mark on the box is a dead giveaway, so [Stephen] put a Celtic knotwork pattern on the box and uses part of it as a reference.

The other problem is that if you run out of battery, the box is locked forever. Well, at least until you apply mechanical force and break the box open. Wireless charging would be an option, but we might favor a small jack that would allow you to plug in an external battery.

This is a clever use of the sensor. However, we might have preferred a mechanical solution that didn’t require batteries. Or, perhaps, you could use a few normally open and normally closed reed switches to make a kind of magnetic combination lock. It would still need a battery, but it wouldn’t draw current until you connected the switches. Both methods also have drawbacks, of course. Like most things, you just get to pick the drawbacks you can live with.

You can see a video of the magnetic imaging tile from [Peter] below. We really want a setup like this for our secret door. We also wonder whether switchable magnets could provide a battery-free solution.

35 thoughts on “Magnetic Lock Opens By Magic”

  1. I rember in the mid 70’s padlocks that opened using a magnetic key, it was the coolest thing to have in school. But it you lost the key…. Bolt cutters

    1. … been solved by NOT including the battery inside the lock. You carry the battery with the key, connect to inconspicuous looking pogo pins, etc.

      1. I don’t think batteries were involved in the old locks he’s describing, just a changing pattern of north and south poles embedded in a metal chunk that was the “key” which pulled the pins in the correct way against springs. Fairly difficult to bump or pick if they are made properly, but I’m sure a certain lawyer has found a way anyway.

        1. It probably involves a thin piece of wire slid in the gap near the shackle. You just give it a twist and pull and the whole thing flies apart. Avoiding the actual unlocking mechanism seems to be easiest way to unlock every lock. He’s a very impressive lawyer, and his debate skills never even come up!

  2. At my workplace we built an order of cabinets that used an RFID reader lock mechanism inside that would read an access card or smartphone from outside. Neat idea but that whole issue about when batteries run dead was 100% applicable lol

  3. The power issue is easily solved by the use of a reed switch to turn the thing on in the first place (assuming a mechanically activated lock)

  4. I’d like to see someone make it box of these, to put an object in and get a 3D render of it.
    It’s nice to be able to slow things down and it beats sticking an inductor to a 3d print head. I wonder what the practical limits of resolution might be, no doubt determined by the amount of data that needs to be dealt with.
    At least viewing film doesn’t have that limitation.
    We need something akin to an addressable LED but as a hall sensor, in a tiled array. I’m guessing LED microsurgery isn’t feasible at scale.
    Perhaps one day AI would be accurate enough to convert the data into a physics simulation of the materials.

      1. Yes, the linked page describes MRI machine and goes into fairly good details while at it.

        The Hall Sensor Board was created as an experiment forked off the ‘official’ MRI machines (which usually cost quite a bundle). The author was literally looking to create affordable budget MRI wand anyone can carry in their pocket, so to speak, and the locked box using the mentioned Sensor Board was finding a use for the board that was not up to specs, but still good enough for other uses.

        MRI tomography is one fascinating topic with many forks.

  5. Batteries are not an issue if you can access a battery compartment… Does expose you to a few kinds of attacks, and a grumpy person could rip the wires out leaving it locked forever..

      1. Not sure how will an array of magnetic sensors would work near an induction charging circuit. Wouldn’t the rapidly changing magnetic field scramble it?

  6. subscriptionwalled, so I can’t view the article, but how is this different from the pattern lock on my phone? (Except that my phone requires only my finger, not a magnetic stylus.)

    1. Spectrum isn’t walled that I know of. It does throw up a box after a minute or so trying to entice you to sign up for a free account, but if you dismiss the box, the article you are reading is still there and then it doesn’t do that again for awhile.

    1. No, the original solution was arranging the reed switches around AND including two that operate in reverse, ie, disengage the circuit.

      There were advanced designs, too, the implied one is the simple kind a 5th grader can build and operate in one weekend. Second iteration included latchup/bistable relay that would disengage the lock – needing a separate restore key to return it to the operating mode.

      Actually, it is even simpler than that, carry two keys. Only when both are present the door can be unlocked. I believe this is nothing new either, three-key mechanical locks existed ever since.

      Something like that.

  7. I remember seeing this in some kind of 1970s DYI magazine. The design was reed switches and magnets in a key, and there was another variant that would latch itself up against strong magnet applied to the entire surface. It was recommended that the reed switches are to be wrapped in some kind of sound-damping material, so it wouldn’t be obvious where they were located by listening (though, of course, stethoscope exists for such tasks – so one probably would do better with quiet Hall sensors instead).

    I’ve also seen somewhat similar solutions, no, no magnets, two buttons hidden in unexpected/counter-intuiitive places to complete the circuit. Yes, car antitheft.

  8. Re the RFID secured locks running out of power- wireless power maybe, but then the ‘key’ becomes a bit of a lump.
    And article provoked a nice rabbit hole on NC reed switches. I had assumed they were always NO.

  9. The magnetic tile is quite interesting, and I wasn’t aware it was a thing. The article about the lockbox feels a bit weird to me, like half a project, as there is no code other than the vibe coded libraries, and no further video or pictures of the box.

    You can definitely do gesture recognition, use an accelerometer to encode a list of ‘which side is up’, or you can make a box which you an open by knocking. Many of these are done in some way or another in actual products, but it always felt gimmicky and not really in the spirit of building a proper lock. An example of the above, Sargent & Greenleaf made a safe lock where the keypad transmits the input sequence by tapping a solenoid against the steel door, this is picked up by the lock inside the safe, decodes it, and unlocks the safe. The dial is removable, so no chance of someone stumbling upon the combination. The name for the lock eludes me at the moment, and the internet has forgotten it as well.

  10. Just use an eeprom or nvram with a sufficiently long life, or even an sd card for storing the lock pattern? Obviously read protect. Then again a lock is only a deterrent, one that can be defeated given sufficient time. And I frankly doubt anyone is going to engineer a secure way to mount this on a bank vault any time soon, brute force on the mechanism or hinges will almost certainly suffice.

Leave a 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.