Introduction: [DIY] Spider Robot(Quad Robot, Quadruped)

Picture of [DIY] Spider Robot(Quad Robot, Quadruped)

2017-03-26 update:
Share the MG90 servo version -

you can download it and build with MG90 servos.

2016-11-1 update:

The all new spider -

2016-04-01 Modify:

Correct the Battery model name and dimension.

2016-01-24 update:

Open the all of design that including the software, Sketchup, EaglePCB,

2015-10-11 upload the PCB layout image file.

2015-10-04 update:

Step 2: schematic pdf file - spider_2015-10-04-open-v2.pdf

Step 10: picture 1.

2015-11-19 update:

Upload the Arduino sketch file which is "special dance" included(step13). Someone who are asking about it, they are interested in it. :-)


This is my first project for the 4 legs robot and it took me about 1 year development.

It is a robot that relies on calculations to position servos and pre-programmed sequences of legs.

I'm doing this by handmade way is because of it could be fun and educational for 3D design/printing and robot control.

This is the fourth generation of my design, you can take a look here if you are interested the history.

2 more projects sharing -

Spider Robot simulator by vPython

Remote control by bluetooth

Building this project is fun, however, it should take you more time and patient to implement.

If it is a hard job to you, the product comes from Sunfounder might a good choice.

Before going to next step, please aware that the soldering tools and 3D printer will be used in this project.

Let's get start and have fun!

Step 1: Electrics Parts Preparation

Picture of Electrics Parts Preparation

Here are the parts:

1x Arduino Pro Mini

1x DC-DC(12-5v/3A output)

1x HC-06 Bluetooth module(option)

12x SG90 servo(3DOF for 4 legs)

1x 3000mhA Li battery (DC12300, 90x43x17mm)

1x 12V Jack

1x 680 Ohm 1/4 watt 5% Resistor

1x 3mm Blue LED

1x Tactile Switch

1x 5x7cm perfboard

Some male and female pin headers

Small guage wire(Solid or Stranded)

I believe that these parts are most popular and not expensive. They are just cost me about 2,000 Taiwan dollar.

Step 2: Make the Main-board

Picture of Make the Main-board


upload the PCB layout image file, you should download the zip file would be better.

You can come here for more information about PCB DIY.


Refer to the schematics file, and place all components like the pictures. you can make the board as small as passable.

The main-board that the last one picture is the newest version, just for you reference.

Here are some tips while you are going to building the PCB:

1. Be sure the output voltage of DC-DC module should be 5v before mount to the perfboard.

2. The servos consume a lot of power, almost 3A in full loading condition. Please use more thick wire for "power" and ground" traces.

3. Do the "open/short" test with the multi-meter for your PCB when you finish the soldering, that is the important process.

4. Using the female pin header instead of solder the modules(Arduino, DC-DC) on the perfboard directly

5. The LED will be on while the "Switch" turns off. Why I design this way is because I would like to check the power source is ok or not when I plug in the power source like battery or something else, it is a simple way for protection..

6. While you see the LED turns on after connect the 12v battery to the board, congratulation!

Step 3: Test the Main-board

Picture of Test the Main-board

Test process:

1. Don't plug the DC-DC and Arduino Pro Mini into the main-board

2. connect the battery to the 12v-Jack of main-board

3. Check the LED, if LED turns on, that is a good start.

4. Push the POWER-Switch, the LED should be off.

4. Using the multi-meter to check all of +5V and GND pins are correct

5. Push the POWER-Switch back to turn off the power, the LED turns on

6. Plug the DC-DC and Arduino Pro Mini into the main-board

7. Push the POWER-Switch, the LED turns off, but the LED of Arduino Pro Mini turns on

Then power off, and connect a servo to the first row of Leg1 connectors of main-board(pin2 of Arduino)

upload the "servo_test" code to Arduino and you will see the servo sweeps from 0 - 180 degree.

If you are here without any problem, that is a great progress!

servo_test source code:

Step 4: Building the Mechanical Parts - Download 3D STL Files

Picture of Building the Mechanical Parts - Download 3D STL Files

This step is going to build the robot mechanical parts, you can print the parts by yourself or ask someone who has 3D printer to help you.

I also open the 3D model design which is design by Sketchup Make version and you can modify it with your great idea.

Download the STL file from

Print parts list:
1x body_d.stl

1x body_u.stl

2x coxa_l.stl

2x coxa_r.stl

2x tibia_l.stl

2x tibia_r.stl

4x femur_1.stl

8x s_hold.stl

Step 5: 3D Objects Printing

Picture of 3D Objects Printing

And print them out by your 3D printer.

Please check the configuration of 3D printer before start to print because of it will take a long time about 7~8 hours to print them all. Be patient~~~~

There are my print setting:

- The fill density - 15%

- Nozzle - 0.3mm

- Print speed - 65

you can print these parts separate by color group.

Step 6: Preparing to Assemable

Picture of Preparing to Assemable

tear down the parts and check the objects printing quality, and using the sandpaper to polish the surface to make it looks good.

Refer to here to get more information:

Step 7: Assemble the Body

Picture of Assemble the Body

Put the battery between the upper body case and lower body case with 4 screws(M3x25mm)

Step 8: Assemble the Leg

Picture of Assemble the Leg

And, install all of servos with legs parts, one leg comes with 3 servos and 4 screws(M1.6x3mm, or glue it anyway)

Notes: 1. Connect to all parts with screws and servos, but do not install the servo rocker arm in this step 2. Be sure the leg direction, refer to the picture 1 Refer to here to get more information:

Step 9: Integrate 4 Legs to Body

Picture of Integrate 4 Legs to Body

connect all of legs to the body, and check all servos and joints are move smoothly.

Step 10: Connect Servos to the Main-board

Picture of Connect Servos to the Main-board


update the picture1 which is wrong pin assignment.


Place the main-board onto the body-case and use the polymer clay to fix it.

And then, refer to the picture, follow the pin number which mark by pink color to connect all servo wire to the main-board, and green color is present the signal direction of servo wire, yellow connect to "S", red to "+", brown to "-".

Be sure the servo of legs should match the pin number of main-board and leg direction, otherwise, the legs will get crazy...

Step 11: Locate the Initial Position for Legs

Picture of Locate the Initial Position for Legs

This is an important procedure, the install procedure:

1. upload the "legs_init" code to Arduino to activate the servos

2. place the legs as the position shows the picture 1, and install the servo rocker arm with screws.

3. tighten all of the screw

legs_init source code:

Step 12: Organize the Wires

Picture of Organize the Wires

Then, organize the wires of the servos to make it great looking.

Now, all of hardware installation was finished.

Step 13: It Is Showtime!!

It is excited to go this step.

Let's upload the "spider_open_v1" code to Arduino to make it moves!

Please download and install the lib FlexiTimer2 first before do compile the code,

you will see the action as following

1. stand up, wait 2 sec

2. step forward 5 steps, wait 2 sec

3. backward 5 steps, wait 2 sec

4. turn right, wait 2 sec

5. turn left, wait 2 sec

6. wave the hand,, wait 2 sec

7. shake the hand, wait 2 sec

8. sit down, wait 2 sec

9. back to 1


PS. the spider_open_v3 is add an interesting movement of "body dancing"

spider_open_v1 source code:

Step 14: Do Something Special

you can add more special feature like change the move speed dynamically with remote control, that will let your robot more attractive.

Welcome to share the funny gaits or movement.

The remote control

Here are some idea share with you in my blog.


Add the IR-detector to detect the obstacle.


handmade the PCB


АлексейК92 (author)2017-11-13

Добрый день , большое спасибо Вам за столь подробный материал!

Он очень сильно помогает в изучении данной тематики, но я безумно нуждаюсь в ваших пояснениях, если вам не трудно прошу Вас пояснить вот этот расчет :

//temp length

const float temp_a = sqrt(pow(2 * x_default + length_side, 2) + pow(y_step, 2));

const float temp_b = 2 * (y_start + y_step) + length_side;

const float temp_c = sqrt(pow(2 * x_default + length_side, 2) + pow(2 * y_start + y_step + length_side, 2));

const float temp_alpha = acos((pow(temp_a, 2) + pow(temp_b, 2) - pow(temp_c, 2)) / 2 / temp_a / temp_b);

Если вас не затруднит начертите как и что вы считаете, это очень поможет , моя электронная почта

Заранее большое спасибо.

Swansong (author)2017-10-13

I love the way this turned out! It looks like a creepy mecha droid :)

gicquelnicolas.1 (author)2017-10-05

I can't find the code for the IR detector version ? (maybe i'm blind today). I'm not really familiar with arduino, and i want to use ultrasonic detectors. I don't know if someone should help me wit this project.

Thanks. Bye !

gicquelnicolas.1 made it! (author)2017-10-02

Thank you! I made it with a arduino nano, because i'm more familiar with raspberry. I wasn't ready for the arduino pro. For now i get it to work with an external power supply, but soon i'll adapt a RC car battery.

LưuL4 made it! (author)2017-09-29

PLs help me, i conect servo like this image!, leg can move, but it don't exactly move, can u help me! pls

DuP6 (author)2017-09-04

Nothing happen when I start.

Please help me

DuP6 (author)2017-09-04

Hi guy,

I done with everything but when I start click switch button, nothing happens.

Please help me

PhamD20 (author)2017-09-04

I dot not what happen with my robot ?

Can you help me.

MisterM2017 (author)2017-08-22


I'm still a little stuck in the early stages. I can't seem to power the servo's with my battery. If I test a servo by attaching it to the arduino power 5V and ground, the test works fine. As soon as I connect the servo power to the DC-DC Buck, it does nothing, and sometimes just vibrates a little.

My DC-DC its outputting 4.96V and 4.98A

Could the AMPs be too high?


Mr M

AO_909 made it! (author)MisterM20172017-08-28

Hi Mr. M,

Actually, I think it's the contrary; you're not feeding enough energy into the DC-DC. The ones that have worked for me are 12V 4A (I think 5A is the highest it can go without frying it, but not entirely sure). Here are some pictures below of two that have worked for me. As always, make sure everything is properly grounded and such before plugging in. If you're trying to find a power supply that is 12V 4A, here is where I found mine.

In addition, I needed to convert the DC plug to power ground in order for it to be plugged into my set up. Here's where I found that:

Adafruit also has a 12V power supply, but it was more expensive than the one I found on eBay. If you want everything in one shipment, then Adafruit's should be fine, but I haven't tested their power supply myself.

Hope this helps!

MisterM2017 (author)AO_9092017-08-30

You came to my rescue again :) Thank you.

It turned out to be a faulty battery. New battery = working quad.

I reworked the body STLs to accommodate the slightly wider battery. It's heavy, but it walks :)

AO_909 (author)MisterM20172017-08-31

Yay, glad to hear! If you feel like sharing on Thingiverse, I have a feeling some other beginners might like to use an adjusted body STL for their projects.

Ebano ramses (author)2017-08-31

If you need it, you can call me because I send the program to have a look at what I did.

Ebano ramses (author)2017-08-31

Hello everyone, I'm a beginner in this area of robotics and I'm having a hard time putting the program together using the pca9865 adafrut PWM card. Could anyone help me?

mohitmaurya175 (author)2017-08-31

can i use 3000mah power back for external power

mohitmaurya175 (author)2017-08-31

can you tell me how much voltage and current battery i need in this project...i'm using 12 sg90 servo motor and 12v-5v 3a dc to dc converter..

PhamD20 (author)2017-08-28

Can I use Arduino Micro Pro instead of Arduino Mini

AO_909 (author)PhamD202017-08-28

I can't speak for the Micro Pro, but I'm using the Arduino Uno to no problems. I think the main thing is making sure that there are enough analog, digital, and power/grounds to plug all the legs and components into the board.

AO_909 made it! (author)2017-07-25

Hi everyone! I just finished making this robot and wanted to share some tips/links that helped me out, as well as provide a Fritzing diagram of where the wires go and such. Hope this helps!

MisterM2017 (author)AO_9092017-08-11

Wow, really really helpful to a noob like me.

I can't quite figure out the 12v jack connection, as my DC-DC_CONV doesn't have numbered sockets. I don't want to wire it wrong and fry something.

I am guessing the jack+ goes to the DC-DC_COV IN+

But I am confused, as it looks like the DC-DC_CONV IN- is connected to the 5V in on the Arduino? :/


Mr M

MisterM2017 (author)MisterM20172017-08-11

Hmmm I am really confusing myself here.

I have attached a image of my DC-DC. If the orientation of mine is correct. I am confused why the IN+ is connected to the 5V on the arduino and the breadboard. :/

AO_909 (author)MisterM20172017-08-12

Hi Mr. M

So the jack+ connected in the breadboard goes into the DC-DC COV Out, and the jack- in the breadboard goes into the DC-DC COV In. There should also be two other cables connected into the other DC-DC COV Out and DC-DC COV In, and that connects directly into the 12V power. The DC-DC shouldn't be connecting directly into the Arduino. I've included some images on my Github media folder (Front_of_DC and Back_of_DC) to provide context. Does that help?

MisterM2017 (author)AO_9092017-08-14

Yes, thank you. That makes things much easier. I got confused by the the Arduino 5v power cable on the fritzing. I thought it was connected to the DC-DC as it passed it, now I know it has nothing to do with it.

Thanks for your help :)

RegisHsu (author)AO_9092017-07-25

great job!

MatheusS57 (author)2017-08-07

Hello, I have a similar spider theft project but this code does not work in my right, could someone help me rewrite it? I'm robotic beginner

MachvelleP (author)2017-08-01

i am waiting for my 3d printerto arrive to start of this project for my kids.

very excited to get this project started :)

shooter9988 (author)2017-07-13

Hi, i have all the parts now and i am trying to get the code onto the arduino pro mini. i have bought the arduino usb 2 seria converter but it isnt working, how did you program it?

RegisHsu (author)shooter99882017-07-13

TX(USB) -> RX(mini)

RX(USB) -> TX(mini)

GND(USB) -> GND(mini)

while you want to upload the sketch, do remember that push the reset button of mini.

by the way, google is a good friend....

JohnT4 (author)2017-07-10

This is a great project Regis, Thank you so much for sharing..

May I ask you, how is the LI battery protected from overcharging without a dedicated circuit to protect it?

RegisHsu (author)JohnT42017-07-10

The battery has its own charger when you buy it from the store.
This charger has charger-IC inside.

MahmoudS42 (author)2017-07-07

Please , Can you upload sourcr code v1 again because it cannot open

JohnT4 (author)MahmoudS422017-07-10

the ino file opens fine for me, just tried it now. Try it again after updating your arduino IDE and report back if you have any more problems?

TaiL10 (author)2017-06-25

Hi, everyone
Can I use 12V/10A voltage source ? It's difficult to find 12V/3A voltage source.

Thanks you !!!

RegisHsu (author)TaiL102017-06-25

it is good to use 12v/10a battery.
however, I am curious about this battery, can you show the picture?

TaiL10 (author)RegisHsu2017-06-25

Below pictures. I think that DC-DC module's failed if output current of battery's 10A.

RegisHsu (author)TaiL102017-06-25

it looks great and heavy...

DariusF4 made it! (author)2017-06-14

modified body

LanceF12 (author)DariusF42017-06-17

DariusF4, Can your share the modified body for Arduino uno?

How did you connect bluetooth?


DariusF4 (author)2017-06-14

i managed to make in a much simpler way using an arduino uno and v5 shield

LanceF12 (author)2017-06-08


Thank you for sharing this project and supporting it. I am having a problem

inserting the servos into the slots because the servos fit perfectly in the

slots, but the wires that comes out of the side of the servo prevents it from

moving into the slot, see photo. Maybe I am doing something wrong? How

does everyone else do this?

Thank you

RegisHsu (author)LanceF122017-06-08

you can cut the edge as the picture 2 of step 8, that will easy to install the servos.

LanceF12 (author)RegisHsu2017-06-11

thank you,

I am reading:

but it is in Chinese and the Google translation to English is bad. There is a section on connecting the s-hold and applying some kind of lubricant I think, what is this lubricant? Also, I want to use an Arduino Uno with an Adafruit PWM/Servo Shield instead of the custom PCB board. I may need to make the body (body_d.stl, body_u.stl) slightly wider, will I need to change anything else to accomodate this?

RegisHsu (author)LanceF122017-06-12

it is Silicone Paste and it can make the movement more smoothly.

you can do some modify the body more wider to fit your PCB board. However, you may change the stand position of source code if the robot move isn't stable.

GentarS (author)2017-05-14

Hi teacher Regis.
The existence of this very project cleaner I can RegisHsu more teachers learn more.
I compiled this with each leg robot slowly and meticulously follow the step.

I still wanted to make the robot school.

But how come everytime I change the coding robots walk so messed up, that I was originally using a coding legs_init after that I change into a coding URspider_open_v1.ino foot robot so messed up and running is not perfect.

Maybe that's the problem I face please help and explanation

Thank you very much.

Almost done.i chose to use a powrbank with 2.1 ampere output(2 slots) and i attach 3 servo to each and it seems to work fine XD

VishalK57 (author)2017-03-16

can you pls tell me how to calibrate the legs and which lines should i uncomment in the code

HariFun (author)VishalK572017-03-20

Vishal, at the end of Step 11 there is a leg_init sketch. Just upload that before you mount the servo horns to match the picture on that step.

VishalK57 (author)HariFun2017-04-07

U said to me and i did the same but my bot 3 legs work properly and 1 leg works wiredly what can i do pls give me suggestions

HariFun (author)VishalK572017-04-07

I would double-check the servos for that leg. There is a diagram showing the servo numbers on step 10.

VishalK57 (author)HariFun2017-04-07

Can u pls share ur simple schematic design

About This Instructable




Bio: My Chinese name is 許英豪. My background is Electronic and software engineering. I have over 30 design experience years on the SmartPhone, Tablet and Digital ... More »
More by RegisHsu:How to Make a Complex Shape 3D Model by SketchUpHandy Power Supply[vPython] Spider Robot simulator
Add instructable to: