Arduino Hexapod Avoider Robot





Introduction: Arduino Hexapod Avoider Robot

About: Lets learn together !!!

Hi Everyone,

Let me introduce my Friend, MBR-L109R

# 12 Servos

# Body made from Acrilic

# 5 Ultrasonics range finder

# Arduino Mega as Controller

# 3300 mAh Li-po power source

# UBEC 5A as Power supply for servos

Step 1: My First Hexapod

That is my MBR-L109

Yess !!!

"R" at MBR-L109R standing for Rebirth

and that is my Photograph 2 Years ago ^^

This Robot I used for Robot Contest "Fire Fighting"

Represent Mercubuana University

Step 2: Mechanic Design

The first thing I do is Design the mechanic.

Mechanic is the first step, but to make a good mechanic, you need to know all part which will be attach to the mechanic.

so I need to know :

# the size of all electronic component and how they will be attached

# the crossing cables from layer to other layer

# the high of the component each layer

# the movement of robot

# Area of Servos to move freely

Step 3: Realize Your Design

I choose to use acrylic and use Laser Cutting to cut more precision.

But Remember , you must really sure before you go to cut.

I use carton to simulate before I go to cut , just to make me sure I did not made some mistake

Step 4: Electronics

Know your component is really important to design mechanic and to program


Arduino Mega Summary :

  • Microcontroller : ATmega2560
  • Operating Voltage : 5V
  • Input Voltage (recommended) : 7-12V
  • Input Voltage (limits) : 6-20V
  • Digital I/O Pins : 54 (of which 15 provide PWM output)
  • Analog Input Pins : 16
  • DC Current per I/O Pin : 40 mA
  • DC Current for 3.3V Pin : 50 mA
  • Flash Memory : 256 KB of which 8 KB used by bootloader
  • SRAM : 8 KB
  • EEPROM : 4 KB
  • Clock Speed :16 MHz


Futaba S3003 - Servo Standard :

Basic Information Modulation:

  • Analog Torque: 4.8V: 44.0 oz-in (3.17 kg-cm) 6.0V: 57.0 oz-in (4.10 kg-cm)
  • Speed: 4.8V: 0.23 sec/60° 6.0V: 0.19 sec/60°
  • Weight: 1.31 oz (37.0 g)
  • Dimensions: Length:1.57 in (39.9 mm) Width:0.79 in (20.1 mm) Height:1.42 in (36.1 mm)
  • Gear Type: Plastic
  • Rotation/Support: Bushing

Additional Specifications

  • Rotational Range: 60°
  • Pulse Cycle: 30 ms
  • Pulse Width: 500-3000 µs
  • Connector Type: J


Ping Parallax :

  • Supply Voltage – 5 VDC
  • Supply Current – 30 mA typ; 35 mA max
  • Range – 2 cm to 3 m (0.8 in to 3.3 yrds)
  • Input Trigger – positive TTL pulse, 2 uS min, 5 µs typ.
  • Echo Pulse – positive TTL pulse, 115 uS to 18.5 ms
  • Echo Hold-off – 750 µs from fall of Trigger pulse
  • Burst Frequency – 40 kHz for 200 µs
  • Burst Indicator LED shows sensor activity
  • Delay before next measurement – 200 µs
  • Size – 22 mm H x 46 mm W x 16 mm D (0.84 in x 1.8 in x 0.6 in)

Step 5: Design Some Board

I need to make my own PCB board for Jumper and Power Supply.

Jumper board for Servos and Ultrasonics.

Power supply for Arduino and Ultrasonics.

Step 6: Realize Your PCB Design

Test your board and make sure there is no short circuit and all work properly.

Step 7: Assemble All Parts

This robot have 3 layers.

1st Layer for :

  • mount legs
  • battery
  • servos jumper
  • UBEC
  • Power Switch

2nd Layer for :

  • Arduino Mega
  • 5vdc Power Supply

3rd Layer for :

  • Ultrasonics Jumper
  • Ultrasonics

Step 8: Trial Test

Step 9: Programming and Algoritma

This the flow of the program :

  1. # first turned on , The robot do "Stanby Pose" for 3 second
    # Ultrasonics program is running to collect datas
    # Foward Function is running as default function
    # All LED Indicator turn off
    # 1st, 2nd & 3rd ultrasonics is collecting datas
    # Robot keep moving foward until 1st, 2nd & 3rd ultrasonics read range < 11 cm
  2. # when 2nd ultrasonic or 3rd ultrasonic read range < 11 cm
    # that mean robot in not straight state
    # robot will turn right , 1 step when read range < 11 cm at 2nd Ultrasonic
    # robot will turn left , 1 step when read range < 11 cm at 3nd Ultrasonic
    # when the robot's state is straight , Foward Function is running as default function
  3. # when robot read 1st Checkpoint ( there is wall in front of the robot )
    # Robot read data from 4th & 5th Ultrasonics
    # robot will turn right , 3 step when read range < 11 cm at 4th Ultrasonic , then 1st LED turn On

    # robot will turn left , 3 step when read range < 11 cm at 5th Ultrasonic , then 1st LED turn On
    # Robot runs 1st and 2nd algoritma (w/o stanby pose)

  4. # when robot read 2nd Checkpoint
    # Robot read data from 4th & 5th Ultrasonics
    # robot will turn right , 3 step when read range < 11 cm at 4th Ultrasonic , then 2nd LED turn On
    # robot will turn left , 3 step when read range < 11 cm at 5th Ultrasonic , then 2nd LED turn On
    # Robot runs 1st and 2nd algoritma (w/o stanby pose

  5. # when robot read 3rd Checkpoint
    # Robot read data from 4th & 5th Ultrasonics
    # robot will turn right , 3 step when read range < 11 cm at 4th Ultrasonic , then 3rd LED turn On
    # robot will turn left , 3 step when read range < 11 cm at 5th Ultrasonic , then 3rd LED turn On
    # Robot runs 1st and 2nd algoritma (w/o stanby pose)

  6. # when robot read 4th Checkpoint
    # Robot read data from 4th & 5th Ultrasonics
    # Robot read 3 LEDs at HIGH State and turn left 3 step then 4th LED turn on
    # Robot runs 1st and 2nd algoritma (w/o stanby pose)

  7. # when robot read there is a wall in front of the robot
    # Robot Read all LED Indicator in HIGH state, that mean The robot is FINISH
    # Robot standby pose for 10 seconds

Step 10: Finally Done

Okay finally done ^^
Feel free if you have question.

Thank you ,

I hope you inspired



    • Clocks Contest

      Clocks Contest
    • Water Contest

      Water Contest
    • Oil Contest

      Oil Contest

    25 Discussions

    Hey sir, may you please tell us what u're talking about on the "EXT SENSOR" because you only have 5 ultrasonics, and what diodes did you use on 51, 47, 43, 39? and also pls, reply. did u used 2 UBECs and 2 lipos?? Thanks In Advance.

    can you also indicate the dimensions in the mechanical design??

    Ini kelas! Mercu, deket juga. mungkin nanti kita bisa belajar bareng. Huehehehe

    U did a very awesome job my brother.I did almost the same hexapod but i face a problem in its movements.Its like its moving for about 9 seconds and then it falls down. How can i fix the problem?

    4 replies

    that mean u miss 1 or more state of stepping.

    I think its coming from the power supply.Please can you tell me how did you connect the UBEC 5A.Because i didnt use it in my circuit.I just connected the servos directly to the 5V power source.I connected the servos in parallel across the power supply.Because of the power my servos suddenly doesnt follow the instruction in the code and they all turn 180 degrees and they just stop working.please send me images and explain clearly how did you connect the UBEC 5A to your circuit.

    if instead of UBEC one uses the normal voltage regulator,will the robot work fine?

    you need to calculate your servos consumption and then provide the regulator accord your calculation

    hey , are u from indonesia ? can u tell me about choose the battery and UBEC ?? where can i buy it or what kind of UBEC if the battery just 2500 mah 2 cell ? do u think it's okey if to power up 18 servos using lipo 2500 mah turnigy?

    4 replies

    Hi Fikri,
    Yes I'm Indonesian.

    Battery' Ampere is tell about how long your robot will still energized. if your robot's consumption is 2.5A and you using 2500mAh (2.5A/hour) Battery , your robot will energized for 1 hour.

    UBEC help to regulate voltage in high current output. UBEC have minimum voltage and maximum voltage to works properly.

    what kind of UBEC for u'r project? and where u buy it ?? i have project to build Quadruped robot 3 DOF with Arm robot on the top, and totally, i use 18 servos MG-995 with torque 10 kg, do u think that's enpugh if i use 2500 mah battery??

    you have to know total consumption of your robot. look at the datasheet.
    for 18 servos I think you need 2 ubec like me.

    for 2500mAh battery your robot can still alive less than 30 minutes

    So u'r robot used 2 UBEC ?? But what about if my robot seperate the servo between arm and leg move, ? So , when the robot walk, 12 servo at leg will move, but the arm (6 servo) on top, not operate,, what about charger ? What kind u'r charger to charge u'r battry?

    cheers Ghild....well right on...I notice your board is already regulated, still cant understand why you need a ubec...I always thought a ubec's purpose differs from what you use it for....If I go for an 11.4v lipo I'll use a high amp voltage regulator

    2 replies

    yes, I have another regulator using IC 7805 , this regulator for powering microcontroller and sensors. it is good to separate power for motors and power for microcontroller.

    a lot of your Ideas are pretty clever, Im building this hexapod but my servos are HV 8.4v ...I'm thinking a 7.4v 2s lipo should do it, what would you recommend?

    2015-02-10 22.34.39 HDR.jpg
    1 reply

    more voltage more torque, you can power the servo directly from lipo, but if you not happy with the torque, try ubec 8.4v to get maximum torque of your servos