Introduction: Mobile Controlled Robot Arm From Scratch V1

The development of science and technology has created new innovations. Of these inventions, the robot is the most important. Because it can imitate the movement of a particular human. Percent has different types of robots that can perform different types of tasks. A robot arm is a device that can replicate a human arm using a motor. You can move it along an axis or rotate it in a specific direction. Initially, robot arms were developed to support mass production in the automotive industry. These were built to increase production efficiency, achieve high precision, and perform the same task multiple times. When studying the basics, duplicating a basic level robotic arm at home is not that complicated.


So, in this project main task was to implement a 5 DOF (Degree of Freedom) mechanical arm using ATMEGA 32 microcontroller. The microcontroller was used to control six servo motors. Since ATMEGA 32 has four PWM signals. Such are “OC0”, “OC1A”, “OC1B”and “OC2” respectively. Mobile application was designed to send movement signal tothe servo motors.

Supplies

  • atmega 32A
  • 7805 voltage regulator * 7
  • 7806 voltage regulator * 7
  • dot board
  • MG 995 motors * 8
  • 12 mhz crystal oscillator
  • bluetooth module hc-06
  • 0.22 uF *8
  • 0.1uF *16
  • 10 uF *8
  • 1k , 2k resistors

Step 1: Servo Motors

Servo motors are motors that can accurately control their position. To achieve this, it uses an internal servo mechanism and gear system. This servo mechanism provides position feedback. Therefore, the motor knows where its shaft is currently located. Servos are used in industrial and hobby applications. Most hobby servos have a range of 180 °, while other servos have a range of 270 °, and some servo motors rotate continuously.

In this application, I used a hobby servo motor. My hobby servo motor uses a DC motor. The potentiometer is used as a feedback sensor. The internal control board monitors its position and adjusts it as needed. This position is controlled by the PWM signal.

Step 2: Pulse Width Modulation (PWM)

Pulse width modulation is a digital signal used primarily to control the output produced. Technically, the user can change the time the signal is on and off. The percentage of high signals is called the duty cycle. This can be calculated using the following formula:

Modes of PWM

There are mainly two type of PWM modes are available in ATMEGA 32. They are 

•     Fast PWM

•     Phase correction PWM 

Step 3: Hardware Design

  • First, I used SolidWorks software to create a CAD design for a mechanical part. All measurement data was recorded.
  • According to the CAD design, the aluminum sheet was cut with a grinder. I bent the parts to make a servo mount and a C mount.

you can find the cad designs for the robot hand from this github link Tharindusb/Robot_ARM_V1 (github.com)

Step 4: . Electronic

  • Arm movement was provided by six MG995 motors controlled by an ATMEGA32 microcontroller.
  • 12 𝑉 Power was used to power the motor and microcontroller. The microcontroller and HC-06 Bluetooth module were given a regulated voltage of 5𝑉 with an L7805CV voltage regulator.

Step 5: C Program

  • In the beginning of the code, main libraries were included. 12 𝑀𝐻𝑧 crystal oscillator was used. 
#define F_CPU 12000000UL  #include <avr/io.h>      
#include <stdio.h>   
#include <util/delay.h>        
#include <stdlib.h>


  • Then UART connection was initialized. Data transmit was enabled by setting TXEN bit and data receiving was enabled by setting RXEN bit in the UCSRB register. UCSRC Register selection was done by setting URSEL bit Character size was defined as 8bit by UCSZ0 and UCSZ1 setting bits in UCSRC register.  
void USART_Init(unsigned long BAUDRATE){ 
 UCSRB |= (1 << RXEN) | (1 << TXEN);                       
 UCSRC |= (1 << URSEL)| (1 << UCSZ0) | (1 << UCSZ1);       
 UBRRL = BAUD_PRESCALE;                                         
 UBRRH = (BAUD_PRESCALE >> 8);} 


you can find the full code from this github link Tharindusb/Robot_ARM_V1 (github.com)


Step 6: Mobile Application Design

  • A mobile application was designed for this project to send control commands over Bluetooth to microcontroller.

from this link you can download app and aia project file for MIT app inventor Robot_ARM_V1/App at main · Tharindusb/Robot_ARM_V1 (github.com)

Step 7: Testing