Space Mouse With Arduino Micro *UPDATE*

30,762

246

150

Introduction: Space Mouse With Arduino Micro *UPDATE*

Hello Makers!

I love 3D cad design and one of the most common panel I use while designing is...View.

I often need to spin the object around, zoom in and out, slice it and so on.

There are amazing professional 3D mice you can buy, but they are not cheap. They usually cost from £150 up.

So...I built my own one! With a couple of extra features because....why not.

The Space Mouse has a joystic with push button integrated and 3 independent customizable buttons.

The functions I use in my setup are:

  • Joystic = rotate view (free orbit)
  • Quick joystic press = home view
  • Press and move = zoom
  • Button 1 = slice view
  • Button 2 = show/hide constraints
  • Button 3 = delete

Supplies

Step 1: The Design and Parts

The design is pretty simple: the base holds all the components and the lid closes them in.

This helps when you have to put the components together and makes the parts easy to print.

The objects to print are: base, lid, buttons holder and 3 buttons extensions. I decided to extend normal pbc push buttons instead of using panel mount units to keep the design compact and as low cost as possible.

The total cost of this project is £15-20 which is pretty good compared to £160 you have to pay for a proper space mouse.

I also included a file to print 4 small washers to hold the joystick module to the base.

I used 0.12 mm layer resolution for all parts except the top which is 0.06 to get a smooth finish straight out of the printer.

I would suggest to use 40 mm/s max, this will make the printing process slower but more accurate.

Step 2: Simplified Version Without Buttons

If you don't have buttons (or you just don't want them) you can use this semplified version.

Step 3: Assembly

The first step is to put the Arduino in.

The base has the Arduino footprint already in place. Just push 4 or more headers (they should come with the board) into the print and place the board on top. Be quick when you solder the pins on the Arduino board, if you keep the soldering iron on the header too long you will start melting the 3D printed base.

After this, we have to connect the buttons and the joystic module.

Using a small gauge wire connect the three buttons in series for the common line (GND), and three single wires for the signals (in my case they are digital pins 7,8 and 9). I used the internal pullup function of Arduino to avoid resistors.

The button plate part has small holes to guide you while positioning the buttons. Use the soldering iron to heat up the pins a bit to help them take their place into the print.

When the buttons are ready, place the button module on the base using two 1.5 mm screws.

Now connect the joystic module (VCC to VCC, GND to GND, X to A0, Y to A1, Switch to digital pin 10) and connect it to the base using 1.5 mm screws and the small washers if you need them.

I designed the joystick mounting points with many holes in order to be used with different joystick module brands. They are all very similar but the dimension might vary slightly.

Next use the soldering iron to gently push the threaded inserts into the top holes of the base. Be gentle and use a knife or a tool to hold the inserts down while pulling back the soldering iron.

Finally place the lit on top and bolt it on with four M2.5 x 6 mm bolts.

I also painted it black with metal finish effect.

Step 4: Test and Use

Finally the Space Mouse is complete!

I tested it in Autodesk Fusion 360 and Autodesk Inventor. It works perfectly, sensitivity is good, not too fast or too slow. The response is immediate and precise.

Pros: It doesn't require specific drivers, cable or equipment. It can be easily configured to work with any software uploading the right sketch. And it is cheap.

Cons: It is a bit light; I will add some lead inside as soon as possible to prevent it from moving on the table. I am currently working on a software to switch from mouse to space mouse automatically to prevent conflict in movements.

I uploaded an Arduino sketch configured for Inventor and my pref. settings. You can change the buttons or function according to your software hotkeys.

You can also find a federence of keyboard declaration here:

https://www.arduino.cc/reference/en/language/funct...

If the main mouse is annoying you too much, try this free software:

https://www.mousemux.com/

It creates a second mouse (in switched mode) so you can use both mouse and space mouse independently.

If you like this project, check out the extended Creative Console!

https://www.instructables.com/Creative-Console-for...

Hope you enjoy the project!

3D Printed Contest

Participated in the
3D Printed Contest

11 People Made This Project!

Recommendations

  • Water Speed Challenge

    Water Speed Challenge
  • Pets Challenge

    Pets Challenge
  • Stone, Concrete, Cement Challenge

    Stone, Concrete, Cement Challenge

150 Comments

0
Icelandian
Icelandian

Question 3 months ago

Hi StefanoS48, I'd like to make your project, but a modified handheld version. I'm sure its possible, but in your opinion how hard would that be to add battery power and make it wireless?
Thanks

0
StefanoS48
StefanoS48

Answer 2 months ago

Hello! Sorry for the late reply! Everything is possible, you need to add a nRF module (for example) and send your readings to a second arduino. If you have a bit of experience with RF systems is actually pretty simple! Give it a go!

0
mrmath
mrmath

Reply 21 days ago

I'm going out on a limb here because I'm not sure all of this is 100% correct. But here you go. Swap out the Micro for an Adafruit Feather 32u4 Bluetooth LE unit. They are a lot more expensive--$30--but you get Bluetooth LE built in, that should allow you to use it as a keyboard and/or joystick along with built in battery charging circuitry. All you'll have to do is adapt the code to use a Bluetooth keyboard/joystick and you're done. The battery charging is built right in. You could even have a switch that lets you decide if you want to use it plugged in as a wired device or as a wired device because the 32u4 is the same chip that's on the Micro.

(I am not advertising for Adafruit here. I just know they have easy to use battery charging boards, and then I thought of this as well. You can do the same thing with an ESP32 board and a separate battery charging circuit, too.)

0
JurreS
JurreS

6 months ago

Great design, did you of anybody else manage to make this work for solidworks?

0
NCvejin
NCvejin

Reply 6 months ago

Yes, I did, I did another arduino program and everything works great. I can send you the code in the message

0
SvenA8
SvenA8

Reply 25 days ago

Hello, Would you like to send the code to me to? Thanks in advance!

0
JurreS
JurreS

Reply 6 months ago

Yes please, that would be very nice!

0
StefanoS48
StefanoS48

Reply 6 months ago

I don't personally use Solid Works, but it should work fine with any software. Just change the hotkeys

0
albertovitale
albertovitale

2 months ago on Step 4

ciao stefano,complimenti per il progetto lo sto stampando ora,mi domandavo puoi condividere i disegni in modo da poterli modificare per implementare dei led all'interno della base spero di non chiedere troppo.comunque sia ottimo lavoro,in futuro farai delle migliorie al progetto?

0
StefanoS48
StefanoS48

Reply 2 months ago

Ciao! Grazie per i complimenti! Purtroppo ho perso gli originali, devo controllare l'ultima versione che ho in Inventor. Per quanto riguarda le migliorie, cerca Creative Console for space mouse qui su instructables :)

0
salvatorepatti82
salvatorepatti82

2 months ago

Ciao Stefano e grazie per il tuo contributo io sono partito dal tuo progetto e ho personalizzato aggiungendo un encoder rotativo scrivendo un altro codice ho eliminato i pulsanti usando quelli dell'encoder e del joystick.Ti ringrazio per lo spunto che mi hai dato dopo condividerò i miei file su thingiverse per chi vuole implementare visto che ho usato le tue stesse misure del progetto iniziale .Spero che ti piace il mio video https://youtu.be/GciYhSreM1E

SPACE copertina.png
0
salvatorepatti82
salvatorepatti82

Reply 2 months ago

Ma sei Italiano ?Mi era venuto il dubbio !Ho visto la console e il progetto lo ritengo spettacolare vorrei fare anche quello in futuro integrando come te il mouse appena costruito.Ti ringrazio ancora per la condivisione di questa idea a nome di tutta la comunità.

1
Oliv12
Oliv12

4 months ago

Hello Stefano, thank you very much for this valuable project.
On my side I updated the software in order to better fit my personnal needs under Fusion 360.
My version of the software is available there: https://github.com/freeasabeer/SpaceMouse

With this software the Space Mouse has the following modes available:
  • normal: moves the mouse pointer as with a normal mouse
  • pan: Fusion 360 pan mode (moves by simulating holding the middle mouse button)
  • rotate: Fusion 360 rotate mode (rotates part by simulating holding SHIFT key + middle mouse button)
  • zoom: Fusion 360 zoom mode (zooms in/out by simulating rolling the middle mouse button)
The 3 space mouse buttons have the following functions:
  • button 1 (Left): simulates a left mouse button
  • button 2 (Middle): toggles between default, pan and rotate modes
  • button 3 (Right): simulates the ESC key
Joystick switch functions:
  • short press: simulates the F6 key (fits to zoom)
  • long press: activates the zoom mode.
    To zoom in: while keeping the joystick pressed, push the joystick.
    To zoom out: while keeping the joystick pressed, pull the joystick.
    When the joystick switch is released, the space mouse switches back to the previous mode that was active (normal, pan, rotate).
0
StefanoS48
StefanoS48

Reply 2 months ago

Great job!

0
buchertimo28
buchertimo28

Question 3 months ago on Introduction

How I must edit the code to use an Arduino Nano?

0
StefanoS48
StefanoS48

Answer 3 months ago

You can't use a nano as it doesn't have USB features.

0
tibalt.boni
tibalt.boni

Question 4 months ago

Hi man, good project.

i just tried to connect micro and joystick.
I open fusion 360 and solidworks, and the joystick just move my mouse, not the part. And left and right are invert.

Can you help me ?

Thank you

0
StefanoS48
StefanoS48

Answer 4 months ago

Hey, you can invert the mouse direction in the code (there is a comment for that) or swap the wires. You also need to set the right hotkey combination to make it work with Solid Works or any other software.