Simple Walker Robot
Intro: Simple Walker Robot
Building a simple walking robot is really easy. Don't let the number of steps fool you into believing otherwise. This robot is basically made with a handful of household items and some simple electronics that you can easily pick up at Radioshack. In fact, this robot is entirely zip tied together, which makes building it and modding it extremely easy. If at any point you are unhappy with how its built, cut the zip ties away and zip tie it together differently.
The "brains" of this robot are also easily modifiable since it is based on an Arduino development board. Programming it and changing the code is extremely straight-forward. Even people with no programming experience can usually get up to speed pretty quickly and start coding their own robotic routines.
For me, this robot was mainly an experiment to see what would happen if I built a full-on robot that was like one of the many Simple Bots that I have built. It was interesting to see how much more robust one of these creatures become when you give it some computer logic.
Check out my book Homemade Robots for more projects!
STEP 1: Go Get Stuff
You will need:
(x4) Rubber spatulas
(x2) 6" turnbuckles
(x1) 2" x 48" aluminum ruler
(x1) Ballpoint pen
(x1) 4-40 x 1/4" nut and bolt
(x1) Arduino Uno REV 3
(x2) Standard Servo
(x2) 3x1 male header pins (strips of 40 available)
(x1) Parallax Ping Sensor
(x1) 9V Snap Connectors
(x1) 9-Volt Battery Holder
(x1) DC Power Plug
(x1) Multipurpose PC Board
(x1) Stranded 22AWG hookup wire
(x1) 9 Volt Battery
(x1) 5-1/2" Zip Ties
(Please note that some of the links on this page contain Amazon affiliate links. This does not change the price of any of the items for sale. However, I earn a small commission if you click on any of those links and buy anything. I reinvest this money into materials and tools for future projects. If you would like an alternate suggestion for a supplier of any of the parts, please let me know.)
STEP 2: Saw
Cut a 10" section off one end using a hacksaw.
STEP 3: Bend
Bend the aluminum slightly (to about 30 degrees) using a rubber mallet or hammer.
If you don't have a bench vise, hang the ruler halfway off the edge of your workbench, place a block of wood atop the ruler and clamp it firmly in place. You have now made an impromptu bending rig.
Simply hammer down on the ruler until it bends down over the edge of the workbench.
STEP 4: Take Apart
Set them aside for some other project.
STEP 5: Drill
Repeat this for the second servo.
STEP 6: Mark and Drill
Place the servo horn at the 3" center point on the turnbuckle.
Position the horn such that it is making a "V" perpendicular to the length of the turnbuckle. This should, by default, position two more "V" shapes pointing to each side of the turnbuckle. Make marks in the valley of each of these "V" shapes.
Finally, drill these two marks with a 1/8" drill bit.
Repeat on the second turnbuckle.
STEP 7: Mark
STEP 8: Drill
STEP 9: Remove
STEP 10: Mark Again
Rotate the servo 180 degrees and repeat on the opposite side.
STEP 11: Drill Again
STEP 12: Zip Tie
Trim away the excess zip tie tails.
STEP 13: Reattach the Horn
Put the first servo horn back on such that all of the "V" shapes are parallel to each of the edges.
Fasten it in place with the mounting screw.
Repeat for the second servo motor.
STEP 14: Mark and Drill a Bit More
On the other side of the same servo, place the Arduino board and make marks in each of its mounting hole. Try to fit the whole thing to one side of the ruler's bend.
On the opposite side of the ruler's bend, place the battery mount and make a mark.
Drill all of the marks that you have just made with a 1/8" drill bit.
STEP 15: Insert
STEP 16: Attach
Repeat this process for the second turnbuckle.
STEP 17: Mounting Holes
Make multiple marks on the spatula's handle on all sides of the turnbuckle to indicate drill holes for zip tying it to the turnbuckle.
Drill the marks that you have just made with a 1/8" drill bit.
Flip the spatula upside down, and place the other spatula on top of it right-side-up. Align them so they are of matching height.
Use the first set of drill holes as guides to drill another set of holes in the other spatula. This should end up as a mirror image of the first (i.e. inverted, but otherwise identical).
STEP 18: Front Legs
For the best results, make sure they roughly mirror each other in position and height.
These two spatulas will serve as the front legs.
STEP 19: Hind Legs
Note that the rear legs of this bot were slightly shorter than the front legs. However, this is not a hard rule. Experiment and see what works for you.
STEP 20: Spacers
Cut the pen's tube into 1/4" sections using a razor blade.
These will be used as spacers for mounting components
STEP 21: Trim
STEP 22: 9V Adapter
Solder the red wire to the central terminal and the black wire to the plug's outer terminal.
Screw back on the plug's cover.
STEP 23: Sensor Board
Solder the Ping sensor in place at a slight angle such that if you hold the board parallel to the ground, it would appear to be rotated about 45 degrees clockwise. This should counter-balance the fact that the PCB will get mounted to the board at about a 45 degree angle.
One the opposite side of the PCB that the Ping was soldered to, nstall two 3-pin male headers such that each one has a pin that is soldered to the ground rail, and a pin the is soldered to the power rail.
STEP 24: Wires
Solder a 6" black wire to the ground rail.
Solder a 6" green wire to the terminal that the Ping's signal pin is connected to.
Solder a 6" green wire to each of the remaining header pins that are not connected to a power or ground connection. These two wires will correspond to the signal pins for each of the servos.
STEP 25: Program
This code could definitely be more robust, but I will leave it up to you to expand upon it.
/* Simple Walker Robot by Randy Sarafan This code is for controlling a simple quadruped robot and having it respond to obstacles that approach. For more information visit the project page: https://www.instructables.com/id/Simple-Walker-Robot/ This code is based on both the Arduino Sweep example by BARRAGAN and the Arduino Ping example by Tome Igoe */ #include <Servo.h> Servo myservo; // create servo object to control a servo // a maximum of eight servo objects can be created Servo myservo1; // create a second servo object to control a servo int pos = 80; // variable to store the servo position for rear legs //changing this value changes the default position of the rear legs int pos1 = 70; // variable to store the servo position for front legs //changing this value changes the default position of the front legs //determines the rate at which the legs move int rate = 1000; // this constant won't change. It's the pin number // of the sensor's output: const int pingPin = 7; void setup() { myservo.attach(9); // attaches the servo on pin 9 to the servo object myservo1.attach(10); // attaches the servo on pin 10 to the servo object myservo.write(pos); // tell servo to go to position in variable 'pos' - sets center axis myservo1.write(pos1); // tell servo to go to position in variable 'pos' - sets center axis delay(5000); } void loop() { long duration, inches, cm; // The PING))) is triggered by a HIGH pulse of 2 or more microseconds. // Give a short LOW pulse beforehand to ensure a clean HIGH pulse: pinMode(pingPin, OUTPUT); digitalWrite(pingPin, LOW); delayMicroseconds(2); digitalWrite(pingPin, HIGH); delayMicroseconds(5); digitalWrite(pingPin, LOW); // The same pin is used to read the signal from the PING))): a HIGH // pulse whose duration is the time (in microseconds) from the sending // of the ping to the reception of its echo off of an object. pinMode(pingPin, INPUT); duration = pulseIn(pingPin, HIGH); // convert the time into a distance inches = microsecondsToInches(duration); //if something is closer than a foot, back away if(inches <= 12){ backward(); } //if nothing is closer than a foot, go forwards if(inches > 12){ forward(); } } //function for going forwards void forward(){ myservo.write(pos + 20); // tell servo to go to position in variable 'pos' myservo1.write(pos1 - 20); // tell servo to go to position in variable 'pos' delay(rate); myservo.write(pos - 20); // tell servo to go to position in variable 'pos' myservo1.write(pos1 + 20); // tell servo to go to position in variable 'pos' delay(rate); } //function for backing away void backward(){ myservo.write(pos + 25); // tell servo to go to position in variable 'pos' myservo1.write(pos1 + 50); // tell servo to go to position in variable 'pos' delay(rate); myservo.write(pos - 25); // tell servo to go to position in variable 'pos' myservo1.write(pos1 - 30); // tell servo to go to position in variable 'pos' delay(rate); } long microsecondsToInches(long microseconds) { // According to Parallax's datasheet for the PING))), there are // 73.746 microseconds per inch (i.e. sound travels at 1130 feet per // second). This gives the distance travelled by the ping, outbound // and return, so we divide by 2 to get the distance of the obstacle. // See: http://www.parallax.com/dl/docs/prod/acc/28015-PING-v1.3.pdf return microseconds / 74 / 2; }
STEP 26: Sensor
Zip tie it firmly in place.
If the sensor is not level to the ground, gently bend its pins until it is.
STEP 27: Arduino
Zip tie it firmly in place.
STEP 28: Attach
STEP 29: Plug
STEP 30: Wire It Up
Plug the black wire from the PCB into the Arduino Ground socket.
Plug the green wire from the Ping sensor into the socket for digital pin 7.
Plug the green wire from the front servo into the socket for digital pin 9.
Plug the green wire from the rear servo into the socket for digital pin 10.
STEP 31: Power
Connect the battery to Arduino, secure it in the battery holder, and it is good to go.
Did you find this useful, fun, or entertaining?
Follow @madeineuphoria to see my latest projects.
47 Comments
ynqjwfb 6 years ago
very good !,NiuBI
laith mohamed 6 years ago
keegannie 6 years ago
Hi! I'm wondering where you found those spatulas. Thanks!
pascalg25 7 years ago
Very nice done project,its wonderfull to enjoy this shared build thank you;
afridave 7 years ago
that is fantastic.....so simple and really cute...all it needs is a pink afro wig on its head...I really enjoyed reading this instructable...very well put together. .thank you.
johnrinker 10 years ago
Thanks for the clear instructions to this amazing robot. It's the first I've ever tried to build. One question: I have a SainSmart HC-SR04 ping sensor that came with my Arduino. It's got 4 pins instead of the 3 on yours. They are marked 'vcc', 'echo', 'trig' and 'GND'. I'm assuming the 'vcc' is power and 'echo' is the signal. I've no idea what the 'trig' does. Any ideas if this sensor will work for the walker bot?
randofo 10 years ago
johnrinker 10 years ago
dimitriman 8 years ago
Did you get this to work?
QuinceyC 9 years ago
My solder job wont work and i cant figure out why. please help!
johnrinker 10 years ago
As soon as I get my breadboard I'll give it a go with your sketch, and change your pingPin assignment to = 12. See what happens!
johnrinker 10 years ago
cmerhar3 8 years ago
Randy, I built this - second Arduino project. Great instructions! Only thing I am struggling with is limiting the movement of the feet/rotation of the servos. The legs rotate until they stop against the robot body every time. Any advice on starting servo position and amount of travel?
T0BY 8 years ago
revealinghourcreations 9 years ago
robobot3112 9 years ago
nice.and smart
Tankos 9 years ago
For some reason the robot walks fine going backwards but not forward. Any suggestions on how to fix this problem? Thanks!
aakashsunkari 10 years ago
Great job! Now RadioShack is using your idea (Don't worry, they gave you you full credit) on their D.I.T idea brochures!
makesomeso 10 years ago
nice robot. Its somewhat more than a simple robot. good work, keep it up.
sanjay satheesh 11 years ago