DIY: How to make a wireless keyboard and mouse GLOVE!

This is not intended as an exact step for step guide, but a guide to provide insights into how people can build their own customized glove. Recommended for people with programming- and some electronics experience.

Search Sparkfun for flex sensors, MPU6050, Arduino Pro Mini 5V, FTDI 5V, Bluetooth HID,  9V battery, voltage regulators (3.3 V and 5V).
Other things you’ll need include glove, needle and thread,  breakaway headers and solder.

Start by finding appropriate resistors to use for voltage division for the flex sensor reading. Write a simple Arduino code that reads the range of values for each sensor and select an appropriate threshold value that later decides whether a finger is bent.

Read more

Now check out this open source MPU6050 library written by Jeff Rowberg and use it to detect yaw, pitch and roll from the MPU6050.
The connections from the MPU to the Arduino are as follows:

MPU5060                        Arduino

Vdd———————– 3.3V

Vio ————————3.3V

SDA ———————- A4

SCL ———————–A5

INT ————————D2

GND ———————-GND

Make sure that you don’t connect the MPU to more than 3.3V.

Now, lets try sending something with the HID bluetooth device. Connect it to the Arduino and go into Command Mode using the instructions from sparkfun. (https://learn.sparkfun.com/tutorials/using-the-bluesmirf/example-code-using-command-mode)

To read about the functionality of the Bluetooth device see the Users Manual. But to save you some time I’ll write some useful commands here:
SH,0230  – Combo mode (keyboard, mouse and joystick)

S~,6 – HID register

R,1   – Reboot

SM,6  – Pairing mode

SF,1 – Factory reset

To connect the parts together, make a circuit board with voltage regulators, and connectors to the battery, the flex sensors and the arduino. Make connectors between the arduino and the Bluetooth device, but make sure not to solder them together so that you can upload a new code to the Arduino anytime. Before putting the things together, sew the flex sensors and the MPU to a glove that you want to use for this project.

 

Now that the hardware is ready, you must put the code together. First you need to make a function that writes letters through the Bluetooth device. The letters can be chosen by bending the appropriate bend sensor. For the mouse functionality make a function that changes the pointers funcion, put it in the loop function and let it take as input the rate of change of the yaw and pitch (depending on x or y axis of the display) times a constant, that determines the mouse sensitivity.
To be able to write the whole alphabet with just one hand, you can make a state machine that changes states when e.g. a roll of the hand is performed. If roll, then you can e.g. make special characters  and toggle mouse functionality ON and OFF, by bending appropriate fingers. Also you can make a quick roll, going back to the original hand position, but this time the hand has changed to a state where you can write another set of five characters. I recommend that the first character set is set up to be the five most frequent letters that appear in writing, and so forth. Customize your glove any way you want!

Finally, if you want to be able to use touchscreens with the glove, cut out the fabric on the tip of the fingers and sew some conductive fabric into it instead!