IOT

Mouse for People With Brain or Nervous Disability

There are millions of disabled people in this world who are always in need of helping hands. Independent mobility reduces the dependence on caregivers.  Disabled people always find themselves challenging to go out independently because of their physical deficiency or inability to move in a  normal fashion.

  In this blog, I designed a Joystick module that functions as a Mouse for Brain or Nervous Disabilities. For persons who have tremors when using a standard mouse, this joystick acts as a mouse.

Hardware Required

  • Arduino pro micro without headers
  • MPU-6050 Accelerometer and Gyroscope 3-Axis Module 3.3V-5V
  • 3 non-latching buttons type AB6Y-M-(color)
  • several different colors of thin insulated stranded wire
  • a micro USB data cable
  • a tap M4
  • a tap M6
  • a socket head screw M6x30
  • two socket-head 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

The base and imu holder of the device is constructed of aluminum, however, 3D printing should work perfectly.  I have access to a CNC mill and a lathe, thus designing Joystick substantially. Make sure the dust cap is printed in a soft TPU. After you’ve assembled and tested the mouse, but before you close the covers, print the dust cap. In your slicer software, you can easily alter the required dustcover height.

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

Tap M6 and M4 in the Holes Marked in the Picture.
  • Tap M4 thread in the hole for the set screw in the base and the IMU holder. Also, tap the M6 thread in the top hole of the IMU holder

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

Solder the Wires on the IMU and the Buttons
  • According to the diagram, solder the wires (4) on the IMU (6050) board. 15cm should suffice. Carry on with the buttons in the same manner. The NO contacts should be used. Do not solder anything to the opposite side at this time.

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

Mouse for People With Brain or Nervous Disability

Assemble the Imu Holder, Print Bed Spring and Base
Assemble the Imu Holder, Print Bed Spring and Base
  • Lead the wires from the IMU unit through the slot and into the IMU holder’s unthreaded hole.
  •  After that, take them through the spring and the base. Set a set screw to secure the spring in the holder. A set screw in the base also locks the spring. With this last screw, you may adjust the play. It’s enough if the joystick can bend 45 degrees in each direction. You can make changes to suit your requirements.

Step 5: Insert and Lock the Buttons in the Cover

Insert and Lock the Buttons in the Cover
Insert and Lock the Buttons in the Cover

The three buttons should be inserted into the lid and secured with the screw. Start with the deepest one because it’s the most difficult to get the screw on. The rest shouldn’t be a problem. Connect the three common wires from the switches to a little length of wire so that they may all be linked to the same ground pin on the Arduino Pro Micro. Use a piece of shrink tube to insulate the container. Examine the diagram.

Step 6: Connect the Arduino

Connect the Arduino
  • Solder wires to the Arduino pro micro.

Ensure that the imu device is properly insulated. If you utilize 3d printed components made of an insulating material, you can skip this step if you use an aluminum part. Place the base assembly on a level surface and glue the IMU-unit LEVEL in all directions in the holder using a few strategic droplets of hot glue. Ensure that the wires on the bottom are inserted into the proper slot in the base and not elsewhere beneath the base.

Step 7: The Code

In the library manager of the Arduino software, download the MPU6050 light library. Connect the Arduino to the computer and upload the program. The joystick should now function similarly to a mouse. Release one of the setscrews to rotate the IMU holder to a comfortable position. Make sure the wires and the slot are on the left side of the base while doing this (the mouse goes up when the joystick is pressed in the up direction).

#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 8: Final Assembly

Final Assembly
  • Hot-glue the Arduino to the cover, ensuring that the micro-USB connector is centered in the hole. Allow the glue to set.
  • Cover the IMU holder and the base rim with the dust cover.
  • After that, use the M6 bolt to secure the handle. Then, carefully slide the two covers together, making sure that none of the wires are caught between anything. The wires are accommodated through a hole in the two covers.
  • The M5x40 screws and captive nuts should be inserted in the bottom to secure the two coverings.

Finally, we have designed and implemented the Mouse for the People With Brain or Nervous Disability. Hope you enjoyed the project and learned something useful. We, MATHA ELECTRONICS  will come back with more informative blogs.

Leave a Reply

Your email address will not be published.