Fil2002EnricoTesta2002
Published © CC BY-NC

SCARA Arm Controlled by Joystick

This is a project about a SCARA arm which is controlled by a joystick and which sends the position by a Bluetooth module.

IntermediateProtip6,280
SCARA Arm Controlled by Joystick

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Machine Screw, M3
Machine Screw, M3
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Machine Screw, M4
Machine Screw, M4
×1
Tactile Switch, Top Actuated
Tactile Switch, Top Actuated
×1
DS3218MG Servo
×1
Analog joystick (Generic)
×1
Heat Inserts
×1
Resistor 10k ohm
Resistor 10k ohm
×1

Software apps and online services

Arduino IDE
Arduino IDE
Ultimaker Cura

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
Hot glue gun (generic)
Hot glue gun (generic)
Multitool, Screwdriver
Multitool, Screwdriver
Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Drill / Driver, 20V
Drill / Driver, 20V

Story

Read more

Custom parts and enclosures

Base

Arm

Dispenser

Funnel

Guide

Error uploading file to Sketchfab.

Practice Platform

Top

Schematics

Wirings SCARA

This is how you must connect the elettronic parts.

Code

Sketch SCARA Arm

Arduino
This is the sketch wich you must load on your arduino board.
#include <Servo.h>  //include the library about servo

Servo servo_base;   //give a name to the servo
Servo servo_arm;
Servo servo_dispenser;


int val = 0;
int val1 = 0;
int n = 0;
int t = 0;
int pos = 0;
int pos1 = 0;
int pos2 = 0;

void setup() {
  servo_base.attach(9);    //set the pin 9 for servo
  servo_arm.attach(10);
  servo_dispenser.attach(11);
  pinMode(A0, INPUT);   //set the pin A0 and A1 to receive data from the joystick
  pinMode(A1, INPUT);
  pinMode(8, INPUT);   //set the pin 8 to receive data from the buttom 
  Serial.begin(9600);  //start the serial monitor
}

void loop() {

  val = int (map(analogRead(A0), 0, 1023, -550, 550) / 512);   //map the value read from A0 ad take the integer
  val1 = int (map(analogRead(A1), 0, 1023, -550, 550) / 512);
  pos2 = map(digitalRead(8), 0, 1, 130, 100);
  pos = n + 1 * val;         //add up the value with the previous
  pos1 = t + 1 * val1;
  pos = constrain(pos, 0, 180);      //limit the value of the variable between 0 and 180
  pos1 = constrain(pos1, 0, 180);
  servo_base.write(pos);         //turn the servo of the angle we want
  servo_arm.write(pos1);
  servo_dispenser.write(pos2);
  n = pos;                      //store the position
  t = pos1;
  delay(10);
  Serial.print("servo-base     ");      // send the value to the bluetooth
  Serial.print(pos);
    Serial.print("servo-arm     ");
  Serial.print(pos1);
    Serial.print("servo-dispenser     ");
  Serial.println(pos2);


}

Credits

Fil2002

Fil2002

0 projects • 0 followers
EnricoTesta2002

EnricoTesta2002

0 projects • 0 followers

Comments