top of page

Arduino Based 4DOF Robotic Arm Control

Updated: Jul 2, 2021



In this tutorial we are going to do is a simple design an Arduino Uno based 4DOF Robotic Arm control using potentiometer. This project will be helpful for beginners who want to learn to develop a Simple Robot (Me arm) in low cost or just want to learn working with Arduino and servo motors.

This Arduino Robotic Me Arm can be controlled by four Potentiometer attached to it, each potentiometer is used to control each servo. You can move these servos by rotating the pots to pick some object, with some practice you can easily pick and move the object from one place to another. We have used low torque servos with metal gear here but you can use more powerful servos to pick heavy objects.


Circuit Diagram


Components Required

  • Arduino Uno

  • Servo Motor MG 90S - 4nos

  • 10K Linear Pot- 4nos

  • 5VDC Power Supply

Servo Motor MG-90S

A servo motor is a closed-loop system that uses position feedback to control its motion and final position.RC servo motor works on the same principal. It contains a small DC motor connected to the output shaft through the gears.


Connecting the Servo Motor to the arduino uno

Black wire of servo motor to the GND pin of arduino uno

Red wire of servo motor to the 5V pin of arduino uno

Orange wire of servo motor to the D5, D6,D7,D8 of arduino uno


Robotic Arm:

We provide variable voltage at the ADC channels of arduino UNO using Pot. So the digital values of Arduino are under control of user. These digital values are mapped to adjust the servo motor position, hence the servo position is in control of user and by rotating these Pots user can move the joints of Robotic arm.



Installing the Arduino_Library

No special Library require for this project.

Subscribe and Download code.


arduino code

#include <Servo.h>

Servo servo0;

Servo servo1;

Servo servo2;

Servo servo3;

int sensorvalue0;

int sensorvalue1;

int sensorvalue2;

int sensorvalue3;


void setup()

{

Serial.begin(9600);

pinMode(A0,INPUT);

pinMode(5,OUTPUT);

servo0.attach(5);

pinMode(A1,INPUT);

pinMode(6,OUTPUT);

servo1.attach(6);

pinMode(A2,INPUT);

pinMode(7,OUTPUT);

servo2.attach(7);

pinMode(A3,INPUT);

pinMode(8,OUTPUT);

servo3.attach(8);

}


void loop()

{

sensorvalue0 = analogRead(A0);

sensorvalue0 = map(sensorvalue0, 0, 1023, 0, 120); // left servo

servo0.write(sensorvalue0);

// Serial.println (sensorvalue0);

sensorvalue1 = analogRead(A1);

sensorvalue1 = map(sensorvalue1, 0, 1023, 70, 150); // right servo

servo1.write(sensorvalue1);

// Serial.println (sensorvalue1);


sensorvalue2 = analogRead(A2);

sensorvalue2 = map(sensorvalue2, 0, 1023, 20, 160); // center servo

servo2.write(sensorvalue2);

//Serial.println (sensorvalue2);


sensorvalue3 = analogRead(A3);

sensorvalue3 = map(sensorvalue3, 0, 1023, 130, 145); // jaw servo

servo3.write(sensorvalue3);

// Serial.println (sensorvalue3);

}






4,299 views0 comments
bottom of page