[DIY] Spider Robot(Quad Robot, Quadruped)




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

About: My Chinese name is 許英豪. My background is Electronic and software engineering. I have over 30 years design experience on the SmartPhone, Tablet and Digital camera. I love DIY!

If you need extra support from me, it will be better that make some suitable donation to me:

2019-10-10 update:
The new compiler will cause the floating number calculation problem. I have modified the code already.

2017-03-26 update:
Share the MG90 servo version - http://www.thingiverse.com/thing:2204279

you can download it and build with MG90 servos.

2016-11-1 update:

The all new spider - https://youtu.be/bxJC_vvggIc

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, https://github.com/regishsu/SpiderRobot

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

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


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. http://regishsu.blogspot.tw/search/label/0.SpiderR...


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

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

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 http://www.thingiverse.com/thing:1009659

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

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

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: http://regishsu.blogspot.tw/2015/07/robot-quadruped-robot-re-design-3-round.html

Step 7: Assemble the Body

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

Step 8: 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:http://regishsu.blogspot.tw/2015/07/robot-quadrupe...

Step 9: 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


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

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

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, http://playground.arduino.cc/Main/FlexiTimer2

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.

If you find my design interesting, you could make a small donation:

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



First Time Author Contest

Participated in the
First Time Author Contest

39 People Made This Project!


  • Clocks Contest

    Clocks Contest
  • Game Design: Student Design Challenge

    Game Design: Student Design Challenge
  • Block Code Contest

    Block Code Contest



Question 3 months ago

First of all, thanks so much for this awesome project!
I plan to use this project for our school Coding showcase (they are learning arduino). I modified the circuit by using the PCA9685 16-Channel 12-bit PWM Driver to drive the 12 servos and using the Adafruit_PWMServoDriver library for it.

* for the pulse width of the SG-90 servo that I'm using :

const int pcaservo[4][3] = { {0, 1, 2}, {3, 4, 5}, {6, 7, 8}, {9, 10, 11} };

1. added a function to convert the angle to PWM :

int angleToPulse(int ang){
int pulse = map(ang,0, 180, SERVOMIN,SERVOMAX); // map angle of 0 to 180 to Servo min and Servo max
return pulse;

2. and changed the polar_to_servo function to this:

pwm.setPWM(pcaservo[leg][0], 0, angleToPulse(alpha) );
pwm.setPWM(pcaservo[leg][1], 0, angleToPulse(beta) );
pwm.setPWM(pcaservo[leg][2], 0, angleToPulse(gamma) );

3. Based on the spider_open_v4 code and changes I've made above, the robot manage to do all the movements (stand, step_forward, step_back, hand_wave, hand_shake, body_dance and sit) but it seems to get stuck at turn_left and turn_right. The serial monitor will also get stuck during that action.

Is it something to do with the error you've mentioned :

2019-10-10 update:
The new compiler will cause the floating number calculation problem. I have modified the code already.

I'm using Arduino IDE v.1.8.15

Can you suggest for the correction for floating number calculation that I should make? Thanks again and awesome job!


Answer 2 months ago

Did you fix the problem now?
if so, please share the solution, or send me the code that I can try to help you.


2 years ago

Hi, can i use a small breadboard instead of pcb..i mean i wanna put all things in the breadboard (nano,servos,Bluetooth module,9v battery), it's possible ?


Reply 2 years ago

Yes but it requires you to study the pcb schematics provided in the zip and solder manually as shown in there


Reply 2 months ago

is dc dc converter mandatory to use


Question 4 months ago

Thank you for posting such a wonderful project! However I do have some problems: for connections between servos and my arduino nano I have used PDF connections from STEP 2 and also a different one from STEP 10. Unfortunately none of them work. I have calibrated the legs in both tries (legs_init.ino) and once I upload with spider_open_v4.ino sketch, three of the legs are in sync while the 4th one goes crazy the other way. Any suggestions?


Answer 4 months ago

I am not sure what problem is that, however, most of problem may cause by power source. Please check you battery and DC-DC converter could output more then 3A currents.


Reply 4 months ago

Thanks Regis for your prompt response. I have done a Bench test with an ATX power supply of 5V and 25A……and same results!!

I guess my next question would be if I need to modify the servo pin locations or something else in the code?

servo_pin[4][3]= { {2, 3, 4}, {5, 6, 7}, {8, 9, 10}, {11, 12, 13} };

I am using the image of STEP 10.

Thanks again


8 months ago

good time of a day.
Really exciting project, but unfortunately
I can`t download any of arduino source code.

Im about to finish the project,
but the sources are not available.


Reply 4 months ago

Thank you very much, It works.


Reply 6 months ago

Oh, do you know how to build the source code with IDE and upload to Arduino board?


Reply 6 months ago

I fix the problem, just opened .ino files in text editor and copy the code itself into new IDE window. Thank you.
But still can`t make the control from bluetooth of my phone


Answer 6 months ago

can you share the schematic? that will easy to discussion.


Answer 1 year ago

The same thing happens to me, Did you find the soution?


Question 8 months ago

I had a question, I'm building this robot using the Bluetooth module but having problems with uploading the code. I keep on getting this error:
Arduino: 1.8.10 (Windows 10), Board: "Arduino Pro or Pro Mini, ATmega328P (5V, 16 MHz)"

Sketch uses 2128 bytes (6%) of program storage space. Maximum is 30720 bytes.
Global variables use 52 bytes (2%) of dynamic memory, leaving 1996 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xc9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xc9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xc9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xc9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xc9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xc9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xc9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xc9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xc9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xc9
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

I am not sure how to resolve this error, searching online doesn't help since it isn't specific to this project.
Please help, thank you.


Answer 6 months ago

you should press the "reset" button while the upload process is going.


Question 6 months ago

Hi, can I have the spider mask print file please?