Home

Contact Me





LinkedIn

1.0 Background


My personal favorite project I've completed is an electro-mechanically-actuated robotic arm. The arm operates by first pressing button 1 (B1) to connect a 9V battery to the power input on an Arduino Nano and a high-torque servo motor. Button 2 (B2) is a latch switch that connects the 5V end of a pull-up resister to a digital pin on the Nano. When the nano receives this 5V input, it sends a PWM signal to the servo motor to turn 180 degrees. When the motor turns, it pulls fishing line threaded through the posterior face of the fingers, in turn the fingers flex, allowing the arm to grab and hold an object. When B2 is pressed again, it is disconnected from 5V and connects to 0V, or ground. When the Nano reads 0V, it turns the motor 180 degrees in the opposite direction, effectively relaxing the fishing line and fingers.

2.0 Final Product


Arm

Complete Robotic Arm

3.0 Videos

Biological Models

Picking up a Water Bottle

Biological Models

Finger Functionality

3.0 Solidworks Assembly

Biological Models

Solidworks Assembly Isometric View

Biological Models

Solidworks Assembly Back View

Biological Models

Solidoworks Top & Bottom View

Biological Models

Solidworks Assembly Side View

Biological Models

Solidworks Assembly Top View


4.0 Circuit Diagram

Biological Models

The circuit used in conjunction with the Arduino Nano utilizes
two switches, a pullup resistor, and a high-torque servo motor.
The first switch (Sw1) attaches power (9V [not 5V] battery)
to the Arduino and servo motor.
The second switch (Sw2) connects A0 (3.3V) to the pull-up resistor,
which inputs 3.3V (or a binary "1") to the nano.
This signals the Nano to turn the servo motor 180 degrees.
All grounds are common.
NOTE: This is an updated/simplified circuit from the origonal circuit I made (the one seen in the images).

5.0 Assembly



Materials

REAL Arduino Nano

*Always read reviews and ensure you are not buying a
cheap knockoff Arduino.
Fakes will NOT interface with the Arduino IDE properly


High-Torque Servo Motor
9V Battery
Prototyping Board
Soldering Iron
Latch Button (x2)
22 AWG Wire*

*Any type of wire between 20-22AWG work for Arduino.
I prefer solid to stranded wire for ease of
soldering, but that is personal preference.

6.0 Code

  
#include 

Servo myservo;  // create servo object to control a servo

int flex = 0;    // flex position (0 degrees)
int extend = 180;   //extended position (180 degrees)
int servo = 9; //Servo on D11 (PWM pin)
int power = A0; //set A0 as 3.3V output
int go = A5; //A5 as input (goes from 0 to 1)
int state = 0; //state of activation (flexed vs. extended)
int delta = 0; //see if state has changed
int flexState = 0; //state variable to control if flexed or not


void setup() {
  myservo.attach(servo);  // attaches the servo on pin 11 to the servo object
  pinMode(servo, OUTPUT);    // sets servo pin as output
  pinMode(power, OUTPUT);    // sets A0 as output
  pinMode(go, INPUT);    // Sets A5 as discrete input
  digitalWrite(power, HIGH); //write power pin to high always
  myservo.write(extend); //ensure arm begins in extension
  myservo.detach(); //detach while not in flexion saves battery power
}

void flexion() {
  flexState = 1; //in flex state
   myservo.attach(servo); //attach servo object. WIll draw current when attached
   delay(100); //delay 100ms
   myservo.write(flex);              // tell servo to go to flex position (close hand)
   delay(1000); //allow servo to travel to position (1000ms)
   while (flexState == 1){ //loop to check if button has been pressed
    state = digitalRead(go); //set "state" to state of the latch (0= open; 1= closed)
    delay(100); //delay
    delta = abs(digitalRead(go) - state); //check for a change in button state
    if (delta > 0){ //if a change has occured
      flexState = 0; //exit flexed state
      delay(100); //delay
      extension(); //enter extension function

    }
    }   
}

void extension() {
   delay(100); //delay 100ms
   myservo.write(extend); //stretch fingers back out
   delay(1000) ; //allow servo to travel (1000ms) 
   myservo.detach(); 
   //detach so motor doesn't draw battery current in extension
//   doesn't need torque since its not holding anything
}


void loop() {
  state = digitalRead(go); //set "state" to state of the latch (0= open; 1= closed)
  delay(100); //delay 100ms
  delta = abs(digitalRead(go) - state);
  //if button has been pressed (state has changed), close the hand:
  if (delta > 0){ //if  button is pressed (latch button)
    flexion(); //call flex function   
  }
}