Accelerometer Based Hand Gesture Controlled Robot Using Arduino
Accelerometer Based Hand Gesture Controlled Robot Using Arduino
Member:
Raj krishan Ghosh (13000313066)
Rajib Dutta (13000313067)
Saity Banerjee (13000313072)
Snehasis Mondal (13000313086)
TECHNO INDIA
EM 4/1 Salt Lake City, Sector V Kolkata: 700091
ACKNOWLEDGEMENT
1
Chapter 2
ABSTRACT
2
Contents
1 ACKNOWLEDGEMENT 1
2 ABSTRACT 2
3 INTRODUCTION 5
3.1 Robot . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.2 Human Machine Interaction . . . . . . . . . . . . . 6
3.3 Gesture . . . . . . . . . . . . . . . . . . . . . . . . 6
3.4 Motivation For the Project . . . . . . . . . . . . . . 6
3.5 Objective of the Project . . . . . . . . . . . . . . . 6
5 LITERATURE REVIEW 9
5.1 Transmitter . . . . . . . . . . . . . . . . . . . . . . 10
5.1.1 Arduino . . . . . . . . . . . . . . . . . . . . 10
5.1.2 Accelerometer (ADXL335) . . . . . . . . . 14
5.1.3 Comparator IC (LM324) . . . . . . . . . . 17
5.1.4 Encoder IC (HT12D) . . . . . . . . . . . . 18
5.1.5 RF Module (Rx/Tx) . . . . . . . . . . . . 20
5.2 Receiver . . . . . . . . . . . . . . . . . . . . . . . . 22
5.2.1 Decoder IC (HT12D) . . . . . . . . . . . . . 22
5.2.2 Motor Driver IC (L293D) . . . . . . . . . . 23
5.2.3 DC Motors . . . . . . . . . . . . . . . . . . 25
5.2.4 Wheels . . . . . . . . . . . . . . . . . . . . . 26
5.2.5 Chassis . . . . . . . . . . . . . . . . . . . . . 27
6 IMPLEMENTATION 29
6.1 System Description . . . . . . . . . . . . . . . . . . 32
3
6.2 Simulation . . . . . . . . . . . . . . . . . . . . . . . 33
6.3 Gesture Control . . . . . . . . . . . . . . . . . . . . 34
6.3.1 Gesture Recognition . . . . . . . . . . . . . 34
6.3.2 Movement of Motors and Wheels . . . . . . 35
6.3.3 Design and Working : . . . . . . . . . . . . . 36
6.4 Used Code for Arduino . . . . . . . . . . . . . . . . 37
9 REFERENCES 41
4
Chapter 3
INTRODUCTION
3.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 in-
terface. Robots can be autonomous, semi-autonomous or remotely
controlled. Robots have evolved so much and are capable of mim-
icking humans that they seem to have a mind of their own.
5
3.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 commu-
nicate 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 mo-
tion 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 inter-
faces and GUIs (Graphical User Interface).
3.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.
6
Chapter 4
GESTURE
CONTROLLED ROBOT
7
4.2 Application
• Through the use of gesture recognition, remote control with
the wave of a hand of various devices is possible.
8
Chapter 5
LITERATURE REVIEW
• Accelerometer
• Comapator IC
• Encoder IC
• RF Transmitter
The second is the receiving end which comprises of following main
components:
• RF Receiver Module
• Decoder IC
9
Figure 5.1: Block Diagram of Robot
• Motor Driver IC
• DC Motors
• Wheels
5.1 Transmitter
5.1.1 Arduino
Arduino is an open source, computer hardware and software com-
pany, project, and user community that designs and manufactures
Single-board microcontrollers and microcontroller kits for building
digital devices and interactive objects that can sense and control
objects in the physical world. Arduino board designs use a variety
of microprocessors and controllers. The boards are equipped with
sets of digital and analog input/output (I/O) pins that may be
interfaced to various expansion boards (shields) and other circuits.
The boards feature serial communications interfaces, including Uni-
versal Serial Bus (USB) on some models, which are also used for
loading programs from personal computers. The microcontrollers
are typically programmed using a dialect of features from the pro-
gramming languages C and C++. In addition to using traditional
compiler toolchains, the Arduino project provides an integrated
development environment (IDE) based on the Processing language
project.Most Arduino boards consist of an Atmel 8-bit AVR mi-
crocontroller (ATmega8, ATmega168, ATmega328, ATmega1280,
10
ATmega2560) with varying amounts of flash memory, pins, and
features. The boards use single or double-row pins or female head-
ers that facilitate connections for programming and incorporation
into other circuits. These may connect with add-on modules termed
shields. Multiple, and possibly stacked shields may be individually
addressable via an IC serial bus. Most boards include a 5 V lin-
ear regulator and a 16 MHz crystal oscillator or ceramic resonator.
Some designs, such as the LilyPad, run at 8 MHz and dispense
with the onboard voltage regulator due to specific form-factor re-
strictions.
Here is the Pin Diagram of Arduino Atmega328:
Pin Descriptions:
11
PB6 :Depending on the clock selection fuse settings, PB6 can be
used as input to the inverting Oscillator amplifier and input to the
internal clock operating circuit.
Port C (PC5): Port C is a 7-bit bi-directional I/O port with internal
pull-up resistors (selected for each bit). The output buffers have
symmetrical drive characteristics with both high sink and source
capability. As inputs, Port C pins that are externally pulled low
will source current if the pull-up resistors are activated. The Port
C pins are tri-stated when a reset condition becomes active, even
if the clock is not running.
PC6 :PC6 is used as an I/O pin. Note that the electrical charac-
teristics of PC6 differ from those of the other pins of Port C.; PC6
is used as a Reset input. A low level on this pin for longer than
the minimum pulse length will generate a Reset, even if the clock
is not running.
Port D (PD7): Port D is an 8-bit bi-directional I/O port with in-
ternal pull-up resistors (selected for each bit). The Port D output
buffers have symmetrical drive characteristics with both high sink
and source capability. As inputs, Port D pins that are externally
pulled low will source current if the pull-up resistors are activated.
The Port D pins are tri-stated when a reset condition becomes ac-
tive, even if the clock is not running.
AVcc: AVCC is the supply voltage pin for the A/D Converter. It
should be externally connected to VCC, even if the ADC is not
used. If the ADC is used, it should be connected to VCC through
a low-pass filter. Note that PC6...4 use digital supply voltage.
AREF :AREF is the analog reference pin for the A/D Converter.
Functions:
12
Figure 5.3: Block diagram of Arduino
13
5.1.2 Accelerometer (ADXL335)
An accelerometer is a device that measures proper acceleration,
also called the four-acceleration. However, the proper acceleration
measured by an accelerometer is not necessarily the coordinate ac-
celeration (rate of change of velocity). Instead, it is the accelera-
tion associated with the phenomenon of weight experienced by any
test mass at rest in the frame of reference of the accelerometer de-
vice. Single- and multi-axis models of accelerometer are available
to detect magnitude and direction of the proper acceleration as a
vector quantity, and can be used to sense orientation (because di-
rection of weight changes), coordinate vibration, shock, and falling
(a case where the proper acceleration changes, since it tends toward
zero). Pairs of accelerometers extended over a region of space can
be used to detect differences (gradients) in the proper accelerations
of frames associated with those points.
ADXL335 Accelerometer:
14
waves. Acceleration deflects the moving mass and unbalances the
differential capacitor resulting in a sensor output whose amplitude
is proportional to acceleration. Phase-sensitive demodulation tech-
niques are then used to determine the magnitude and direction of
the acceleration.
Pin description:
15
Figure 5.5: Description of ADXL335
16
Figure 5.6: Pin diagram of ADXL335
17
Figure 5.7: LM324 IC
18
an RF transmitter. These 12 bits are divided into 8 address bits
and 4 data bits. HT12E has a transmission enable pin which is
active low. When a trigger signal is received on TE pin, the pro-
grammed addresses/data are transmitted together with the header
bits via an RF or an infrared transmission medium. HT12E begins
a 4-word transmission cycle upon receipt of a transmission enable.
This cycle is repeated as long as TE is kept low. As soon as TE
returns to high, the encoder output completes its final cycle and
then stops.
Pin Diagram of RF-Encoder:
Pin Description:
19
5.1.5 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
20
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.
RF Receiver:
21
Pin Description of RF Receiver:
5.2 Receiver
5.2.1 Decoder IC (HT12D)
HT12D is a decoder integrated circuit that belongs to 212 series of
decoders. They are paired with 212 series of encoders. The chosen
pair of encoder/decoder should have same number of addresses and
data format. In simple terms, HT12D converts the serial input into
parallel outputs. It decodes the serial addresses and data received
by, say, an RF receiver, into parallel data and sends them to out-
put data pins. The serial input data is compared with the local
addresses three times continuously.
22
RF-Decoder:
23
cases, a transistor can act as a switch and perform this task which
drives the motor in a single direction. Figure 3-10 L293D IC Turn-
ing 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”.
• Turning off all the switches gives the motor a free wheel drive.
24
5.2.3 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 con-
ductor experiences a mechanical force.
DC motors have a revolving armature winding but non-revolving ar-
mature 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.
25
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 quan-
tity 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 mo-
tor, 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.
5.2.4 Wheels
Wheeled robots are robots that navigate around the ground using
motorized wheels to propel them. This design is simpler than using
treads or legs and by using wheels they are easier to design, build,
and program for movement in flat, not-so-rugged terrain. They
are also better controlled than other types of robots. Disadvan-
tages of wheeled robots are that they cannot navigate well over
obstacles, such as rocky terrain, sharp declines, or areas with low
friction. Wheeled robots are most popular among the consumer
market; their differential steering provides low cost and simplicity.
Robots can have any number of wheels, but three wheels are suffi-
cient for static and dynamic balance. Additional wheels can add to
balance; however, additional mechanisms will be required to keep
all the wheels in the ground, when the terrain is not flat. Large
26
diameter wheels give the robot low torque but high velocity.
Types of wheels:
• 2 wheeled robot
• 3 wheeled robot
• 4 wheeled robot
5.2.5 Chassis
A chassis consists of an internal framework that supports a man-
made object. It is analogous to an animal’s skeleton. An example
27
of a chassis is the under part of a motor vehicle, consisting of the
frame (on which the body is mounted) with the wheels and machin-
ery. The chassis is used to maintain the bot made of aluminium
sheet and the r.f. receiver is mounted on it to receive the signal.
28
Chapter 6
IMPLEMENTATION
29
The following figure shows the modulated output of the RF module:
30
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 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 mi-
crocontroller. 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 mi-
crocontroller 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
31
produce a voltage that opposes the external voltage applied to it.
This is called Counter Electromotive Force (CEF) or Back Electro-
motive 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, flyback diodes are used. They prevent
the back emf from increasing and damaging the motors.
The schematic of receiving end can be seen below:
32
Figure 6.1: Transmission of Data
6.2 Simulation
We performed a simulation of our project in ARDUINO and the
code was written in Arduino Programing Language language us-
ing Arduino Software. We wrote a code for the microcontroller
to run DC motors using the H-Bridge IC (L293D). In the simula-
tion we sent the relevant data to the Microcontroller (ATMega328)
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:
33
6.3 Gesture Control
6.3.1 Gesture Recognition
As the user moves his hand, the accelerometer reading changes. It
is then retrieved by the application. There are two values: One
is maximum value and the other is minimum value. The range is
specified using these two values for each function of the robot. If
the value retrieved by the application lies between these specified
values, then the corresponding determinant is generated. This de-
terminant is sent to the microcontroller, which then receives the
determinant value, process it to recognize the corresponding ges-
ture, and sends signals to move the robot accordingly.
34
the forward movement, and the robot moves in the forward direc-
tion. The angle of the tilt or the difference between the angle of
tilt of users hand and the threshold value of forward movement
gesture determines the speed of the robot. When the user tilts his
hand on the right direction, the gesture is recognized as the right
turn, and the robot moves in the right direction. When the user
tilts his hand in the left direction, the gesture is recognized as the
left turn, and the robot moves in the right direction. The angle of
the tilt of users hand determines whether the left or right turn is
a normal turn or a sharp turn. A sharp turn is one in which a car
changes direction without slowing down before turning. When the
user tilts his hand backwards, the gesture is recognized as the move
backward gesture, and the robot moves in the backward direction.
If the users hand is somewhere between the two gestures, i.e., the
accelerometer value is somewhere between the threshold of two di-
rections(forward and left turn, left turn and backwards, backwards
and right turn, forward and right turn), then the robot moves in
that diagonal direction.
35
in the motor shield is to stop the robot, all the motors are made
stationary resulting the robot to stop.
Similarly, to rotate the robot in backward directions, similar method-
ology is used. To turn the robot in the backward left direction, the
left diagonal motors are rotated forwards while the right diagonal
motors are rotated backwards. This makes the robot turn in the
backward left direction. To turn the robot in the backward right
direction, the right diagonal motors are rotated forwards while the
left diagonal motors are rotated backwards. This makes the robot
turn in the backward right direction.
36
decoder (13, 11) are set to low and other two output pin of decoder
(12, 10) are set to high. This condition commands the robot to
move in forward direction. Led connected to pin 13 and 11 are not
glowing as it is low and led connected to pin 10 and 12 are glowing
since, it is high.
Backward Movement :
When the accelerometer is tilted towards backward direction, two
output pin of decoder (12, 10) are set to low and other two output
pin of decoder (13, 11) are set to high. This condition commands
the robot to move in backward direction. Led connected to pin 13
and 11 are glowing as it is high and led connected to pin 10 and 12
are not glowing since, it is low.
Moves towards Right :
When the accelerometer is tilted towards right, two output pin of
decoder (12, 11) are set to low and other two output pin of decoder
(13, 10) are set to high. This condition commands the robot to
move towards right. The output can be seen in the above picture.
Led connected to pin 13 and 10 are glowing as it is high and led
connected to pin 11 and 12 are not glowing since, it is low. Moves
towards Left :
When the accelerometer is tilted towards left, two output pin of
decoder (12, 11) are set to high and other two output pin of decoder
(13, 10) are set to low. This condition commands the robot to move
towards left. Led connected to pin 13 and 10 are not glowing as it
is low and led connected to pin 11 and 12 are glowing since, it is
high.
37
Chapter 7
CONCLUSION,
LIMITATIONS AND
FUTURE WORK
7.1 Conclusion
We have gone through several hurdles and at the end we are able to
complete the project work.The project finally ran as our expectetion
was.It showed all the proper movements.
38
Chapter 8
FEASIBILITY OF THE
PROJECT
8.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.
8.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.
39
8.3 Economic
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.
40
Chapter 9
REFERENCES
1.Google.com
2.wikipedia.com
3.youtube.com
4.https://www.slideshare.net/mahkamkhan/wireless-gesture-controlled-
robot-fyp-report
5.https://www.youtube.com/watch?v=8s116ufjmjk
6.https://create.arduino.cc/projecthub/user206876468/hand-gesture-
controlled-robot-4d7587
7.https://www.youtube.com/watch?v=eyY5iAKhULw
8.https://www.youtube.com/watch?v=i2U49usFo10
9.https://www.scribd.com/document/98400320/InTech-Real-Time-
Robotic-Hand-Control-Using-Hand-Gesture
10. http://en.wikipedia.org/wiki/DC-motor
11.electronics.stackexchange.com/questions/18447/what-is-back-emf-
counterelectromotive-force
12.http://seminarprojects.com/s/hand-gesture-controlled-robot-ppt
13.Gesture Controlled Tank Toy User Guide http://www.slideshare.net/neeraj18290/wireless
gesture-controlled-tank-toy-transmitter
14. Embedded Systems Guide (2002) http://www.webstatschecker.com/stats/keyword/
15.Robotic Gesture Recognition (1997) by Jochen Triesch and Christoph
Von Der Malsburg http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.37.5427
41