Hand Gesture Recognition Project
Hand Gesture Recognition Project
Arduino Nano
I. Objective
Build a system that reads the bending of fingers using flex sensors and hand orientation
using an accelerometer (MPU-6050). The data is displayed on an LCD and optionally sent
via Bluetooth (HC-05) to a phone or another microcontroller.
Arduino Nano 1
10kΩ resistors 4
Breadboard 1
2. MPU-6050 Wiring
MPU-6050 Pin Arduino Nano Pin
VCC 5V
GND GND
SDA A4
SCL A5
#include <Wire.h>
#include <LiquidCrystal.h>
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
void setup() {
Serial.begin(9600);
lcd.begin(16, 2);
lcd.print("Initializing...");
if (!mpu.begin()) {
lcd.clear();
lcd.print("MPU failed!");
while (1);
}
lcd.clear();
lcd.print("Ready");
delay(1000);
}
void loop() {
for (int i = 0; i < 4; i++) {
flexValues[i] = analogRead(flexPins[i]);
}
sensors_event_t a, g, temp;
mpu.getEvent(&a, &g, &temp);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("F1:");
lcd.print(flexValues[0]);
lcd.print(" F2:");
lcd.print(flexValues[1]);
lcd.setCursor(0, 1);
lcd.print("F3:");
lcd.print(flexValues[2]);
lcd.print(" F4:");
lcd.print(flexValues[3]);
delay(500);
}