Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Electronics Basics

Gesture Mouse – Controlling Computer With a Glove

Gesture Mouse – Controlling Computer With a Glove

February 3, 2023 /Posted by / 0

Hello there! Gesture Mouse – Controlling Computer With a Glove !

This instructable is on making a gesture-controlled mouse in the form of a glove.

The initial idea is to integrate this in FPS (First Person Shooter) games and computer pointer control, but it can also be used in other projects like a remote controlled car, mechanical hand, etc.

Hope you like the project. Leave your thoughts and suggestions in the comment section.

Thank you!

Supplies gloveSupplies Supplies
  Supplies Supplies Supplies

Main Components

  • Flex sensor: Sensor which detects bend in the form of resistance increase or decrease. Used for mouse buttons.

As it may seem, the flex sensors are a bit costly. Alternatively, these sensors can also be made by yourself with minimal cost. One good example is this.

  • MPU-6050: Gyroscope, accelerometer and thermometer in one small module. To be used for directing pointer.
  • Arduino Pro Micro: Small and compact Arduino with direct USB connectivity for communicating with host computer.
  • Glove: Any normal cloth or leather glove can be used for tying the gyroscope module and flex sensors.

The glove can also be bought by your own choice based on some factors given on Step 3.

Accessories

  • Jumper Cables Male to Male & Female to Female: Cables for connecting all the components
  • Heat Shrink Tubes: Best for securing cable connections.
  • Cable Ties: Ties for securing every component onto the glove.

Tools used

  • Soldering iron with accessories
  • Wire stripper

All of the above listed items can be bought by one’s own choice, albeit keep care on buying the glove.

Gesture Mouse – Controlling Computer With a Glove

Step 1: Know How the Sensors Work

The Flex Sensors

The flex sensor is generally used as a goniometer (device for measuring bend angle).

These sensors work as variable resistors. They have a polymer ink layer inside which has electrically conductive particles. When the sensor in ‘flexed’, these particles move further apart, therefore, lowering the conductivity and producing resistance.

This resistance is measured by a microcontroller for calculating bend angle or taking actions on the basis of the degree of bend.

The MPU-6050’s Gyroscope…

The gyroscope measures rotational velocity (rad/s). This is the change of the angular position over time along the X, Y, and Z-axis (roll, pitch, and yaw). This allows us to determine the orientation of the sensor. We are using this functionality of the sensor for our project.

…And The Accelerometer

The accelerometer measures acceleration (rate of change of the object’s velocity). It senses static forces like gravity (9.8m/s2) or dynamic forces like vibrations or movement. The MPU-6050 measures acceleration over the X, Y, and Z-axis. Ideally, in a static object, the acceleration over the Z-axis is equal to the gravitational force, and it should be zero on the X and Y-axis.

Step 2: Preparing the Components

Special Jumper Cables

The Arduino Pro Micro has RAW and VCC for power supply with three ground pins for power supply. So, for distributing +ve power to the flex sensors, we’ll have to make custom jumpers.

We’ll make 1 female to male and female jumper for power.

For flex sensors, we’ll make 2 male to two female jumper.

The MPU-6050 Sensor

We would be using the first four pins – the VCC, GND, SCL & SDA.

To make tying easier, solder these pins only. Else, its your choice to solder the other pins.

The Flex Sensors

The flex sensors have two pins.

We’ll solder male connector of a male to female jumper onto one pin.

Next, solder one free connected end from the special jumper for the sensors to the other pin.

During soldering, keep the soldering iron in contact for the least time possible. The sensors have a very weak inner conductive membrane, which can deteriorate on extended exposure to heat and bend. So, caution is crucial.

Step 3: Readying the Glove

Readying the Glove Readying the Glove Readying the Glove

The Glove

The two vital factors of buying the proper glove are as follows:

  • The glove should be of the perfect size, i.e., should perfectly fit the hand of the user.
  • It should be flexible enough to allow free movement of the fingers.

Using a cloth gardening glove with spaces between the threads would be best for tying the components. Making holes in the leather or any other glove may prove difficult and couldn’t be reused.

Placing the Components

The Flex Sensors

In order to bring the “trigger-pulling” feeling, the flex sensors would be placed on the fingers.

It is one’s choice if they want to put the sensors on inside of the fingers or the outside. It is adviced to put the sensors on the outside of the hand to maximise the movement of the fingers.

To tie these, we’ll put 3-4 cable ties on equal distances through the spaces and tighten them around the sensors by looping it from inside the glove skin and zip it from outside like done in pics 2 and 3.

Ensure keeping the fingers free from ties in the middle of the finger, otherwise the ties would prickle the finger when it is fold.

The MPU-6050

The sensor is placed between the index and middle finger, at the bottom of the flex sensors.

It is apparent that in order to make the glove move the pointer by (in a way) pointing it towards the target area, the sensor would be placed on the edge of one the fingers.

Unfortunately, that is not possible due to the flex sensors. That’s because in order to click buttons, the finger would have to be moved, displacing the sensor, which would in turn displace the pointer.

Therefore, the sensor is placed below the fingers to lessen the pointer displacement but also keeping the “gun effect” to a certain level.

Preferably, the sensor’s y-arrow should point towards the computer screen perpendicularly to produce the effect more efficiently.

For fixing this sensor, the ties would be put through the pcb holes and through the glove layer and tightened up.

The Arduino

The board could be put straight or flipped on the wrist depending on the way its pins have been soldered.

Keep in mind that the pins need to face up to connect wires easily and the micro USB also needs to be clear of the glove for easy USB connection.

For tying, a single long tie could be used to fasten it there diagonally along the Arduino.

Stick a piece of double sided tape before tying.

Your glove should look something like Pic 1 by now.

Step 4: Making the Circuit

Making the Circuit

After fixing all the components in their places, now’s the time for connecting everything.

MPU-6050’s Connections:

VCC to VCC

GND to GND (any)

SCL to 3

SDA to 2

Use 4 female to female jumpers for connection.

Flex Sensors’ Connections

Left Jumper to GND

Right Simple Jumper to A0 (index sensor) and A1 (middle sensor)

Right +ve Jumper to RAW and VCC

Ensure to tighten the female connectors for better connection by pushing in their metal strips visible from the little hole on them.

Step 5: Programming the Arduino

Before we do any programing, we’ll need to install Arduino IDE onto our computer along with MPU-6050 operating library.

Download the IDE from here : Software | Arduino

And the MPU-6050.h library from here : ElectronicCats/mpu6050: MPU6050 Arduino Library (github.com)

Install the IDE and open the .ino code file in the editor. Include the .zip file from the GitHub repositery into the code.

Afterwards, now lets understand the working of vital portions of the code.

The code starts off by including the following libraries.

  • Wire.h : This library allows the microcontroller to communicate with I2C devices. Here, I2c device is referred to MPU-6050 module, which communicates with the SCL and SDA pins.
  • I2Cdev.h : This library is used for reading and writing I2C functions.
  • MPU-6050.h : Controller library for MPU-6050 module.
  • Mouse.h : HID Library for mouse functions.

The Wire.h, I2Cdev.h and Mouse.h generally come pre-installed with the IDE. If not, download and include these libraries from GitHub.

// Include libraries
#include <Wire.h>
#include <I2Cdev.h>
#include <MPU6050.h>
#include <Mouse.h>

setup() initializes I2C communication, MPU-6050 module connection, HID mouse functionality and serial communication.

void setup()
{
  Wire.begin();
  mpu.initialize();
  Mouse.begin();
  Serial.begin(9600); // Begin serial communication for reading sensor readings
}

loop() executes continuously the whole functionality.

void loop()
{
 moveMouse();
 clickMouse();
 printValues();
 delay(rate);
}

moveMouse() gets rotational values from the gyro sensor and feeds them into the variable assigned.

Then, it converts the output values into pointer displacement values in the form of x and y displacement coordinates.

In the end, it calls the Mouse.move() function, which moves according to the displacement values calculated.

void moveMouse()
{
  if (flagIndex == 0 && flagMiddle == 0)
  {
    mpu.getRotation(&gx, &gy, &gz); // Get rotation values from gyroscope

    // Convert output values to pointer displacement
    vx = -(gx + 200) / sense; // Here, change the '200' & '30' values to the approximate +ve values
    vy = (gz + 30) / sense;   // of the values shown by the gyroscope when in rest on the serial monitor.

    Mouse.move(vx, vy); // Move mouse according to gyro rotation
  }
}

clickMouse() uses values from the flex sensors to detect change in bend and take actions defined in the clickIndex() and clickMiddle() functions. Both functions are assigned to the respective flex sensor.

void clickMouse()
{
  // Read flex sensor values
  valIndex = analogRead(indexPin);
  valMiddle = analogRead(middlePin);

  // Perform mouse functions
  clickIndex();
  clickMiddle();
}

clickIndex() makes sure of left mouse clicks based on state of the flex sensors. clickMiddle() also works in a similar fashion. The only difference is of mouse button.

void clickIndex()
{
  if (flagIndex == 0)
  {
    if (valIndex > buffIndex)
    {
      flagIndex = 1;
      Mouse.press(MOUSE_LEFT);
      Mouse.release(MOUSE_LEFT);
    }
  }
  else if (flagIndex == 1)
  {
    if (valIndex < buffIndex)
    {
      flagIndex = 0;
    }
  }
}

After understanding the whole code, now just plug the arduino in, compile the code and upload it.

Open the serial monitor afterwards for viewing the sensor outputs.

Open the serial monitor afterwards for viewing the sensor outputs.

Attachments

  • download {{ file.name }}GestureMouse.ino  Download

Step 6: Check the Result

And THATS it. Your gesture mouse is ready. Kudos to you. 🎉

Here is a demonstration clip of the finished project.

  • download {{ file.name }}Gesture Mouse – Controlling Computer With a Glove – Step #6   Download

I hope this article help you lot & all the best for your projects also you can share your project with us.

Tags: Computer With a Glove, Gesture Mouse, Gesture Mouse - Controlling Computer With a Glove
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Arduino Based Door Lock System...
Arduino Based Door Lock System
Self Balancing Robot Using Arduino
Self-balancing robot with MPU6...

Related posts

Svg%3E
Read more

Coffee Roaster: Temperature Profile Controller Build

April 1, 2026 0
Table of Contents Why Build a Coffee Roaster? Roasting Temperature Profiles Components for the Build Thermocouple Placement PID Profile Controller... Continue reading
Svg%3E
Read more

Sous Vide Cooker: Precision Temperature Water Bath

April 1, 2026 0
Table of Contents What Is Sous Vide Cooking? Precision Temperature Requirements Components for the Build PID Temperature Controller Water Circulation... Continue reading
Svg%3E
Read more

Kiln Controller: High-Temperature Pottery Automation

April 1, 2026 0
Table of Contents What Is a Kiln Controller? Temperature Requirements for Ceramics Components for High-Temperature Control K-Type Thermocouple and MAX6675... Continue reading
Svg%3E
Read more

Heat Gun Controller: Temperature and Airflow Regulation

April 1, 2026 0
Table of Contents What Is a Heat Gun Controller? Temperature and Airflow Regulation Components for the Build PID Temperature Control... Continue reading
Svg%3E
Read more

Soldering Iron Station: PID Temperature Controller Build

April 1, 2026 0
Table of Contents Why Build a Soldering Station? PID Temperature Control for Soldering Components Required Thermocouple Sensing at the Tip... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now