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.

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



<p>Sup.Ive finished attaching the body.The question : I cant find the dc 12300 battery anywher in my local online shops.My mum wont allow shops like amazon or ebay.So can i use an old power bank?ill make a series then just connect it to power supply.Will it work?I think it will cause power bank output are 5v right?</p>
it is fine with any battery or power bank. however, you should make sure the output capabilty of battery is over 3A current.<br>
<p>Hello I have a question, is the a6 + a7 a direct connection to the powerjack and ground. I'm asking this question because there is a box with the 1 and 2 inside of it. (see added image)</p>
A6/A7 connect to a 2 pins connector, these two connectors weren't connect together.<br>
<p>So they are both seperate 2 pins connectors? Why did you connect those, cause I assume you're not using them?</p>
<p>I left a6/a7 connector for another purpose, you can omit it. </p>
<p>is the [1 2] rectangle at the power jack/in_ground also can be omitted?</p>
<p>May I know why you want to omit these pins? </p>
<p>well I'm assuming those pins are not being used right? So why would I not omit them if I'm not using them. I'm still confused about the [1,2] pins at the powerjack, are also these not being used?</p>
<p>allright, and same goes for the 2pin-connector connected at POWER_JACK and IN_GROUND? (also shown in the same picture)</p>
<p>Hey, I was wondering if we have to modify the servos in any way. If the servo have 180 deg of motion, should we modify it to have 360 deg?</p>
<p>Good afternoon, I need to use a capacitor if so please pass the specification and resistance it is 1k or 10k</p>
hallo, how are using for android?
<p>Android?!! </p><p>Too heavy system and expensive for this kind of toys.</p>
<p>Hi I just really quickly want to ask what parts these two schematics reference? I am at a loss on what it is for and where it connects too.</p>
Those pins are just reserved for future used, for examples Gyroscope sensor, IR sensor,...,etc.<br>
<p>Oh thank you for that, I was getting confused :) </p>
I am using arduino nano for servo board. The connection given to servo is like this<br>d2,d3,d4,d5,d6,d7 for servo 1,2,3,4,5,6 and A0,A1,A2,A3,A4,A5 for servo 7,8,9,10,11,12.<br>I make the servo board twice and the crazy leg position repeats.<br>
<p>I don't know what servo board you are using. However, the pins of 7~12 are wrong. They are should be connected to the nano digit pins. In my design, the pin from d2-d13.</p>
I am using arguing nano.I want to use nRF24L01 for wireless control.Is there any way to make that change in the v3 code
<p>you can modify the line in the sketch file</p><p>const int servo_pin[4][3] = { {2, 3, 4}, {5, 6, 7}, {8, 9, 13}, {12, 11, 10} };</p><p>it is a config for the servo pin.</p>
for which leg the pins{8,9,13} and {10,11,12} is to be connected
I have to use nRF24L01.the pins d8-d13 should be assigned to the wireless module. Does changing the servo pin in arduino code to A0-A5 after d7 should make the robot to run properly?
Ive made autonomus mode. Ill share my code on my youtube channel
I've seen it...cool!!
I am facing an issue here. please help ...<br>1.when I upload the leg.init code to nano and try to run all the servo using power bank [5v 2.1A] the servo vibrates.when connecting each servo at a time it does not vibrates and i install all rocker arm as in picture.<br>2. after uploading V3 code the leg comes into weird position <br>3. I am using nRF24L01 for wireless control. what changes to be made for using this module
<p>it may cause by the wrong connection between servos and Arduino board. you should read the step 10 more detail.</p>
<p>I have some questions regarding power supply</p><p>I'm using a 5v ,5A portable power bank as the power supply to the servos.</p><p>The problem is its not accurately 5v output,its about 3.9v,So can i use a Step Up to increase it to exact 5v . And now How should i power the Arduino Pro Mini. I was planning to power it with a 9v battery .But unfortunately i dont know much about these things ,as im new to this. Can you tell me how to connect 9v battery to arduino and how to use that 5v regulated power bank as external power supply for servos. And how to fit the servo into those 'Tibia' Leg parts (i'll attach the images). As there is those 3 wires of servo, it cant be fitted inside that square hole. the hole is exactly printed for the bottom of the servo. Sorry for my &lt;&lt;Noob questions&gt;&gt; .And i bought &quot;XL 4005 DC-DC&quot; Step down.Can it be used as Step Up for that 3.9 v Power bank.Please Help me i have to submit this project in 15 days .Thank You.</p><p>LINKS.</p><p>Power Bank:-<a href="http://www.shopo.in/products/2578747" rel="nofollow">http://www.shopo.in/products/2578747 </a> (Not the same one but different model)</p><p>DC-DC Step Down:-<a href="http://www.ebay.in/itm/282146608026?aff_source=Sok-Goog" rel="nofollow">http://www.ebay.in/itm/282146608026?aff_source=Sok...</a></p><p>Thank You .Please Help.</p>
<p>the &quot;RAW&quot; pin of arduino board (mini-pro or nano) can be input the range of 3.3-12v. And, the voltage range of servo should be 4.8v-6v.</p><p>For the power system of my robot, the power board MUST support 3A output capability whatever you are using STEP-UP or STEP-DOWN. the XL4005 is STEP-UP and can't be used for STEP-UP.</p><p>The Tibia with Servo install issue, you should read this instruction more detail in STEP 8, you need cut off the edge for easy install.</p>
<p>And Also How Much Ohm resistor should we use ? 680 ,or 1K or 10K Ohms ???????it is mentioned as 10k ohms in the pdf and 680 ohms in the parts list and i think you have used 1K ohm in your board (by seeing colour codes). And can you send me a clear picture of the main board (not the PCB one,i need the perfboard one.)Thank You</p>
<p>the range of 680-10k are the fine, it is just the LED current limit. you can refer to here to get more understanding.</p><p>https://www.sparkfun.com/tutorials/219</p>
<p>I have one more question.</p><p>Is it OK if two legs have different size with the two others ?</p><p>thanks</p>
I am curious about why you want to make the leg with different size?
<p>Actualy, my friend accidently, somehow, printed it in difference size.</p><p>I just curious, is it something that make my robot restart it self when it walk?</p>
<p>It could be made the robot restart if some(one) of servos was over-current because of the loading didn't balance.</p>
<p>- I have a question about the spider_open_v3 code, how do I stop it from looping example moves, and be able to control it via Bluetooth, I tried using the code from your github Regis but that also had problems for me, forward and back worked on that code but for everything else there was just crazy moves and wierds actions (eg. when trying to turn right 2 legs just go flat and then I have to reset them to get them back into place.</p><p>- I also want to know about issues regarding the servos, when I run the robot/ when its on its 4 legs, I am hearing a weird buzzing sound, this sound goes away when I place the robot say on a box so the legs don't touch. Does this sound mean I am straining the servos? I have already had 2 servos burn out, so I removed the battery which is ~180g but the buzzing sound still remains. </p>
<p>its the servos trying to hold the position there told to go to and gravitys attempting to change the position so what youre hearing is the battle between good and evil....</p><p>tell it to sit...poke a leg that makes a noise..if it stops..im right! lol</p><p>ill forward you that automode in a bit bro</p>
<p>I have finished the Spider build, and all's well. I have tried to use HC-06 to no avail. It installs on the Pro Mini and pairs ok with Android. Unfortunately, I'm at a loss as to how to install the code. I have tried to follow the tutorial ReguisHsu kindly posted, Part 2 The-remote-control. Unfortunately, I'm at a complete loss as how to install the code. Does the code the spider_open_v3.ino remain and the HC-06 code added. Or do I remove spider_open_v3. If so it's here I'm failing. If some could talk me through the sequence I'd be eternally grateful. Sorry for the long comment</p>
<p>you probably need to edit the baudrate to 9600. flash the code on the remote instructions page to the arduino. </p>
<p>Upload this code to Arduino: (provided by Regis Hsu)</p><p><a href="https://github.com/regishsu/SpiderRobot/blob/master/spider%20robot/spider_robot.ino" rel="nofollow">https://github.com/regishsu/SpiderRobot/blob/maste...</a> </p><p>to control robot by bluetooth (android) use the app recommended and just change the values of buttons on the app. </p>
<p>HI Regishsu..</p><p>First I want to thank you for sharing this cool project.</p><p>Me and my son realy exited building this project.</p><p>I use Arduino Nano with expantion shield.</p><p>For power I use two 18650 battery. (from inside used laptop battery, to get cheap one).</p><p>But we stil have any problem. Everytime this robot walk or turn, it only take one or two step and than stop and restart itself. But when I hold it in the air and make it walk. It can walk a couples step and then it stop and restart it self (more step than when it on ground).</p><p>Is it a power matters ?</p><p>thanks</p><p>cupi</p>
More thwn likely a power issue, double check for any shorts and if possible use a external supply to eliminate power issues 12v 2amp wall plug make sure center of plugs dc jack is positive thought.
<p>link me the battery pls.It only last 2 minutes with my lips bat</p>
I got mine from dx.com dc12300
<p>Hi RegisHsu,<br><br>thank you for sharing this project :)</p><p><br>I'm nearly done, but i've a few problems/questions.<br>1.) Can you explain the servo_init code? When i start the Robot with that code, all servos are vibrate. It that okay or should the go to it neutral position and be silent?<br><br>2.) There are two versions of the basic code v1 and v3. It test both and try to connect the legs as shown in your instructions (step 10). But the leg go crazy?<br><br>3.) Does make it Sence to order some servos with a metal gear? Any suggestions?<br><br>Greetings,<br>Bastian from Germany</p>
1. the servo_init code is just drive the servos to the angle 90&deg;, I have modified the code already, please download it again to try.<br>2. you may try to download and install the lib and try again from http://playground.arduino.cc/Main/FlexiTimer2 <br>3. the metal gear would be MG90, there are different dimension between SG90 and MG90. you need to modify the 3D parts.
<p>Hello guys,</p><p>I'm slowed down again due to a problem, for my robot I brought an Arduino Uno and a servo shield to make the build a bit simple.</p><p>This one:</p><p><a href="https://www.adafruit.com/products/1411" rel="nofollow">https://www.adafruit.com/products/1411</a></p><p>I tried for days using the original servo_init files to try to get my servos to swing but then I realised I need to use the specific library for the shield: <a href="https://github.com/adafruit/Adafruit-PWM-Servo-Driver-Library" rel="nofollow">https://github.com/adafruit/Adafruit-PWM-Servo-Dri...</a></p><p>Now the problem I have is I cannot use the original code supplied by Regis, and as I am only a beginner in coding, will someone be able to explain to me how I can get the original code to work with this shield, or how can I modify the original code to work with the shield?</p><p>If anyone could help me by taking time to modify the following files to solve my problems I will be very grateful. </p><p><a href="https://github.com/regishsu/SpiderRobot/blob/master/spider%20robot/spider_robot.ino" rel="nofollow">https://github.com/regishsu/SpiderRobot/blob/maste...</a></p><p><a href="http://www.instructables.com/files/orig/F78/BJT8/IEEOJWKW/F78BJT8IEEOJWKW.ino" rel="nofollow">http://www.instructables.com/files/orig/F78/BJT8/I...</a></p><p>Thanks everyone, very desperate for answers and help, my robot is due very soon for assessment, please help \(&gt;.&lt;)/</p><p>I will also leave my email here if anyone wants to contact me that way.</p><p>spittingcobra9921@gmail.com </p>
<p>Im not building it yet, my plan is using Arduino Uno too.</p><p>Maybe you can ask Gsyan (Thingiverse.com)</p><p><a href="http://www.thingiverse.com/make:168395" rel="nofollow">http://www.thingiverse.com/make:168395</a></p><p>he use Ardiuno Uno too.</p><p>Please update if you fix the problem</p><p>Thanks</p><p>cupi</p>
refer to the code <br>https://github.com/adafruit/Adafruit-PWM-Servo-Driver-Library

About This Instructable




More by RegisHsu:Handy Power Supply [vPython] Spider Robot simulator [DIY] Spider Robot - PART II - Remote control 
Add instructable to: