DIY Space Mouse For Fusion 360 Using Magnets
DIY Space Mouse For Fusion 360 Using Magnets
by salimbenbouz
This project originated from my curiosity about CAD input devices. I realized that I was struggling to remember
navigation combos in Fusion 360 whenever I switched workstations. Having never used a Space mouse before, I decided
to explore the possibility of creating a similar device using only the parts I already had on hand.
To make the 3-axis joystick, I used a low-resolution magnetometer and neodymium magnets mounted on a spring
system directly inspired form the real 3D connexion Space Mouse. Currently, the device emulates the mouse and
keyboard to execute the orbit and pan functions within Fusion 360. There are also two shortcut buttons — one for the
home view and another for tting to the screen.
To address the lack of a native option to assign a keyboard shortcut for views in Fusion 360, we will go over a
workaround that involves a custom python add-in.
Supplies:
Parts
1 × QT Py RP2040 Adafruit
1 × TLV493D Triple-Axis Magnetometer Adafruit
1 × STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long Adafruit
2 × Tactile Button switch (6mm) Adafruit
3 × Adafruit LED Sequins - Emerald Green (optional) Adafruit
4 × Rubber Bumper Feet Adafruit
Hardware
Round Magnets Amazon
6 × (6 × 2mm)
Springs Amazon
3 × Compression 23/64" × 1-3/8"
3 × Extension 13/64" × 13/16"
M2.5 Heat-Set Inserts McMasterCarr
24 × 3.4 mm
M2.5 Socket Head Screws Amazon
10 × 3mm
3 × 5mm
7 × 8mm
4 × 12mm
3D printing
Finishing (optional)
Assorted Grits Sandpaper Amazon
Glazing and Spot Putty Amazon
Filler Primer Amazon
Spray Paint Amazon
Flat Matte Clear Coat Amazon
Tools
3D Printer Amazon
Soldering Station/Iron. Amazon
Helping hands Amazon
Precision Screwdriver Set Amazon
Wire stripper Amazon
Sanding block
Flux, Solder
Hook up wire
Flush cutters
Hobby knife
Tweezers and pliers
A liate links may be included in the parts list. I may receive a small commission at no additional cost to you.
https://youtu.be/iHBgNGnTiK4
The video will give you an overview of the design and build process.
https://youtu.be/iHBgNGnTiK4
Step 2: 3D Printing
You can grab the included STLs in the page or from Github
️⚠ Few things to keep in mind before printing
I have designed the holes and t of the pieces to accommodate tolerances from my 3D printing setup.
You might want to verify the heated inserts holes and the t, particularly between the Base_top.stl and
the Base_bottom.stl before proceeding.
For the Base_bottom.stl, I printed it using a 5% grid in ll with 3-4 wall counts. Around layer 64, I paused
the print to pack in the steel BB's and add some weight. This step is essential to counteract the tension
from the springs prevent the the device from sliding around.
View in 3D Download
https://www.instructables.com/F1J/FXGT/LJEASBWK/F1JFXGTLJEASBWK.stl
View in 3D Download
https://www.instructables.com/FKB/GZCS/LJCVD5XJ/FKBGZCSLJCVD5XJ.stl
View in 3D Download
https://www.instructables.com/FKA/31VR/LJCVD5XK/FKA31VRLJCVD5XK.stl
View in 3D Download
https://www.instructables.com/FMT/QSHX/LJCVD5XL/FMTQSHXLJCVD5XL.stl
View in 3D Download
https://www.instructables.com/FTN/7C09/LJCVD5XN/FTN7C09LJCVD5XN.stl
View in 3D Download
https://www.instructables.com/F0V/NSEB/LJCVD5XO/F0VNSEBLJCVD5XO.stl
View in 3D Download
https://www.instructables.com/F32/PBBO/LJCVD5XP/F32PBBOLJCVD5XP.stl
If you are not familiar with post-processing techniques for FDM prints, I have some instructions in this project to guide
you.
Once the clear coat has had ample time to dry, I proceeded to install the heated inserts into the designated 24 holes.
Although it may seem excessive for most cases, I prefer incorporating them into my 3D prints. I would rather do this then
deal with stripped threads after few adjustments.
DIY Space Mouse for Fusion 360 Using Magnets: Page 8
DIY Space Mouse for Fusion 360 Using Magnets: Page 9
Step 5: Assembly _1
Following that, I proceeded to install six mini round magnets (6x2mm) into the designated slot on Stem_top.stl.
Please note that depending on the tolerances of your 3D printer and the magnet manufacturer, you may need to apply
some glue to secure them in place. In my case, I was able friction t them.
Now, we can assemble the spring mechanism and attach it to the knob from the inside.
I did not plan on this initially. However, it seemed to be a great opportunity to incorporate some LEDs for added visual
interest.
I soldered wires to both switches and carefully measured the length of the shared wire (ground) that needs to t into the
channel around the opening in the middle. Then, I placed the two printed buttons with the thicker part facing up into the
slots, followed by the switch it self. Once that was completed, I positioned the Base_middle_plate.stl and guided the
remaining 5 wires (3 from the buttons and 2 from the leds) through the opening from inside. Finally, I secured plate using
four 4 x 3mm M2.5 screws.
️⚠ Check the wiring diagram
Step 9: Wiring _3
The assembly was nalized by positioning the Base_bottom.stl and securely attaching it to the stem using 3 x 8mm
M2.5 screws then to the rest of the body using 4 x 12mm M2.5 screws.
To enhance stability, I a xed 4 rubber feet to the bottom.
Now, we can proceed to upload the code and conduct a test run of the device.
First thing is to get the Adafruit QT Py RP2040 working in the Arduino IDE. You can follow this guide if you never done
this before.
Once the board is working properly you can open the Arduino sketch located here and install the required libraries in
your environment.
#include <TinyUSB_Mouse_and_Keyboard.h>
#include <OneButton.h>
#include <Tlv493d.h>
#include <SimpleKalmanFilter.h>
In order for the sketch to compile you will also need to change the USB stack to from Arduino to TinyUSB. You can read
more on how to do that here.
Once the board ashed successfully you can unplug, open the serial console and plug it back in.
By default the code prints out to the console x,y,z after initialization.
You can test the knob to see if it moves the mouse cursor and if it's in the right orientation. Incase it's reversed you can
invert the values in the code if you don't want to open it and ip the sensor.
Depending on how centred the knob in your build and how the everything ts together, you might need to adjust the
magRange and sensitivity values. You can move the knob to the extremities take a look at the x and y values printed on
serial console and adjust the ceiling value for magRange.
The "dead zone" or center position is represented by xyThreshold you can adjust this for tighter tolerances to your
preference.
The shortcut buttons are sent from these 2 functions. You can de ne new combos if you like using this reference.
// go to home view in Fusion 360 by pressing (CMD + SHIFT + H) shortcut assigned to the custom Add-in command
void goHome()
{
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press(KEY_LEFT_SHIFT);
Keyboard.write('h');
delay(10);
Keyboard.releaseAll();
Serial.println("pressed home");
}
Serial.println("pressed fit");
}
I have a lot of ideas and I plan on making more projects like these Follow me for more
-7.94,113.39,-65.07
113.88,-65.07,192.28
-64.39,192.28,-16.46
191.69,-16.46,-137.40
-15.97,-137.40,-8.43
-137.30,-8.43,113.39
-7.94,113.39,-65.07
113.88,-65.07,192.28
-64.39,192.28,-16.46
191.69,-16.46,-137.40
-15.97,-137.40,-8.43
-137.30,-8.43,113.39
-7.94,113.39,-65.07
113.88,-65.07,192.28
Try with this simple test https://codefile.io/f/sJ0u8AG7ba or one of the examples included with the
library.
If you are not using a STEMA QT connector on the RP2040 from Adafruit you can use the
regular I2C bus and not the secondary Wire1*
Very nice build, i love the heat threaded inserts, that made it so much easier to disassemble and
reassamble. I slightly modified some parts, I wanted the wires to go through the middle post, like
seen in the pictures. I used a Waveshare RP2040 and I also added some adressable LED´s
(ws2812) with an effect on the calibartion sequenz to see when it has finished and built in menu
to select different animations and colours. Thank you for the interessting, fun and usefull project.
:)
Also special thanks to "alvaropc2011" from the comments here for the diagram on how to wire
the RP2040. :)
hi ,
I used adafruit RP2040 & TLV493D Triple-Axis Magnetometer Adafruit . But I still not able to
compile the code with library and any advice
I´ve sent you a message :)
Very cool! Nice suggestion for the wire routing. it turned out really nice
Fantastic project!
thanks!
Wow awesome job. Cant wait to build it myself. Found the springs instead for 50€ for 11€
I use a service to localize amazon links for all countries but sometimes it suggests some horrible
alternatives. Glad you found a reasonably priced kit!
having trouble location a TLV493D at a reasonable price, would one of the other Magnetometers
from Adafruit work?
Small suggestion or not sure what you mean. The brass inserts i am guessing are meant to be
4mm diam as the holes are around 3.7. I bought 3.5 outside diameter but they just fell in. I am
guessing your 3.5 measurement is the length? Thank you
Hi, yes it is M2.5 and the 3.4 is the length, the diameter is around 4.3 I think. Here is the exact
reference for the ones I had https://www.mcmaster.com/94180A321/
SPECTACULAR!!
I ordered all the material, I had difficulty in finding the component "TLV493D Triple-Axis
Magnetometer", seems to have disappeared from the Earth, thanks to Mouser.it I ordered it.
I love this.. and everyone that sees it wants me to make them one... but I'm gonna keep it to
myself.. lol... I'm doing final post-processing and its looking great.. will post a photo when done.
One thing that concerns me is that no matter how hard I try - I cannot get the springs to line up
properly so that the center of the magnets are in the center of the hole that the sensor monitors
though. It doesn't seem to matter too much except it the model tends to catch the knob part
occasionally - can you give any tips?
Yes, I noticed that it catches sometimes, rarely but it still happens. In the next one I might open
the base little more or change that angle to prevent it from happening ... maybe with stiffer
springs it would be better?
DIY Space Mouse for Fusion 360 Using Magnets: Page 34
Thank you for this project.
I can't find M2.5 Heat-Set Inserts 3.4 mm, only M2.5 3.5.
I've found M2.5x4x3.5: https://amzn.to/3D6MgMX
Can I use them?
Thank you
It should be fine. I left enough clearance in the holes everywhere. Just make sure the diameter
will work, here is the exact ones I used https://www.mcmaster.com/94180A321/
Thank you very much
Good morning,
wonderful project that I will realize. Can you replace the LEDs with neopixel Ada4776? without
touching the code too much
https://www.adafruit.com/product/4776?
THANK YOU
Thanks. You can do that and it's not hard to change. The wiring is different for Neopixels and
you'll have to add the code to handle them. Right now the Leds are just on the 3v and they turn
on when you plug in the device.
Great work. I finished building the mouse, but I had problems compiling the code. It wasn't clear
that you need two additional libraries, see hear
https://learn.adafruit.com/mouse-and-keyboard-cont....
Now it compiles but the board isn't recognized by windows, maybe the cabe, sadly I haven't a
good cable on hand to test further.
edited:
I figured out what I did wrong. Hadn't put the qt py rp2040 board into boot mode. Accomplished
by holding the boot-button while pushing the reset-button.
It works now, but I have to test it out more.
Waouh, what an impressive project. I like so much to work with the spacemouse but since i quit
my job, it's missing me so much.
Do you have a link for the breadboard you're using, please? And is there any particular tool too ?
Thank you so much. You're a genius
Thank you. I don't have a link for that exact breadboard but I have some of the tools I use linked
in the description of the video.
Amazing project
Thank you
Thanks!
Hi, love the build, can’t wait to build it and try it out. Any reason you went for 6x2 magnets vs
6x3. I have those in storage. Thanks
Link to heated inserts in supplies is not working, could you please provide its dimension like
thread*length*diametre ?
I fixed the link to Amazon. Thanks for letting me know. Here another link to McMasterCarr with
the exact dimensions.
Very nice build.
I personally don’t think I would attempt this, but kudos to you taking this on.