Introduction: Robotic Newton's Cradle

Here is my second attempt to automate the Newton's Cradle. This one doesn't require any modifications to the cradle itself. It uses 3 servos, an Arduino Uno , scrap wood, and some chop sticks plus a kitchen utensil hanger slider rod. Watch the video, ifun.t's

Step 1: Slider Servo

This picture shows the while rail at the bottom that I got from a kitchen utensil hanger thingy. I mounted an aluminum bracket on two of the sliders, connected that to a standard size servo via another aluminum bracket and a chopstick linkage bar. This pushes the claw mechanism to and from the Newton's Cradle.

Step 2: Forward and Backward Tilting Servo

On the slider bar you see a vertically mounted servo to which the claw is attached. This servo tilts the claw forward towards the cradle and backwards from it.

Step 3: The Claw

The claw or gripper is just a servo mounted on a piece of wood and connected to two chopsticks via wire linkage. It doesn't close exactly equally with both grippers but gets close enough to get the job done.

Step 4: Arduino Sketch

Finally here is the arduino program that controls the servos: (has a little garbage in it - need to clean it up)

#include
Servo servo1,servo2,servo3;

//int potPin = 2;

// select the input pin for the potentiometer

int servangle = 0; // servo angle variable int potPin = 4;

// select the input pin for the potentiometer

int potPin2 = 0;

// select the input pin for the potentiometer

int ledPin = 13;

// select the pin for the LED int val = 0;

// variable to store the value coming from the sensor

int valPot2 = 0;

int valInc = 4;

int currAngle = 0;

int newAngle = 0;

int delayTime = 0; //Analog read pins const

int buttonPin = 2;

void myServo(int curAngle,int newAngle,int angleInc,int incDelay,int servoNum)

{ if (curAngle < newAngle) { for(int angle=curAngle;angle < newAngle;angle += angleInc) {

if (servoNum == 1) servo1.write(angle);

if (servoNum == 2) servo2.write(angle); delay(incDelay); } }

else if (curAngle > newAngle) { for(int angle=curAngle;angle > newAngle;angle -= angleInc) {

if (servoNum == 1) servo1.write(angle);

if (servoNum == 2) servo2.write(angle); delay(incDelay); } } }

void setup() {

Serial.begin(9600);

pinMode(ledPin, OUTPUT);

// declare the ledPin as an OUTPUT

//pinMode(buttonPin,INPUT);

servo1.attach(9);

delay(10);

servo1.write(145);

servo2.attach(11);

delay(10);

servo2.write(90);

servo3.attach(13);

delay(10);

servo3.write(90);

delay(2000); }

void loop() {

//Serial.print(" buttonpin= ");

Serial.println(digitalRead(buttonPin));

val=1000;

Serial.print(" delay val= ");

Serial.print(val);

Serial.print(" angle val= ");

Serial.println(valPot2);

digitalWrite(ledPin,HIGH);

//servo1.write(30); //150 to 30

myServo(145,30,1,10,1);

servo2.write(145); //90 to 150

delay(1000);

servo3.write(109); //80 to 110 - clamp

delay(1000);

//servo3.write(100); //80 to 110

//servo1.write(145); //150 to 30

servo2.write(130); //90 to 150

int y = 131; for (int x=30;x<146;x=x+2) {

//myServo(30,145,1,10,1);

servo1.write(x); //90 to 150

delay(30);

y = y-1;

if(y > 89) { servo2.write(y);

delay(30); }

//myServo(130,90,1,10,2); }

delay(7000);

servo3.write(80); //90 to 150 - open clamp

// myServo1(172,90,1,15);

delay(val);

//servo1.write(172);

//myServo1(valPot2,175,1,1);

digitalWrite(ledPin,LOW);

//cli();

delay(5000); }

Comments

author
Doctorwhofan84 (author)2016-04-27

Really cool.

author
JimRD (author)Doctorwhofan842016-04-27

Thank you. One of my favorite projects. Tom Baker was my Doctor.

About This Instructable

480views

14favorites

License:

Bio: I am an American teaching English at Shangluo University, Shaanxi. I like making machines that do interesting but fairly useless things - I call them Quixotic ... More »
More by JimRD:Arduino Controlled Morse Code Key and TransmitterMagnetic Levitating Globe Tear-apart and FixMorse Code Key (and Sounder) Made From Steak-knife and Multi-tester
Add instructable to: