1. 1 | P a g e
THE PROJECT REPORT
ON
WIRELESS GESTURECONTROLLED ROBOT
Submitted in partialfulfillmentof the requirements
For the degree of
BachelorofTechnology
In
Electronics and communication Engineering
Submitted by
LOKENDAR
(120080102053)
SHIVANI VERMA
(120080102107)
SESSION 2012-2016
DEPARTMENT OF ELECTRONICSENGINEERING
DEV BHOOMIINSTITUTE OF TECHNOLOGY& ENGINEERING
DEHRADUN-248007
2. 2 | P a g e
CERTIFICATE
This is to certify that the thesis entitled âWIRELESS GESTURES CONTROLLED
ROBOTâ, submitted by LOKENDAR (120080102053) & SHIVANI VERMA
(120080102107) in the partial fulfillment of the requirements for award of Bachelor in
Technology in Electronics and Communication Engineering, has satisfactorily
presented during the year 2015-16.
HOD Guide
3. 3 | P a g e
ACKNOWLEDGEMENT
We have a great pleasure in presenting this project report on âWIRELESS
ACCELEROMETER CONTROLLED ROBOTâ and to express our deep regard to
towards those who have offered their valuable time & guidance in my hour of need.
Firstly we express our sincere gratitude to Mentor, the guide of the project who carefully
and patiently leant his valuable time and effort to give directions as well as to correct
various documents with attention and care. It is a great honor to do this project in this
esteemed institution, and we would extend our thanks to Mr. Singh, member of Semantic
Microelectronics who has shared their vast knowledge and experience during our stay.
We do also like to appreciate the consideration of the Project Coordinator, our Faculties
and colleagues, which enabled us to balance our work along with this project. It was their
attitude that inspired us to do such an efficient and apposite work.
We wish to avail this opportunity to express a sense of gratitude and love to all our
friends and our family for their unwavering support, strength, help and in short for
everything they have done during the crucial times of the progress of our project.
4. 4 | P a g e
ABSTRACT
Now a day, Robots are controlled by remote or cell phone or keyboard etc. If we think
about cost and required hardwareâs all this things increases the complexity, especially for
low level application.
Now the robot that we have designed is different from above one. It doesnât require any
type of type of complex keys or joysticks. It is a robot which is controlled by
accelerometer, which drives itself according to position of accelerometer. Hardware
required is very small, and hence low cost and small in size.
5. 5 | P a g e
TABLE OF CONTENTS
CHAPTER1:
INTRODCUTION..................................................................................1
1.1 Robot................................................................................................1
1.2 Human Machine Interaction ............................................................1
1.3 Gesture..............................................................................................2
1.4 Motivation for Project......................................................................2
1.5 Objective of Project..........................................................................2
CHAPTER 2:
GESTURE CONTROLLED ROBOT ...................................................2
2.1 Gesture Controlled Robot................................................................3
2.2 Applications .....................................................................................4
CHAPTER 3:
LITERATURE REVIEWâŚâŚâŚâŚâŚ.. ...............................................4
3.1 Accelerometer (ADXL335) .............................................................7
3.2 Comparator IC (LM324)...................................................................8
3.3 Encoder IC (PT2262)......................................................................10
3.4 RF Module (Rx/Tx) .......................................................................12
3.5 Decoder IC (PT2272)..................................................................... 14
3.6 Microcontroller (ATMEGA 16) .....................................................15
3.7 Motor Driver IC (L293D)................................................................17
3.8 DC Motors ......................................................................................19
3.8.1 DC Gear Motor ............................................................................20
CHAPTER 4:
IMPLEMENTATION âŚ......................................................................21
4.1 Simulation .......................................................................................26
7. 7 | P a g e
CHAPTER 1: INTRODUCTION
Recently, strong efforts have been carried out to develop intelligent and natural interfaces
between users and computer based systems based on human gestures. Gestures provide
an intuitive interface to both human and computer. Thus, such gesture-based interfaces
can not only substitute the common interface devices, but can also be exploited to extend
their functionality.
1.1 ROBOT
A robot is usually an electro-mechanical machine that can perform tasks automatically.
Some robots require some degree of guidance, which may be done using a remote control
or with a computer interface. Robots can be autonomous, semi-autonomous or remotely
controlled. Robots have evolved so much and are capable of mimicking humans that they
seem to have a mind of their own.
1.2 HUMAN MACHINE INTERACTION
An important aspect of a successful robotic system is the Human-Machine interaction. In
the early years the only way to communicate with a robot was to program which required
extensive hard work. With the development in science and robotics, gesture based
recognition came into life. Gestures originate from any bodily motion or state but
commonly originate from the face or hand. Gesture recognition can be considered as a
way for computer to understand human body language. This has minimized the need for
text interfaces and GUIs (Graphical User Interface).
1.3 GESTURE
A gesture is an action that has to be seen by someone else and has to convey some piece
of information. Gesture is usually considered as a movement of part of the body, esp. a
hand or the head, to express an idea or meaning.
1.4 MOTIVATION FOR PROJECT
Our motivation to work on this project came from a disabled person who was driving his
wheel chair by hand with quite a lot of difficulty. So we wanted to make a device which
would help such people drive their chairs without even having the need to touch the
wheels of their chairs.
1.5 OBJECTIVE OF PROJECT
Our objective is to make this device simple as well as cheap so that it could be mass
produced and can be used for a number of purposes.
8. 8 | P a g e
CHAPTER2:GESTURECONTROLLED
ROBOT
2.1 GESTURE CONTROLLED ROBOT
Gesture recognition technologies are much younger in the world of today. At this time
there is much active research in the field and little in the way of publicly available
implementations. Several approaches have been developed for sensing gestures and
controlling robots. Glove based technique is a well-known means of recognizing hand
gestures. It utilizes a sensor attached to a glove that directly measures hand movements.
A Gesture Controlled robot is a kind of robot which can be controlled by hand gestures
and not the old fashioned way by using buttons. The user just needs to wear a small
transmitting device on his hand which includes a sensor which is an accelerometer in our
case. Movement of the hand in a specific direction will transmit a command to the robot
which will then move in a specific direction. The transmitting device includes a
Comparator IC for assigning proper levels to the input voltages from the accelerometer
and an Encoder IC which is used to encode the four bit data and then it will be
transmitted by an RF Transmitter module.
At the receiving end an RF Receiver module will receive the encoded data and decode it
by using a decoder IC. This data is then processed by a microcontroller and passed onto a
motor driver to rotate the motors in a special configuration to make the robot move in the
same direction as that of the hand.
2.2 APPLICATIONS
ďˇď Through the use of gesture recognition, remote control with the wave of a hand of
various devices is possible.
ďˇď Gesture controlling is very helpful for handicapped and physically disabled people to
achieve certain tasks, such as driving a vehicle.
ďˇď Gestures can be used to control interactions for entertainment purposes such as gaming
to make the game player's experience more interactive or immersive.
9. 9 | P a g e
CHAPTER 3: LITERATURE REVIEW
Our gesture controlled robot works on the principle of accelerometer which records hand
movements and sends that data to the comparator which assigns proper voltage levels to
the recorded movements. That information is then transferred to an encoder which makes
it ready for RF transmission. On the receiving end, the information is received wirelessly
via RF, decoded and then passed onto the microcontroller which takes various decisions
based on the received information.
These decisions are passed to the motor driver IC which triggers the motors in different
configurations to make the robot move in a specific direction. The following block
diagram helps to understand the working of the robot:
Figure 3.1 Block Diagram
Accelerometer
Comparator IC
Encoder IC
RF Receiver
RF Transmitter
Motor Driver
Motors
Decoder
MCU
10. 10 | P a g e
We divided our task into two parts to make the task easy and simple and to avoid
complexity and make it error free. The first is the transmitting section which includes the
following components:
ďˇď Accelerometer
ďˇď Comparator IC
ďˇď Encoder IC
ďˇď RF Transmitter Module
The second is the receiving end which comprises of following main components:
ďˇď RF Receiver Module
ďˇď Decoder IC
ďˇď Microcontroller
ďˇď Motor Driver IC
ďˇď DC Geared Motors
3.1 ACCELEROMETER (ADXL335)
An Accelerometer is an electromechanical device that measures acceleration forces.
These forces may be static, like the constant force of gravity pulling at your feet, or they
could be dynamic â caused by moving or vibrating the accelerometer. It is a kind of
sensor which record acceleration and gives an analog data while moving in X, Y, Z
direction or may be X, Y direction only depending on the type of the sensor.
Figure 3-2 ADXL335 Accelerometer
11. 11 | P a g e
PIN
NO.
SYMBOL FUNCTION
1 ST See the sensitivity of the accelerometer
2 Z Records analog data for Z direction
3 Y Records analog data for Y direction
4 X Records analog data for X direction
5 GND Connected to ground for biasing
6 VCC +3.3 volt is applied
Table 3-1 Pin description for Accelerometer
3.2 COMPARATOR IC (LM324)
The comparator IC compares the analog voltage received from the accelerometer and
compares it with a reference voltage and gives a particular high or low voltage. The
received signal is quite noisy and of various voltage levels. This IC compares those levels
and outputs in the form of 1 or 0 voltage levels. This process is called signal
conditioning. The figure shown below is comparator IC. The pins 1, 7, 8 and 14 are
output pins. A reference voltage is connected to the negative terminal for high output
when input is high or positive terminal for high output when input is low from the
LM324 IC.
13. 13 | P a g e
Table 3-2 Pin description for LM324
3.3 ENCODER IC (PT2262)
PT2262 is a remote control encoder paired with PT2272 utilizing CMOS technology. It
encodes data and address pins into serial coded waveform suitable for RF or IR
modulation. PT2262 has
a maximum of 12 bits of tri-state address pins providing up to 312 address codes; thereby,
drastically reducing any code collision and unauthorized code scanning possibilities. The
pin description is shown below. It has 4 input while 1 output pin. The address pins can
also be utilized as data pins
PIN NO. SYMBOL FUNCTION
1 Output 1 Output of 1st Comparator
2 Input 1- Inverting Input of 1st Comparator
3 Input1+ Non-Inverting Input of 1st Comparator
4 VCC Supply Voltage; 5V (up to 32V)
5 Input 2+ Non-Inverting Input of 2nd Comparator
6 Input 2- Inverting Input of 2nd Comparator
7 Output 2 Output of 2nd Comparator
8 Output 3 Output of 3rd Comparator
9 Input 3- Inverting Input of 3rd Comparator
10 Input 3+ Non-Inverting Input of 3rd Comparator
11 Ground Ground (0V)
12 Input 4+ Non-Inverting Input of 4th Comparator
13 Input 4- Inverting Input of 4th Comparator
14 Output 4 Output of 4th Comparator
14. 14 | P a g e
Figure 3-4 PT2262 IC
PIN NO. SYMBOL FUNCTION
1-8 A0-A7 Address pins
9 Vss Ground pin
13-10 D0-D3 Output pins
14 TE Enables the transmission
15-16 Osc1-Osc2 Rosc of 470K ohm is
connected
17 Dout Output for transmission
18 Vcc 5V supply voltage
Table 3-3 Pin description for PT2262
3.4 RF MODULE (Rx/Tx)
Radio frequency (RF) is a rate of oscillation in the range of about 3 KHz to 300 GHz,
which corresponds to the frequency of radio waves, and the alternating currents which
carry radio signals. Although radio frequency is a rate of oscillation, the term "radio
frequency" or its abbreviation "RF" are also used as a synonym for radio â i.e. to describe
the use of wireless communication, as opposed to communication via electric wires. The
RF module is working on the frequency of 315 MHz and has a range of 50-80 meters.
15. 15 | P a g e
Figure 3-5 RF Transmitter
PIN FUNCTION
VCC 5V supply
GND Ground pin
Data Input from pin 17 of PT2262 for data transmission
Ant A wire attached here works as an antenna
Table 3-4 Pin description for RF Tx
Figure 3-6 RF Receiver
16. 16 | P a g e
Table 3-5 Pin description for RF Rx
3.5 DECODER IC (PT2272)
PT2272 is a remote control decoder paired with PT2262 utilizing CMOS Technology. It
has 12 bits of tri-state address pins providing a maximum of 312 address codes; thereby,
drastically reducing any code collision and unauthorized code scanning possibilities. The
input data is decoded when no error or unmatched codes are found. It has 1 input while 4
output pins. The address pins can also be utilized as data pins.
Figure 3-7 PT2272 IC
PIN FUNCTION
VCC 5V supply
GND Ground pin
GND GND Output to pin 14 of PT2272 for data transmission
Ant A wire attached here works as an antenna
17. 17 | P a g e
PIN NO. SYMBOL FUNCTION
1-8 A0-A7 Address pins
9 Vss Ground pin
13-10 D0-D3 Output pins
14 Din Input from RF
15-16 Osc1-Osc2 Rosc of 470K ohm is
connected
17 VT Indicates valid transmissions
18 Vcc 5V supply voltage
Table 4-2 Pin description for PT2272
18. 18 | P a g e
MICROCONTROLLER (ATMEGA 16)
Pin Diagram:
FIGURE -3 AVR AT mega16
19. 19 | P a g e
FEATURES
⢠High-performance, Low-power Atmel AVR 8-bit Microcontroller
⢠Advanced RISC Architecture
â 131 Powerful Instructions â Most Single-clock Cycle Execution
â 32 x 8 General Purpose Working Registers
â Fully Static Operation
â Up to 16 MIPS Throughput at 16 MHz
â On-chip 2-cycle Multiplier
⢠High Endurance Non-volatile Memory segments
â 16 Kbytes of In-System Self-programmable Flash program memory
â 512 Bytes EEPROM
â 1 Kbyte Internal SRAM
â Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
â Data retention: 20 years at 85°C/100 years at 25°C (1)
â Optional Boot Code Section with Independent Lock Bits In-System Programming by
On-chip Boot Program
True Read-While-Write Operation
â Programming Lock for Software Security
⢠JTAG (IEEE std. 1149.1 Compliant) Interface
â Boundary-scan Capabilities According to the JTAG Standard
â Extensive On-chip Debug Support
â Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAG Interface
⢠Peripheral Features
â Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes
â One 16-bit Timer/Counter with Separate Prescalers, Compare Mode, and Capture Mode
â Real Time Counter with Separate Oscillator
â Four PWM Channels
â 8-channel, 10-bit ADC
8 Single-ended Channels
7 Differential Channels in TQFP Package Only
2 Differential Channels with Programmable Gain at 1x, 10 xs, or 200 xs
â Byte-oriented Two-wire Serial Interface
â Programmable Serial USART
â Master/Slave SPI Serial Interface
â Programmable Watchdog Timer with Separate On-chip Oscillator
â On-chip Analog Comparator
⢠Special Microcontroller Features
â Power-on Reset and Programmable Brown-out Detection
â Internal Calibrated RC Oscillator
â External and Internal Interrupt Sources
â Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby and
Extended Standby
⢠I/O and Packages
â 32 Programmable I/O Lines
â 40-pin PDIP, 44-lead TQFP, and 44-pad QFN/MLF
20. 20 | P a g e
⢠Operating Voltages
â 2.7V - 5.5V for ATmega16L
â 4.5V - 5.5V for ATmega16
⢠Speed Grades
â 0 - 8 MHz for ATmega16L
â 0 - 16 MHz for ATmega16
⢠Power Consumption @ 1 MHz, 3V, and 25°C for ATmega16L
â Active: 1.1 mA
â Idle Mode: 0.35 mA
â Power-down Mode: < 1 ÎźA
A crystal oscillator is attached to the pins 18 and 19 of the microcontroller. The oscillator
creates an electrical signal of a very precise frequency which is used to keep track of
time. Two Capacitors are connected in parallel with the oscillator to remove unwanted
frequencies.
Figure 3-9 Crystal Oscillator
3.7 MOTOR DRIVER IC (L293D)
It is also known as H-Bridge or Actuator IC. Actuators are those devices which actually
gives the movement to do a task like that of a motor. In the real world there are different
types of motors available which work on different voltages. So we need a motor driver
for running them through the controller.
The output from the microcontroller is a low current signal. The motor driver amplifies
that current which can control and drive a motor. In most cases, a transistor can act as a
switch and perform this task which drives the motor in a single direction.
21. 21 | P a g e
Figure 3-10 L293D IC
Turning a motor ON and OFF requires only one switch to control a single motor in a
single direction. We can reverse the direction of the motor by simply reversing its
polarity. This can be achieved by using four switches that are arranged in an intelligent
manner such that the circuit not only drives the motor, but also controls its direction. Out
of many, one of the most common and clever design is a H-bridge circuit where
transistors are arranged in a shape that resembles the English alphabet "H".
Figure 3-11 H-Bridge
22. 22 | P a g e
As seen in the image, the circuit has four switches A, B, C and D. Turning these switches
ON and OFF can drive a motor in different ways.
ďˇď When switches A and D are on, motor rotates clockwise.
ďˇď When B and C are on, the motor rotates anti-clockwise.
ďˇď When A and B are on, the motor will stop.
ďˇď Turning off all the switches gives the motor a free wheel drive.
ďˇď Turning on A & C at the same time or B & D at the same time shorts the entire circuit.
So, never try to do it.
3.8 DC MOTORS
A machine that converts DC power into mechanical power is known as a DC motor. Its
operation is based on the principle that when a current carrying conductor is placed in a
magnetic field, the conductor experiences a mechanical force.
DC motors have a revolving armature winding but non-revolving armature magnetic field
and a stationary field winding or permanent magnet. Different connections of the field
and armature winding provide different speed/torque regulation features. The speed of a
DC motor can be controlled by changing the voltage applied to the armature or by
changing the field current.
Figure 3-12 DC Moto
23. 23 | P a g e
3.8.1 DC GEAR MOTOR
A geared DC Motor has a gear assembly devoted to the motor. The speed of motor is
counted in terms of rotations of the shaft per minute and is termed as RPM .The gear
assembly helps in increasing the torque and dropping the speed. Using the correct
arrangement of gears in a gear motor, its speed can be reduced to any required figure.
This concept of reducing the speed with the help of gears and increasing the torque is
known as gear reduction.
Reducing the speed put out by the motor while increasing the quantity of applied torque
is a important feature of the reduction gear trains found in a gear motor. The decrease in
speed is inversely relative to the increase in torque. This association means that, in this
sort of device, if the torque were to double, the speed would decrease by one half. Small
electric motors, such as the gear motor, are able to move and stand very heavy loads
because of these reduction gear trains. While the speed and ability of larger motors is
greater, small electric motors are sufficient
to bear these loads.
Figure 3-13 DC Gear Motor
24. 24 | P a g e
CHAPTER 4: IMPLEMENTATION
The accelerometer records the hand movements in the X and Y directions only and
outputs constant analog voltage levels. These voltages are fed to the comparator IC which
compares it with the references voltages that we have set via variable resistors attached to
the IC. The levels that we have set are 1.7V and 1.4V. Every voltage generated by the
accelerometer is compared with these and an analog 1 or 0 signal is given out by the
comparator IC.
Fig 4-1 Input and Output of Comparator IC
This analog signal is the input to the encoder IC. The input to the encoder is parallel
while the output is a serial coded waveform which is suitable for RF transmission. A push
button is attached to pin 14 of this IC which is the Transmission Enable (TE) pin. The
coded data will be passed onto the RF module only when the button is pressed. This
button makes sure no data is transmitted unless we want to. The RF transmitter modulates
the input signal using Amplitude Shift Keying (ASK) modulation.
It is the form of modulation that represents digital data as variations in the amplitude of a
carrier wave. The following figure shows the modulated output of the RF module:
25. 25 | P a g e
Fig 4-2 ASK Modulation
The RF modules works on the frequency of 315MHz. It means that the carrier frequency
of the RF module is 315MHz. The RF module enables the user to control the robot
wirelessly and with ease. The schematic of transmitting end can be seen below:
26. 26 | P a g e
Fig 4-3 Transmitting Circuit
This transmitted signal is received by the RF receiver, demodulated and then passed onto
the decoder IC. The decoder IC decodes the coded waveform and the original data bits
are recovered. The input is a serial coded modulated waveform while the output is
parallel. The pin 17 of the decoder IC is the Valid Transmission (VT) pin. A led can be
27. 27 | P a g e
connected to this pin which will indicate the status of the transmission. In the case of a
successful transmission, the led will blink.
The parallel data from the encoder is fed to the port 1of the microcontroller. This data is
in the form of bits. The microcontroller reads these bits and takes decisions on the basis
of these bits. What the microcontroller does is, it compares the input bits with the coded
bits which are burnt into the program memory of the microcontroller and outputs on the
basis of these bits. Port 2 of the microcontroller is used as the output port. Output bits
from this port are forwarded to the motor driver IC which drives the motors in a special
configuration based on the hand movements.
At a dead stop, a motor produces no voltage. If a voltage is applied and the motor begins
to spin, it will act as a generator that will produce a voltage that opposes the external
voltage applied to it. This is called Counter Electromotive Force (CEF) or Back
Electromotive Force (Back EMF). If a load stops the motors from moving then the
current may be high enough to burn out the motor coil windings. To prevent this, fly back
diodes are used. They prevent the back emf from increasing and damaging the motors.
The schematic of receiving end can be seen below:
28. 28 | P a g e
Fig 4-4 Receiving Circuit
4.1 SIMULATION
We performed a simulation of our project in PROTEUS and the code was written in C
language using KEIL MICROVISION. We wrote a code for the microcontroller to run
DC motors using the H-Bridge IC (L293D). In the simulation we sent the relevant data to
the Microcontroller (AT89C51) through switches. The Microcontroller processed the data
and sent the information to the Actuator IC (L293D). The Actuator IC upon receiving
information showed response by driving the DC motors. The simulation schematic is as
follow:
A
T
M
E
G
A
1
6
30. 30 | P a g e
CHAPTER 5:
CONCLUSION, LIMITATIONS AND FUTURE
WORK
5.1 CONCLUSION
We achieved our objective without any hurdles i.e. the control of a robot using gestures.
The Robot is showing proper responses whenever we move our hand. Different Hand
gestures to make the robot move in specific directions are as follow:
Fig 5-1 Move Forward
Fig 5-2 Move Backward
Fig 5-3 Move Right
31. 31 | P a g e
Fig 5-4 Move Left
The robot only moves when the accelerometer is moved in a specific direction. The valid
movements are as follows:
DIRECTION ACCELEROMETER ORIENTATION
Forward +y
Backward -y
Right +x
Left -x
Stop Rest
Table 5-1 Accelerometer Orientation
Our finished product can be seen in the images below:
Figure 5-8 Receiving Circuit
32. 32 | P a g e
Figure 5-9 Transmitting Circuit
Figure 5-10 Hand Assembly
33. 33 | P a g e
5.2 LIMITATIONS AND FUTURE WORK
ďˇď The on-board batteries occupy a lot of space and are also quite heavy. We can either use
some alternate power source for the batteries or replace the current DC Motors with ones
which require less power.
ďˇď Secondly, as we are using RF for wireless transmission, the range is quite limited;
nearly 50-80m. This problem can be solved by utilizing a GSM module for wireless
transmission. The GSM infrastructure is installed almost all over the world. GSM will not
only provide wireless connectivity but also quite a large range.
ďˇď Thirdly, an on-board camera can be installed for monitoring the robot from faraway
places. All we need is a wireless camera which will broadcast and a receiver module
which will provide live streaming.
34. 34 | P a g e
CHAPTER 6: FEASIBILITY OF THE PROJECT
During the development of the project we researched the feasibility in different fields,
especially software and hardware. The feasibility study is shown below.
6.1 SOFTWARE
We targeted to choose a language that is easy to understand and program. So we chose
assembly language for our project. Assembly language is the basic language of
microcontrollers. Although its not user friendly in terms of programming but still one can
learn it quickly.
6.2 HARDWARE
We chose accelerometer as the sensing device because it records even the minute
movements. We could also have completed our project using Arduino but chose
microcontroller instead because its cost is low and is easily available everywhere. There
are a number of dc geared motors available but the ones we chose are capable of
supporting loads up to 6kgs.
6.3 EXPENSES
This project is quite cost effective. The components used are easily available in the
market apart from accelerometer, RF modules and the motors. These components are
quite cheap as compared to the motors which are the only expensive part in our whole
project. But these particular motors are capable of providing support to loads up to 6kgs
which is what we wanted.
35. 35 | P a g e
COMPONENT COST
2 LF33CV Voltage regulator 100
3 1uF Capacitor 10
4 Accelerometer(ADXL335) 2360
5 Comparator IC (LM324) 15
6 10K Variable Resistor 20
7 Encoder IC (PT2262) 200
8 470K ohm Resistor 4
9 RF Module (Rx/Tx) 1013
10 LED 2
11 330 ohm Resistor 2
12 Decoder IC (PT2272) 325
13 Microcontroller (AT mega 16) 85
14 Crystal Oscillator (11.0592 MHz) 10
15 33pF Capacitor 2
16 Motor Driver IC (L293D) 110
17 1N4007 Diode 8
18 6V/4.5A Battery 980
19 DC Gear Motors 16000
20 Base 300
21 Vero Board 170
22 Wires 30
23 Free Wheels 200
24 Hand Assembly 150
Table 6-1 Expenses
36. 36 | P a g e
MICROCONTROLLER CODE
#indef F_CPU
#define F_CPU 16000000UL
#endif
#include <avr/io.h>
#include "lcd.h" //include LCD Library
#include <util/delay.h>
void InitADC(void)
{
ADMUX|=(1<<REFS0);
ADCSRA|=(1<<ADEN)|(1<<ADPS0)|(1<<ADPS1)|(1<<ADPS2); //ENABLE ADC,
PRESCALER 128
}
uint16_t readadc(uint8_t ch)
{
ch&=0b00000111; //ANDing to limit input to 75.1
ADMUX = (ADMUX & 0xf8)|ch; //Clear last 3 bits of ADMUX, OR with ch
ADCSRA|=(1<<ADSC); //START CONVERSION
while((ADCSRA)&(1<<ADSC)); //WAIT UNTIL CONVERSION IS COMPLETE
return(ADC); //RETURN ADC VALUE
}
int main(void)
{
char a[20], b[20], c[20];
uint16_t x,y,z;
InitADC(); //INITIALIZE ADC
lcd_init(LCD_DISP_ON); //INITIALIZE LCD
lcd_clrscr();
while(1)
{
lcd_home();
x=readadc(0); //READ ADC VALUE FROM PA.0
y=readadc(1); //READ ADC VALUE FROM PA.1
z=readadc(2); //READ ADC VALUE FROM PA.2
itoa(x,a,10);
itoa(y,b,10);
itoa(z,c,10);
lcd_puts("x="); //DISPLAY THE RESULTS ON LCD
lcd_gotoxy(2,0);
lcd_puts(a);
lcd_gotoxy(7,0);
37. 37 | P a g e
lcd_puts("y=");
lcd_gotoxy(9,0);
lcd_puts(b);
lcd_gotoxy(0,1);
lcd_puts("z=");
lcd_gotoxy(2,1);
lcd_puts(c);
}
}
#include <reg51.h>
#include <delay.h>
#define ADC_VREF_TYPE 0xE0 // Read the 8 most significant bits
// of the AD conversion result
unsigned char read_adc(unsigned char adc_input)
{
ADMUX=adc_input | (ADC_VREF_TYPE & 0xff);
// Delay needed for the stabilization of the ADC input voltage
delay_us(10);
// Start the AD conversion
ADCSRA|=0x40;
// Wait for the AD conversion to complete
while ((ADCSRA & 0x10)==0);
ADCSRA|=0x10;
return ADCH;
}
void main(void)
{
unsigned int x,y,z;
PORTB=0x00;
DDRB=0xFF;
PORTC=0x00;
DDRC=0x00;
PORTD=0x00;
DDRD=0xFF;
TCCR0=0x00;
TCNT0=0x00;
TCCR1A=0x00;
TCCR1B=0x00;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
38. 38 | P a g e
OCR1BH=0x00;
OCR1BL=0x00;
ASSR=0x00;
TCCR2=0x00;
TCNT2=0x00;
OCR2=0x00;f
MCUCR=0x00;
TIMSK=0x00;
UCSRB=0x00;
ACSR=0x80;
SFIOR=0x00;
ADMUX=ADC_VREF_TYPE & 0xff;
ADCSRA=0x83;
SPCR=0x00;
TWCR=0x00;
while (1)
{
// Place your code here
x=read_adc(3): y=read_adc(4);
z=read_adc(5);
PORTB=x;
//---------------------------------------------------------------// X AXIS
//--------------------------------------------------------------- if(x>0xab)
{
PORTD=0x0c;
}
else if(x<0x9b)
{
PORTD=0x03;
}
//-------------------------------------------------------------- // Y AXIS
//------------------------------------------------------------------
else if(y>0xab)
{
PORTD=0x08;
}
else if(y<0x9b)
{
PORTD=0x0e;
}
//--------------------------------------------------------------
//---------------------------------------------------------------
else
PORTD=0xff;
}
39. 39 | P a g e
}
//Receiver main program
#include<reg51.h>
void main()
{
P2=0xff;
P1=0x00;
while(1)
{
if(P2==0x80)
{
P1=0xaa;
}
else if(P2==0xe0)
{
P1=0x55;
}
else if(P2==0x30)
{
P1=0xa5;
}
else if(P2==0xC0)
{
P1=0x5a;}
else
P1=0x00;}}
40. 40 | P a g e
REFERENCES
[1] âGesture Controlled Robot PPTâ
http://seminarprojects.com/s/hand-gesture-controlled-robot-ppt
[2] âGesture Controlled Tank Toy User Guideâ
http://slideshare.net/neeraj18290/wireless-gesture-controlled-tank-toy-transmitter
[3] âEmbedded Systems Guide (2002)â
http://www.webstatschecker.com/stats/keyword/a_hand_gesture_based_control
interface for a car robot
[4] âRobotic Gesture Recognition (1997)â by Johan Triesch and Christoph Von Der
Malsburg http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.37.5427
[5] âReal-Time Robotic Hand Control Using Hand Gesturesâ by Jagdish Lal Raheja,
Radhey Shyam, G. Arun Rajsekhar and P. Bhanu Prasad
[6] âHand Gesture Controlled Robotâ by Bhosale Prasad S., Bunage Yogesh B. and
Shinde Swapnil V.
[7] http://www.robotplatform.com/howto/L293/motor_driver_1.html
[8] http://en.wikipedia.org/wiki/Gesture_interface
[9] http://www.wisegeek.com/what-is-a-gear-motor.htm
[10]http://www.scribd.com/doc/98400320/InTech-Real-Time-Robotic-Hand-Control-
Using Hand-Gestures
[11] http://en.wikipedia.org/wiki/DC_motor
[12]http://electronics.stackexchange.com/questions/18447/what-is-back-emf-
counterelectromotive-force
[13] http://en.wikipedia.org/wiki/Robots
[14] www.alldatasheet.com
[15] www.google.com
[16] www.wikipedia.com