DIY Arduino Robot Arm – Controlled by Human Gestures

Introducing the DIY Robot Arm controlled by Human Gestures.

Imagine being able to control a robotic arm with just the movement of your hand, mimicking the synergy between humans and machines seen in blockbuster films like Pacific Rim or Avatar. While we’re not quite at the level of industrial-sized robots yet, what if you could build a smaller, functional version that responds to your gestures?

This project is an attempt to achieve this.
We’re taking on the challenge of building an Arduino-powered robotic arm, designed to follow hand gestures in real-time. Whether it’s rotating, grabbing objects, or performing complex maneuvers, this robotic arm can be programmed to carry out tasks with precision, all through the natural movements of your hand.

Robotic Arm - Robot Captcha
Robot Arm – Passing Captcha Test
Robotic Arm - Moving Objects
Robot Arm – Moving Objects

Staying true to Iron man’s suit convention, each iteration would be known as Mark. This prototype would be known as MARK 1. We can expect more iterations to improve on the original robotic arm.

Robotic Arm - Robot Arm and Glove
Robot Arm Powered by Hand Gestures

View the Full DIY Robot Arm (controlled by Hand Gestures) Tutorial Here



Overview

In this tutorial, we’ll build a six-axis Robot controlled by Hand gestures using a Robotic Glove. And by mimicking natural human gestures such as a pinch, or a wrist rotation to the left, You’ll be able to open/close or rotate the robotic arm left and right respectively. In effect, manually controlling a Robotic Arm.

robotic arm features

MARK 1 Features:

  • 6 Axis Rotation
  • Portable
  • Control the Robot with Human Gestures
  • Can Be pre-programmed to carry out basic functions
  • Can be controlled wirelessly from a range
  • Can hold a load weight 600g (Max Load 1kg)

Part List

robotic arm part list
Robotic Arm & Glove – Part List

The Robotic Arm is fully customizable. You can either buy your own or 3d print your own. If you choose to 3D print, no worries. There is a list of different Robots that use servo motors, so the theory of what we’re building still applies.

For this project, this prototype (Mark 1)  would be 3D printed as it gives me more space to create custom parts.

Robotic Arm: Thingiverse 3D Printed Robotic Arm (credits: Wonder Tiger):

You can find more information on this build, along with the screw types from the parts above. The time taken to print can up to 40 hours. However, this cuts the cost of buying a Robotic Arm.

Robotic Glove: The Robotic Glove.STL files (credits: Roman 13)

robotic arm glove 3d print
Robotic Glove – 3D Printer Build Only

The Robotic Glove was an aesthetic addition to the project, but you can just as well use a builders glove to implement the Robotic Arm.

Note: for larger hands, print at 105% scale

Robotic Arm – Electronics

Below are all the parts that are required to build the electronics:

PartsRetailer
6 x Servo Motor – MG966R Series
Servo Driver, PCA9685
Battery Pack (5V, 2200 mAh)
Arduino Uno
Arduino HC-05
Breadboard
Jumper Wires
NEMA 17 Servo Motor
A4988 Stepper Motor Driver
LiPo 11.1V, 2200mAh, 3s

Hand Glove – Electronics

PartsRetailer
3 x Flex Sensor
2 x MPU6050 (Accelerometer)
Arduino Nano
3 x Resistors (10K)
Resistors (220R)
Builders Glove
9V Battery
9V Battery Clip
3 x Capacitor (100nF)
Arduino HC-05
Braided Cable Sleeve

Accessories – Electronics

Other Parts
Braided Sleeve
Breadboard
Jumper Wires

How it Works

robotic arm how it works
Robotic Arm Theory – Electronics Only

Overall, we’re sending a signal (over Bluetooth) from the Robotic Glove to the servo motor. When a value has been received, the servo driver will send a signal to a specific servo motor moving the Robotic Arm.

Now, if we add multiple servos and more sensors, we can control each Motor. `

robotic arm all motors
Robotic Arm Joints -Servo Motor Naming

 

If we think of a Robotic Arm as a series of servo motors coordinating with each other to perform a function, we can create a robotic arm controlled by a Robotic glove.

The Robotic Glove’s Arduino uses sensors to communicate with the Robotic Arm Arduino and sends data to move a Servo to the desired angle.

You may be wondering, what sensors does the Robotic Glove use?

For MARK 1, we would be using Flex Sensors and an accelerometer (MPU6050)

  • Flex Sensors – Based on the degree of bend of this plastic piece, the resistance changes, affecting the current. This measurement is then used to detect hand movement changes.
  • Accelerometers – For more natural gestures, an accelerometer can detect a change in the arms and wrist rotation.

We are using these sensors to detect a change in a gesture. We can then send a specific value mapped of a gesture to the Robotic Arm to control a servo motor via Bluetooth. And With enough gestures, the robotic arm comes to life!

robotic arm aerial view
Robotic Arm – Full View

Robotic Arm Mapping

The following represents a mapping table of the values sent to the Robotic Arm by the Glove. Each is having keys to characterize its function. (P – Pinkie, L – Right, etc.)

NumberServo NameRobotic Arm ActionGlove Sensor ValuesAction
1Base JointRotate Base Left or RightAcccelermotor_2 T, tMove Elbow Left or Right
2 & 3Shoulder JointMove Shoulder Joint Closer or FurtherPinkie Finger Flex – P, pBend or Extend Pinkie
4Elbow JointRotate Elbow Joint Closer or FurtherAccelerometer_2 – C, cBend Elbow or Extend Elbow
5Wrist JointRotate Robotic Arm Joint Up or DownAccelerometer_1 – U, DRotate Wrist Up or Down
6Wrist Joint 2 (Rotate)Rotate Robotic Arm (CW or CCW)Accelerometer 1 – L, RRotate Wrist Left or Right
7Gripper JointClose Claw Grip or Open Claw GripIndex Finger Flex -F,fBend or Extend Index Finger
Robotic Arm Gloves Values and Mapping

Note: Capital “F” (finger) represents the opposite direction of the servo motor spin

Assembly of Parts

robotic arm main partsRobotic Arm – Assembly

Purchasing a Robotic Arm can be quite expensive. To to keep this robotic arm within Budget, 3D printing a Robotic Arm was the best option.

This helps in the long run, as there are many examples of a 3D printed robotic arm that can be customized, e.g., adding an LED, creating a camera stand Clamp:

As previously mentioned, the Robotic Arm was modeled around the Robotic Arm on Thingyverse. I’ve chosen this example as it was an excellent design providing six-axis, well documented, and had strength/ robustness. You can access Wonder Tiger’s Robotic Arm from the Part’s list.

You can also find my remixes for a Robotic Arm Camera Stand. We’ll cover this more in a future release. However, the parts could take a collect at least 40 hours to print all parts.

You can find many other Robotic Arm 3D Printed alternatives too.

Introducing the servo motor and Driver

robotic arm servo driver
Servo Driver for Robotic Arm

Given that the Robotic Arm is ideally a series of motors in coordinating together, we can theoretically attach several motors that can be all powered by the Arduino. In this project, we’ll be using the PCA9685 Servo Driver to power the MG966R Servo.

HCPCA9685 Library: Add this Library to your Arduino IDE.

Note: Use an external power supply when powering each Motor. The Arduino cannot supply enough power to control all motors. In this project, a 5V, a 2200 mAh RC Battery was used.

The Arduino diagram wiring should look as below:

robotic arm servo plugged

 

NEMA-17 for base rotation

Since the Robotic was starting to gain a bit of weight, and the MG966R servo motor was not powerful enough to rotate the Robotic Arm at the base. To rotate the Robotic Arm, a more robust motor than a servo motor would need to be used

robotic arm stepper motor a4988
Robotic Arm – Stepper Motor and Driver

A Stepper Motor (NEMA-17) can be used due to its precision and high torque, helping the Robotic Arm rotate seamlessly to gesture controls.

The NEMA-17 and the A4988 Driver si used to control the direction of the Motor, you can see from the diagram below:

robotic arm nema 17 assembled

And finally, the following diagram shows the final wiring diagram assembly of the complete Robotic Arm.

Assembly of Circuitry

The below wiring diagram shows the final assembly of all electronic parts to create a Robotic arm, including the Bluetooth module. We’ll cover the paring process below.

robotic arm full assembly diagram

 

Human Flex Sensor

robotic arm electronic glove
Robotic Glove – Fully Assembled with Flex Sensor

In keeping true to the Robotic Arm’s aesthetics, you can print a 3D Printed Exoskeleton Gauntlet to use as your Robotic Glove.

However, you can use a standard Builder’s Glove for prototyping the Robotic Glove. This ‘Robot Glove Exoskeleton’ design just blended well with the design of the Robotic Arm.

The Robotic Glove consists of the following components:

  • Flex Sensor –  Based on the bend of the finger, the current changes which we could use to send a signal to the Motor
  • Accelerometer (MPU6050) – We can control the Motor by mapping human gestures from X, Y, Z plane
  • LED – The LED will light up when a human gesture control has been sent to the Arduino
  • Bluetooth (HC-05) Module – Sending data to Robotic Arm HC-05 Receiver
  • Arduino Nano – The microcontroller would perform as the brains of the Robotic Glove

The following diagram is great to test the flex sensor and the Accelerometer.

Important: The Robotic Arm will only be as accurate as the robotic Glove controls, So it’s worth getting this right.

robotic arm arduino monitor
Robotic Glove – Sending Values by bending the Flex Sensor

Configuring the Bluetooth (Master and Receiver)

The Arduino Robotic Arm communicates over Bluetooth using the HC-05 modules. Below highlight the critical information.

ModuleConfiguration
Robotic Glove HC-05  Master
Robotic Arm HC-05 Slave
Note: Baud Rate is set at 4800

Arduino Programming

You can download the following code below:

Note: All other test codes and the latest version can be found on the Arduino Robotic Arm Git Repo

Programming the Robotic Arm

robotic arm full circuit
Robot Arm – Full Assembly and Wiring


The Robotic Arm code makes use of the HCPCA9685 Library (for the Servo Driver). This way, we can power multiple servo motors, all controlled by an Arduino. In the code, we can start by adding this library and declaring the servo variables.

The following variables are used to find the previous/increment and get the Servo’s current position.

* Include the HCPCA9685 library */
#include "HCPCA9685.h"
/* I2C slave address for the device/module. For the HCMODU0097 the default I2C address
   is 0x40 */
#define  I2CAdd 0x40
/* Create an instance of the library */
HCPCA9685 HCPCA9685(I2CAdd);
//initial parking position of the motor
const int servo_joint_L_parking_pos = 60;
//Degree of robot servo sensitivity - Intervals
int servo_joint_L_pos_increment = 20;
//Keep track of the current value of the motor positions
int servo_joint_L_parking_pos_i = servo_joint_L_parking_pos;
//Minimum and maximum angle of servo motor
int servo_joint_L_min_pos = 10;
int servo_joint_L_max_pos = 180;

Initialize the Serial Port at Baud Rate 4800 to start the Bluetooth communication

 Serial.begin(4800); // Initialise default communication rate of the Bluetooth module

In the loop() section, we’re constantly checking whether any data is coming from the robotic glove. If true, we’ll store the incoming data in the ‘state’ variable. And depending on the character given, we’ll use this to move the motor(s).

The following section outlines the code:

The Robotic Arm code can be seen as a series of servo motors working together to simulate human movements. The code is the same, with Servo’s being driven by a Servo Driver based on Bluetooth’s values.

//Defining the servo driver. 0x40 Address is the default I2C Address.
#define I2CAdd 0x40 
int response_time = 5; //Receiving values from the Robotic Glove interval
// Checks whether data is coming from the serial port
  
if (Serial.available() > 0) { 
    state = Serial.read(); // Reads the data from the serial port
    Serial.print(state); // Prints out the value sent
    //Motor functionality code block
}

Based on the current ‘state’s value,’ the servo Driver would send a signal to the respective Motor.

For example, if we bend our fingers. The value ‘f’ would be sent by the robotic glove (via Bluetooth) whereby the Robotic Arm would read this data and trigger a function to rotate the respective servo motor. This process is repeated in an infinite loop.

if (Serial.available() > 0) { // Checks whether data is coming from the serial port
    state = Serial.read(); // Reads the data from the serial port
    Serial.print(state); // Prints out the value sent
    //For the naming of the motors, refer to the article / tutorial
    //Move (Base Rotation) Stepper Motor Left
    if (state == 'S') {
      baseRotateLeft();
      delay(response_time);
    }
}

Note: The code implements a hard stop, to stop the Motor from exceeding its maximum angle, which can strip the motor gears.

HCPCA9685.Servo(0, servo_joint_L_parking_pos_i); // Drive the servo motor at channel 0 to the desired angle.
//Move Claw Motor Downwards
    if (state == 'f') {
      if (servo_joint_3_parking_pos_i < servo_joint_3_max_pos) {
        HCPCA9685.Servo(4, servo_joint_3_parking_pos_i);
        delay(response_time);
        Serial.println(servo_joint_3_parking_pos_i);
        servo_joint_3_parking_pos_i = servo_joint_3_parking_pos_i + servo_joint_3_pos_increment;
      }
    }
void baseRotateLeft() {
    digitalWrite(stepPin, LOW); //Spin in a direction based on HIGH, LOW
    delayMicroseconds(stepDelay); //Change the speed of the Stepper motor
}

If the value of the servo motor is less than the maximum rotation, continue spinning. If it has reached the maximum rotation of 180 degrees, stop.

servo_joint_3_parking_pos_i < servo_joint_3_max_pos

Where servo_joint_3_max_pos is the maximum position of the Motor.

Note: The code implements a hard stop to stop the Motor from exceeding its maximum angle, which can strip the motor gears.

Programming the Flex Sensor

The Robotic Arm code can be found on GitHub. If you work on the project, contribute your own version to Git Repo. This would help build an index of different versions and functionalities of the Robotic Arm.

The code has already been documented (Also available on Git). However, we’ll cover the key points:

We’ll define the five sensors:

//LED ON PIN 3
int pinkie_Data = A1;
int finger_Data = A2;
int thumb_Data = A3;
//const int MPU_addr = 0x68;
const int MPU2 = 0x69, MPU1 = 0x68;

Note: 0x68 and 0x69 represent the I2C Address of the 2 MPU6050 Accelerometers

//How often to send values to the Robotic Arm
int response_time = 1000;  

The Following code outlines the Arduino reading the values of the sensors:

  // read the values from Flex Sensors to Arduino
  pinkie = analogRead(pinkie_Data);
  finger = analogRead(finger_Data);
  thumb = analogRead(thumb_Data);

Read the current position of the Accelerometer:

GetMpuValue1(MPU1);  
GetMpuValue2(MPU2);

Calibrating the values:

The Following code calibrates to find the upper and lower limit of the Flex Sensor. To re-calibrate the flex glove, press the reset button on the Arduino.

  if (bool_caliberate == false ) {
    delay(1000);
    thumb_high = (thumb * 1.15);
    thumb_low = (thumb * 0.9);
    finger_high = (finger * 1.03);
    finger_low = (finger * 0.8);
    pinkie_high = (pinkie * 1.06);
    pinkie_low = (pinkie * 0.8);
    bool_caliberate = true;
  }

We’ll constantly check if the current value has exceeded the defined flex’s upper or lower limit based on the calibration. If the flex sensor goes above or below this value, data is sent to the Robotic Arm to move a specific servo motor in a specific direction.

  // finger 1 - Claw Bend/Open
  if (finger >= finger_high) {
    Serial.print("F");
    delay(response_time);
  }
  if (finger <= finger_low) {
    Serial.print("f");
    delay(response_time);
  }

Programming the Robot Arm

Results – Pay-off

robotic arm stand up

The Robotic Arm is accurate enough to move objects. However, it will require some work to move complex objects, or even compete with the ‘million-plus year’ human beings have on dexterity … although spending more time working on the code, the Robot’s precision can be is works as intended for MARK 1i. Although the Arm can be improved can be improved significantly.

If you would like to improve the code, contribute to the Arduino Robot Arm Git Repo and build your arm. Let’s make this open for others to build on!

Lastly, We can also control the Robot through hand gestures and program the Robot to automate basic tasks.

Next Steps

And that’s all for MARK 1 (Version 1) folks!

But this is just the beginning. With more iterations planned, there’s plenty of room to improve the arm’s dexterity, precision, and power. Plus, by integrating new technologies, you could take this project even further, perhaps adding advanced AI functionality or automation.
If you would like to support this project, consider supporting my Patreon page.

Alternatively:



18 thoughts on “DIY Arduino Robot Arm – Controlled by Human Gestures”

  1. Hey! I was wondering if i could just buy an arm and if you have any recommendations and which arm I could buy? I dont really have a 3D printer so was wondering if you know of any decent arms.

    • Hi Mo,
      Thanks for watching. The best arm differs on your preference but I would recommend getting a servo motor Arduino Arm on Amazon. The best-rated one should be a good choice. You can pretty much then start from Arduino and programming building.

  2. Hi, great project you did. I wanted to know if it was possible to have access to the electronic diagram to build the hand and be able to control the robotic arm. I saw that the arduino code is present but not the diagram. Also my 3d printer is not big enough for printing so I figured I could change the proportions and include 9g servo motors in it. Do you think this could work? Thanks in advance.

  3. I am very impressed by this project and plan to give it a go. I have a 3D printer so that helps. i am a 75 year old Englishman and my electronics training was on thermionic valves and transistors (a long time ago) so I am looking forward to using ths project to learn about the new world….and it is ideal for Covid lockdown! Thanks very much and I hope your career goes from strength to strength!

    • Hi Trevor,

      Thanks and much appreciated!!
      Hope you find these projects useful. More interesting projects on the way.
      Stay tuned!

  4. Is there an alernative to the LiPO battery. It needs an expensive charger and I am sure a 9v battery should be OK?

    • Hi Trevor,
      You could use a 9V battery, but the capacity would not be as much…(assuming you’re referring to the 12V NEMA 17 Motor)
      If you would like to use an alternative have a look at a 12V RC Battery

      Good luck!

  5. Are you using a continuous servo? I bought the MG996R and they seem to operate like continuous servos which doesn’t allow me to use them for inverse kinematics.

    • Hi Michael, seems you’ll need to use the 180 degrees Servo Motor versions (the one used for this Arm). This would help you set a fixed position.

  6. Dear Eben,

    Hello.
    I want to thank you for you job. It is great.
    I have almost repeated your project ( robot arm). But I have several problems with it. And I still can not to force it to work property. I have finished the hardware but can not cope with a code because I am not good at programming.
    I would be appreciate you a lot if you connected with me by email and help me a little bit to complete this project. First of all I would ask you to share the working code ( arm+ glove) version wich does not need any adjustments. As I noticed the code which you placed at Github should be adjusted before using.

    I hope you will answer. Thx in advance.

  7. Hello,
    Could you share the last working version of the code (glove + arm)?
    Current version does not work.
    I would be appreciate a lot.

  8. Back on this after a delay. Can’t find the HCPCA9685.h driver so can’t compile. Adafruit did not have the same commands so could not prog left and right elbow joint to work from the same software. Should Adafruit driver be the same as HCPCS9685

    Cheers
    Trevor

Comments are closed.