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.

I am totally in love with the sound of metal on tiles. Good job! It looks great too.

Ahah!! I'll provide you an audio file with 5 minutes of walking! X)

{Thank you!}

Great work. I like legged robots. Nice Video

Question1: how can I add some LED effects like kitt or something else without stealing clock cycles?

Question2: same as before but for panning head..

One solution to the problem I saw is this funny device http://www.sparkfun.com/commerce/product_info.php?products_id=9428 which would allow me to perform many actions at the same time..

Or would be better to use another arduino?

Other suggestons are welcome!

It looks amazing! I would be terrified to hear that at night in my house. You know what would be even cooler? If it could jump. But I think it could lose balance. Also, as a suggestion, ad some two leds where the eyes are, to glow red in the dark or something. ;)

Thank you!! :)

The idea of the jump is a littel bit hard to realize because first it would loose balance and secondly the servo power is not enough.. :(

Leds are on the way, i was thinking about a led bar like kitt or some leds under the body and/or legs but I had some dubts as I said in the previous post!

Here is my idea to make it jump...

From the start position, where the body touches the ground (perhaps just very close to the ground) have all the legs lift the body at once until their tip (that touches the ground) is right below the servo axle. Then, move all the legs back to the start position. Make sure this is a fast move. After you see the robot making hops, add a rotation move so the legs also propel the robot forward. Perhaps the servos are not fast enough, but is worth a try. If you think they can break at landing, just open them out more and have the robot land on it's belly. Install some foam padding on the belly, I'm sure it will help.

Good luck! I love it!

thank you!

I got what you said, and thanks for the idea, but I think that it would be mostly a suicide! :P

it is very heavy and some parts are rather delicate! moreover what you proposed would be a falling, and not properly a jump, wouldn't be?

Seeing that one jump will be an epic sight! 

hmm... I'll think about it.. by now I have lots of upgrades in program and too many things to do outside... :( 

but for now you can stay tuned cause a new upgrade is going to be released! ^_^