Description
The goal was to create a crawler using a servo motor. I tried several things to make a crawler. First I added headweight and tried controlling it using a potentiometer. I realized headweight helped in sliding and crawling. Next, I tried to mimic the walking motion of a human, when we transfer weights from one side to the other. I attached weigths to both sides of a plank attached to servo motor. I removed the potentiometer and used the automated code to control the servo. The motor crawled but it was still very slow.
In my final attempt, I created the crawling motion through tail weight. It consists of 2 boxes tied with stick which is connected to the servo. The box in front has no weight and the box in the back has some weight of the arduino, batteries etc. When the servo rotates, because the box in the front has no weight , it twists and when the servo goes back to original position, it drags the box to move forward because of the tail weight attached to it. It is completely automated and will keep crawling until unplugged.
Video:
A video of all my attempts can be found here:
http://www.youtube.com/watch?v=mNI30ROWN9g
Components:
1 Arduino
1 Servo Motor
1 Power source of 2 AA batteries
1 BreadBoard
2 Boxes
1 Stick
Many wires.
Code:
Used arduino's sweep code.
// Sweep
// by BARRAGAN <http://barraganstudio.com>
// This example code is in the public domain.
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created
int pos = 0; // variable to store the servo position
void setup()
{
myservo.attach(7); // attaches the servo on pin 9 to the servo object
}
void loop()
{
for(pos = 0; pos < 120; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(8); // waits 15ms for the servo to reach the position
}
for(pos = 120; pos>=0; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(8); // waits 15ms for the servo to reach the position
}
}
- Login to post comments