Gesture Controlled Robot Arm Using PIC16F877A

Introduction

This project uses a wearable gesture device to operate a robotic arm. The robot arm will be controlled by the wearers natural arm movements.

Main Components

  • 1 x PIC16f877A 
  • 1 x AM3X 3-axis accelerometer - to detect arm movements
  • 2 x Bend / flex sensors - to detect wrist and finger movement 


How it works

The voltages from the sensors are fed into the ADC pins of the PIC16F877A micro controller. The ADC module converts the analogue voltages into their equivalent digital values. We then use these values to control the servos on our robot arm.


Flex sensor

The Flex Sensor works in the same way as a variable resistor. Its resistance varies when flexed. You can purchase flex sensors online, but you can also make your own which is what I did for this project. If you want to know more on how to make a flex sensor, check out  Making a flex sensor.

This is used in a voltage divider circuit and the output voltage can be calculated using the voltage divider formula. Vout = Vin x (R2 / RT)



The Vout of the voltage divider circuit is connected to an op-amp buffer circuit. The output of the buffer is then connected to the ADC input pin of the microcontroller.

Accelerometer

The AM3X 3-axis accelerometers operating voltage is 3.3v. The Y, X & Z output voltages vary in proportion to the amount of force being applied. As each axis needs both positive and negative values the output voltage is offset at half the operating voltage (3.3v / 2 = 1.65v). 

If force = 0g then output = 1.65v 
If force = -1g then output = 0v
If force = 1g then output = 3.3v


Robot Arm

The robot arm used in this project has 4 degrees of freedom. This number represents the different movements the robot arm is capable of doing. It consists of 5 servos which control: 
  1. Gripper - open / close
  2. Shoulder - up / down
  3. Base - rotate: left / right
  4. Elbow - up / down
  5. Wrist - up / down
As each servo needs its own PWM signal to operate, we need multiple PWMs from our chip. This can be accomplished with the standard IO pins using software written PWM. For more info check out creating software PWM for multiple servos.  


Video of gesture controlled robot arm

The Code for gesture controlled robot arm was done using Hitech C compiler

Comments

Popular posts from this blog

HC-SR04 Ultrasonic Sensor code for Distance Measurement