Project tutorial
Autonomous Biped Robot Using Arduino Based Embedded Platform

Autonomous Biped Robot Using Arduino Based Embedded Platform © CC BY

This project will show you how to make a DIY autonomous biped robot.

  • 100 views
  • 0 comments
  • 1 respect

Components and supplies

Apps and online services

About this project

All the animated movie lovers out there! You sure remember WALL-E, don’t you? And how adorable that robot is! Only if there was a way to have on. Guess what! There is a way, one with a twist. Instead of moving using wheels, our WALL-E will move using *clears throat* using feet! Yes, you heard us right. So, gather your stuff, pump up your DIYing levels, and ready, set, go!

Before you move ahead, there’s something we want to share with you. We’re launching something sooooper exciting real soon and want you to be the first know about when it’s out.

To know more about it, visit here!

Step 1: Things You'll Need

Hardware

  • Metal servo and its accessories
  • Micro servo and its accessories
  • Ultrasonic Sensor
  • Ultrasonic Holder
  • Some 3D parts
  • Base plates
  • Nuts and Bolts
  • Jumper Cable

Software

  • Arduino IDE

Step 2: Assembly of the Feet

We will start by assembling the feet of the biped.

Take a 3D Printed foot, you will notice a small space into it.

We will be placing our metal servo into it.

Once you place the servo, fix it using hot glue.

In the accessory of the servo, you will find a 4-sided servo horn. Cut one of its sides to make it 3-sided horn.

Fix the servo horn onto the servo head.

Repeat the same process for the other leg.

You can download the.STL from below.

Step 3: Assembly of the Leg

Once you are done assembling the feet, its time to assemble the leg.

Take one of the two 3D Printed legs.

The servo horn attached to the servo of the foot shall now be fixing into this leg, using the self-threading screws.

Repeat the same process for the other leg.

Download the.STL from below.

Step 4: Assembling the Bottom Base Plate

Take the other 2 metal servos and fix a double-sided horn on the servo head.

Fix this horn onto the leg using screws.

Take the base plate and insert the servos into the space given for servos and fix it.

You can download the file for the base plate from below.

Step 5: Assembling the Upper Base Plate

Take the other base plate and add the micro servo on it using bolts.

Fix the double-sided servo horn onto the servo head.

Place evive on top of this base plate and fix it.

Take the ultrasonic sensor holder and fix the ultrasonic sensor into it.

Step 6: Completing the Assembly

Take the base plate with legs and fix the plate with evive on it using standoffs of 15mm length.

Once done, fix the double-sided horn onto the ultrasonic holder using a self-threading screw.

We have 3D printed the eye of our biped. Glue it on top of the ultrasonic sensor.

Thus, your assembly is complete.

Step 7: Connections

Make the connections as shown in the figure.

Step 8: Code

Upload the following Arduino Code to your evive.

Step 9: Working

The servos that are attached to its feet are used to move the feet so that the robot can take the turn.

The servos attached to the leg is used for the movement of the biped.

The ultrasonic sensor at the top makes the robot autonomous as it will detect the obstacle and will move accordingly.

Step 10: Conclusion

With this, your DIY Autonomous Biped Robot is all set to show you its moves!

Code

Arduino Code for BipedArduino
#include <Arduino.h>
#include <Wire.h>
#include <SoftwareSerial.h>

#include "evive.h"
#include "Servo.h"

double angle_rad = PI/180.0;
double angle_deg = 180.0/PI;
void stop();
Servo servo_4;
Servo servo_44;
Servo servo_2;
Servo servo_45;
Servo servo_3;
void back();
double dela;
void reverse();
double DelayTime;
void Forward();
void Left();
void Right();
TFT_ST7735 lcd = TFT_ST7735();
float getDistance(int trig,int echo){
    pinMode(trig,OUTPUT);
    digitalWrite(trig,LOW);
    delayMicroseconds(2);
    digitalWrite(trig,HIGH);
    delayMicroseconds(10);
    digitalWrite(trig,LOW);
    pinMode(echo, INPUT);
    return pulseIn(echo,HIGH,30000)/58.0;
}


void stop()
{
    servo_4.write(90); // write to servo
    
    servo_44.write(90); // write to servo
    
    servo_2.write(90); // write to servo
    
    servo_45.write(90); // write to servo
    
    servo_3.write(90); // write to servo
    
}

void back()
{
    servo_4.write(90); // write to servo
    
    servo_2.write(145); // write to servo
    
    _delay(dela);
    
    servo_3.write(125); // write to servo
    
    _delay(dela);
    
    servo_44.write(110); // write to servo
    
    servo_45.write(110); // write to servo
    
    _delay(dela);
    
    servo_2.write(90); // write to servo
    
    _delay(dela);
    
    servo_3.write(90); // write to servo
    
    _delay(dela);
    
    servo_3.write(35); // write to servo
    
    _delay(dela);
    
    servo_2.write(55); // write to servo
    
    _delay(dela);
    
    servo_44.write(70); // write to servo
    
    servo_45.write(70); // write to servo
    
    _delay(dela);
    
    servo_3.write(90); // write to servo
    
    _delay(dela);
    
    servo_2.write(90); // write to servo
    
    _delay(dela);
    
}

void reverse()
{
    back();
    
    _delay(DelayTime);
    
    Left();
    
    _delay((DelayTime) * (3));
    
}

void Forward()
{
    servo_4.write(90); // write to servo
    
    servo_2.write(145); // write to servo
    
    _delay(0.1);
    
    servo_3.write(125); // write to servo
    
    _delay(dela);
    
    servo_44.write(70); // write to servo
    
    servo_45.write(80); // write to servo
    
    _delay(0.1);
    
    servo_45.write(70); // write to servo
    
    _delay(0.1);
    
    servo_2.write(90); // write to servo
    
    _delay(0.1);
    
    servo_3.write(90); // write to servo
    
    _delay(dela);
    
    servo_3.write(35); // write to servo
    
    _delay(dela);
    
    servo_2.write(55); // write to servo
    
    _delay(dela);
    
    servo_45.write(110); // write to servo
    
    servo_44.write(80); // write to servo
    
    _delay(0.1);
    
    servo_44.write(90); // write to servo
    
    _delay(0.1);
    
    servo_44.write(100); // write to servo
    
    _delay(0.1);
    
    servo_44.write(110); // write to servo
    
    _delay(0.1);
    
    servo_3.write(90); // write to servo
    
    _delay(0.1);
    
    servo_2.write(90); // write to servo
    
    _delay(dela);
    
}

void Left()
{
    servo_4.write(90); // write to servo
    
    servo_2.write(145); // write to servo
    
    _delay(0.1);
    
    servo_3.write(125); // write to servo
    
    _delay(dela);
    
    servo_44.write(70); // write to servo
    
    servo_45.write(80); // write to servo
    
    _delay(0.1);
    
    servo_45.write(70); // write to servo
    
    _delay(0.1);
    
    servo_2.write(90); // write to servo
    
    _delay(0.1);
    
    servo_3.write(90); // write to servo
    
    _delay(dela);
    
    servo_3.write(35); // write to servo
    
    _delay(dela);
    
    servo_2.write(55); // write to servo
    
    _delay(dela);
    
    servo_44.write(130); // write to servo
    
    servo_45.write(90); // write to servo
    
    _delay(0.1);
    
    servo_3.write(90); // write to servo
    
    _delay(0.1);
    
    servo_2.write(90); // write to servo
    
    _delay(dela);
    
}

void Right()
{
    servo_4.write(90); // write to servo
    
    servo_2.write(145); // write to servo
    
    _delay(0.1);
    
    servo_3.write(125); // write to servo
    
    _delay(dela);
    
    servo_44.write(70); // write to servo
    
    servo_45.write(80); // write to servo
    
    _delay(0.1);
    
    servo_45.write(70); // write to servo
    
    _delay(0.1);
    
    servo_2.write(90); // write to servo
    
    _delay(0.1);
    
    servo_3.write(90); // write to servo
    
    _delay(dela);
    
    servo_3.write(35); // write to servo
    
    _delay(dela);
    
    servo_2.write(55); // write to servo
    
    _delay(dela);
    
    servo_45.write(130); // write to servo
    
    servo_44.write(90); // write to servo
    
    _delay(0.1);
    
    servo_3.write(90); // write to servo
    
    _delay(0.1);
    
    servo_2.write(90); // write to servo
    
    _delay(dela);
    
}


void setup(){
    lcd.init(INITR_BLACKTAB);
     lcd.setRotation(1);
    DelayTime = 0.5;
    dela = 0.5;
    lcd.fillScreen(0);
    
    servo_4.attach(4); // init pin
    servo_44.attach(44); // init pin
    servo_2.attach(2); // init pin
    servo_45.attach(45); // init pin
    servo_3.attach(3); // init pin
    pinMode(A0+7,INPUT);
    pinMode(40,INPUT);
}

void loop(){
    
    lcd.setCursor(10, 10);
    lcd.print((analogRead(A0+7)) / (0.0381));
    if(((digitalRead(40))==(1))){
        if((getDistance(8,9)) < (15)){
            stop();
            lcd.setCursor(10, 20);
            lcd.print("Obstacle");
            servo_4.write(45); // write to servo
            _delay(0.5);
            if((getDistance(8,9)) > (25)){
                Right();
                lcd.setCursor(10, 20);
                lcd.print("Right   ");
                _delay(DelayTime);
            }else{
                servo_4.write(135); // write to servo
                lcd.setCursor(10, 20);
                lcd.print("Obstacle");
                _delay(0.5);
                if((getDistance(8,9)) > (25)){
                    Left();
                    lcd.setCursor(10, 20);
                    lcd.print("Left    ");
                    _delay(DelayTime);
                }else{
                    servo_4.write(0); // write to servo
                    lcd.setCursor(10, 20);
                    lcd.print("obstacle");
                    _delay(0.5);
                    if((getDistance(8,9)) > (25)){
                        Right();
                        lcd.setCursor(10, 20);
                        lcd.print("Right   ");
                        _delay((DelayTime) * (2));
                    }else{
                        servo_4.write(180); // write to servo
                        lcd.setCursor(10, 20);
                        lcd.print("obstacle");
                        _delay(0.5);
                        if((getDistance(8,9)) > (25)){
                            Left();
                            lcd.setCursor(10, 20);
                            lcd.print("Left    ");
                            _delay((DelayTime) * (2));
                        }else{
                            reverse();
                            lcd.setCursor(10, 20);
                            lcd.print("Reverse ");
                        }
                    }
                }
            }
        }
        Forward();
        lcd.setCursor(10, 20);
        lcd.print("forward ");
        _delay(0.2);
    }else{
        stop();
        lcd.setCursor(10, 20);
        lcd.print("Stop    ");
    }
    
    _loop();
}

void _delay(float seconds){
    long endTime = millis() + seconds * 1000;
    while(millis() < endTime)_loop();
}

void _loop(){
    
}
evive LibraryC/C++
No preview (download only).

Custom parts and enclosures

Foot+Left.STL
Foot%2BLeft.STL
Foot+Right.STL
Foot%2BRight.STL
Leg.STL
Leg.STL
Base+Plate.STL
Base%2BPlate.STL

Schematics

Fritzing Diagram for Biped
Bipad fritzing diagram 2ztuzfpsss

Comments

Similar projects you might like

4*4*4 LED Cube Using Arduino Embedded Prototyping Platform

Project tutorial by STEMpedia

  • 1,874 views
  • 0 comments
  • 9 respects

Menu Based Visual Interface for Arduino

Project tutorial by evive

  • 3,258 views
  • 1 comment
  • 13 respects

4-Wheel Robot Made With Arduino Controlled Using Dabble

Project tutorial by STEMpedia

  • 3,005 views
  • 5 comments
  • 20 respects

AVALANCHE - Low Cost Autonomous Robot

Project showcase by Guadalupe Bernal

  • 8,905 views
  • 8 comments
  • 70 respects
Add projectSign up / Login