Introduction: Control Robotic Arm With Gloves, Android Phone and Arduino
Today, we have almost 2 techniques to play with Robotic Arm, either by buttons for example as on Game shield or using gloves that include sensors. Yet, today I will show you a new technique by using only your Android Phone and Arduino.
Basically, The project illustrate how to send the mobile sensors data via Bluetooth to Arduino using 1Sheeld and then controlling the motion of the servos.
Step 1: Components
1- Arduino Uno (18$)
2- 1Sheeld (60$)
3- Servo X2 (1.8 $)
4- Gripper for Robotic Arm with 2 DOF (2.3$)
5- Any Metallic heavy Base.
6- Any kind of strong adhesive (glue)
7- Android Smart Phone/ Tablet.
Step 2: Arm Fabrication
Actually, I'm don't have too much experience in mechanical things. Yet, I tried as much I could to implement the Arm as shown in figure. Basically, all you have to do firstly is to estimate how much load each servo will carry in order to get the right servo with the required torque.
Step 3: Mobile Application
Step 4: Arduino Sketch
As shown below the code is so simple. Actually, any one even who is new in using Arduino can get it.
All we have to declare the pins for 4 PWM for each servo and then map the Value of the sensor from (0 to 180) which are the whole region the servo can rotate.
#include <OneSheeld.h> #include <Servo.h> Servo myservo1; Servo myservo2; Servo myservo3; Servo myservo4; void setup() { OneSheeld.begin(); myservo1.attach(3); myservo1.write(90); myservo2.attach(5); myservo2.write(0); myservo3.attach(6); myservo3.write(180); myservo4.attach(9); myservo4.write(15); } void loop() { if (ToggleButton.getStatus ()) myservo2.write(120); else myservo2.write(0); if(OrientationSensor.getZ()>0 && abs(OrientationSensor.getZ())<= 83 && GravitySensor.getZ() > 0) myservo1.write(map(OrientationSensor.getZ(),0,90,90,0)); if(OrientationSensor.getZ()<0&& abs(OrientationSensor.getZ()) <= 83&& GravitySensor.getZ() > 0) myservo1.write(map(abs(OrientationSensor.getZ()),90,0,180,90)); if(OrientationSensor.getY() < 0 && OrientationSensor.getY() >= -90 && abs(GravitySensor.getZ()) >= 2.5) myservo4.write(map(abs(OrientationSensor.getY()),0,90,15,105)); if(OrientationSensor.getY() > 0 && OrientationSensor.getY() <= 50 && abs(GravitySensor.getZ()) >= 2.5) myservo4.write(map(abs(OrientationSensor.getY()),0,50,15,0)); if(OrientationSensor.getX() > 0 && OrientationSensor.getX() <= 180 && abs(GravitySensor.getZ()) >= 2.5) myservo3.write(map(abs(OrientationSensor.getX()),0,180,180,0)); }
Step 5: Test
Finally, all you have to do to open 1Sheeld mobile Application, then choose the required shields (Orientation, gravity and Button) .
14 Comments
Question 4 years ago
when i compile the code it says
fatal error: OneSheeld.h: No such file or directory
#include
compilation terminated
exit status 1
error compiling for board Arduino/Genuino Uno.
can you please correct it
6 years ago
hello, im having a trouble, i upload the code and as soon as i turn my motors on they keep rotating forever. I need help ?
7 years ago
Sorry, I'm kinda new at arduino, which holes in the circuit board do the servos. That probably sounds like a dumb question, sorry
Reply 7 years ago
the pwm ports
the one that are having a tild(~) this type of notation.
7 years ago on Introduction
Hey! I'm sorry but I'm a real novice at using arduino so could you tell me how am I going to make my servos take only a 35 degree rotation? Please do reply. Thank you! XD
8 years ago on Introduction
Hi, i'm having some trouble
could you contact me at lfernandomr25@gmail.com
Please!! thanks.
8 years ago
Its Looking Cool.....
Reply 8 years ago on Introduction
I'm so glad for being interested
8 years ago on Introduction
Great... project...especially what using android phone....
Reply 8 years ago on Introduction
yeah sure, actually smart phones nowadays have powerful capabilities that we should use in our projects :)
8 years ago
What website did you get the gripper from?
Reply 8 years ago on Introduction
I got it from a local electronics shop in my city. I think you will find it in Amazon or aliexpress
8 years ago on Introduction
That's so cool, looks like magic to me! Thanks for sharing your process!
Reply 8 years ago on Introduction
Thanks a lot :)