Froggy World 1 the Catapult
Intro: Froggy World 1 the Catapult
Froggy World is an amusement park for adventurous frogs.
This ride is the first in a series. Each ride receives a signal from the previous ride "You've got the frog;" and each ride signals the next that "Frog has left, you've got the frog." Eventually, the frog will be returned to the catapult (by another ride) and the cycle will repeat.
The concept for winding and releasing the catapult spring comes from Arduino Controlled Catapultby UnusualTravis
https://www.instructables.com/id/Arduino-Controlled-Catapult/
STEP 1:
The code "winds" the spring servo, then moves the "release servo." The spring servo unwinds (catapult falls back to start position) and the "release servo" moves to the latch position. Then the "frog has left" signal is activated.
#include <Servo.h>
Servo myservo;
Servo release;
int start = 13;
int next = 11;
int val = 0;
void setup ()
{myservo.attach(5);
release.attach(6);
pinMode(start, INPUT);
pinMode(next, OUTPUT);
digitalWrite(next, HIGH);
myservo.write(150);
release.write(120);
}
void loop ()
{val=digitalRead(start);
if(val==LOW)
{myservo.write(5);
delay(1000);
release.write(180);
delay(1000);
myservo.write(150);
delay(2000);
release.write(120);
digitalWrite(next, LOW);
delay(1000);
digitalWrite(next, HIGH);
}}
STEP 2:
Design and 3d print files are available at:
http://www.thingiverse.com/thing:42991
STEP 3:
STEP 4:
STEP 5:
STEP 6:
STEP 7:
STEP 8:
Add the base and the restraint with screws or small bolts.
STEP 9:
STEP 10:
STEP 11:
STEP 12:
Attach the servo horn to the servo motor and stretch the spring just enough that the catapult arm will lie at rest when the servo horn is in the leftmost position.
STEP 13:
STEP 14:
STEP 15:
Solder jumper pins to the ends of all wires (use heat shrink tubing to protect the solder connections from shorting).
STEP 16:
STEP 17:
Download the software from step #2 to the Arduino if you have not already done so.
STEP 18:
Neaten up the cable runs with cable ties or holders (some printed ones are available if you are 3d printing parts).
32 Comments
MikeTheMaker 10 years ago
Now, let's change the code so that the catapult only fires once (on power up or whenever you push the reset button on the Arduino).
Run the program, with nothing attached to the servos. After a few seconds, the servos will settle down. Attach the servo arms--myservo will be in the relaxed position, the release servo will be in position to hold the arm.
#include
Servo myservo;
Servo release;
void setup ()
{myservo.attach(5);
release.attach(6);
myservo.write(150);//this puts the spring in the unwound position
release.write(120);//this puts the release servo in a position to hold the catapult
}
void loop ()
{
myservo.write(5);//wind the spring
delay(1000);//give the spring time to get wound
release.write(180);//release the catch
delay(1000);//wait for the arm to fling
myservo.write(150);//return spring to released position
delay(2000);//give arm time to flop down
release.write(120);//reset catch
delay(1000000000);//wait a long long time before repeating
}
AIBalboa24 10 years ago
MikeTheMaker 10 years ago
MikeTheMaker 10 years ago
Red on both servos are connected together and connected to positive on the 7.5 volt battery.
Black on both servos are connected together and connected to negative on the 7.5 volt battery. Negative on the 7.5 volt battery is connected to negative on the 9 volt battery.
Yellow on the spring winding servo is connected to pin 5 on the Arduino.
Yellow on the release servo is connected to pin 6 on the Arduino.
Positive from the 9 volt battery goes to Vin on the Arduino.
Negative from both batteries (you connected them earlier) also goes to "Gnd" on the Arduino.
You will probably need some jumper wires if you don't already have them. They have little metal pins on the ends . . . those pins will plug into the arduino sockets or the breadboard holes.
On the sides of the breadboard, everything near the red line is connected together (usually put positive from a battery there). Everything next to the blue line (between the blue line and red line) is connected together--usually put battery negative there. In the middle of the breadboard, groups of 5 pins (like A,B,C,D,E) are all connected together.
Do most of your connecting on the breadboard. You may have to solder wires from the servo and wires from the batteries (if they do not have pin connectors).
MikeTheMaker 10 years ago
Jumper pins make life a lot easier than soldering--then it is easy to change your projects around.
AIBalboa24 10 years ago
Am i doing something wrong?
MikeTheMaker 10 years ago
MikeTheMaker 10 years ago
AIBalboa24 10 years ago
MikeTheMaker 10 years ago
MikeTheMaker 10 years ago
MikeTheMaker 10 years ago
#include <Servo.h>
UnusualTravis 11 years ago
J-Five 11 years ago
MikeTheMaker 11 years ago
J-Five 11 years ago
MikeTheMaker 11 years ago
J-Five 11 years ago
I better not give you any ideas.
MikeTheMaker 11 years ago
https://www.instructables.com/id/Froggy-World-2-The-Boot/
J-Five 11 years ago