Engr Muhammad Sheraz
Published © LGPL

Make a Simple Robotic arm Using Servo Motor

Use this homemade Arduino project to pick and place objects using a servo motor.

IntermediateFull instructions provided10 hours11,024
Make a Simple Robotic arm Using Servo Motor

Things used in this project

Hardware components

UTSOURCE Arduino UNO & Genuino UNO
×1
UTSOURCE Rotary potentiometer
×1
UTSOURCE Jumper wires
×1
UTSOURCE Servo Motors
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

circuit

File missing, please reupload.

Code

code

Arduino
#include <Servo.h>
Servo servo0;
Servo servo1;
Servo servo2;
Servo servo3;
int sensorvalue0;
int sensorvalue1;
int sensorvalue2;
int sensorvalue3;
void setup()
{
  pinMode(A0,INPUT);
  pinMode(3,OUTPUT);
  servo0.attach(3);
  
  pinMode(A1,INPUT);
  pinMode(5,OUTPUT);
  servo1.attach(5);
  
  pinMode(A2,INPUT);
  pinMode(6,OUTPUT);
  servo2.attach(6);
  
  pinMode(A3,INPUT);
  pinMode(9,OUTPUT);
  servo3.attach(9);
}

void loop()
{
  sensorvalue0 = analogRead(A0);
  sensorvalue0 = map(sensorvalue0, 0, 1023, 0, 180);
  servo0.write(sensorvalue0);
  sensorvalue1 = analogRead(A1);
  sensorvalue1 = map(sensorvalue1, 0, 1023, 0, 180);
  servo1.write(sensorvalue1);
  sensorvalue2 = analogRead(A2);
  sensorvalue2 = map(sensorvalue2, 0, 1023, 0, 180);
  servo2.write(sensorvalue2);
  sensorvalue3 = analogRead(A3);
  sensorvalue3 = map(sensorvalue3, 0, 1023, 0, 180);
  servo3.write(sensorvalue3);
}

Credits

Engr Muhammad Sheraz

Engr Muhammad Sheraz

14 projects • 64 followers
BSc Electerical Enginer and An Expert Academic Writer https://aquabcasing.com/WhatsApp: +923057608848

Comments