Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Recently, strong efforts have been carried out to develop intelligent and natural
interfaces between users and computer based systems based on human gestures. Gesture
provides 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 extent their functionality.
1.1ROBOT
A robot is usually an electro-mechanical machine that can perform task
automatically. Some robot requires some degree of guidance, which may be done using a
remote control or with a computer interface. Robots can be autonomous, semiautonomous
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.3OBJECTIVE OF PROJECT
The objective of this project is to build a accelerometer based gesture controlled
robot by using arduino board. 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.
arduino board 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 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.
APPLICATIONS:
i.
Through the use of gesture recognition, remote control with the wave of a
ii.
iii.
ORGANIZATION OF REPORT
Chapter 2 describes the literature of components used in project.
1. Chapter 3 shows the strategy and implementation of project.
2. Chapter 4 shows results based on project.
3. Chapter 5 concludes the project and shows the future scope of project.
We divided our task into two sections 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:
i.
ii.
iii.
iv.
Accelerometer
Arduino board
Encoder IC
RF Transmitter Module
The second is the receiving end which comprises of following main components:
i.
ii.
iii.
iv.
RF Receiver Module
Decoder IC
Motor Driver IC
DC Geared Motors
2.1ACCELEROMETER (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. Here is a
small image of an Accelerometer shown. We can see in the image that there are some
arrows showing if we tilt these sensors in that direction then the data at that
corresponding pin will change in the analog form.
PIN NO.
1
2
3
4
5
6
SYMBOL
ST
Z
Y
X
GND
VCC
FUNCTION
Sets the sensitivity of accelerometer
Record analog for Z direction
Record analog for Y direction
Record analog for X direction
Connected to ground for biasing
+3.3V is applied
Inputs, a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and
a reset button. It contains everything needed to support the microcontroller; simply
connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery
to get started.
Table 2.2 Technical Data of Arduino
Microcontroller
Operating voltage
Input voltage
Digital I/O pins
Analog inputs pins
DC current per I/O pins
Flash memory
Clock speed
ATmega328
5V
7-12V
14(of which 6 pins provide PWM output)
6
40mA
32KB of which 2KB is used by bootloader
16MHz
2.2.1 ATMEGA328-Microcontroller
Atmel ATmega328 8-bit AVR microcontrollers are high-performance RISC-based
devices that combine 32KB ISP Flash memory with read-while-write capabilities, 1KB
EEPROM, 2KB SRAM, 23 general-purpose I/O lines, 32 general-purpose working
registers, serial programmable USART, and more. Atmel ATmega328 MCUs execute
powerful instructions in a single clock cycle, allowing the device to achieve throughputs
approaching 1 MIPS per MHz while balancing power consumption and processing speed.
These Atmel MCUs are designed for use in industrial automation and home and building
automation.
Features of ATmega328:
i.
ii.
iii.
iv.
v.
vi.
vii.
viii.
ix.
x.
xi.
xii.
xiii.
xiv.
xv.
Applications:
i.
7
ii.
iii.
Industrial automation
Sensors
HT12E is a 2^12 series encoder IC widely used in remote control and very
common among Radio Frequency RF applications. This HT12E IC capable of converting
12 bit Parallel data inputs into serial outputs. These bits are classified into 8 (A0-A7)
address bits and 4(AD0-AD3) data bits. Using the address pins we can provide 8 bit
security code for secured data transmission between the encoder and the decoder. The
8
encoder and decoder should use the same address and data format. HT12E is capable of
operating in a wide Voltage range from 2.4V to 12V and also consists of a built in
oscillator.
Pin Description of IC HT12E: The pin Description of the IC HT12E was pretty
simple to understand with total of 18 pins.
i.
ii.
OSC1 and OSC2: Input and output pins of the internal oscillator present inside
the IC.
iii.
TE: This pin is used for enabling the transmission a low signal in this pin will
enable the transmission of data bits.
iv.
A0 - A7: These are the input address pins used for secured transmission of this
data. These pins can be connected to VSS or left open.
v.
AD0 - AD3: These pins are feeding data into the IC. These pins may be connected
to VSS or may be left open for sending LOW or HIGH bits to the encoder.
vi.
DOUT: The output of the encoder can be obtained through this pin and can be
connected to the RF transmitter.
WORKING OF HT12E IC:
HT12E starts working with a low signal on the TE pin. After receiving a low
signal the HT12E starts the transmission of 4 data bits as shown in the timing diagram
above. And the output cycle will repeats based on the status of the TE pin in the IC. If the
TE pin retains the low signal the cycle repeats as long as the low signal in the TE pin
exists. The encoder IC will be in standby mode if the TE pin is disabled and thus the
status of this pin was necessary for encoding process. The address of these bits can be set
through A0 - A7 and the same scheme should be used in decoders to retrieve the signal
bits.
Role of EncoderEncoder is used for encoding data and to convert parallel data into serial data. As
now data is available on the output pins of the IC then it is sent to the input pins of
encoder IC HT12e. Data is parallel data which is converted into serially by encoder IC.
Then serially data is given to transmitter. Transmitter transmits these signals to the
receiver present on the robot.
2.3
DECODER IC (HT12D)
These are the decoder ICs which are used as a series of CMOS low power
schottky ICs.
operation, a pair of encoder/decoder with the same number of addresses and data format
should be chosen. The decoders receive serial addresses and data from a programmed
1212series of encoders that are transmitted by a carrier using an RF or an IR transmission
medium.
They compare the serial input data three times continuously with their local
addresses. If no error or unmatched codes are found, the input data codes are decoded and
then transferred to the output pins. The VT pin also goes high to indicate a valid
transmission. The 1212 series of decoders are capable of decoding information that
consists of N bits of address and 12_N bits of data. Of this series, the HT12D is arranged
to provide 8 address bits and 4 data bits, and HT12D is used to decode 12 bits of address
information.
HT12D is a decoder integrated circuit that belongs to 212 series of decoders. This
series of decoders are mainly used for remote control system applications, like burglar
alarm, car door controller, security system etc. It is mainly provided to interface RF and
10
infrared circuits. 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 output data pins. The serial input data is compared with the local addresses three
times continuously. The input data code is decoded when no error or unmatched codes are
found. A valid transmission in indicated by a high signal at VT pin.
HT12D is capable of decoding 12 bits, of which 8 are address bits and 4 are data
bits. The data on 4 bit latch type output pins remain unchanged until new is received
VDD and VSS are used to provide power to the IC, Positive and Negative of the
power supply respectively. As I said earlier its operating voltage can be in the
ii.
11
iii.
A0 A7 is the address input pins. Status of these pins should match with status of
address pin in HT12E (used in transmitter) to receive the data. These pins can be
iv.
v.
vi.
HT12D decoder will be in standby mode initially ie, oscillator is disabled and a HIGH on
DIN pin activates the oscillator. Thus the oscillator will be active when the decoder
receives data transmitted by an encoder. The device starts decoding the input address and
data. The decoder matches the received address three times continuously with the local
address given to pin A0 A7. If all matches, data bits are decoded and output pins D8
D11 are activated. This valid data is indicated by making the pin VT (Valid Transmission)
HIGH. This will continue till the address code becomes incorrect or no signal is received.
12
2.4
remote control applications, as in where you need to control some machines or robots
without getting in touch with them (may be due to various reasons like safety, etc). Now
depending upon the type of application, the RF module is chosen. For short range
wireless control applications, an ASK RF Transmitter-Receiver Module of frequency 315
MHz or 433 MHz is most suitable.
RF module comprises of an RF transmitter and an RF Receiver. The
transmitter/receiver (TX/RX) pair operates at a frequency of 434 MHz. An RF transmitter
receives serial data and transmits it wirelessly through RF through its antenna connected
at pin4. The transmission occurs at the rate of 1Kbps - 10Kbps.The transmitted data is
received by an RF receiver operating at the same frequency as that of the transmitter.
PIN DESCRIPTION:
1. RF Transmitter
13
PIN NO.
NAME
FUNCTION
GND
Ground (0V)
DATA
VCC
Supply voltage
ANTENNA
Antenna output
2. RF Receiver
Table 2.4 Pin descriptions RF Receiver
PIN NO.
NAME
FUNCTION
GND
Ground(0V)
DATA
NC
No connection
VCC
Supply voltage(5V)
VCC
Supply voltage(5V)
GND
Ground(0V)
GND
Ground(0V)
ANT
Antenna input
TECHNICAL DETAILS:
A. TX (transmitter) technical specification:
i.
Working voltage 3V-12V
ii.
Working current max40mA(12V),min9mA(3V)
iii.
Modulation mode: ASK
iv. Working frequency: 315MHz-433.92MHz, customized frequency
v.
vi.
14
is available.
Transmission power: 25mW (315 MHz at 12V)
Velocity: 10Kbps
available
Velocity: <9.6 Kbps
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.
drive two DC motors, relays, solenoids, etc. The device is TTL compatible. Two H
bridges of L293D can be connected in parallel to increase its current capacity to 2 Amp.
PIN DESCRIPTION:
Table 2.5 Pin diagram
PIN NO
1
2
3
4
5
6
7
8
9
10
16
FUNCTION
Enable pin for Motor 1; active high
Input 1 for Motor 1
Output 1 for Motor 1
Ground (0V)
Ground (0V)
Output 2 for Motor 1
Input 2 for Motor 1
Supply voltage for Motors; 9-12V
Enable pin for Motor 2; active high
Input 1 for Motor 1
NAME
Enable 1,2
Input 1
Output 1
Ground
Ground
Output 2
Input 2
VCC 2
Enable 3,4
Input 3
11
12
13
14
15
16
Output 3
Ground
Ground
Output 4
Input 4
VCC1
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".
As you can see 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.
i.
ii.
iii.
iv.
Turning off all the switches gives the motor a free wheel drive
v.
Lastly turning on A & C at the same time or B & D at the same time shorts your
entire circuit. So, do not attempt this
17
H-bridges can be built from scratch using relays, mosfets, field effect transistors
(FET), bi-polar junction transistors (BJT), etc. But if your current requirement is not too
high and all you need is a single package which does the job of driving a small DC motor
in two directions, then all you need is a L293D IC. This single inexpensive package can
interface not one, but two DC motors. L293, L293B and few other versions also does the
same job, but pick the L293D version as this one has an inbuilt flyback diode which
protects the driving transistors from voltage spikes that occur when the motor coil is
turned off.
VOLTAGE SPECIFICATION:
VCC is the voltage that it needs for its own internal operation 5v, L293D will not
use this voltage for driving the motor. For driving the motors it has a separate provision to
provide motor supply VSS (V supply). L293d will use this to drive the motor. It means if
you want to operate a motor at 9V then you need to provide a Supply of 9V across VSS
Motor supply. The maximum voltage for VSS motor supply is 36V. It can supply a max
current of 600mA per channel. Since it can drive motors Up to 36v hence you can drive
pretty big motors with this l293d.
VCC pin 16 is the voltage for its own internal Operation. The maximum voltage ranges
from 5v and up to 36v
2.7
DC MOTOR
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.
18
19
20
3.1 STRATEGY
During the development of the project we researched the feasibility in different
fields, especially software and hardware. The feasibility study is shown below.
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.
2. HARDWARE
We choose accelerometer as the sensing device because it records even the minute
movements. We have chosen arduino because it is easy to use and easily available. There
are a number of dc geared motors available but the ones we chose are capable of
supporting loads up to 2kgs.
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.
3.2 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 arduino board 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
arduino board.
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
21
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:
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.
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.
22
The parallel data from the encoder is fed to the L293D. This data is in the form of
bits. The L293D 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 L293D and outputs on the basis of these bits. 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, flyback
diodes are used. They prevent the back emf from increasing and damaging the motors.
23
24
Assemble the circuit on the PCB as shown in figure. After assembling the circuit on the
PCB, check it for proper connections before switching on the power supply.
25
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:
26
The robot only moves when the accelerometer is moved in a specific direction. The valid
movements are as follows:
Table 4.1 Accelerometer movements
DIRECTION
Forward
Backward
Right
Left
Stop
5.1 CONCLUSION
27
ACCELEROMETER ORIENTATION
+Y
-Y
+X
-X
Rest
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
ii.
iii.
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.
CODING:
#include<LiquidCrystal.h>
28
intx_data,y_data;
intx_ref,y_ref;
void setup()
{
// Serial.begin(9600);
DDRD = 0xff;
PORTD = 0x00;
x_ref = 333;
y_ref = 333;
}
void loop()
{
x_data = analogRead(A5);
y_data = analogRead(A4);
if(x_data>x_ref+20)
{
PORTD = 5;
}
else if(x_data<x_ref-20)
{
PORTD = 10;
}
else if(y_data>y_ref+20)
{
PORTD = 9;
}
else if(y_data<y_ref-20)
29
{
PORTD = 6;
}
else
{
PORTD = 0;
}
delay(200);
}
30