Let's Make Robots! | RobotShop

Micro Servo Robot

MiniRobot_1_3.ino_.zip2.73 KB
MiniRobot_1_3EN.ino_.zip3.52 KB
Micro_Servo_Robot_Flowchart.pdf84.04 KB
Micro_Servo_Robot_Diagramm.pdf74.13 KB

4 axis robot arm with a small gripper and teach function. (In fact: it is a 3 axis robot)

This robot can follow. This robot can learn. And this robot can repeat endles. And he lost all his memory if the batterys are low. This makes it new all the time he is powered again. - The idea for this project is taken from https://www.robotshop.com/letsmakerobots/node/21633 - Stoerpeak made me do it! -

Arduino mini pro 5V/16MHz

4 micro servos 180degrees

4 22k potentiometer

NmH Battery 4.8V

Wires, Button, Switch

Balsa wood, Metal, Plastic

Zip Ties and Glue


Teach mode: After a reset the robot arm follows the teach in arm while simple mapping the analog inputs every 25ms to the servo motors. Pressing the button stores each servo position in a array

Play mode: Double press the button switch to play mode. The sketch reads the array step by step and and moves the robot arm. For cool loocking movements i added a routine calculates different micro steps for each servo to have moving start and end sync on all axis. Also added a ramp for soft increase/decrease velocity. Shorter travel distances the robot does slow, longer distances with faster speed. Its all about timing so my thoughts in this moment

Play Mode version 1.1 The gripper input is used to set the delay (0,1,3,15,60,300 seconds) after a loop is done. The switch (it was left from the project start) pauses the robot

08/2015 i added the same code 1.3 but i try add english comments

10/2015 flowchart for the code and electrical diagram. (make sure you use a pullUp resistor at input 4,6 / change the code for input 4. This should fix the 'slow running problem' often happend)


Hey people!!: If u share my code please keep decency and give me credits. And dont forget Stoerpeak!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

hye.. u have really nice project !!! i have build the circuit but i have the problem about your circuit diagram post.. can u explain more details. can u skecth new circuit diagram because i really dont see how the circuit works.. and what value of resistor did u put in the circuit diagram?  im new in arduino .. sory for my bad english.

im done with the circuit on the breadboard. im use arduino uno . the servo work perfectly with the potentiometer. and now, i have problem with button and switch connection. can u draw me the connection ??? in the .ino code, u have declare DI 13, DI 4 and DI 6 ...and where to connect it?

DI 4 for the Switch, DI 6 for the Button, DO13 is output for the led

The button and switch needs a pulldown resistor. > http://arduino.cc/en/Tutorial/Button

hi.. when im done in teach mode, i was double click at the button but the play mode is too slow ( 90degree=30sec) . i dintn change any coding and i think the connection is correct.. any solution sir?

the only difference i see is i was using a arduino mini pro insted a arduino uno. but this makes no sense... how u powered your system? usb? battery?

i have use baterry, usb port and ac power adapter . i have try all the ways to power up my arduino but still same result... too slow in play mode.

Seems to be the same problem I had. All the servos moved very slow. FYI, I am using digital power suply, which should be good. I am using Arduino mini pro 5V board.

Pinaut: I saw your reply on my original post. I did not change any code.

And I tried to change some lines that I think makes sense regarding the 'speed', but no luck. I really love to see this control work wells on my desk. Please let me know if there thing(s) I can debug with.



really dident now why your code run slow

try change 'time' in the 'playmode part' from void_loop with numbers (they are microseconds until next micro step will be done) 

 else // ausführen


      if (currentMicros - previousMicros > time) // speed für servo update/step


        previousMicros = currentMicros;




  }// ende playmode

Please tell me why the 4 servomotors runs too slow, please help us, I have already verified all the previous details commented / posts; but its the same... please S.O.S hahaha thanks in advance for your help from someone who has 3 hrs became familiar with arduino.

can you send a new curciut diagram?