3D Printed Magnetic Switches Promise Truly Custom Keyboards

While most people are happy to type away at whatever keyboard their machine came with, for the keyboard enthusiast, there’s no stone to be left unturned in the quest for the perfect key switch mechanism. Enter [Riskable], with an innovative design for a 3D printed mechanism that delivers near-infinite adjustment without the use of springs or metallic contacts.

The switching itself is performed by a Hall effect sensor, the specifics of which are detailed in a second repository. The primary project simply represents the printed components and magnets which make up the switch mechanism. Each switch uses three 4 x 2 mm magnets, a static one mounted on the switch housing and two on the switch’s moving slider. One is mounted below the static magnet oriented to attract it, while the other is above and repels it.

With this arrangement the lower magnet provides the required tactility, while the upper one’s repulsive force replaces the spring used in a traditional mechanism. [Riskable] calls it the magnetic separation contactless key switch, but we think “revolutionary” has a nicer ring to it.

The part which makes this extra-special is that it’s a fully parametric OpenSCAD model in which the separation of the magnets is customisable, so the builder has full control of both the tactility and return force of the keys. There’s a video review we’ve posted below that demonstrates this with a test keypad showing a range of tactility settings.

We have a resident keyboard expert here at Hackaday in the shape of our colleague [Kristina Panos], whose Keebin’ With Kristina series has introduced us to all that is interesting in the world of textual input. She plans on taking a keyboard made of these clever switches on a test drive, once she’s extruded the prerequisite number of little fiddly bits.

Thanks [Daren Schwenke] for the tip.

53 thoughts on “3D Printed Magnetic Switches Promise Truly Custom Keyboards

  1. Looking at the Hall switches: OH49E Series …
    The output voltage is set by the supply voltage and varies in proportion to the strength of the magnetic field.

    So maybe you could do away with the traditional caps shift, and as an enhancement IF YOU TYPE HARDER YOU GET CAPS!

    Ideal for trolls and the like…

    1. Hall effect sensors are regularly used for musical keyboards because they offer fine measurements of velocity and position, there are all sorts or fun things you could do.

      You could even use them to add more control to WASD keys for gaming, so that you can move at different speeds.

        1. I was thinking more press the key lightly to move slowly, as if you weren’t pressing an analogue stick the full distance, but that would work too.

          Btw, you don’t necessarily need a whole hall sensor chip per key if you have a PCB with an inductive coil sensor under each key.

          1. that’s data that’s just not supported through the keyboard event datastream but having that actually mapped as a co-chip joystick device would be interesting….

      1. or all of the possible data involved in a keystroke could be
        incorporated in a text to speach algorythim ,giving a voice
        to internet trolls and other more gentle denizens alike.

      2. They’re not very common in musical keyboards. What’s common is membrane contacts with multiple contacts at different heights and the timing it takes for both to touch is measured and a velocity is derived. Hall sensors would make a keybed cost substantially more expensive and would only be marginally beneficial for most players.

        1. I work at a company that makes electronics for music instruments (specifically organs)

          And yes, hall effect sensors make the keyboards more expensive but they are fairly common for professional electronic systems and high-end instruments, especially in those where the switch position as well as velocity makes a difference.

          The alternative once you hit that level is actually silver switch contacts, not membrane.

          1. Roland, Korg, Nord, Yamaha, Fatar use membranes and they make up the bulk of the pro keyboard market. None of them have ever used optical or electromagnetic technologies. Roland went to membrane in the 80s and many of those still work fine. Roland made organs as long as anyone (as Rodgers- til the organ market literally all died off), and they were all membrane. Yamaha had leaf springs until the 90s, same w Fatar and Korg. The small organ segment might use them, zero top acts use Allen, Rodgers, Lowry or Viscount though. They use the above mentioned pro brands.

    2. Did you know that the venerable Apple III did something like that in about 1980? The cursor movement keys were two-step, and would make the cursor move faster (faster auto-repeat) if you pressed harder. In fact, the first step was just to move the key down (no click) then the second step was to press a bit harder once it had bottomed out (and feel a click).

      Features like that in old machines were one of the things that got my collection started!

      1. Very cool to know. As usual, it seems there are lots of ideas initially, that will then be dropped again to simplify as product become more mainstream.

        It would be quite useful, still, today.

    3. Interesting idea, but I don’t think it’s practical for anyone but hunt and peckers. I’m skeptical that you could control the force like that when touch typing. But maybe. While I have doubts, I cant say I’m certain enough that it won’t work that it’s not worth testing the idea.

      1. If pianists can control the force of each finger independently when playing with their eyes closed, I think there’s a good chance that you’d be able to control the overall force of your strokes when typing. (disclaimer: I’m a decent pianist, but I’m somewhere between a hunt and pecker and a touch typist)

  2. Cool concept.

    However… I wonder what happens if I ever drop a paperclip in the keyboard (on purpose or by accident), if I’m able to get it out again but holding the keyboard upside down.
    For future safety reasons I think I need to switch to non-magnetic/non-magnetizable paperclips (and staples, rings, screws, springs, iron filings (which could be a problem)). Fortunately, I don’t have a compass close to my keyboard, so that will be fine.

    1. Oh I drop magnetic things on to my (Void Switch) keyboard all the time! The keyboard is actually super handy in that it’ll immediately take hold of whatever is dropped right where you dropped it 👍. Never have to worry about screws rolling on to the floor then under the desk to be lost forever… They’ll end up right there at the edge of the keyboard for easy grabbing 😁

      Paperclips, bits of wire, screws, etc all end up getting caught and easily removed 👍

      1. Weird answer. There is a whole range of tactility and manufacturing cost between these keys and a touchscreen. And you all throw them on the same pile. It’s the talk of war mongerers. “You’re either for us or against everyone else”. Please do that on Facebook or Twitter, but not here.

        1. Actually this is Hackaday. His talk of environmentally friendliness is really weird here. It’s a one off hack, I could see if the maker was ramping up production on a product, but to start taking of environmental impact right now? Not the time or place.

        2. Well… that escalated quickly…

          “If you don’t like magnets in homemade keyswitches, just use a touchscreen…”

          “WAR MONGER!”

          I can already envision the new Andy Antunes video on Youtube. May I suggest E minor?

    1. No, actually this is *way* more environmentally friendly than a normal keyboard. With a normal keyboard what do you do when a switch stops working (or even just becomes a bit finicky)? *You throw out the entire keyboard* and buy a new one.

      With a Void Switch keyboard if a switch gives you trouble you *just print a new one* at a cost around $0.01. You can pull the magnets out of the old switch and put them in the new one. The whole process takes about a minute.

      Also if you want people to be printing their own switches, springs are a bad idea. In order for end users to be able to pick their strength, travel, and whatnot you’ll need them to stock a *huge* amount of springs. Springs that are only useful for one very, very specific purpose. Whereas with 4x2mm magnets they’ll have something that’s generally useful for all sorts of things.

      1. Thats because a modern keyboard is priced to break at maybe $5.
        Would you spend $50 on one which lasts you 30 years ?
        Welcome to the problem the planet has.

        And withe VoidSwitch, you have to own a 3d printer.
        Or know somewhere that can print it. And once they add in profit, that switch is costing $5, same as a new mechanical keyboard.

        I like your argument, but it doesn’t work in the commercial world as scarcity isn’t a thing yet. Nor is the cost of recycling.

        1. > Thats because a modern keyboard is priced to break at maybe $5.
          Would you spend $50 on one which lasts you 30 years ?

          Actually, I’ve spent $100 on a mechanical keyboard that lasted me a little over two years before two of the (supposedly made for millions of keypresses) switches started failing. Literally millions of people are spending approximately $100-200 on “gaming” mechanical keyboards. Only the contactless ones (like my Void Switch) will last a long time (>3-5 years) but only my Void Switch keyboards can actually last *forever* (30 years? Pfft! Try 100!).

          Also, you’re vastly overestimating the cost of these switches as well as how hard it is for every day people to get ahold of a 3D printer or just a friend that has one. The switch is about $0.01 worth of filament. If you include the case and the keycaps a fully 3D printed keyboard is under $5 of filament.

          For $200-300 you can get a 3D printer that is plenty capable enough to print all these things (and many *other* things). So for the price of two gaming keyboards you can have a 3D printer and print as many keyboards/switches as you want for basically nothing.

          My ultimate plan though is to setup a marketplace of sorts where people can hire 3D printerers and keyboard assemblers to get their perfect keyboard made just for them… At a fraction of the cost of a “midrange” mechanical keyboard.

          1. ive spent about $157 on my keyboard. its hot swapable so if a switch dies i can replace it very easily. (without even taking it apart and busting out a soldering iron.) note: 157 was the cost of the more expensive components and not any labor, it took me about 3 hours to build it and mod it, at $15 an hour for 3 hours that would be $45 dollars, so if i were to buy it it would probably cost just over $200 for a nice feeling looking and sounding keyboard that works great.

            the cheapest mechanical keyboard i’ve found is about $20 on some sketchy looking wholesale website.

      2. This is not really a valid point because even the cheap keyboards available today are REALLY reliable. Yes, I’m talking about the rubber membrane stuff. I’m typing this on a 15-year old keyboard, which has about half of its key labels polished away from typing. The “switches” still work perfectly.

        Perhaps the mechanical keyboards have more difficulty in this area, but you were referring to a normal keyboard :)

        1. I usually have the backlight LED’s die before the mechanical switches in my keyboards. The old IBM model M’s, built in the 1980’s, are still being used by some people to this day. So the mechanicals seem fine in this area.

  3. Duplicate article of https://hackaday.com/2021/08/02/mag-lev-switches-are-the-future-of-clacking/ ?

    Pretty cool mechanism, I like the idea of using magnetic springs, and using them laterally to act as a buckled spring is even better.

    Can anyone comment on the longevity of the mechanism in comparison to springs?
    Will the magnets loose their power over time/repetitions of having their fields challenged?

    Ingress of little bits of metal could be an issue (certainly on my desk) but it could be made to be inherently waterproof which is a nice thought.

    1. It’s actually not a duplicate article because this one is all about the fact *that you can now print your own*. I posted the switch source files to a public (Github) repo which is the very first link in the article. Though it isn’t immediately obvious that this is the case if you’re not clicking the links so I understand the confusion.

    2. > Can anyone comment on the longevity of the mechanism in comparison to springs?

      Whether you’re using springs or magnets it’ll be the plastic that wears out first. Though I suppose that the springs could corrode/rust a lot faster if they’re not coated (in regular switches they usually are though).

      In any case I have a guarantee: If you print Void Switches in PETG they will last *at least* a zillion cycles. I was going to guarantee a jillion but the lawyers talked me down.

      > Will the magnets loose their power over time/repetitions of having their fields challenged?

      Rare earth (neodymium) magnets don’t lose their strength over time (well, within a few human lifespans anyway haha). So that won’t be an issue.

      > Ingress of little bits of metal could be an issue (certainly on my desk) but it could be made to be inherently waterproof which is a nice thought.

      I already thought of that! Any little magnetic particles/bits that end up stuck to the switch won’t interfere with its movements; they’ll get stuck to the top of the switch body (off in the corner) or to the underside of the stem (underneath the switch). Either way the switches are trivial to clean since they’re contactless and you can take the entire top of the keyboard off for cleaning (https://gfycat.com/unconsciousvigilantkinglet) or have a close look at the underside of each switch to see if anything’s stuck there (you’d notice when typing pretty quickly, haha): https://gfycat.com/costlyglaringhyracotherium

      1. ah i guess in their quiescent state there isn’t much magnetic force on them, I’ve only really encountered magnetic springs when there has been some continual loading on them pushing opposing poles together.

        Those gifs should be in the article! that’s fantastic… might have to print some bits and have a play!

        the only deterrent for people crating their own is the part count (105*4 printed parts + 105*3 magnets for a full size keyboard), but that’s always the case with keyboards.

        Think I’ll be making a macro keeb for starters / testing.

        @riskable, Cheers muchly for making your design files available for others to play with!

    3. Perhaps it could be made more clear in the article, but this post is talking about the first complete and public release of the files necessary to print your own switches. Back when that original post was written, it was still in development.

    1. I already thought of that! With a standard 4mm-of-travel switch the “levitator” (magnet repelling the magnet in the body) should be far enough away from the body and stem magnets at rest (keyup) that it won’t have a (non-trivial) impact on the longetivity of the magnets.

      The magnetic force being exerted on the body magnet from the levitator magnet at rest is so small as to be mostly irrelevant. The only time the levitator comes into play is on keydown when it gets close to the body magnet (and “softens the blow”/smooths the force curve, as it were). Considering that it’s down at that level for just milliseconds with each keystroke I don’t think it’s realistically ever going to be an issue for anyone.

      The levitator isn’t even that important: It’s primary function is to aid returning the switch to its original position and to do that it doesn’t need much strength. It has a *secondary* function of softening the force when you bottom out the switch but that’s not why I added it to the switch design… Some keycaps can be very heavy and some 3D printing materials have strong-enough stiction (e.g. resin) that the switch could get stuck down without it (the levitator).

      I’d also like to mention that if you make yourself Void Switches with slightly less travel (3.5mm or less) you won’t need the levitator at all. There’s plenty of strength in neodymium magnets to return the switch to the keyup position with such shorter travel distances. You can still soften the feel of bottoming out with silicone o-rings or similar (e.g. thin printed TPU parts).

      I’ve got a low-profile version of my Void Switch that has only 2mm of travel and uses 4x1mm magnets… I’m not using the levitator in those because it’s unnecessary.

  4. I wonder if 6mm diameter x 3mm height magnets could be realistically used for that. From my preliminary test messing with the parameters on OpenSCAD it looks like some parts would need some rework to make that happen.

  5. Will you be making your own keycaps?
    Also, how hard would this be made using a UV resin 3D printer?
    I don’t have anytype of 3D printer but I am seriously looking at a UV resin printer because I have another project I want to do that would be eadier to do using UV resin instead of a filament printer.
    The UV printer could also be as small as the largest thing I want to print as with both types the cost increases with the increase to the building area.
    I would just have to make multiple runs to fit whatever I want.
    I realize that I am preaching to the choir here but I felt I needed to explain myself before everyone started to tell me to buy a filament printer which I don’t want to do.
    I can also use UV resin to make keycaps using molds designed to two part acrylic if I wish.

  6. What microcontroller or other ICs would you use with these keys? I know with digital keys you can cheat and use a resistor grid to get multiple keys on the same pin, but I’d imagine you’d need a dedicated pin for each key if the input is analog, and for a 105-key board, that’s a lot more pins than an Arduino or a Pico can support.

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.