Close
0%
0%

MagMouse

Open source SpaceMouse with Bluetooth, RGB, and 3D Hall sensors

Similar projects worth following
The MagMouse is a DIY SpaceMouse that's 100% hand solderable, costs less than $20, and has as many features as I could stuff into it. It uses 3D Hall sensors and a Halbach magnet array instead of joysticks (which other DIY SpaceMice use) to make it small and fit all the electronics on a single PCB.

Features

  • Full 6DOF tracking (translation + rotation)
  • Compact
  • Bluetooth
  • Power efficient (hopefully)
  • 10 NeoPixels
  • 5 buttons
  • Total cost <$20
  • No wiring
  • Hand-solderable
  • You only need the board, a 3D printer, and some screws
  • Open source

Motivation

It all started when I saw this DIY SpaceMouse.

I then started making one before realizing how gigantic it was. There was a whole bunch of wiring, tons of empty space, and it wasn't nearly compact enough to be actually used comfortably. I began writing code for a 3-joystick version to hopefully make it smaller and while it did succeed in that, it still wasn't small enough to be comfortable. I was learning PCB design at the time and decided that would be the best approach for any future version I do end up making.

Fast forward a few years and I have quite a bit of PCB design experience. Recently I saw this new SpaceMouse design. It looked great, had some nice features, and was mostly 3D printed. I especially liked the 3D printed springs; no rubber bands, no joysticks, just a few grams of printable plastic. I wanted to make it, but I quickly realized it wasn't full 6DOF, and it could have been made cheaper and better with a PCB and "raw" components, instead of some relatively expensive modules.

I have decided to take matters into my own hands and make the DIY SpaceMouse of my dreams.

I want one!

I will be selling pre-soldered kits because it's cheaper for you to buy one that way vs buying the parts in small quantities from DigiKey, AliExpress, and your PCB house of choice plus shipping for all. Additionally, it allows me to recuperate at least a little bit of cost from designing & prototyping, although my main goal is just to learn and have a feature-filled cheap SpaceMouse. Shipped worldwide via USPS.

Current Status

2/5/26

Simulating. Will probably order prototype PCBs soon. Take the survey in the latest project log!

  • 4 × TMAG5273A1 DigiKey, 3D Hall Effect Sensor
  • 1 × NRF52840 "Super Mini / Pro Micro" AliExpress, Microcontroller Dev Board
  • 10 × WS2812E-2020 Optional [LED], AliExpress, 2020 RGB LED
  • 1 × PJ30072S6_R1_00301 Optional [LED], DigiKey, SOT23-6 Voltage Regulator
  • 1 × 74LVC1T45W6-7 Optional [LED], DIgiKey, SOT26 Level Shifter

View all 13 components

  • Good News, Bad News (and an important update)

    Benjamin G.02/05/2026 at 08:30 1 comment

    It's been an eventful month for this project... after getting off vacation I ran into a bunch of problems, but made a bunch of solutions.


    TLDR: The prototype design sucks, so I made a simulator, adjusted part choice and configuration, added AI (the good kind). Details later. Please take the 1-minute survey.

    The Bad News

    • The prototype PCBs got lost in the mail. So I couldn't actually test the design.
    • Wouldn't have mattered much anyway, that design had a LOT of flaws.
    • Turns out, the current idea of using a radial magnet only provides 5DOF reliably. We will need to use a Halbach array of magnets instead to get full 6DOF. (5 magnets)
    • The ideal size for magnets for this design is 7x7x7mm cubes, which is not commonly produced.
    • The current choice of sensor is actually really noisy.
    • This probably needs 4 sensors, not just 3.
    • The usual method for estimating position and rotation from the sensors is too slow to run on a microcontroller.

    The Good News

    • PCBWay has graciously offered to send some free PCBs for prototyping, no strings attached.
    • I was able to build a simulator for optimizing & validating sensor and magnet designs.
    • Previous version didn't work well in simulation, due to aforementioned single-magnet 5DOF issue. I have created a design which works very well in simulations. More accurate. In theory.
    • We can get a MUCH better sensor for around the same price (TMAG5273). This has much less noise, more sensitivity, and includes a built-in averaging function. There's an even better version (TMAG5170) but it's 3x as expensive. We'll see if that's needed when I make the prototype.
    • Custom sizes of magnets can be purchased from Alibaba. The Halbach array with custom magnets is actually cheaper than the 2 radial magnets... in bulk.
    • It's actually pretty easy to train a neural net to be about as accurate as the conventional solver, and it's faster. I'll make another log with more detail later.
    • PCBA services are extremely cost-effective... in bulk. While it still is possible to create a hand-solderable version, there are a few pretty small/difficult components. It's very likely the version you will buy will only have the SuperMini board hand-soldered on. Maybe the buttons too. The rest will be professionally assembled at the PCB factory.
    • I am going to try and design this to be 100% 3D printed, no screws. Should be possible.

    I will create another update soon with more details on the simulator and neural net. Short version is, it uses MagPyLib and PyTorch to train a 36k parameter neural net to solve for position and rotation given readings from 4 sensors. It uses LiteRT (Tensorflow Lite) to run this on the NRF52840. The current setup is accurate to about 0.4mm and 2 degrees on average, without denoising.

    Here's a preview of the simulation visualization (using the neural net):

    Important: Take the 1 Minute Survey

    As I mentioned previously, this is actually pretty affordable, in bulk. Magnets for each board are about $1, NRF52840 board for $3, and the PCBA services can be less than $10. So we're still on track for the <$20 goal.

    HOWEVER, it's only cheap if I can order a bunch of them at once. Of course, this isn't the case for the prototypes, but once the design is finalized I will want to know how many of them to buy. Especially the magnets, as apparently they have a very long lead time (probably due to Chinese holiday soon). If I end up with 400 extra magnets, that'll kinda suck for me. If demand is stronger than I thought and I run out, that'll suck for you. As a college student, pulling the trigger to buy $100 in oddly sized magnets is not something I can do recklessly, so take the survey!

    Also, apparently the Magmouse name is taken, by a mouse with a magnet at the bottom, go figure... suggest names in the survey.

    https://forms.gle/YADcYZhiaJF6HaDy9

    Thank you.

View project log

Enjoy this project?

Share

Discussions

Dirk wrote 02/10/2026 at 12:20 point

Sieht sehr vielversprechend aus, ich freue micht schon auf die Veröffenlichtung weiterer Daten um sie nachzubauen.

  Are you sure? yes | no

tyler wrote 01/25/2026 at 20:59 point

This is a sweet project. Thanks for sharing. I can't wait to for the boards to become available. If you are in need of beta testers I would love to help out

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates