Let's Make Robots!

Se.Gu.A.Ro. (Sensor Guided Autonomous Robot)

Walks around and turns when it finds an object too much close to it.
Hexapod_Final.pde6.51 KB
Hexapod2_left_right.pde9.38 KB

Hi there!!

I am proud to show you my first creation!

This is a 2DOF hexapod entirely built by myself with a bit of external help for the pratical part.

It walks straight until an object get too close to it (perceived with the ping))) ultrasonic sensor).

The project started 7 months ago when I saw by chance a video on youtube about phoenix which captured me! I started getting informations from the internet about theory, pieces and prices of servos and other stuff, then I sketched some ideas I had to make it move.. The movement of the legs is semicircular when they have to go back to the front but the hardest part was the one where I had to put together all the 6 legs! I spent months (of non-continiuos work due to study) on this but finally I managed to write a piece of code that worked! Then the rotation gait has been the subject of study for my last 2 months but, even in this case I managed to make it working!

The pratical part, that is the building part had been hard too because of the precision required to make the holes for the servos perfectly.. But!.. As some of you had noticed reading the forum (thaks a lot), I had a "little" problem about the wheigh that I solved lightening the body (made of galvanized iron), changing 6 of the 12 servos and (this is the modify that allowed me to make it working continuosly for over 13 minutes without stumble) setting the leg's end more close to the body. Surely I explained this last part terribly but forgive me (I'm not english :D)! These images will explain better:

This is the leg before:

And this is the leg with the new setup that allowed it to stay alive for over 13 minutes:

now the force that the servo has to apply is less than before and so he get "power up"!! ^_^



Here there are the steps which led to the final result:


Body lightened:

Finished (for now). I want to keep adding features like optional remote control, other (maybe) degrees of freedom.. Added:

  • sensor
  • arduino and pad wit pins for servos
  • batteries
  • double switch to turn on arduino and servos concurrently

The double switch and the 9V battery:

The sensor and the mess of wires:

The homemade servo connections:

More pics with explanation :)

Top view (relative to the board oriented normally, with the board on the robot this is the bottom view):

Bottom view:

The final result:


  • reorganized code in functions to have a clearer and easier reading (code attached)
  • added sequence for left rotation (left or right rotation chosen randomly)


  • added bakward walking. Waiting for ps2 controller connector to enter fun! Code will be available after controller implementation [Temporarily suspended]


  • added a servo to pan the sensor in order to get rid of diffcult situations like corners or surfaces at first not detectable! (watch video to see it in action!!)

Side view:

Bottom view:

  • added a new optional walking gait which is less energy consuming because all the legs, apart one, are always flat on the floor.. So the weight  is distributed over five legs rather than three!


  • Started coding to implement inverse kinematics!! Yeah you heard right! I'm on the way to implement IK expanding Seguaro's capabilities by adding the third DOF to each leg!!

Suggestions (specially about code) are welcome.

Thanks for watching =)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

good! I'm lookin forward to hearing from you news about it!

this is a great project, i may do a quadrapod version made out of acrylic material, 

have any tips, on servos and shape and design, if so that would be much apreciated

Great! I think acrylic is very light so I think you won't need very strong servos! I advise you the Hitec HS-55 that would be fine! If the material is not as light as I thought you can choose a different servos from hitec, that I found to be very reliable! about the shape, I advise you to remove all the unessential parts: it will help you to limit the weight and save battery power! maybe if you post a sketch or something else i could give more advices because now I don't have more.. I'm very tired due to hard study.. :\

my basic design is a rough octagon with the servos mounted on the slants, the servos are going to be attached in a similar way too yours, also the servos i use will be price-dependant as i am still in my GCSE's and havn't got much money to put toward my first project, so i am keeping it simple, as i would like to add a pan/tilt camera attached to the top.

hmm.. An octagon you said.. In my opinion, since you are going to put the servos attached at 45° compared to the walking direction, it would be better to have 3 degrees of freedom per leg, especially if you are going to put a camera on it, in order to have a more fluid gait( having only 4 legs it is going to be rather unstable).. i think, IMHO, this should be the best way! What do you think about?

the info is great, and will prove very useful i will use a square shape with a slimmer body, i am using an arduino UNO so it will be small and light, could you give me a cut out diagram of your legs and body shape, so i may use it for reference? thanks

Sorry! I saw just right now your message! study is absorbing all my time :[

however, arduino uno is naturally a good choice!

Here is a drawing made on the fly right now! I hope this is enough but I know it isn't as a cad drawing :D  If you need something more detailed and scaled just ask ;)



This isn't really a technical comment, but I just love the noise this thing makes! :)

I tried to build a 2DOF quadropod once out of clear acrylic on a similar design to what wattersto08 is talking about, but my servos weren't all that good and it pulled 1.4 Amps just lifting itself off the floor! (And it wasn't stable enough to stay up with only 3 legs, which wasn't very helpful)

Love the design!

Thanks!! ^_^

Your comment is very useful for wattersto08! It confirms my advice to use 3 dof for each leg int order to get more stability and more fluid movements!

Of course it will draw more current and wattersto08 will have to use a more powerfull battery.. But keep in mind that lifting from the floor is more expensive (in terms of current) than keeping the body up! my bot uses to draw up to 5Amps, but it's made of steel! :P

 Cool! I almost got the impression that the robot was in the military with the way it walked. I love how it sounds on the tile. Keep up the good work!