Embedded SystemsBeginnerPRJ-148

Gesture Controlled Device (Accelerometer) Using Arduino

Tilt your hand left, right or forward to switch different devices on.

Built and tested by Drisya K S · Industrial Robotics Institute

Arduino Uno

Arduino IDE

LevelBeginner
Build time1–2 hours
BoardArduino Uno
Parts7 components

What is the Gesture Controlled Device (Accelerometer)?

Control appliances with hand movements instead of switches. An ADXL335 accelerometer worn on the hand sends tilt readings to an Arduino; tilting left, right or forward switches on one of three LEDs (or relays for real appliances), and holding level turns them all off.

How it works

  1. The accelerometer outputs X and Y tilt as analog voltages.
  2. The Arduino reads them and prints the values to the Serial Monitor.
  3. Tilt left (X < 300) turns on device 1; tilt right (X > 700) device 2; tilt forward (Y < 300) device 3.
  4. Holding the hand level turns everything off.

Parts list

ComponentQty
Arduino Uno1
Accelerometer Module (ADXL335 or MPU6050)1
LEDs x3 (or Relay Module)1
Resistors 220Ω3
Jumper WiresAs needed
Breadboard1
Power Supply1

Software

  • Arduino IDE

Wiring and connections

FromConnect to
ADXL335 VCC3.3V
ADXL335 GNDGND
ADXL335 XA0
ADXL335 YA1
ADXL335 ZA2
LED 1 / Relay 1D2
LED 2 / Relay 2D3
LED 3 / Relay 3D4
LED / relay GNDGND

How to build the Gesture Controlled Device (Accelerometer)

  1. Connect the ADXL335 to 3.3V, GND, A0 (X), A1 (Y) and A2 (Z).
  2. Connect three LEDs through resistors (or a relay board) to D2, D3 and D4.
  3. Upload the code and open the Serial Monitor at 9600 baud.
  4. Tilt the sensor and note the X and Y values; adjust 300 and 700 if needed.
  5. Mount the sensor on a glove or wristband.

Gesture Controlled Device (Accelerometer) code

Complete, tested Arduino C++ code for this project. Copy it into Arduino IDE and upload it to the Arduino Uno.

int xPin = A0;
int yPin = A1;

int led1 = 2;
int led2 = 3;
int led3 = 4;

void allOff() {
  digitalWrite(led1, LOW);
  digitalWrite(led2, LOW);
  digitalWrite(led3, LOW);
}

void setup() {
  Serial.begin(9600);
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
}

void loop() {
  int x = analogRead(xPin);
  int y = analogRead(yPin);

  Serial.print("X: "); Serial.print(x);
  Serial.print("  Y: "); Serial.println(y);

  allOff();
  if (x < 300)        digitalWrite(led1, HIGH);   // Left
  else if (x > 700)   digitalWrite(led2, HIGH);   // Right
  else if (y < 300)   digitalWrite(led3, HIGH);   // Forward
  // else: neutral, all off

  delay(200);
}

Real-world uses

  • Assistive tech for people with limited mobility
  • Gesture-controlled robots
  • Smart home control
  • Learning accelerometers

Frequently asked questions

What is a Gesture Controlled Device (Accelerometer)?

Control appliances with hand movements instead of switches. An ADXL335 accelerometer worn on the hand sends tilt readings to an Arduino; tilting left, right or forward switches on one of three LEDs (or relays for real appliances), and holding level turns them all off.

What components are needed for the Gesture Controlled Device (Accelerometer)?

You need: Arduino Uno (1), Accelerometer Module (ADXL335 or MPU6050) (1), LEDs x3 (or Relay Module) (1), Resistors 220Ω (3), Jumper Wires, Breadboard (1), Power Supply (1). Software: Arduino IDE.

Is the Gesture Controlled Device (Accelerometer) project good for beginners?

Yes. It is rated beginner and takes about 1–2 hours to build, using the Arduino Uno. The guide on this page explains every connection and step.

Where can I get the code for the Gesture Controlled Device (Accelerometer)?

The complete, tested Arduino C++ code is free on this page. Copy it into Arduino IDE and upload it to the board.

Can I buy a kit for the Gesture Controlled Device (Accelerometer)?

Yes. IRI sells a kit with the parts for this project (PRJ-148). Message IRI on WhatsApp at +91 86060 82634 for the kit price and delivery details.

Industrial Robotics Institute
Logo