How to Make a Robotic Arm
In this project, I have built a smartphone-controlled robotic arm.
Components and supplies
1
3D printed robotic arm
1
NodeMCU ESP8266 Breakout Board
4
SG90 Micro-servo motor
Project description
Code
Arduino Code
arduino
Download Remotexy
1#define REMOTEXY_MODE__ESP8266WIFI_LIB_POINT 2#include <ESP8266WiFi.h> 3 4#include <RemoteXY.h> 5 6// RemoteXY connection settings 7#define REMOTEXY_WIFI_SSID "yobots" 8#define REMOTEXY_WIFI_PASSWORD "12345678" 9#define REMOTEXY_SERVER_PORT 6377 10 11 12// RemoteXY configurate 13#pragma pack(push, 1) 14uint8_t RemoteXY_CONF[] = 15 { 255,4,0,0,0,28,0,8,13,0, 16 5,0,28,9,40,40,2,26,31,4, 17 0,82,3,8,48,2,26,4,128,1, 18 51,96,9,2,26 }; 19 20// this structure defines all the variables of your control interface 21struct { 22 23 // input variable 24 int8_t joystick_1_x; // =-100..100 x-coordinate joystick position 25 int8_t joystick_1_y; // =-100..100 y-coordinate joystick position 26 int8_t slider_1; // =0..100 slider position 27 int8_t slider_2; // =0..100 slider position 28 29 // other variable 30 uint8_t connect_flag; // =1 if wire connected, else =0 31 32} RemoteXY; 33#pragma pack(pop) 34#include <Servo.h> 35Servo servo1; 36Servo servo2; 37Servo servo3; 38Servo servo4; 39 40///////////////////////////////////////////// 41// END RemoteXY include // 42///////////////////////////////////////////// 43 44 45 46void setup() 47{ 48 RemoteXY_Init (); 49 servo1.attach(D5); 50 servo2.attach(D6); 51 servo3.attach(D7); 52 servo4.attach(D8); 53 54 // TODO you setup code 55 56} 57 58void loop() 59{ 60 RemoteXY_Handler (); 61 int val1; 62 int val2; 63 int val3; 64 int val4; 65 val1=map(RemoteXY.joystick_1_x,-100,100,0,180); 66 val2=map(RemoteXY.joystick_1_y,-100,100,0,180); 67 val3=map(RemoteXY.slider_1,0,100,0,180); 68 val4=map(RemoteXY.slider_2,0,100,0,180); 69 70 servo1.write(val1); 71 servo2.write(val2); 72 servo3.write(val3); 73 servo4.write(val4); 74 //delay();// TODO you loop code 75 // use the RemoteXY structure for data transfer 76 77 78} 79
Arduino Code
arduino
Download Remotexy
1#define REMOTEXY_MODE__ESP8266WIFI_LIB_POINT 2#include <ESP8266WiFi.h> 3 4#include <RemoteXY.h> 5 6// RemoteXY connection settings 7#define REMOTEXY_WIFI_SSID "yobots" 8#define REMOTEXY_WIFI_PASSWORD "12345678" 9#define REMOTEXY_SERVER_PORT 6377 10 11 12// RemoteXY configurate 13#pragma pack(push, 1) 14uint8_t RemoteXY_CONF[] = 15 { 255,4,0,0,0,28,0,8,13,0, 16 5,0,28,9,40,40,2,26,31,4, 17 0,82,3,8,48,2,26,4,128,1, 18 51,96,9,2,26 }; 19 20// this structure defines all the variables of your control interface 21struct { 22 23 // input variable 24 int8_t joystick_1_x; // =-100..100 x-coordinate joystick position 25 int8_t joystick_1_y; // =-100..100 y-coordinate joystick position 26 int8_t slider_1; // =0..100 slider position 27 int8_t slider_2; // =0..100 slider position 28 29 // other variable 30 uint8_t connect_flag; // =1 if wire connected, else =0 31 32} RemoteXY; 33#pragma pack(pop) 34#include <Servo.h> 35Servo servo1; 36Servo servo2; 37Servo servo3; 38Servo servo4; 39 40///////////////////////////////////////////// 41// END RemoteXY include // 42///////////////////////////////////////////// 43 44 45 46void setup() 47{ 48 RemoteXY_Init (); 49 servo1.attach(D5); 50 servo2.attach(D6); 51 servo3.attach(D7); 52 servo4.attach(D8); 53 54 // TODO you setup code 55 56} 57 58void loop() 59{ 60 RemoteXY_Handler (); 61 int val1; 62 int val2; 63 int val3; 64 int val4; 65 val1=map(RemoteXY.joystick_1_x,-100,100,0,180); 66 val2=map(RemoteXY.joystick_1_y,-100,100,0,180); 67 val3=map(RemoteXY.slider_1,0,100,0,180); 68 val4=map(RemoteXY.slider_2,0,100,0,180); 69 70 servo1.write(val1); 71 servo2.write(val2); 72 servo3.write(val3); 73 servo4.write(val4); 74 //delay();// TODO you loop code 75 // use the RemoteXY structure for data transfer 76 77 78} 79
Downloadable files
Robotic Arm
I have designed a PCB in Eagle as per this circuit diagram.
Robotic Arm

Comments
Only logged in users can leave comments