HUMANOID robotic ARM using pic microcontroller

The purpose of the HUMANOID robotic ARM project is to implement the position control and vision control on the robotic arm. The proficiency and precision of the robots in each field of work e.g. VLSI chip design and fabrication in the industry, working at high temperature in modern steel industries doing a hectic job all the time is well known.

microcontroller based humanoid robotic arm-min

The “Vision Control” is implemented using the webcam as an image capturing device and the software “Matlab(acting as the brain of the project) “to apply image processing algorithms to calculate the coordinates of the obstacle. After the image is captured, gray scaled and threshold, an elliptical grid is applied over the entire image. Of all of the intersections in the grid, the algorithm chooses rectangular coordinates of one point most likely to be the center of the obstacle. The obstacle is assumed to be dark enough to produce sufficient contrast (as it is placed on white background).you may also like to read followings articles related to humanoid robot:

HUMANOID robotic ARM using pic microcontroller

Since the arm needs the coordinates be in the form of (R ), where  is the angular displacement of base disk in x-y plane. A slotted disk and sensor arrangement with each motor  required these coordinates to be in no: of integral slots between  the extreme values(say, min and max  for base disk) hence need is felt of developing calibration equation that calculates no: of slots( by mapping against the coordinates). Each of the remaining arm parts except gripper offers the variation both in R and.The above-stated methodology has been applied for all motors   

The “Position Control” or the feedback control is implemented using microcontroller “PIC16F877A” (acting as the heart of the project).It receives the no: of slots for each motor from PC (matlab 7), via serial cable and is responsible of taking the robotic arm (gripper) precisely to the obstacle.

PIC microcontroller makes sure that each motor in the structure is held energized (and the related component of the arm continues to move) until the gripper reaches exactly where the obstacle is placed. At each instant the position of the arm is reported to the PIC via feedback through sensors.The gripper motor is then energized to allow picking of the obstacle.

robotic arm using pic microcontroller-min

Part of HUMANOID robotic ARM


Motors are the main muscles of our humanoid arm using pic microcontroller.  These motors are being used at locations in the structure where motion is required whether it is rotational or angular. Depending upon the locations, the load attached to the motors at these locations and the height from the ground level, motors of various torques, speeds, power and sizes have been chosen for the appropriate function.

Although these motors have different properties according to their usage but all are basically Direct Current Motors usually called DC Motors. The basic parts included in the construction of any DC Motor which are the same for all DC motors are:

  • Stator: It is the stationary part of the dc machine.
  • Field Magnets: These are used to produce the main magnetic flux in which the current carrying conductor is placed. These can be either permanent type or produced electrically.
  • Yoke: This is the outer shell of the motor which is used for protection and it holds the magnets.
  • Rotor: It is the rotating part of the motor. It contains the following parts:
  • Armature Coil: This is the coil in which current flows and upon the action of the magnetic field, a force acts on this coil resulting in the rotations of the rotor.
  • Shaft: This is the part of the motor on which the armature coil is placed.   
  • Commutator:It consists of commutator segments. This is the part of a dc machine which cannot be ignored. It keeps the current flow in only single direction hence a constant rotation of the rotor in single direction. The Commutator is also located on the shft near the top. This is mostly the split ring type.
  • Brushes: This is the part which slides over the commutator segments as the rotor rotates. These connect the power supply terminals with the armature coil through the commutator. These brushes are usually made of carbon and are commonly known as carbon brushes.
  • Power terminals: These are connected with the carbon brushes. These terminals are coming out of the stator where we connect the DC supply.The structure of a DC motor is shown in the following figure:

The DC motor works on the principal of Faraday’s Law of Electromagnetic Induction , which states as:“Whenever a current carrying conductor is placed in the magnetic field, it experiences a force whose magnitude and direction depends upon the cross product of magnetic field flux vector B and current I in the armature winding.”

DC MOTORS USED:Depending upon these requirements following are the types of motors which are being used in our project the humanoid arm using microcontroller:

  • Wiper Motor ( quantity=2)
  • Johnson Motor ( quantity=3)

WIPER MOTOR:This type of motor is called a “gear head” or “gear motor” and has the advantage of having lots of torque.The standard voltage requirement for the wiper motor is 12 volts DC. The electrical system in our robot usually puts out voltage between 13 and 13.5 volts, so it’s safe to say the motor can handle up to 13.5 volts with no problem.

The minimum required current for the motor is 1.6 amps at 70 rpm, 0.9 amps at 41 rpm (and 4 amps if you elect to run it at 106 rpm. These current ratings are for the motor spinning with no load. As we add mechanical load, these numbers can increase dramatically, doubling or even tripling under a heavy load. (When testing for torque, I found the motor to draw close to 14 amps in a stalled condition.) This factor must be taken into account when selecting a power supply. Since the motor will only use what it needs when it comes to current, it’s best to provide a source with a higher current rating than you think you might need. I would recommend a 5 amp or greater supply to handle most circumstances.Most power sources are labeled as to their output current. Be aware that the milliamp (or ma) is 1/1000 of an amp, so something labeled 500 ma is only 1/2 amp, and probably will not drive the motor.


It is a very power DC motor. Johnson is the name of the company which is manufacturing DC motors. We have chosen this type of motor because of its cheap price. This is a gear reduced dc motor. We did not put load directly on the shaft of the motor but converted its rotary motion into linear motion by using mechanical assembly.

The specifications of the Johnson motor being used in our project is

  • 16,000 RPM
  • 12 VDC
  • Draw 1.8 Amp
  • Shaft Size 1/8″ (D) X 3/8″ (L)
  • Diameter 1.5″ X 3″ long 2.5mm
  • Mounting Holes in front
  • Fully Reversible Great for RC Boats and other Application

BEARINGS:A bearing is a device to allow constrained relative motion between two or more parts, typically rotation or linear movement. Bearings may be classified broadly according to the motions they allow and according to their principle of operation as well as by the directions of applied loads they can handle. For individual balls that are sometimes called “ball bearings”. In HUMANOID robotic ARM we are using bearings at two locations. These are named as:

  • Shoulder Bearing
  • Base Disc Bearing Design

The type of bearing used for the both is ball bearing. The size of the ball bearing used with shoulder is kept a little higher than the base disk bearing, because of the difference in their width

SHOULDER BEARING:This is just a ball bearing of dia. 1 inch. It is placed in to a rectangular support made of aluminum.

BASE DISC BEARING DESIGN:It is a combination of six ball bearings attached to six L-shaped structures. On one side of these L-shaped structures lies a ball bearing and the other side is connected under the circular rotating disc. These six similar structures arranged symmetrically, make up the Base Disc Bearing Structure.


Material usage  in HUMANOID robotic ARM has been divided into following two major types depending upon its usage and properties:

  • Material for Sensor Disc for robotic arm
  •  Material for robotic arm’s main body

MATERIAL FOR SENSOR DISCS:The material being used for the sensor discs is black opaque synthetic plastic. Plastic is chosen because of its property that it is very softer than any metal. With this benefit it is possible to create slots for the sensor disc in it with high accuracies, short time creation and easy cutting. We used a laser cutter for making such slots.

MATERIAL FOR ROBOT’S MAIN BODY;The material being used for robotic arm main body is stainless steel and Aluminium. Steel is used at the locations where heavy load is to be bared such as the locations of base, base disc and shoulder. The thickness of sheet of steel used in the base disc is 3.5mm and the thickness of sheet used in making shoulder is 2mm.Aluminium is being used at places where lighter parts are required such as arm, wrist and gripper. The thickness of sheet being used in arm is 2.5mm and that of wrist is 2.5mm.

HARDWARE DESIGNING Humanoid robotic arm

Our structure consists of the following parts.Each part is described as follows:

BASE DISK:Base consists of assembly of three circular disks one moving and two stationary. All the three disks are made of stainless steel. First disk touches the ground so it supports the whole structure. Above the first disk six stainless steel rods are welded. At the other end of the rods disk two is welded. Base Wiper motor is fixed with the disk 2. Above disk two, the rotating disc structure including the six ball bearings attached to the six L Shape rods lies rotating. This disk is called the rotating base disc number 3.

SHOULDER:Shoulder consists of two parallel wide strips of stainless steel joined together from the   center. The whole assembly of the shoulder is mounted on ball bearing structure. A nut is attached at the approximate mid of the strips through which the shaft of the wiper motor is crossing. This wiper motor is situated on the rotating base disc.The whole shoulder structure lies on the rotating base disc. It can move without any hindrance in vertical plane from about 0 degrees to about 120 degrees with respect to the circular disc.

ARM:Arm also consists of two parallel strips of aluminium joined together from the center. The whole assembly of the arm is mounted on the shoulder of the Humanoid arm. These two parts are connected using a freely movable shaft. On the shorter end side of the arm a nut is connected through which the shaft of the Johnson motor passes. This motor is located on the shoulder strips of the structure.This motor remains stationary with respect to the shoulder and doesn’t move it but when it rotates, with the help of the shaft and nut arrangement, the arm part of the structure moves upwards or downwards. It can move without any hindrance in vertical plane from about 30 degrees to about 120 degrees with respect to the shoulder.

 WRIST:The Wrist also consists of two parallel strips of aluminium joined together from the gripper end side. The whole assembly of the wrist is mounted on the arm of the Humanoid structure. These two parts are connected using a freely movable shaft. On the shorter end side of the arm a nut is connected through which the shaft of the Johnson motor passes.This motor is located on the Arm strips of the structure. This motor remains stationary with respect to the arm and doesn’t move it but when it rotates, with the help of the shaft and nut arrangement, the wrist part of the structure moves upwards or downwards. It can move without any hindrance in vertical plane from about 30 degrees to about 120 degrees with respect to the Arm.

GRIPPER:This is the most technical portion of the mechanical design of humanoid robotic arm and needed most of our time. It is the portion of the robot where the object is to grab hold until commanded to let go. Here a sophisticated structure is used at the two limbs of the gripper which sends a signal to the control system when an object is grabbed resulting in the stopping of the gripping action. It is made of aluminium. A motor, nut and shaft assembly is also located here which make the grabbing phenomenon possible.

Robotic ARM Electrical hardware components

  • PIC16F877A microcontroller: Robotic arm can not do anything without getting some of kind of instructions either from human or from a intelligent device like microcontroller or digital signal processor. In this project PIC16F877A microcontroller is used which basically a main heart of humanoid robotic arm. It controls the all functions of robotic arm. Sensors are interfaced with PIC16F877A microcontroller. Sensor data is read by microcontroller and after that microcontroller provides certain instructions to motors according to position of robotic arm and sensors which are mounted on robotic arm.
  •  Optical sensor: SLOTTED OPTICAL SWITCHE OPB870 is used to detect presense of anything. Optical sensor internal circuit have one infrred light emitting diode and a photo transistor.
  • H Bridge: H Bridge is used to control direction of motors connected with humanoid robotic arm. For more information on robotic arm check how to design H bridge .
  • OPTICAL DISK : The diagram shown below is made in AutoCAD with 90 slots. The width of these slots is kept a little more than the aperture of the photodiode in the infrared transmitter to ensure proper operation of conduction and obstruction of light .Three other optical disks with similar shape but differing in no: of slots are attached with each other motor except gripp  
  • OPERATION of optical disk:In the diagram above is shown a disk with slots. As the sensor moves over these slots,Subsequent conduction and obstruction of light takes place as it crosses any slot, and logic Vcc appears at the output of the sensor if light path is clear and when blocked logic 0 (low voltage) appears. In this way the interrupts in the form of 1 and 0 are generated to the pic microcontroller, which takes actions to stop and start the motors on the basis of algorithm
  • TROUBLESHOOTING: The pitch of the slots must be greater than the aperture of the IR sensor for reliable operation.The slotted disk must be of such material that completely blocks the light when its non slotted portion faces the IR transmitter otherwise the differentiable interrupts cannot be generated.The sensor must be wider enough to incorporate the disk easily without offering any hindrance to its motion.

GUI of humanoid robotic arm using MATLAB

A graphical user interface (GUI) in matlab is shown below:


C code and MATLAB CODE: If you need more explanations and code of  humanoid robotic arm contact me on my email address: [email protected] Keep sharing this with others. thanks 🙂

Leave a Comment