This is an old revision of the document!


Smart Glove for interpreting ASL (Sign Language) alphabet

Author: Andrei-Alexandru Georgescu
Group: 332-CD

Introduction

The intent is to make a hand-worn device that uses several sensors to internally store the position of each finger, as well as orientation measured with a gyroscope, and then using this data to interpret, based on set of logistic regressions, a corresponding letter according to the ASL standard alphabet.
The ML based interpretation of the gestures makes the device highly personalizable, as it could be trained for a specific individual's range of motion and manner of making the gestures.
Its primary and intended purpose is to interpret gestures, but it can also be used, once trained, in an educational fashion as it uses an LED to signal if the gesture is recognized.

General description


An important part of the project's logic is based on the 6 IMUs used. One is the “Reference Sensor” and it is mounted on the wrist such that it doesn't much experience the rotational movements of the hand. The other 5 are each mounted on a fingertip and all funnel their outputs towards the controller through an I²C multiplexer. The microcontroller is going to in turn request data from each of the sensors over the I²C line, and use the values to determine the position of each fingertip relative to the wrist.

The intended function of the project has 2 possible running modes, which determine how the positional data is used:

  • Learning Mode - In Learning Mode, the expectation is that the controller is connected to a companion computer that deals with the mathematical computation of the regression weights. It is also in this mode that the connected button is intended to be used, serving as a snapshot “trigger”, recording the data at the pressing moment and sending it over USART to the companion for processing.
  • Interpreting Mode - In Interpreting Mode, the expectation is that the controller has been pre-loaded with the necessary weights from a prior learning session. Here the positional data is used to sequentially calculate the “probability” of the gesture being associated to known symbol, interpreting the gesture to be the symbol with the highest “probability”, but only if it passes a minimum threshold of 80%. While a value is interpreted as known, a green led is active and internally a clock is started. If the guessed position is still the same after a half a seconds has passed, the interpretation is considered valid and written over I²C to the LCD. In Interpreting Mode, the connected button is instead used to clear the LCD screen of prior written content.

Hardware Design

Software Design

Development Medium: Arduino IDE Libraries:

  • Wire.h - For I²C communication.
  • LiquidCrystal_I2C.h - For controlling the LCD over I²C.
  • math.h - For the mathematical functions required for inference.
  • MPU6500_WE.h - For controlling the IMUs used and polling them for data.

Algorithms and Datastructures:

  • Multinomial Logistic Regression/Softmax Regression - Using sklearn in Python on the companion / math operation locally on the ESP32
  • Wrapper Class over MPU6500
  • Wrapper functions over Wire for using TCA9548
  • Wrapper functions over Wire and LiquidCrystal_I2C for communicating with the LCD1602

Implemented Functions:
TCA9548 Functions:

  • init - to be called during setup, activates the I²C connection
void tca9548_init() {
  Wire.begin(SDA_PIN, SCL_PIN);
}
  • tca9548_select - sets the TCA9548 multiplexor to channel i, provided that i is a valid channel (0 to 7)
void tca9548_select(uint8_t i) {
  if (i > 7) return;
  Wire.beginTransmission(0x70);
  Wire.write(1 << i);
  Wire.endTransmission();
}

MPU6500 Functions:

  • Constructor - makes the MPU6500 library object and memorizes the TCA9548 channel it is on
MPU6500::MPU6500(uint8_t mux_channel) {
  _mux_channel = mux_channel;
  _mpu = new MPU6500_WE(MPU6500_ADDRESS);
}
  • init - to be called by setup, launches the IMU into autocalibration and configures it for maximum precision
void MPU6500::init() {
  tca9548_select(_mux_channel);
  _mpu->init();
  _mpu->autoOffsets();
  _mpu->enableGyrDLPF();
  _mpu->setGyrDLPF(MPU6500_DLPF_6);
  _mpu->setGyrRange(MPU6500_GYRO_RANGE_250);
  _mpu->enableAccDLPF(true);
  _mpu->setAccDLPF(MPU6500_DLPF_6);
  _mpu->setAccRange(MPU6500_ACC_RANGE_2G);
}
  • get_data - to be called inside the loops, makes sure the communication is over the correct TCA9548 channel and fetches current angular data
xyzFloat MPU6500::get_data() {
  tca9548_select(_mux_channel);
  return _mpu->getAngles();
}

LCD1602 Functions:

  • lcd1602_init - to be called during setup, initializes the LCD and turns on the backlight
void lcd1602_init() {
  lcd.init();
  lcd.backlight();
  lcd.clear();
  lcd.setCursor(0, 0);
  delay(25);
}
  • lcd1602_write_char - writes a character at the specified position, provided that position is valid
void lcd1602_write_char(uint8_t pos_col, uint8_t pos_row, char c) {
  if (pos_col >= LCD_COLS || pos_row >= LCD_ROWS) {
    return;
  } 
  lcd.setCursor(pos_col, pos_row);
  lcd.print(c);
}
  • lcd1602_write_char - writes a character at the current cursor position
void lcd1602_write_char(char c) {
  lcd.write(c);
}
  • lcd1602_write_string - writes a string at the specified positon
void lcd1602_write_string(uint8_t pos_col, uint8_t pos_row, const char* s) {
  lcd.setCursor(pos_col, pos_row);
  lcd.print(s);
}
  • lcd1602_set_first_row - moves the cursor to point at the begining of the first row
void lcd1602_set_first_row() {
  lcd.setCursor(0, 0);
}
  • lcd1602_set_second_row - moves the cursor to point at the begining of the second row
void lcd1602_set_second_row() {
  lcd.setCursor(0, 1);
}
  • lcd1602_test - displays a basic text for testing purposes
void lcd1602_test() {
  lcd.setCursor(2, 0);
  lcd.print("Booting up!");
}
  • lcd1602_clear - clears the text from the LCD and sets the cursor to point to 0, 0
void lcd1602_clear() {
  lcd.clear();
  lcd.setCursor(0, 0);
}

Main Functions:

pm/prj2025/iotelea/ageorgescu2407.1748281628.txt.gz · Last modified: 2025/05/26 20:47 by ageorgescu2407
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0