Arduino-Based Robotic Arm Controlled by Hand Gestures

Introduction

Hello everyone, trust you’re doing well. We’re excited to share our latest post on Arduino projects. This article focuses on creating a robot arm controlled by hand gestures using Arduino UNO. To detect hand movements, we’ll utilize four IR sensors positioned in four distinct directions with their sensor heads facing upwards. Feel free to explore additional Arduino and IoT projects crafted by our team. Follow the circuit diagram to assemble the components and proceed by uploading the provided code to the Arduino board.

Description

In this project, the robotic arm’s motion is controlled without direct physical contact. Instead, it responds to hand gestures, utilizing IR sensors within the circuit. These sensors detect hand movements and emit a high signal upon detecting obstacles within their range.

Two servo motors manage the x-axis and y-axis movements respectively. When you position your hand over the sensors, the robotic arm adjusts its motion accordingly. Such robotic arms are currently highly sought-after, finding widespread use across various industries to enhance productivity.

Carefully read through the article for comprehensive instructions on building this project independently. Additionally, you can explore our previously created WiFi controlled robot using nodemcu for further reference.

Components Required

Certainly, here’s a rephrased list of the components required:

– Arduino UNO
– 4 infrared (IR) sensors
– 2 servo motors
– Cardboard pieces
– Jumper wires and a breadboard
– USB cable used for uploading the code

Circuit For Hand Gesture Controlled Robot

To begin, position two servo motors on top of each other following the reference image provided in the project. Utilize a piece of cardboard to support this setup.

Next, link the positive supply wires of both servo motors to the Arduino’s 5-volt pin. Connect the negative supply wires of the servos to the GND pin of the Arduino.

Proceed by attaching the signal wire of the first servo motor to the digital-12 pin of the Arduino. Connect the signal wire of the second servo motor to the digital-13 pin of the Arduino.

Subsequently, acquire four IR sensors and connect their VCC pins to the Arduino’s 5-volt pin. Connect the GND pins of these sensors to the GND pin of the Arduino.

Utilize a breadboard for streamlined connections. Link the OUT pin of the first, second, third, and fourth IR sensors respectively to the digital-8, digital-6, digital-7, and digital-9 pins of the Arduino. Your circuit is now assembled and ready for use.

Code For Hand Gesture Controlled Robot

Attention: Prior to uploading this code to the Arduino, ensure the installation of <Servo.h> in case an error occurs. You can refer to instructions on adding a zip library to the Arduino IDE here for guidance.

//Techatronic.com
#include
Servo motor1;
Servo motor2;
int sensor1 = 8;
int sensor2 = 6;
int sensor3 = 7;
int sensor4 = 9;
void setup() {
pinMode(sensor1,INPUT);
pinMode(sensor2,INPUT);
motor1.attach(12);
motor2.attach(13);
// Serial.begin(9600);
}

void loop() {

int top = digitalRead(sensor1);
int bottom = digitalRead(sensor2);
int right = digitalRead(sensor3);
int left = digitalRead(sensor4);
//Serial.println(top);
//Serial.println(bottom);
//Serial.println(right);
//Serial.println(left);
if (top == 1 && bottom == 1 && right == 1 && left == 1)
{
motor1.write(60);
motor2.write(60);
}
else if(top == 1 && bottom == 1 && right == 1 && left == 0)
{
motor1.write(0);
motor2.write(60);
}
else if(top == 1 && bottom == 1 && right == 0 && left == 1)
{
motor1.write(180);
motor2.write(60);
}
else if(top == 1 && bottom == 1 && right == 0 && left == 0)
{
motor1.write(60);
motor2.write(60);
}
else if(top == 1 && bottom == 0 && right == 1 && left == 1)
{
motor1.write(60);
motor2.write(0);
}
else if(top == 1 && bottom == 0 && right == 1 && left == 0)
{
motor1.write(0);
motor2.write(0);
}
else if(top == 1 && bottom == 0 && right == 0 && left == 1)
{
motor1.write(180);
motor2.write(0);
}
else if(top == 1 && bottom == 0 && right == 0 && left == 0)
{
motor1.write(60);
motor2.write(0);
}
else if(top == 0 && bottom == 1 && right == 1 && left == 1)
{
motor1.write(60);
motor2.write(180);
}
else if(top == 0 && bottom == 1 && right == 1 && left == 0)
{
motor1.write(0);
motor2.write(180);
}
else if(top == 0 && bottom == 1 && right == 0 && left == 1)
{
motor1.write(180);
motor2.write(180);
}
else if(top == 0 && bottom == 1 && right == 0 && left == 0)
{
motor1.write(60);
motor2.write(180);
}
else if(top == 0 && bottom == 0 && right == 1 && left == 1)
{
motor1.write(60);
motor2.write(60);
}
else if(top == 0 && bottom == 0 && right == 1 && left == 0)
{
motor1.write(0);
motor2.write(60);
}
else if(top == 0 && bottom == 0 && right == 0 && left == 1)
{
motor1.write(180);
motor2.write(60);
}
else if(top == 0 && bottom == 0 && right == 0 && left == 0)
{
motor1.write(0);
motor2.write(0);
}
}

We trust you enjoyed this project and have a solid grasp of its concepts. Should you have any inquiries or uncertainties regarding this project, please utilize the provided comments section. Additionally, explore further tutorials on Arduino and Raspberry Pi for more learning opportunities.


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

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

Scroll to Top