Introduction: Mouse for People With Brain or Nervous Disability

About: General maker. Coordinator @ Makerspace De Nayer. CO-Founder & Chairman @ Fablab Klein-Brabant VZW Electronics teacher

Joystick that behaves as a mouse for people who experience tremor when using a regular mouse. I designed this one for a 6 year old girl with Ataxia–telangiectasia

Supplies

  • Arduino pro micro without headers
  • MPU-6050 Accelerometer and Gyroscope 3-Axis Module 3.3V-5V
  • 3 non latching buttons type AB6Y-M-(colour)
  • several different colours of thin insulated stranded wire
  • a micro USB data cable
  • a tap M4
  • a tap M6
  • a sockethead screw M6x30
  • two sockethead screws M5x40 
  • two nuts M5
  • two setscrews M4 with a flat point and internal hexagon
  • one strong printbed spring about 30mm long OD 8mm
  • hot glue gun
  • 3D printed files found on printables.com

Step 1: Print the Files From Printables.com

Find the files here

I have made the base and imu holder out of aluminum but 3D printing should be fine. I was asked to make the joystick pretty heavy and i have acces to a cnc mill and a lathe at the makerspace of which i am the coordinator. Make sure to print the dust cap in a soft TPU. Print the dustcap after you have assemled and tested the mouse, but before you close the covers. You can easely adjust the needed height of the dustcover in your slicer software.

Step 2: Tap M6 and M4 in the Holes Marked in the Picture.

Tap M4 thread in the hole for the setscrew in the base and the IMU holder. Also tap M6 thread in the top hole of the IMU holder

Step 3: Solder the Wires on the IMU and the Buttons

solder the wires (4) on the IMU (6050) board according to the schematic. 15cm should be enough. Do the same for the buttons. Use the NO contacts. Do not solder anything to the other side yet.

Step 4: Assemble the Imu Holder, Print Bed Spring and Base

Lead the wires from the IMU unit trough the slot into the unthreaded hole of the IMU holder. Then also lead them trough the spring and trough the base. Put the spring in the holder and lock with a setscrew. Also lock the spring with a setscrew in the base. Adjust the play with this last screw. If the joystick can bend 45° in each direction, thats already plenty. You can adjust to your needs.


Step 5: Insert and Lock the Buttons in the Cover

Insert the three buttons in the cover and fix with the screw. Do the deepest one first as it is pretty tricky to get the screw on. The others should be no problem. Connect the 3 common wires form the switches to eachother and connect to a small length of wire so they can all be connected to the same ground pin of the arduino pro micro. Insulate with a piece of shrinktube. Check the schematic.

Step 6: Connect the Arduino

Solder the wires to the aruino pro micro.

Step 7:

Insulate the imu unit if you use an aluminum part, you can skip this if you use 3d printed parts from an insulating material. Put the base assembly on a level surface, and with a few strategic dots of hot-glue, glue the IMU-unit LEVEL in all directions in the holder. Make sure the wires on the botom are in the designated slot in the base and not somewhere else under the base.

Step 8: The Code

Download the MPU6050_light library in the librarymanager of the aruino software. Upload the program to the arduino. The joystick should now behave as a mouse. Release one of the setscrews to rotate the IMU holder in such a position that feels natural. (mouse goes up when the joystick is pressed in the up direction) Make sure the wires and the slot is on left side of the base when doing this. If you do not know to upload a program or download a library to an arduino, please consult an instructable about this topic.


 #include <Wire.h>
 #include <MPU6050_light.h>
 #include <Mouse.h>
 MPU6050 mpu(Wire);
 unsigned long timer = 0;
 int Xang, Yang, Zang;
 int linkerknop = 7;
 int middenknop = 8;
 int rechterknop = 9;
 void setup() {
  
  pinMode(linkerknop, INPUT_PULLUP);
  pinMode(middenknop, INPUT_PULLUP);
  pinMode(rechterknop, INPUT_PULLUP);

  //Serial.begin(9600);
  //while (!Serial) ;
  Wire.begin();
  byte status = mpu.begin();
  while (status != 0) { } 
  delay(1000);
  mpu.calcOffsets(); 
  Mouse.begin();    
  Keyboard.begin(); 
 }


 
 void loop() {
 
  
 mpu.update();
    
 if ((millis() - timer) > 60) { 

  //Reading the MPU data
  Xang=mpu.getAngleX();
  Yang=mpu.getAngleY();
  Zang=mpu.getAngleZ();
  
  int liknopstate = digitalRead(linkerknop);
  int miknopstate = digitalRead(middenknop);
  int reknopstate = digitalRead(rechterknop);
  bool vlagli = 0;
  bool vlagmi = 0;
  bool vlagre = 0;
    if ( liknopstate > 0){
    if (vlagli = 1){
    Mouse.release(MOUSE_LEFT);
    vlagli = 0;
    }
    }
  else {
    Mouse.press(MOUSE_LEFT);
    vlagli = 1;
    } 
    
  if ( miknopstate > 0){
    if (vlagmi = 1){
    Mouse.release(MOUSE_MIDDLE);
    vlagmi = 0;
    }
    }
  else {
    Mouse.press(MOUSE_MIDDLE);
    vlagmi = 1;
    } 
   
   if ( reknopstate > 0){
   if (vlagre = 1){
    Mouse.release(MOUSE_RIGHT);
    vlagre = 0;
    }
    }
  else {
    Mouse.press(MOUSE_RIGHT);
    vlagre=1;
    }   
    
    
   if ((Yang > 6) || (Yang < -6) || (Xang > 6) || (Xang < -6)){  
  
     if (Yang > 6){
     Yang = map(Yang, 6, 10, 1, 10);
     }

     else if (Yang < -6) {
     Yang = map(Yang, -10, -6, -10, -1); 
     }
      
     else if (Xang > 6) {  
     Xang = map(Xang, 6, 10, 1, 10); 
     }

     else if (Xang < -6) {
     Xang = map(Xang, -10, -6, -10, -1); 
     }
    
     Mouse.move(Yang, Xang, 0);
   }
  timer = millis();
   }}

Step 9: Final Assembly

Glue the arduino with hot-glue so that the micro-USB connector is centered in the hole of the cover. Let the glue harden.

Slide the dust cover over the IMU holder and over the base rim.

Next install the handle with the M6 bolt. Then slide the two covers together keeping attention that none of the wires are squeezed between something. There is an opening in the two covers to accomodate the wires.

Lock the two covers with the M5x40 screws and the captive nuts which should be inserted in the bottom.

Step 10: Attribution

Attribution to KIKIHOBBYREPAIR and his project SPACE RAT. I have worked on from his idea. Not much is the same, but still i feel i should mention him. Also Loren, my colleage has helped in the design. Hope you can help some people with this design! Cheers Davy.

Creative Commons Licence - Attribution - Non Commercial