Introduction: Arduino Biped

Picture of Arduino Biped

A robot is defined as a mechanical or virtual intelligent agent that can perform tasks automatically or with guidance .
Typically a robot is an electro -mechanical device that is guided by computer and electronic programming .

So I decided to try my hand at robotics, and what appealed to me the most was the Biped as it involves movement and balance. For this Ide be able to incorporate servos and accelerometers.

The Final Biped is a two legged Arduino controlled actuated robot with 8 Degrees of Freedom (DOF) and accelerometer feedback.

This is my first time using Arduino, servos and accelerometers so this may not be the best way to go about the final robot but it seems to be working as intended.


After much research I decided to go with the Arduino as it has Servo libraries which makes life a lot easier. Instead of creating 8 different PWM (pulse width modulation) signals for each servo, one can just set the rotation using a single command. (I will post code later). The Arduino I went with is the MEGA250 which has 14 PWM pins , Im only using 8 for the servos, also more than enough Analogue inputs for the accelerometer. 

The Arduino does not come with an istallation cd so the software can be found at the following link:

Arduino Software

It also doesn't come with the USB cable.
You will have to install the Arduino drivers, they come with the download. A "how to" google search should help.

The servos I used are HD-1501MG which have the minimum torque I would suggest for a biped of this size as it struggles in some positions. I purchased 8 from microRobotics. Heres the link to the product, you can also view the specs:


As far as precision is concerned, these are probably not the best option, but anything more high end was too expensive considering I needed 8.

The accelerometre is an ADXL330 which I picked up off an old project. A gyroscope from a broken WII remote works well too.

The structure of the BOT is Perspex, I cut it from a single sheet and rounded the edges.

I used many nuts and bolts, and a glue gun to hold it together.

An example of a biped with serial communication, Also has a nice GUI which I adapted to work with mine:

A similar Project, which I used the code as a template for my code:

A nice tutorial on how to get the robot walking:

Step 1: Structure - Perspex

Picture of Structure - Perspex

Cutting the Perspex:

- I used a Table saw for the long cuts and a jig saw for the short ones.

- I used a grinder to round the edges.

Step 2: Feet

Picture of Feet

Feet Construction:

- Attach a single bracket onto the center of the base of the foot. img[1]
the ankle servo will be supported by this bracket

- Cut a slot in the bracket for a perspex piece which we will mount to the servo. img[2]

- place the perspex piece into the slot and glue down with the glue gun. img[3]

- Round off the edges. img[4]

Step 3: Joints

Picture of Joints

The Pivot points are made up of 3 small square pieces of perspex sandwidged together.

- The first square has a hole drilled in so that the bolt can fit through, but the head cant.

- The second square has a larger diameter hole that the head of the bold can fit through freely

- The third square is solid piece of perspex which goes on top of the 2nd square to make sure the bold doesnt fall out.

Put the bolt through the hole of the1st square, place the 2nd square over the head of the bolt (note: the perspex needs to be slightly thicker than the height of the bolts head). Place the 3rd over the 2nd to cover the bolts head.

- grind down the edges of the block

The joint is complete, I used about 14 of these.

Step 4: Lower Legs - (tibia/fibula)

Picture of Lower Legs - (tibia/fibula)

The best way to do this step is to follow the pictures below as it is hard to explain the attachments.

Basically the lower leg consists of the Foot---> Bolt---->Shock Absorber---->cross bolt of shin

- To fit the lower bolt holding the shock absorber, drill a hole at a 45 degree angle through the lowest part of the perspex front plate of the foot.

- Slip on the shock absorber to the end and then slip a nut on each side to hold it in place, 

- see pictures on how to assemble the shin region.

I added a wider base to the feet and a back support with a pivot point all for extra stabilization, see last image.

Step 5: Thighs -(Femoral Region)

Picture of Thighs -(Femoral Region)

The thighs are setup by bolting two of the "thigh" perspex cutouts together. Once the edges of the cutouts are rounded off, make sure to drill holes for the pivot points, 1 at either end of a single side of a thigh section at the centre of the radius of the rounded edge.

- Drill the holes for the servos.

- When attaching the servos, make sure to position them so that their is enough rotation space in the correct direction.

- the best way to attach the servo is to drill 3 holes in line, the 2 holes on either side will attach the turning arm/disk, the center hole will be so that you can attach the servo to its arm/disk with its bolt after attaching the disk to the perspex.

- Now attach the thigh to the lower leg.

Step 6: Hip - (Gluteal Region)

Picture of Hip - (Gluteal Region)

The Hip region is made the same way as the thighs, except they are facing forward instead of sideways.

Step 7: Waist

Picture of Waist

Step 8: Final Steps

Picture of Final Steps


KomalC9 (author)2017-11-29

Hi sir

Upto how much weight and height, it can manage to work

Robocool (author)2017-06-22

hey can i use this servo for bipedal robot?? it has 10kg/cm torque...please reply fast because i have to buy servos tomorrow...

RitikG2 (author)2015-10-03

Hello bluebean , I am Ritik from India. I was just going through your project and I have decided to make it as my science exhibit for the science exhibition . Could you mail me its dimensions . And are the shockers(the red springs attached to the feet) important ? They are not available in India and I was thinking to skip them. Please reply fast.

Robotics Hero (author)2015-09-20


Have you joined the thigh and the tibua with glue gun or u have just kept the servo motor???

Sir, the supports u made is glued with servo motors or just kept there???


Robotics Hero (author)2015-09-19

The project you made is awesome....I love it!!!
I m Pratham Kumar and I m 12 years old and I want to make such a biped robot like you.

Sir can u tell me how can we connect the servo motors and the accelarometer altogether on the Arduino board??

Sir I will be ur thankful..


AhasanRatul (author)2015-08-18

Hi, nice project. as i am working on a biped, could please help me to sync the swing and left-right movement for it? i am using arduino and MPU-6050. i just want to know the angle values for each servos for each step while walking.

MarthusL (author)2015-06-28

hello, my name is Marthus'm 16 and I'm from Brazil. I was amazed by your project and wanted to try to do it, however I have no card to buy the premium to download the project. could you send me email with the project ? thanks for attention, Marthus.

GuruP4 (author)2015-05-09

hi..a really cool project..!!

i m too working on the biped..and could u tell me , how did u power up your servos? like , did u use a battery or?

bluebean (author)GuruP42015-05-09

Thank you, Originally I was going to use a battery pack but I was worried that the bipeds center of gravity would be too high up. So I used a power supply with 2 leads so the biped was always tethered.

GuruP4 (author)bluebean2015-05-16

thank u,...

sandysheva made it! (author)2015-02-07

I try to build something smaller, with Arduino ATMEGA168 and 8pcs micro servo from TowerPro SG90 (4pcs) and SG92 (4pcs), it looks good!

kprasad6 (author)2015-01-17

hello i m working in this robot.i m using your code bt the problem is coming due to the speed of servo motors.plzz tell me a way to drive the servo smoothlly and slowelly.

shivang_helios (author)2013-12-20

hey this is the image of the biped i made... the problem is it's knee has gone too inclined due to the size of the shock absorber.... due you tthink would it be a problem during motion ???

bluebean (author)shivang_helios2013-12-20

Thanks for the pic! Nice to see progress.

The shock abosrber can be problematic if its causing the knee to bend too much. I had alot of issues during the bipeds motion and I had to tighten the springs. If the shock absorber does not hold up the biped while it is stationary, then it will fail during motion. If its causing too much trouble, make that joint a fixed joint (remove the shock) and change your walking algorithm to compensate for that , i.e. The hip will have to lift the leg a bit higher so the foot does not drag on the floor

shivang_helios (author)2013-12-16

Should i adjust the servos at neutral condition while mounting it..... ?

bluebean (author)shivang_helios2013-12-16

Yes, before mounting the servos set them at neutral so that it can have 90 degrees of motion in either direction. Most servos have a variable resistor that you can tweak with a screw driver if you are slightly off. But rather dont use that unless you have too.

bluebean (author)2012-08-21

If you using the servo as a wheel then perhaps you can use something like this:


Servo myservo;

void setup()
myservo.writeMicroseconds(1500); // set servo to mid-point

void loop() {}

peraz91 (author)bluebean2012-08-21

I finished my 8 dof but after a few minutes I do move through the gui resets continuously: (

bluebean (author)peraz912012-08-21

I'm not sure what you mean? '8 dof' the robot? which gui, the one I posted 'FOBO'?
send some pics to make this clear.

peraz91 (author)bluebean2012-08-21

yes yes, I did the robot similar to yours! I'm trying to do with the gui Fobo walk!

bluebean (author)peraz912012-08-21

The whole gui resets? Or the servo resets?Wen i connected my robot to Fobo gui, the prob i had was that Fobo gui is made for servos from 0->120 whereas my servos were 0->180 so if i slide the bar over too much, it goes back to zero, this may be what you are reffering to, if so you must limit your range of motion.

peraz91 (author)bluebean2012-08-22

I use one arduino and when placed on the ground shortly after my robot is reset. Overload problems?

bluebean (author)peraz912012-08-22

Sometimes the serial monitor gets overloaded, so try not to write to much to the monitor. send me a pic of the bot, or a link to a video, im keen to see your progress

peraz91 (author)bluebean2012-08-27

how do I export the movements created by the gui to an arduino sketch? with the key export the sketch gives me errors!

peraz91 (author)2012-08-17

I can use the accelerometer as 5 dof of SparkFun? thanks

bluebean (author)peraz912012-08-18

It shouldn't make a difference which accelerometer you use. just make sure you check the datasheet for the correct pin layout. If im not mistaken, the 5 DOF Sparkfun is a combination of Gyroscope and accelerometer, measuring Rotation aswel as acceleration would result in a more accurate feedback.

peraz91 (author)bluebean2012-08-19

Could you help me if You want to use it as you did with your robot?
beautiful is your 8 dof!!

bluebean (author)peraz912012-08-19

thank you, The Accelerometer im using is only a 3axis (X,Y,Z) , the 'servo motion' is 8DOF, so feedback compared to movement is not the best ratio. So if you are to use Gyros and accelerometers it would be best. I am glad to help you as far as my knowledge extends, and can provide some basic code if you require. I initially got my biped as stable as possible in the code of the walk and the structure of the bot without feedback and then added the sensors for extra stability. I recommend this method. checkout my other proj for an idea of gyro control:

peraz91 (author)bluebean2012-08-19

thank you! with the interface can control all 8 servo. but in the sketch of the robot finished I have not figured x commands him to walk.

peraz91 (author)peraz912012-08-19

I'm not good at communicating with the Arduino serial monitor: (

bluebean (author)peraz912012-08-19

here's some basic code to use with the serial monitor, simply upload the code, open up serial monitor, wait for it to respond, then either type 'x' or 'z': (attach a servo to pin 13)


Servo MyServo;
int data = 0;
void setup()//initialising the servo pin and the serial communication



void loop()
if (Serial.available() > 0) {

data =; // read the incoming byte:

case 'x' : Left(); break;
case 'z' : Right(); break ;


void Left()
Serial.print("Function Left() activated ");
void Right()
Serial.print("Function Right() activated ");


so a function such as 'Left()' would contain your steps for walking.

my walking code thats posted on this instructable isnt up to date, so i will upload the lastest version soon.

peraz91 (author)bluebean2012-08-20

when you have time can you tell me how to connect my 5 dof to use it as your own 3-axis? thank you!

bluebean (author)peraz912012-08-20

Ok, on your accelerometer chip you should have pins labelled X-acc,Y-acc, Z-acc, (NOT the ones with rotational arrows, those are for the gyroscope) , There should also be pins labled "GND" and , either "VCC" (or 3V3 or 3.3V OR 5V)

x,y ,z are your axis
GND is your ground/zero/earth
vcc or 3.3v is what powers the accelerometer

for now lets use the x axis only:

- connect the x-acc pin to the analogue 'pin 0' of the arduino.
- connect the GND to the GND pin of the arduino
- Connect the 3.3v to the 3.3 pin of the arduino (or vcc to vcc)

its as simple as that.

now use this code as a very basic example:


  int potpin = 0;
  int val;
  void setup()
  void loop()
    val = analogRead(potpin);            // reads the value of the accelerometer //(value between 0 and 1023)
    val = map(val, 0, 1023, 0, 179);//

        if (val > 90) {
        Serial.Print("the value is above 90");
     Serial.Print("the value is below 90"); 
    delay(15);                           // waits for the servo to get there


if you want to use it on a graph like in 1 of my clips you will need the software "processing" i think ive posted the code for that aswel, but try this first.

bluebean (author)bluebean2012-08-20

Found a pic on the web, labelled the pins for you:

142536789 (author)bluebean2012-08-23


peraz91 (author)bluebean2012-08-21

ok, my 5 dof instead of 3.3v has written RAW ....

peraz91 (author)peraz912012-08-21

my 5 dof don't working :(

bluebean (author)peraz912012-08-21

RAW just means unregulated supply, its the same as 3.3v or 5v.
did you open up the serial monitor to see if its printing out anything?

bluebean (author)bluebean2012-08-21

if you want to test the 5dof by itself, u can...

- plug in RAW to the +ve on a power supply.
- GND to the -ve on power supply @3.3v
- X-acc to an oscilloscope pin (GND of oscilloscope must go to GND of power supply)

And when you tilt the accelerometer you should see the voltage rise on the oscilloscope. can maybe even try with a multimeter.

peraz91 (author)bluebean2012-08-21

the 5 dof works because in the sketch of example works ... I do not know why he does that.
I would like to create a balance robot with 5 DOF and two servo parallax continuous rotation.

bluebean (author)peraz912012-08-21

is the servo acting as a joint or a wheel?

bluebean (author)bluebean2012-08-21

I dont think you can use continuous rotation servos as joints. eg: 'servo.write(90)' As far as I know you need bi-directional ,(0->180)

peraz91 (author)bluebean2012-08-21

thanks for raw, but the servant does not rotate in both directions as your own. my servant rotates in one direction only if I delete the raw and gnd!!

peraz91 (author)bluebean2012-08-21

will not load because it says "Invalid use of class print"

peraz91 (author)2012-08-23

My robot.... (work in progress!)

About This Instructable




More by bluebean:City Skyline Pallet ArtAmerican Flag PalletUPPER LIMB EXOSKELETON (IRON MAN EXO-ARM)
Add instructable to: