Pana Maria, 335CA
The project consists of a glove that allows video game control through hand movements (for player movement) and the pressing of a button (for game interaction). Data is transmitted wirelessly to the computer via Bluetooth. The goal is to create an alternative method of interacting with games, based on motion and gestures, that is intuitive, portable, and easy to use without traditional controllers.
The glove is equipped with an MPU6050 motion sensor (accelerometer + gyroscope), which detects the orientation and movement of the hand. These movements will be mapped to keyboard inputs as follows:
In addition, a button is placed near the thumb, allowing it to be easily pressed like a trigger (similar to a detonator). This button is mapped to an action key, such as left-click or attack, enabling interaction with the game environment (e.g., breaking blocks, hitting mobs).
The MPU6050 communicates with the Arduino Uno via the I2C protocol. The Arduino processes the data and transmits it via UART to an HC05 Bluetooth module. On the PC side, a program receives the Bluetooth data and emulates keyboard input, making the glove behave like a motion-enabled controller.
The MPU6050 gyroscope and accelerometer module is interfaced using the Arduino Uno’s I2C communication protocol. Specifically, pins A4 and A5 are used, where A4 (PC4) serves as the SDA (data line) and A5 (PC5) serves as the SCL (clock line). These pins are chosen because the ATmega328P microcontroller provides dedicated hardware support for I2C on these lines. The MPU6050 is powered via the 3.3V line and protected by a voltage divider.
For user interaction, an Arcade Button (3343) is connected with a combined LED and data line setup. The button's input is read on digital pin D8 (PB0), while the LED is powered from the 5V supply and grounded through GND. Pin D8 is strategically selected to avoid conflicts with critical communication pins - such as A4/A5 used for I2C, D0/D1 used for UART, and D10–D13 reserved for SPI - leaving these interfaces free for future expansion. Furthermore, D8 is compatible with Timer2-based interrupts, which are utilized for polling the button at 2kHz (every 0.5 milliseconds).
The HC05 Bluetooth module is interfaced via the Arduino’s hardware UART on pins D0 and D1. Specifically, the HC05’s RX pin is connected to Arduino TX (D1/PD1), and its TX pin to Arduino RX (D0/PD0). These are the default UART pins on the ATmega328P, providing direct access to the USART0 peripheral. The HC05 is powered via the 5V line and protected by a voltage divider.
Although I initially started developing the code in Arduino IDE and used its provided libraries, once I got the project working I replaced the library code with my own implementations, targeting my use case and applying the knowledge gained during the laboratories.
At its core, the software is composed of two parts: the C code for the Arduino and the Python code for the PC.
Upon powering on, the Arduino initializes its hardware components with low-level control:
Wire
library.SoftwareSerial
, but replaced due to interrupt conflicts.The main loop handles continuous data processing and user input detection:
W
= ForwardA
= LeftS
= BackwardD
= RightSoftwareSerial
, which disables all interrupts during communication.SoftwareSerial
.H
) every 2 seconds.W
, A
, S
, D
):pynput
library to simulate key presses.B
)H
)Now that the glove itself is also done, the “final product” is ready to go. The project works as intended i.e. both movement and interaction are controlled accordingly by the glove. To get a glimpse of how using it looks like, check out this demo:
Hardware Resources:
Software Resources:
Miscellaneous resources (mainly for working out issues):