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.

<p>can you pls tell me how to calibrate the legs and which lines should i uncomment in the code</p>
<p>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.</p>
<p>Hi Regis! Thanks for sharing your awesome design!<br>It is AWESOME!!!<br><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/9Pos9pE8xwU" width="500"></iframe></p>
<p>should I need to use capacitors to avoid glitch of servo motion. In the picture of circuit diagrams, capacitors are used but you haven't say about the capacitors.</p>
<p>Why did you take the leg calibration parts of code out?</p><p>It is impossible to have the servos be perfectly aligned and the legs perfectly straight.</p><p>How is this part done?</p>
<p>actually the legs need a calibration function, however I didn't put it into the code because of this project isn't a commercial product. You can refer to original design here (https://www.sunfounder.com/robotic-drone/quadruped/crawling-quadruped-robot-kit.html) to put it back. </p>
<p>Fantastic project!!! Thanks for sharing all the details! </p><p>I've made my own laser cut quadruped robot and trying to adapt your code. </p><p>Only difference is that I'm using Adafruit's 16 channel controller board instead of arduino PWM pins. Your code mentions &quot;adjustment&quot; routines, but they are missing. Would you mind sharing those as well? :) </p><p> I got everything moving but because I'm wired different and have different frame, leg positions is incorrect (i.e. leg #4 is not doing mouch for some reason). I think I just need to calibrate it...<br>I wrote small function to emulate &quot;servo&quot; command with PWM controller:</p><p>void moveServo(char chan, float deg) {<br>int pulselength;<br>if ( (deg &gt;= 0 ) &amp;&amp; (deg &lt;= 180 )) {<br>pulselength = map(deg, 0, 180, SERVOMIN, SERVOMAX);<br>pwm.setPWM(chan,0,pulselength);<br>} else Serial.println (&quot;Invalid degree specified!&quot;);<br>}</p>
<p>You can disregard my question. I just found original Soundfounder's code :) Looks like you removed parts of it, that's what confused me. There's also a nice guide explaining how code works.</p>
<p>Can you tell me the link to the code you found, i am also having a slight problem...</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>
Same here<br>I used atx power supply to make sure the current is sufficient. But the spider keep restarting.<br><br>
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.
Hello<br>Nice project you have.<br><br>I decided to make one, with arduino i made by myself (not uno or mini). When I uploaded legs init, it's still working perfectly, but when I uploaded demo sketch, the robot just stand-forward and repeat.<br><br>https://drive.google.com/file/d/0Bws6H47Gp4hZQ0FoaV8weXBXbmM/view?usp=drivesdk<br><br>Can anyone help me?<br>I guess its not power issue since I tried with battery and power supply (40A max)
<p>here some upgrade comman you can download,</p><p>some improvements i make it using bluetooth module;-</p><p>-folding</p><p>-Head up</p><p>-Head down</p><p>-Body dance</p><p>-adjust high but cant walk</p><p><a href="https://drive.google.com/open?id=0B6o0nhlQqriqT0JvMWQ1OVVuaFU" rel="nofollow">https://drive.google.com/open?id=0B6o0nhlQqriqT0Jv...</a></p><p><a rel="nofollow">[d</a></p>
how about share the video?
<p>this video for folding</p>
Dear author, would you be able to print parts for me? Id be happy to pay! I cannot afford a printer and cant find someone to do it!
<p>hey i sell this frame</p><p><a href="https://www.etsy.com/listing/478977661/" rel="nofollow">https://www.etsy.com/listing/478977661/</a></p>
<p>hey i sell this frame</p><p><a href="https://www.etsy.com/listing/478977661/" rel="nofollow">https://www.etsy.com/listing/478977661/</a></p>
<p>this is auto? ^.^ i want to control it. can you tell me how to do that ?</p>
<p>hey dude,i found a battery online its the same brand as you recommend but im curious with the size,it always vary from one shop to another.</p><p>this is the closest spec i found:Size: Approx. 90*45*18mm (L*W*H)</p>
<p>this code is wrong..can you fix it ?</p>
I don't know what are you talking about which code, however, the code is correct and all of people are made it already.
thankz for you super
<p>Hello,</p><p>Great tutorial, I am nearing the end of my spider.</p><p>I would like to add the infrared remote and IR detector. </p><p>I did look for these in github but was not able to find.</p><p>Would you be able to provide me with schematics and code for infrared remote and IR detector please?</p><p>Please send the schematics and code to the following email: spittingcobra9921@gmail.com</p><p>Also I would like some advice, I brought the DC 12300 but it was faulty, would you be able to recommend me an alternative and also if I choose not to buy a battery, will this robot work with AA batteries in series?</p><p>Sorry, for the long comment, waiting to hear from you.</p><p>Thankyou</p>
<p>Hi</p><p>I have been struggling to get a suitable battery. In the mean time I put together a battery case to take 8 x AAA rechargeable batteries so I can carry out testing. It lasts about 10mins which is more than enough for the purpose. Hope this is helpful. </p>
<p>is it on serial or paralle?</p>
<p>You can use two 18650 (3.7v+3.7v=7.4v) instead of DC12300. However, you need to modify the part of body_d.</p><p>for the IR detector, my orignal code seems gone. here is a brief FYI.</p><p>the feedback pin is connected to Arduino A0(14).</p><p>void loop()</p><p>{</p><p> SCmd.readSerial();</p><p> if (!digitalRead(14))</p><p> {</p><p> step_back(1);</p><p> }</p><p>}</p>
<p>thx for the reply.</p><p>I found this code in previous comment, is this still functional?</p><p>The connection is Vcc,GND and A0.</p><p>Here is the code segment, please port it into your code.</p><p>/////////////////////////////////////////////////////</p><p>// pin-A0</p><p>#define IR_Detect_IO 14</p><p>void setup()</p><p>{</p><p>...</p><p>// config IR_Detect_IO pin as input</p><p>pinMode(IR_Detect_IO, INPUT);</p><p>...</p><p>}</p><p>int flag_obstacle = 0;</p><p>int mode_left_right = 0;</p><p>void loop()</p><p>{</p><p>int tmp_turn, tmp_leg, tmp_body;</p><p>//Regis, 2015-07-15, for Bluetooth command</p><p>SCmd.readSerial();</p><p>if (!digitalRead(IR_Detect_IO) &amp;&amp; is_stand())</p><p>{</p><p>tmp_turn = spot_turn_speed;</p><p>tmp_leg = leg_move_speed;</p><p>tmp_body = body_move_speed;</p><p>spot_turn_speed = leg_move_speed = body_move_speed = 20;</p><p>if (flag_obstacle &lt; 3)</p><p>{</p><p>step_back(1);</p><p>flag_obstacle++;</p><p>}</p><p>else</p><p>{</p><p>if (mode_left_right)</p><p>turn_right(1);</p><p>else</p><p>turn_left(1);</p><p>mode_left_right = 1 - mode_left_right;</p><p>flag_obstacle = 0;</p><p>}</p><p>spot_turn_speed = tmp_turn;</p><p>leg_move_speed = tmp_leg;</p><p>body_move_speed = tmp_body;</p><p>}</p><p>}</p>
<p>what not try it first?</p>
<p>I am still waiting on the battery, and I don't have access to a power supply/ AC-DC plug. So, would you please be able to recall if this was the functional code?</p>
<p>Hey, did you print your 3d parts in ABS or in PLA?</p>
I am using PLA,however, ABS is fine.
<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>
Not needed
Thanks for the reply!
<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>okok thx.I think it will reach around 2.7 will it be sufficient?</p>
I think it wont work with 2.7A ,Coz i first tried 2.5 A but it was able to run onlyb8 servos,so i added 2 of them and got 5A :)
<p>Hello, I would like to control the servos via I2C using a servo driver board. How much work is it to modify the cope for this. I have to admit that I am no coder at all.</p><p>Thanks Michi</p>
<p>Hello I stand Axel GonzalezRusso am from Argentina, I saw it and I love your project, I'm doing about 6 months ago but I had some problems with programming, I could solve but I emerged new and makes a time that can not resolve them and appreciate to help me complete this project. I pass the error in a file .ino .txt<br>https://gist.github.com/DavidRom98/195678a481fccb217e549564489e955d</p>
<p>What error message you got? what Arduino you are using? the include file missing - #include &lt;NewPing.h&gt;?</p>
<p>I finished assembling, checked all connections, but when I turn the switch he makes a move and begins to shake and flashing leds as Arduino was short, he trembles every time</p>
any details information about your board and battery?<br>
<p></p><div>It is the list of the materials you sent</div>
<p>please show the pictures and I could know in details.</p>
<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>

About This Instructable




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