Fakhr El-deen Gamal
Published © CC BY-NC-SA

Control your RoboArm with your Smartphone

RoboArm that simulate the human movements through Orientation senor in my mobile

IntermediateWork in progress6 hours12,575
Control your RoboArm with your Smartphone

Things used in this project

Story

Read more

Custom parts and enclosures

RoboArm Dxf file

Schematics

CEFam.png

Code

RoboArm

Arduino
move your phone to see the Arm movements
#include <OneSheeld.h>
#include <Servo.h>
Servo gripper;
Servo base;
Servo motor1;
Servo motor2;

int base_val=0;
int mot1_val=0;
int mot2_val=0;


void setup()
{
     gripper.attach(10);
     base.attach(9);
     motor1.attach(13);
     motor2.attach(11);
     OneSheeld.begin();
  
}

void loop()
{
  
  if(ProximitySensor.getValue() > 0)
  {
    gripper.write(120);
    Terminal.println("open");
  }
  else
  {
    gripper.write(0);
     Terminal.println("close");
  }
  

  if(OrientationSensor.getX() >0 && OrientationSensor.getX() <190 && OrientationSensor.getY() < 2 && OrientationSensor.getY() > -6&& OrientationSensor.getZ() > 0 && OrientationSensor.getZ() < 5)
  {
    base_val = map (abs(OrientationSensor.getX()),0,190,179,0);
    base.write(base_val);
    Terminal.println(base_val);
    
  }
   if(OrientationSensor.getX() >10 && OrientationSensor.getX() <25 && OrientationSensor.getY() < 0 && OrientationSensor.getY() > -85 && OrientationSensor.getZ() > 3 && OrientationSensor.getZ() < 7)
  {
    mot1_val = map (abs(OrientationSensor.getY()),0,85,179,0);
    motor1.write(mot1_val);
    Terminal.println(mot1_val);
    
  }
  
   if(GravitySensor.getZ() >=9 && AccelerometerSensor.getX() > 0 )
  {
    mot2_val = map (abs(AccelerometerSensor.getX()),0,4,179,0);
    motor1.write(mot2_val);
    Terminal.println(mot2_val);
    
  }

}

Credits

Fakhr El-deen Gamal

Fakhr El-deen Gamal

2 projects • 23 followers
I am an Electrical engineer student and i have passion on learning and working at embedded systems
Thanks to 1Sheeld.

Comments