0% found this document useful (0 votes)
238 views

Simple Humanoid Walking and Dancing Robot Arduino

This instructable describes how to build a simple humanoid robot that can walk, jump, and perform dances using an Arduino microcontroller and four micro servos. The robot uses two servos per leg attached to cardboard "feet" to allow the legs to move. The Arduino code controls the servos to execute walking motions and simple dances. Assembly requires common materials like cardboard, wood, wire and hot glue. Programming the Arduino allows the robot to be controlled to walk and perform dances through coded servo positions and timing. Overall this provides an introductory project for learning robotics that is inexpensive and accessible for beginners.

Uploaded by

Hamza Khila
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
238 views

Simple Humanoid Walking and Dancing Robot Arduino

This instructable describes how to build a simple humanoid robot that can walk, jump, and perform dances using an Arduino microcontroller and four micro servos. The robot uses two servos per leg attached to cardboard "feet" to allow the legs to move. The Arduino code controls the servos to execute walking motions and simple dances. Assembly requires common materials like cardboard, wood, wire and hot glue. Programming the Arduino allows the robot to be controlled to walk and perform dances through coded servo positions and timing. Overall this provides an introductory project for learning robotics that is inexpensive and accessible for beginners.

Uploaded by

Hamza Khila
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

instructables

Simple Humanoid Walking and Dancing Robot (Arduino)

by shahryar.adil.3

This instructable will be about making a humanoid to make. This robot can be made as a beginners
walking robot that uses Arduino and can walk, jump robot to introduce yourself to the field of robotics.
and do some dances. The thing that is different in this Let's get into making the robot!! (If you like this
robot compared to other humanoid robots is that while instructable, please vote for it in the micro-
others use several high torque (expensive) servos, controller and other contests!!! :D)
this robot only uses 2 (micro) servos per leg. This
makes the robot easy to create, code and also cheap

Simple Humanoid Walking and Dancing Robot (Arduino): Page 1


Step 1: Tools and Material Required

The bill of materials is as follows:

Micro Servo or any other (qty. 4) ($6 for four).


Arduino UNO(you can use other models but keep in mind that using other models may affect
stability). ($6.45)
Wires. ($1.6 for 1m)
Perfboard(not necessary, I did not use one). ($0.78 for one, sold as kit)
Thin sheet wood (2 pieces measuring 6.2 x 4.6 cm). This measurement can vary if you are using
any other type of servos.

Cardboard (small pieces required).

Total:Around $16 including cardboard and sheet wood.

The required tools include:

Soldering Iron (with solder).


Hot Glue gun.
Cutter.
Hacksaw (to cut wood).
Printer cable for Arduino.

Step 2: Preparing Servos

The first thing that you need to do is to attach the use as reference to attach the servos together. Try to
servo horns to the servos. Keep in mind that you can't keep the horns are as close to 90 degrees as
just attach them to the servo, it has to be done possible.
properly or you will encounter problems later.This
video explains how to attach the servo horns to the After that, take a piece of cardboard and glue both of
servos, click here to view it. (The video is not mine the servos on it and cut extra cardboard out. One way
but is made by Karl Wendt). to ensure that you do this properly is to make sure
that the screw mounting part of both the servos is
Now that you have attached the horns to the servos, touching. Make sure to keep the wire part on the
it is time to glue the servos together. Both the servo outside.
sets are attached in different ways so be careful while
gluing them. I have attached pictures which you can

Simple Humanoid Walking and Dancing Robot (Arduino): Page 2


Simple Humanoid Walking and Dancing Robot (Arduino): Page 3
Step 3: Attaching the Arduino

Once that is done, take a rectangular piece of shown in the pictures. This MAY damage your
cardboard (mine measured 6.4 x 5.4 cm) and hot glue Arduino (highly unlikely) so if you do this, it will be at
it to the backside of the servos as shown in the your own risk.
pictures. You can round the corners to make it look a
bit neater. The only thing left to do now (in terms of hardware) is
the wiring.
After that, take the Arduino and hot glue the backside
of the arduino (the white side) to the cardboard as

Simple Humanoid Walking and Dancing Robot (Arduino): Page 4


Step 4: Wiring the Servos!

The way I have done it, it looks a bit confusing but connection, you have to understand the naming for
believe me, it isn't. The red wire of the servos are the servos. Looking from the pin side of the arduino,
positive, the brown are negative and the orange wire the servo on the top right is the right thigh servo. The
is the signal wire. So, all you have to do is to solder one below it is the right foot servo. The servo at the
all the red wires together and then solder a stiff piece top left is the left thigh servo and the one below it is
of wire to that which connects to the 5v pin of the the left foot servo. Connect the right thigh signal wire
Arduino. Then, solder all the brown wires together to pin 5, the left thigh signal wire to pin 11, the left
and attach a solid piece of wire to them. This wire will foot signal wire to pin 3 and the right foot signal wire
connect to the GND pin which is below the 5v pin. to pin 9. Make sure that all of the signal wires are
(Wiring diagram attached) attached to the pins with a squiggly line before them
(PWM pins). (Wiring diagram attached)
After that, you will be left with four orange wires or
signal wires. Before soldering them to a stiff wire for

Simple Humanoid Walking and Dancing Robot (Arduino): Page 5


Step 5: Choosing Power Source

Now comes the time to choose whether you will be other in series. Then, you have to wire the 9v pack to
powering the robot using USB power (which is the power jack on the Arduino (the wiring diagram is
inconvenient and causes occasional disturbances) or attached). The power jack has 3 pins one on top, one
using six AA cells. I chose the latter, although it's on bottom and one on the right (pic attached). The
entirely your choice what you want to do. The one at the top and the one at the right are the ground
problem with AA cells is that they run out in a few pins. The negative wire of your battery pack connects
hours. If you chose USB power, all you have to do is to one of them. The one at the bottom is the 9v pin,
to connect a printer cable and power it with that (mine the positive wire of your battery pack gets soldered to
didn't work like that, it kept on falling), but if you that.
chose AA cells then its a little bit more complicated. If
you are using USB power (which I don't recommend), Once again, soldering wires directly to that is can
you can a power bank to make it more portable. damage your Arduino (although its unlikely), so do
this at your own risk.
First of all, you have to create the 9v power supply
which is just 3 3v AA battery packs soldered to each

Simple Humanoid Walking and Dancing Robot (Arduino): Page 6


Step 6: Adding Feet

The next step is creating the robot is to attach feet to the base of the robot. For feet, I used a 6.2 x 4.6 cm piece of
thin sheet wood for the feet. At first, I had used cardboard but that was very floppy and unsuitable so I opted for
sheet wood. All you have to do now is to hot glue the wood onto the feet servos of the robot. Try to glue the servos
at the exact middle of the feet.

Simple Humanoid Walking and Dancing Robot (Arduino): Page 7


Simple Humanoid Walking and Dancing Robot (Arduino): Page 8
Step 7: Programming

Now that we are done with the hardware part of the in the comments section and I will try to answer them
robot, it is time to work on the software. To upload the ASAP. I have uploaded the code for walking, jumping
code to the robot, you need to download the Arduino and a few dances. Of course, once you are familiar
IDE software. It can be downloaded from here. Once with the software you can write your own code for the
that is done installing, connect the Arduino to your PC robot. If you made some mistakes while making the
via the USB printer cable. Then open the Arduino robot, you might have to tweak the code just a little
software and go to the 'Tools' from the toolbar and it bit. Once again, if you need help just ask for it in the
should say Arduino/Genuino there. Click on ports and comment section. (Note: Yes I know, the way I
select the one with Arduino/Genuino next to it. Then, programmed this robot is very inefficient but this was
enter the code I have provided into the software and my first micro-controller project and I did not know
click on the right arrow sign at the top left. After some how to use functions so hopefully the coding will be
time, it should say Done Uploading and if you have better in the future contests!)
done everything right, your robot should start to
move!! If you are having any problems, mention them

Download (https://cdn.instructables.com/ORIG/FCM/57ED/J16YCOR1/FCM57EDJ16YCOR1.rar)

http://www.instructables.com/ORIG/FCM/57ED/J16YCOR1/FCM57EDJ16YCOR1.rar

(https://cdn.instructables.com/ORIG/FCM/57ED/J16YCOR1/FCM57EDJ16YCOR1.rar)

Step 8: Understanding the Code

Simple Humanoid Walking and Dancing Robot (Arduino): Page 9


In this step, I will try to explain the code the best I leftfoot.attach(3); <><> This command attached the
can. Lets do the dancing code. Servo object 'leftfoot' to pin 9.

------------------------------------------------------------------------- leftthigh.attach(11); <><> This command attached


------------------------------------------------------------------------- the Servo object 'leftthigh' to pin 9.
---
} <><> Marks the ending of the setup commands.
#include <><> This command is used for including
the servo library. void loop() <><> This is the code that will be
repeated multiple times to do the actions.
Servo rightfoot; <><> This command creates a
Servo object with the name 'rightfoot'. This will be { <><> Marks the beginning of the loop of commands.
used to address the servo later.
leftfoot.write(10); <><> This command is used to
Servo rightthigh;<><> This command creates a make the Servo go to it's initial position after each
Servo object with the name 'rightthigh'. This will be loop.
used to address the servo later.
leftthigh.write(90); <><> This command is used to
Servo leftfoot;<><> This command creates a Servo make the Servo go to it's initial position after each
object with the name 'leftfoot'. This will be used to loop.
address the servo later.
rightthigh.write(105); <><> This command is used
Servo leftthigh;<><> This command creates a Servo to make the Servo go to it's initial position after each
object with the name 'leftthigh'. This will be used to loop.
address the servo later.
rightfoot.write(180); <><> This command is used to
void setup() <><> This includes the intial commands make the Servo go to it's initial position after each
that the Arduino will go through once before going loop.
through the loops.
delay(1000); <><> This creates a 1 sec delay before
{ <><> Marks the beginning of the setup commands. the next command is executed. The value is in
milliseconds.
rightfoot.attach(9); <><> This command attached
the Servo object 'rightfoot' to pin 9. leftfoot.write(17); <><> This command is used to
make the 'leftfoot' servo go to 17 degrees.
rightthigh.attach(5); <><> This command attached
the Servo object 'rightthigh' to pin 9. delay(25); <><> This command creates a delay of 25

ms before the next command is executed. It is added


to make the actions look smoother. If you want to
make the dance slower, you can increase the value of
all the delay commands and vice versa.

leftthigh.write(95); <><> This command is used to


make the 'leftfoot' servo go to 17 degrees.

delay(25);<><> This command creates a delay of 25


ms before the next command is executed. It is added
to make the actions look smoother. If you want to
make the dance slower, you can increase the value of
Simple Humanoid Walking and Dancing Robot (Arduino): Page 10
all the delay commands and vice versa.

......... <><> I did not write all the commands because


all the commands that follow are basically the same
as these.

.........<><> I did not write all the commands because


all the commands that follow are basically the same
as these.

} <><> Marks the ending of the loop of commands.

(I have attached a picture which shows how the servo


degrees work.)

-------------------------------------------------------------------------
-------------------------------------------------------------------------
---

I used more or less the same commands in all of the


programs I have coded so I don't think further
explanation is needed. This could have been done in
a much more shorter and efficient way but this was
my first time working with a micro-controller so I used
basic commands as they seemed to get the job done
:). If you need further explanation of any part of the
code, feel free to ask in the comments.

Simple Humanoid Walking and Dancing Robot (Arduino): Page 11


Step 9: Conclusion

Now that the robot is done, what next? Well, you was not working so I though that I would re-write my
should now be familiar with robotics and also with own version of that instructable. Another thing that
writing code for the Arduino. You can continue to motivated me to write this instructable were the
code new functions for this robot or even make a new contests going on at Instructables at this time (such
and bigger robot. This instructable was created with as the micro-controller contest) which had very good
mainly the purpose of introducing people to the field prizes. Winning those contests would equip me with
of micro-controllers and robotics. I think that this is an gear which would be useful for future instructables.
excellent beginners robot as it is easy and cheap to Anyway, if you liked this instructable, don't forget
make. I originally got this idea from this instructable to vote for it in the contests, I would love that!! :D.
here, but the person who made it made a mistake or Thank you for viewing my instructable.
something, I'm not sure, because my robot as well as
many other people's robot in the comments section

https://youtu.be/QveDVkUwDHU

Simple Humanoid Walking and Dancing Robot (Arduino): Page 12

You might also like