Control 1 Servo Motor Using 1 Potentiometer (Humanoid Robot EP 01)

1,826

34

0

Published

Introduction: Control 1 Servo Motor Using 1 Potentiometer (Humanoid Robot EP 01)

This is the first step for making motion capturing robot. The robot’s name is Choom which means “dancing” in Korean.

Step 1: Goal

If you follow this Instructables, you will be able to control one motor by using one sensor.

If you follow all this tutorials, you will be able to make a motion capturing robot set.

Step 2: Motion Capturing!

Have you seen this robot? I build and shared all of them. This is a kind of motion capturing. These robots are a simple example.

Step 3: Motion Capturing for a Humanoid Robot

I thought that it could be nice if I make a humanoid robot in this way.

The right picture is a humanoid that I build 4 years ago. You can download all of design files as well.

Anyway, in order to control this kind of robots, you need to make a motion set which takes a lot of time and energy like a stop motion animation.

If it is controlled by using motion capturing, it will be easy and fun to play with it.

Step 4: Final Goal for the Project

The final goal for this project is making 2 kind of robots.

One robot will be a master robot which has sensors on the body. The robot doesn’t have any motors.

The only role for the mater robot is reading all the angle of its joints and sending the values to the slave robots.

Other robots will be slave robots which have motors. They are going to move based on the master robot

Step 5: Following Steps

In order to make the robots, we need to understand overall system.

1. We will test only one servo by using one potentiometer which will be easy. In the stage, we don’t need any extra board but the Arduino.
2. use 8 sensors for 8 motors with some extra boards.
3. send its data through wireless communication.
4. use 20 motors and 20 potentiometers for the humanoid robot.

If you are worry about the source code, circuit or 3d files, don’t worry. I will share everything.

Step 6: Part List

These parts are the parts that we will use. It can be changed to some extent.

Step 7: Overall Principal of This Episode

This is the basic overall principal in this episode. How can we getting angle from a joint of the body? One of simple way is put a potentiometer on the joint. As the joint rotates, the potentiometer rotates as well.

The Arduino reads the analog value of potentiometer and sends the signal to servo motor.

Step 8: Schematic

This schematic shows how to connect with each component. The most important thing in the schematic is the direction. The board can be damaged, If you put the cable in wrong direction.

Step 9: Making the Circuit

I used the Dupont cables. I slightly cut the end of the terminal so that it could be tight. Plug the cables like this video, and glue it

Step 10: Code

Here is the source code we will upload

• copy the source code and paste your Arduino IDE
• include Servo.h which is a library
• make a servo instance,
• attache it pin number 9.
• map the range from 10 bit analog value to 180 degree
• write the pwm value to the servo.

Step 11: Test (1)

It seems good but it needs calibration. The potentiometer has wider range than the servo.

Step 12: Code Modification (Angle Calibration)

To fix this problem, I added some code for check the analog value

Step 13: Getting Values From the Arduino

Now that I can read the analog value, I will check the value when the potentiometer points 180 degree. The value is around 843, on the other hand, 0 degree of the potentiometer is around 113.

Step 14: Final Code

I put the number on the source code line 13.

It means the limitation value of the potentiometer is from 113 to 842.

And map the range of the analog value to angle which is from 0 to 180.

For example, when the potentiometer value is 113, angle is 0 degree.

Step 15: Final Test

I uploaded the code and tested it. It looks good.

Now that we knew how to handle one joint, we can make this up to 8 joints and 8 motors by using Arduino Nano.

Next tutorial, we will control more than 8 motors with extra board which will be awesome.

Step 16: Video Instruction and Part List

This is an entry in the
Make it Move Contest

Recommendations

• 3D CAM and CNC Class

506 Enrolled

• Casting Contest

We have a be nice policy.

Questions

0

Can the "1 potentiometer - 1 servo" be done with an Arduino UNO as well?

If so, and if there are any differences, could you explain what they are?

Thanks!