[Arduino Robot] How to Make a Motion Capture Robot | Thumbs Robot | Servo Motor | Source Code

1,461

14

3

About: Hi, I'm Eunchan Park from S.Korea. I have 3 missions Making Happy Things, Sharing How To Make Happy Things, Copying Happy Things Maker for the world's Happiness In order to pursue my mission, I have a big go...

Thumbs Robot. Used a potentiometer of MG90S servo motor. It is very fun and easy! The code is very simple. It is only around 30 lines. It looks like a motion-capture.

Please leave any question or feedback!

[ Instruction ]

[ About the maker ]

Step 1: ARDUINO PARTS

Install Arduino IDE

Install CH340 Driver (for Chinese version)

DOWNLOAD - source code

Select board / Processor / Com port

  • Arduino Nano
  • ATmega328P (Old Bootloader)

Plug your arduino nano

  • Plug the USB cable and a new port will appear.

Find / select emerging com port

  • Click the appeared port and hit the upload button
  • Hit the upload button

Step 2: 3D PRINTING PARTS

Download 3d modeling files from Thingiverse

Print all parts one by one

Step 3: Circuit Part

Use the Arduino Nano Expansion Board. Because the Arduino Nano itself doesn't have many pins, you will need to use an expansion board.

When you look at the wiring connected to the motor, you can see three colors. Yellow, Red and Brown. Brown must be connected with G (Ground).

In the following steps, we will look it closely again.

Step 4: HARDWARE PART - Prepare All the Parts

Step 5: Modify 3 Servo Motors Into Position Sensor

Following steps show you how to modify a servo motor into position sensor. basically most servo motors have a potentiometer or encoder for getting an angle value.

We will use that potentiometer itself. we need to open the case, disassemble the board and rewire it again.

Step 6: Unscrew 4 Bolt on the Backside and Open the Front Case

You will need a small screw driver because they are too small. The motor has 3 parts - front, body and back.

When you open the front side, you will see the gears. Actually, we don't use this motor as "motor". So, the gears are not necessary anymore theoretically. But we will use some part of them so that the operation angle still has limitation of rotation.

Step 7: Remove the 3rd Gear

The potentiometer in the servo motor has angular limitation which is around 180 degree. The potentiometer has its own limitation mechanism but it is so weak. It is easily broken often. In order to protect it, the gear gives another mechanism. The first gear has a plastic bumper which will be contact with second gear.

We definitely need the first gear for the overall frame, the second gear is needed for the limitation. So, we cannot get rid of them. Instead of them, we can remove the third gear.

You may wonder why we need to remove a gear. These three servo motors will be used for getting angle information. If there are gears in them, the movement will be stiff. So, we must get rid of one of gear from them.

Step 8: Re-wiring / Soldering

Cut the wires which are connected with the motors.

Step 9: Use a Soldering Tool and Detach the Board

Step 10: Cut a Wire and Prepare for Soldering

and put some paste and put some lead on the cable

Step 11: Solder It

from the very left side red yellow and brown

Step 12: Put Some Glue on It

and recover its back side

We need 2 more potentiometers. do the same work for two other motors

Step 13: Make the First Joint Basement

I used a cooking board for making this project. it is cheap and firm to use it. In order to fix the frame on the board, you will need to use screws which has sharp end. It makes hole and thread at the same time.

There are 6 motors. 3 motors on the left side is the original motors. on the other hand, there are 3 motors which are modified in before step.

Step 14: Make the Yaw Joint

You will need to use M2 * 6mm screw bolt.

Step 15: Assemble the Yaw Joint With the First Motor

As you can see the last picture, you will need to put the joint in horizontal direction. And the location should be 90 degree of the both motor and potentiometer.

In other words, you can rotate those yaw-joint 90 degree clockwise and counter clockwise from that location.

Step 16: Assemble the Arduino Nano With Arduino Nano Expansion Board

Make sure the direction. The USB port will be same side with DC jack.

Step 17: The First Layer Connection

The potentiometer is connected with Analog 0 pin of the Arduino. You must plug it in correctly. This Arduino Nano has 8 channel ADC (Analog Digital Converter). Basically, the potentiometer gives analog level or volatage. You can read that volt value by using ADC pins

One the other hand, the servo motor is connected with Digital 9 of the Arduino. Servo motors can be controlled by using PWM (Pulse Width Modulation). The Arduino Nano has 6 channel PWM pin (pin 9, 10, 11, 3, 5 and 6) . So, we can use up to 6 servo motors.

In this step, the source code looks like this

#include <Servo.h>

Servo servo[6];
void setup() {
pinMode(A0, INPUT);
servo[0].attach(9);
}

int tempADC[3] = {0};
void loop() {
tempADC[0] = analogRead(A0);
servo[0].write(map(tempADC[0] , 0, 1023, 0, 180));
}

Step 18: Assemble the Second Layer

The second layer is also simple to make. What you need to be careful of is putting it in the correct location when you plug the cable into the Arduino.

  • The left Servomotor is connected with pin 10
  • The right potentiometer is connected with A1

#include <Servo.h>
Servo servo[6];
void setup() {
pinMode(A0, INPUT);
pinMode(A1, INPUT);
servo[0].attach(9);
servo[1].attach(10);
}
int tempADC[3] = {0};
void loop() {
tempADC[0] = analogRead(A0);
servo[0].write(map(tempADC[0] , 0, 1023, 0, 180));
tempADC[1] = analogRead(A1);
servo[1].write(map(tempADC[1], 0, 1023, 0, 180));
}

Step 19: Assemble the 3rd Layer Frames

Step 20: Assemble the Frame With the 2nd Motor / Potentiometer

Step 21: Assemble the 3rd Motor Into the Joint Frame

Step 22: Plug the Cable Into the Arduino

  • The 3rd motor is conncected with pin 11
  • The 3rd potentiometer is connected with A2

code looks like this

#include <Servo.h>
Servo servo[6];
void setup() {
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(A2, INPUT);
servo[0].attach(9);
servo[1].attach(10);
servo[2].attach(11);
}
int tempADC[3] = {0};
void loop() {
tempADC[0] = analogRead(A0);
servo[0].write(map(tempADC[0] , 0, 1023, 0, 180));
tempADC[1] = analogRead(A1);
servo[1].write(map(tempADC[1], 0, 1023, 0, 180));
tempADC[2] = analogRead(A2);
servo[2].write(map(tempADC[2], 0, 1023, 0, 180));
}

Step 23: Assemble the Thumbs Frame

Step 24: Test and Adjust Angle

Put the USB cable into any power source and the robot will be turned on soon. The angle may be slightly different. Adjust the angle one by one.

Step 25: One More Robot?

If you want to make one more robot, you can make it. Plug servos into 3, 5 and 6.

#include <Servo.h>
Servo servo[6];
void setup() {
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(A2, INPUT);
servo[0].attach(9);
servo[1].attach(10);
servo[2].attach(11);
servo[3].attach(3);
servo[4].attach(5);
servo[5].attach(6);
}
int tempADC[3] = {0};
void loop() {
tempADC[0] = analogRead(A0);
servo[0].write(map(tempADC[0] , 0, 1023, 0, 180));
servo[3].write(map(tempADC[0] , 0, 1023, 0, 180));
tempADC[1] = analogRead(A1);
servo[1].write(map(tempADC[1], 0, 1023, 0, 180));
servo[4].write(map(tempADC[1], 0, 1023, 0, 180));
tempADC[2] = analogRead(A2);
servo[2].write(map(tempADC[2], 0, 1023, 0, 180));
servo[5].write(map(tempADC[2], 0, 1023, 0, 180));
}

Step 26: Done!

If you have any question, please feel free to leave it :)

Microcontroller Contest

Runner Up in the
Microcontroller Contest

Share

    Recommendations

    • Make it Glow Contest 2018

      Make it Glow Contest 2018
    • Plastics Contest

      Plastics Contest
    • Optics Contest

      Optics Contest

    3 Discussions