Professional Documents
Culture Documents
College of Engineering
Electrical Engineering
Department
Wirelessly Controlled
Robotic Hand
By
Mohamed Saad A.K.
Supervisor
Abdullah M. Zyarah
June 2016
To My Parents, Saad & Najwa
“Here is the deepest secret nobody knows
Here is the root of the root and the bud of the bud
And the sky of the sky of a tree called life; which grows
Higher than soul can hope or mind can hide
And this is the wonder that's keeping the stars apart
I carry your heart with me, I carry it in my heart”
I
Acknowledgment
I would like to express my deepest appreciation to all those who provided me
the possibility to complete this report. A special gratitude I give to my final year
project supervisor, Mr. Abdullah M. Zyarah, whose contribution, suggestions and
encouragement, helped me to coordinate my project especially in writing this report.
My completion of this project could not have been accomplished without the
support of my Colleagues, Mohannad, Mortadha, Mustafa, Ahmed, Farah, Reema,
Zahraa and Samar, I could not finish this project without your support and guidance.
Of course, I could not forget my best friends’ support through the hard times. Omer,
Hassan, you truly are my best friends.
II
Abstract
Developing robotic system that behaves just as human is the ultimate goal of
robot research community. Unfortunately, this system is way far to achieve, because
there is no control and processing system has been developed works just as the
biological human neocortex, where all data processing carried out and motor control
signals are generated. However, over the last years, neural network algorithms, which
is inspired by the neocortex structure and the principle of operation, grab a lot of
attention in the research community as a step forward to develop standalone systems
work like the human brain. Although these systems demonstrate astonishing results in
several applications including prediction and decision making, unpredicted behavior of
such systems is something expected. For this reason, this work is resorted to robot-
human interaction system since it may give more promising results especially when it
is needed to mimic human movements. The interaction between human and robot may
have a significant impact on the industry and shapes our future. Typically, the
interaction can be achieved by recording human movements accurately and translating
it into control signals controlling the developed robotic platform.
III
CONTENTS
Acknowledgment ......................................................................................................... II
Abstract ...................................................................................................................... III
Contents ......................................................................................................................IV
List of Figures .............................................................................................................. V
List of Tables ........................................................................................................... VII
CHAPTER ONE: Introduction .................................................................................. 1
CHAPTER TWO: Background .................................................................................. 3
2.1: ZIGBEE ............................................................................................................... 3
2.1.1: ZigBee Shield ........................................................................................... 5
2.1.2: UART Communication Protocol .............................................................. 5
2.2: MICROCONTROLLER........................................................................................... 7
2.2.1: Pic Microcontroller ................................................................................... 8
2.2.2: PICKIT 3 .................................................................................................. 9
2.2.3: Analog To Digital Converters ................................................................ 10
2.2.4: ADCs in PIC Microcontroller ................................................................ 11
2.3: MOTORS ............................................................................................................ 12
2.3.1: Types of Motors ..................................................................................... 13
2.3.2: Pulse Width Modulation ......................................................................... 13
2.3.3: Servo Motors .......................................................................................... 14
2.4: FLEX SENSORS .................................................................................................. 16
CHAPTER THREE: Hardware Implementation ................................................... 17
3.1: TRANSMISSION CIRCUIT ................................................................................... 17
3.1.3: Flex Sensor Voltage Divider .................................................................. 17
3.1.2: Transmission Circuit Source Code ......................................................... 18
3.1.3: XBee Configuration and Installation ...................................................... 20
3.1.4: Transmission Circuit Hardware Implementation ................................... 22
3.1.5: Final Look of the Transmission Circuit.................................................. 25
3.2: RECEIVING CIRCUIT ......................................................................................... 26
3.2.1: Data Representation................................................................................ 26
3.2.2: Receiving Circuit Source Code .............................................................. 27
3.2.3: Receiving Circuit Hardware Implementation ......................................... 31
3.2.4: Robotic Hand Kit .................................................................................... 34
3.2.5: Final Look of the Receiving Circuit ....................................................... 35
CHAPTER FOUR: Conclusion & Future Work .................................................... 36
REFERENCES ....................................................................................................... VIII
APPENDIX .................................................................................................................. X
IV
List of Figures
1.1: Evolution of the Robots ....................................................................................... 1
2.1: XBee Chip ........................................................................................................... 3
2.2: XBee and XBee PRO .......................................................................................... 3
2.3: XBee Shield ......................................................................................................... 5
2.4: UART Communication ....................................................................................... 6
2.5: UART Waveforms............................................................................................... 6
2.6: Microcontroller-XBee UART Interface .............................................................. 7
2.7: PIC 16F873A ....................................................................................................... 8
2.8: PICKIT 3 ............................................................................................................. 9
2.9: ADC Basic Principle ......................................................................................... 10
2.10: ADC Parameters .............................................................................................. 10
2.11: ADC Block Diagram in PIC16F87X ............................................................... 11
2.12: Several Types of Motors ................................................................................. 13
2.13: Pulse Width Modulation Showing the Average Voltage ................................ 14
2.14: Servo Motor Main Parts .................................................................................. 15
2.15: Servo Motor PWM .......................................................................................... 15
2.16: Servo Wires Specification ............................................................................... 16
2.17: Flex Sensor ...................................................................................................... 16
3.1: Proteus Model of the Transmission Circuit ....................................................... 17
3.2: Flex Sensor Voltage Divider ............................................................................. 18
3.3: CCS C Compiler Window ................................................................................. 18
3.4: a-ADC Program Segment, B-ADC Proteos Example ....................................... 19
3.5: Transmission Program for a Single Input .......................................................... 19
3.6: XBee Explorer ................................................................................................... 20
3.7: XBee Chip Mounted on Explorer ...................................................................... 20
3.8: XCTU Displaying the XBee Module ................................................................ 21
3.9: XCTU Displaying the XBee Network Settings ................................................. 21
3.10: UART Data Format ......................................................................................... 22
3.11: Stretched Gloves .............................................................................................. 22
3.12: Flex Sensors Glued Over the Glove ................................................................ 22
3.13: Flex Sensor Connection ................................................................................... 23
3.14: Female Pin Headers for Flex Sensors .............................................................. 23
3.15: Female Pin Headers implemented in the circuit .............................................. 24
3.16: Transmission Circuit ....................................................................................... 24
3.17: Different Views of Transmission Circuit ........................................................ 25
3.18: Final Look of the Transmission Circuit........................................................... 25
3.19: Proteus Model of the Receiving Circuit .......................................................... 26
3.20: De Facto Representation of Bytes ................................................................... 27
3.21: Servo Rotation Library .................................................................................... 27
3.22: Synchronizing the Transmission Process ........................................................ 28
3.23: Getting Data from the XBee ............................................................................ 29
3.24: Synchronizing Process inside the C-Compiler ................................................ 29
V
3.25: Receiving Program Flowchart ......................................................................... 30
3.26: MG995 Servomotor ......................................................................................... 31
3.27: Receiving Circuit under Implementation ........................................................ 31
3.28: Servomotor Hook-up Wires ............................................................................ 32
3.29: Servo Male Pins (3*5) ..................................................................................... 32
3.30: Rechargeable Batteries .................................................................................... 32
3.31: Different Views of the Receiving Circuit ........................................................ 33
3.32: Robotic Hand Kit ............................................................................................. 34
3.33: Cord Tied to the Servo Gear ............................................................................ 34
3.34: Final Look of the Receiving Circuit ................................................................ 35
4.1: The project is completed and presented in the Scientific Exhibition ................ 36
4.2: The project represented to Dean of the Faculty of Engineering with MR.Thamir
and other Guests ....................................................................................................... 37
VI
List of Tables
2.1: Specifications and Performance for ZigBee & ZigBee PRO .............................. 4
3.1: XBees Configuration ......................................................................................... 21
3.2: Servomotor Degree and its Control Signal Timing Up ..................................... 28
3.3: Servomotor Angle Movement ........................................................................... 29
VII
References
1- XBee, Datasheet. "XBee-PRO™ OEM RF Modules. “." Product Manual v1.
xAx-802.15 4 (2013).
2- Gutierrez, Jose A., et al. "IEEE 802.15. 4: a developing standard for low-
power low-cost wireless personal area networks." network, IEEE 15.5 (2001):
12-19.
3- Boonsawat, Vongsagon, et al. "XBee wireless sensor networks for temperature
monitoring." the second conference on application research and development
(ECTI-CARD 2010), Chon Buri, Thailand. 2010.
4- Osborne, Adam. "An Introduction to Microcomputers: Volume 1—Basic
Concepts, Berkeley: Osborne." (1980). Augarten, Stan. "The Most Widely
Used Computer on a Chip: The TMS 1000." State of the Art: A Photographic
History of the Integrated Circuit (New Haven and New York: Ticknor &
Fields). ISBN 0-89919-195-9. Retrieved (2009): 12-23.
5- Svendsli, Odd Jostein. "Atmel’s Self-Programming Flash
Microcontrollers."Systementwicklungsprojekt-Thomas Kittel (2013).
6- Peatman, John B. Design with PIC microcontrollers. Simon & Schuster Trade,
1997.
7- Fu, Yejun. A Millimeter Wave Electro-Optical Transmitter for Radio over
Fiber Systems. Diss. Concordia University Montréal, Québec, Canada, 2012.
8- Microchip, P. I. C. "chipKIT™ PGM Programmer/Debugger Reference
Manual."
9- Zuch, Eugene L. "Principles of data acquisition and conversion." Data
Acquisition and Conversion Handbook (1979): 13-18.
10- Figueras, Ilka, Maximiliano Moreno, and Patricia Lauriet-Moreno. "Control
card check." U.S. Patent Application No. 10/734,983.
11- Mazidi, Muhammad A., et al. Pic microcontroller and embedded systems.
Prentice-Hall, Inc., 2005.
12- Gramme, Izenobe Theophile. "Improvement in magneto-electric machines."
U.S. Patent No. 120,057. 17 Oct. 1871.
13- Popović‐Bijelić, Ana, et al. "Multi‐Field Surface Electrode for Selective
Electrical Stimulation." Artificial organs 29.6 (2005): 448-452.
14- Theraja, B. L., et al. "A Textbook of Electrical Technology Vol II." Chand &
Co., New Delhi (2005).
15- Barr, Michael. "Pulse width modulation." Embedded Systems
Programming14.10 (2001): 103-104.
16- Sweeney Jr, James S. "Adaptive pulsing motor control for positioning
system." U.S. Patent No. 4,353,019. 5 Oct. 1982.
17- Lin, F-J., and S-L. Chiu. "Adaptive fuzzy sliding-mode control for PM
synchronous servo motor drives." Control Theory and Applications, IEE
Proceedings-. Vol. 145. No. 1. IET, 1998.
18- Servomotor , Datasheet
VIII
19- Zimmerman, Thomas G., et al. "A hand gesture interface device." ACM
SIGCHI Bulletin. Vol. 18. No. 4. ACM, 1987.
20- Configuration, X. C. T. U. "Test Utility Software." URL http://ftp1. digi.
Com/support/documentation/90001003_A. pdf (2008).
21- Spark Fun Products.
22- Russell, Rusty. "virtio: towards a de-facto standard for virtual I/O
devices."ACM SIGOPS Operating Systems Review 42.5 (2008): 95-103.
IX
Appendix
Appendix 1
ZigBee (Xbee) Pinout Description
X
Appendix 2
XBee Shield Pin Diagram
XI
Appendix 3-A
PIC16F873A Pinout Description
XII
Appendix 3-B
PIC16F873A Pinout Description
XIII
CHAPTER 1: Introduction
CHAPTER ONE
Introduction
Human-robot interaction (HRI) can be defined as the interdisciplinary study of
interaction dynamics between humans and robots. Researchers and practitioners specializing
in HRI come from a variety of fields, including engineering (electrical, mechanical, industrial,
and design), computer science (human-computer interaction, artificial intelligence, robotics,
natural language understanding, and computer vision), social sciences (psychology, cognitive
science, communications, anthropology, and human factors), and humanities(ethics and
philosophy).
A step-by-step approach has been taken, starting with a basic, static walk, through an
automatically adjustable, intelligent walk, ending towards the capability of working for a
human being. This is shown in Figure 1.1. It represents robots development of Honda
Humanoid Company.
Robots today are moving towards applications beyond the structured environment of a
manufacturing plant. They are making their way into the everyday world that people inhabit –
hospitals, offices, homes, construction sites and other cluttered and uncontrolled environments.
The successful introduction of robotics into human environments will rely on the development
of competent and practical systems that are dependable, safe, and easy to use. The value of
their contribution to the work environment will have to be unquestionable and their task
performance must be as reliable as that of a human worker. The introduction of a robot to assist
a human in such tasks will reduce fatigue, increase precision, and improve quality, whereas the
human can control the robot and communicate the task to it, rather than program the robot to
do a certain task, and that's exactly what makes the robot so safe to use.
1|Page
CHAPTER 1: Introduction
The thing to remember about gesture, whether if it is used as a verb or a noun, is that
not only is it a movement of the hands or body, but it is also a movement that has some meaning,
intention, or emotion behind it. When this word is used, it enters a whole history of human
communication, because there is no language that exists entirely without gesture. People cannot
communicate without gesture. It is so connected to intention that there is a phrase
"empty gesture," used to mean an action or movement that is without genuine feeling.
The Robot represented in this project works best as an example that has a massive role
to play in creating a disability friendly environment, which offers a major help for the disabled
to be connected with other and their environment in many activates. There is a huge number of
tasks that can be communicated to this robot to be done, starting from using it in medical
surgery due to its Suitable size. Also it can be used in industrial operations where humans suffer
from the danger of various types of tasks.
The original benchmarks for HRI were proposed by Isaac Asimov in his now famous
three laws of robotics: 1. a robot may not injure a human being or, through inaction, allow a
human being to come to harm. 2. A robot must obey orders given it by human beings except
where such orders would conflict with the First Law. 3. A robot must protect its own existence
as long as such protection does not conflict with the First or Second Law. The designed Robot
in this project operates According to these rules that what makes it proper to use.
2|Page
CHAPTER 2: Background
CHAPTER TWO
Background
2.1 ZigBee (XBee)
ZigBee (also known as XBee) is a wireless microcontroller made by DIGI which uses
the ZigBee protocol [1]. It was designed to meet IEEE 802.15.4 standards which specifies the
physical layer and media-access control for low rate personal area networks (LR-WPANS) [2].
ZigBee supports the engineering requirements of low cost, low power and high performance.
The ZigBee module is shown in Figure 2.1, the modules is widely used in RF applications that
requires a low data-rate, long battery life and secure networking.
Wireless light switches, electrical meters with in-home-displays, and other consumer
are all examples of XBee Applications, also industrial equipment that operate within the
Industrial, Scientific & Medical (ISM ) 2.4 GHz frequency .This technology is considered to
be simpler and less expensive than other WPANs, such as Bluetooth. ZigBee existed in two
types as shown in Table 1.1(XBEE & XBEE PRO) [1].
3|Page
CHAPTER 2: Background
Table 1.1: Specifications and Performance for ZigBee & ZigBee PRO
There are a few differences between the regular XBees and the XBee Pros. XBee Pro
is bigger in size, and uses more power and costs more money. The greater power means longer
range (1 mile instead of 300ft) so if the XBee is required to be used for long range
communication process, the XBee Pros is qualified, and otherwise the regular models satisfy
the requirements.
4|Page
CHAPTER 2: Background
Typically, all the XBee pins are coupled with its equivalent shield pins, where DIN and
DOUT of the XBee is connected to the UART pins of the Microcontroller used in this project.
The Power is taken from any 5V DC supply and regulated on-board to 3.3V DC before being
supplied to the XBee. The shield also takes care of level shifting on the DIN and DOUT pins
of the XBee. The board also includes LEDs to indicate power and activity on DIN, DOUT,
RSSI pins of the XBee [3].
5|Page
CHAPTER 2: Background
The UART usually does not directly generate or receive the external signals used
between different items of equipment. Separate interface devices are used to convert the logic
level signals of the UART to and from the external signaling levels. External signals may be
of many different forms. Examples of standards for voltage signaling are RS-232, RS-
422 and RS-485 from the EIA (Electronic Industries Alliance) as shown in Figure 2.5.
Historically, current (in current loops) was used in telegraph circuits. Some signaling schemes
do not use electrical wires. As example optical fiber, and (wireless) Bluetooth in its Serial Port
Profile (SPP). Some signaling schemes use modulation of a carrier signal (with or without
wires). Examples are modulation of audio signals with phone line modems, RF modulation
with data radios, and the DC-LIN for power line communication [4].
6|Page
CHAPTER 2: Background
Data enters the UART module through DI pin (pin 3) as an asynchronous serial signal.
The signal should idle ‘high’ when no data is being transmitted. Each data byte consists of a
start bit logic ‘0’, 8 data bits (least significant bit first) and a stop bit logic ‘1’ [1].
2.2 Microcontroller
A microcontroller is a self-contained system with peripherals, memory and a processor
that can be used in embedded systems. Most microcontrollers that are used today are embedded
in other consumer products or machinery. Such as automobile engine control systems,
implantable medical devices, remote controls, office machines, appliances, power tools, toys
and other embedded systems. By reducing the size and cost compared to a design that uses a
separate microprocessor, memory, and input/output devices, microcontrollers make it
economical to digitally control even more devices and processes. Mixed microcontrollers are
common, integrating analog components needed to control non-digital electronic systems [5].
7|Page
CHAPTER 2: Background
The most popular Microcontrollers are from Intel (such as the 8051), Zilog (derivatives
of their famous Z-80 microprocessor), Motorola (such as the 68HC05), Atmel (the A VR),
and Microchip.
Figure 2.7 represents PIC16F873A which has 128 bytes of EEPROM data memory, an
ICD, 2 Comparators, 5 channels of 10-bit Analog-to-Digital (A/D) converter, and a Universal
Asynchronous Receiver Transmitter (USART). All of these features make it ideal for more
advanced level A/D applications in automotive, industrial, appliances and consumer
applications [8].
8|Page
CHAPTER 2: Background
2.2.2 PICKIT 3
PICKIT is a family of programmers for PIC microcontrollers made by Microchip
Technology. They are used to program and debug microcontrollers, as well as program
EEPROM. Some models also feature logic analyzer and serial communications (UART) tool.
The PICKIT 3 programmer/debugger is a debugger system used for hardware and software
development of Microchip PIC microcontrollers (MCUs) that are based on In-Circuit Serial
Programming and Enhanced In-Circuit Serial Programming 2-wire serial interfaces. In addition
to debugger functions, the PICKIT 3 programmer/debugger system also may be used as a
development programmer [9].
PICkit 3 programmer/debugger allows the user to debug the needed application on his
own hardware in real time. Also allows debugging with hardware breakpoints. Besides setting
breakpoints based on internal. Along with programming any kind of PIC device.
This device have internal switch-mode voltage regulators that allows it to generate voltages
from 3.5 to 5.5 volts, from a 5 V USB supply, at around 100 mA. Also, it has an option for
calibrating the output with a multimeter, for increased accuracy. Additionally, for some PICs,
the MCLR programming voltage can be generated, at around 13 to 14 volts. This voltage is
required to reprogram the flash memory [9].
9|Page
CHAPTER 2: Background
Digital signals propagate more efficiently than analog signals, largely because digital
impulses, which are well-defined and orderly, are easier for electronic circuits to distinguish
from noise, which is chaotic. This is the chief advantage of digital modes in communications.
Computers communicate and think in terms of binary digital data; while a microprocessor can
analyze analog data, it must be converted into digital form for the computer to make sense of
it. A typical telephone modem makes use of an ADC to convert the incoming audio from a
twisted-pair line into signals the computer can understand. In a digital signal processing system,
an ADC is required if the signal input is analog [10] [11].
10 | P a g e
CHAPTER 2: Background
11 | P a g e
CHAPTER 2: Background
2.3 Motors
An electric motor is a machine which converts electric energy into mechanical energy.
Its action is based on the principle that when a current carrying conductor is placed in a
magnetic field, it experiences a mechanical force whose direction is given by Fleming’s Left-
hand Rule. There are several types of motors, but it will always be classified to two main
categories: DC motors, and AC motors [15].
The first commutator DC electric motor capable of turning machinery was invented by
the British scientist William Sturgeon in 1832. Following Sturgeon's work, a commutator-type
direct-current electric motor made with the intention of commercial use was built by the
American inventor Thomas Davenport, which he patented in 1837. The motors ran at up to 600
revolutions per minute, and powered machine tools and a printing press. Due to the high cost
of primary battery power, the motors were commercially unsuccessful and Davenport went
bankrupt [13].
In the 1880s, many inventors were trying to develop workable AC motors because AC's
advantages in long-distance high-voltage transmission were counterbalanced by the inability
to operate motors on AC. Practical rotating AC induction motors were independently invented
by Galileo Ferraris and Nikola Tesla, a working motor model having been demonstrated by the
former in 1885 and by the latter in 1887. In 1888, Tesla presented his paper ‘A New System
for Alternating Current Motors and Transformers’ to the AIEE that described three patented
two-phase four-stator-pole motor types: one with a four-pole rotor forming a non-self-starting
reluctance motor, another with a wound rotor forming a self-starting induction motor, and the
third a true synchronous motor with separately excited DC supply to rotor winding. One of the
patents Tesla filed in 1887, also described a shorted-winding-rotor induction motor [13] [14].
Ac motors require an alternating current or voltage source like the power supplied from
the wall outlet in houses, while DC motors require a direct current or voltage source like the
voltage coming out from the batteries [15].
The motor is constructed of two essential components:
1- Stator: a permanent magnet (or magnets) around the edge of the motor case that
remains static.
2- Rotor: a coil inside the stator mounted on an axle that spins around at high speed.
Electric motors are used to produce linear or rotary force (torque), and should be
distinguished from devices such as magnetic solenoids and loudspeakers that convert
electricity into motion but do not generate usable mechanical powers, which are respectively
referred to as actuators and transducers. Motors are used everywhere, there is a motor in fans,
blowers, cars, trains, clocks, etc. In industry, motors are used for lifting, moving, accelerating,
rotating, braking and spinning materials in order to paint, cut, plate, punch, film, etc. [15]
12 | P a g e
CHAPTER 2: Background
13 | P a g e
CHAPTER 2: Background
Pulse width modulation works as a speed control by driving the motor with a series of
“ON-OFF” pulses and varying the duty cycle, the fraction of time that the output voltage is
“ON” compared to when it is “OFF”, of the pulses while keeping the frequency constant. The
power applied to the motor can be controlled by varying the width of these applied pulses and
thereby varying the average DC voltage applied to the motors terminals [17].
As shown in Figure 2.13, by changing or modulating the timing of these pulses the
speed of the motor can be controlled, i.e., the longer the pulse is “ON”, the faster the motor
will rotate and likewise, the shorter the pulse is “ON” the slower the motor will rotate. In other
words, the wider the pulse width, the more average voltage applied to the motor terminals, the
stronger the magnetic flux inside the armature windings and the faster the motor will rotate
[17].
PWM signals are used for a wide variety of control applications. Their main use is for
controlling DC motors but it can also be used to control valves, pumps, hydraulics, and other
mechanical parts. The frequency that the PWM signal needs to be set at will be dependent on
the application and the response time of the system that is being powered [16].
14 | P a g e
CHAPTER 2: Background
The servo motor is constructed of four main parts as shown in Figure 2.14:
1- A normal DC Motor.
2- A Gear reduction unit.
3- A position-sensing device (usually a potentiometer).
4- A control circuit (PID Controller) which allows the servomotor to be brought to its
commanded position more quickly and precisely, with less overshooting.
Servos are commonly electrical or partially electronics in nature, means that it uses an
electric motor as primary means of creating a mechanical force. Other types of servos use
hydraulics, pneumatics, or magnetic principles. For the electric servo motors, they are generally
with a PWM period of 20ms, and they are settled at angular position 0o when the PWM period
is 15ms as shown below.
15 | P a g e
CHAPTER 2: Background
When intermediate value of pulse width is above 1.5ms, servo rotates in clockwise
position, conversely, anticlockwise. There are three wires to a servo motor as shown in Figure
2.16. Two wires are for power, +5V and ground. The third wire feeds a positional control signal
to the motor [18] [19].
Flex sensors may be used in robotics to determine joint movement or placement. They
may also be used like whiskers for wall detection. The sensors we are making are also pressure
sensitive so they can also be used as bumper switches for wall detection or pressure switches
on robotic grippers. For bio-metrics, the sensor can be placed on a moving joint of athletic
equipment to provide an electrical indication of movement or placement. A few of the sensors
can be incorporated onto a glove to make virtual reality glove [20].
16 | P a g e
CHAPTER 3: Hardware Implementation
CHAPTER THREE
Hardware Implementation
This chapter is divided into two main sections: Transmission circuit and Receiving circuit.
17 | P a g e
CHAPTER 3: Hardware Implementation
The resistance of the flex sensors used in this project were measured experimentally.
The maximum value the flex sensor reached is 95KΩ, while at rest it is about 30KΩ.
18 | P a g e
CHAPTER 3: Hardware Implementation
By creating a new project file and selecting the desired PIC device, the user can start
writing the program. The first part of the transmission circuit is to enable the ADC channels.
This can be done using the program syntax shown in Figure 3.4.a. This program file is
simulated using Proteus program as shown in Figure 3.4.b to verify its function.
Figure 3.4-b represents an ADC PIC-based circuit implemented using Proteus circuit
simulator. The circuit can be used to convert any analog signal applied at channel AN0 to a
corresponding digital value which is displayed on a LED bar.
19 | P a g e
CHAPTER 3: Hardware Implementation
The program segment shown in Figure 3.5 enables the ADC and UART transmission
for PIC16F873A. As it is shown in this program, port ‘A’ channels are enabled to allow the
ADC conversion. Five channels of ADC are utilized in the work, each of which is connected
to a flex sensor so that the voltage across it can be measured. Since the Microcontroller executes
the source code in sequential fashion, reading the voltage across the flex sensor takes five cycle
of the while loop. Once the analog value is converted to digital, it will be sent to the receiving
circuit via the XBEE module.
20 | P a g e
CHAPTER 3: Hardware Implementation
After plugging the USB cable to the PC and opening the XCTU program,
the XBee module should be displayed on the radio modules window as shown In
Figure 3.8. Finally, by clicking the module the XCTU starts reading the module
radio settings.
After reading the XBee module settings, XBEE modules are configured to form a
Router-Coordinator network connection as shown in the XCTU window in Figure 3.9. XBees
can only communicate with each other if they have the same network ID. For both devices the
PAN ID is given ‘D4A1’. The destination high and low addresses are changed for both XBees,
Table 3.1 illustrates how both XBees are configured.
21 | P a g e
CHAPTER 3: Hardware Implementation
Figure 3.10 illustrates the serial bit pattern of data passing through the module. Serial
communications depend on the two UARTs (the microcontroller's and the RF module's) to be
configured with compatible settings (baud rate, parity, start bits, stop bits, data bits) [1].
Figure 3.11: Stretched Gloves Figure 3.12: Flex Sensors Glued Over
The Glove
22 | P a g e
CHAPTER 3: Hardware Implementation
Figure 3.13 illustrates how the flex sensors are connected to the glove. X0, X1, X2, X3
& X4 represent the flex sensors pins connected to PIC16F873A ADC. This is to measure the
voltages across the flex sensors that represent the user’s hand gesture.
These five values and a ground are entering PIC16F873A ADC ports via male-female
pin headers as shown in Figure 3.14.
23 | P a g e
CHAPTER 3: Hardware Implementation
24 | P a g e
CHAPTER 3: Hardware Implementation
25 | P a g e
CHAPTER 3: Hardware Implementation
26 | P a g e
CHAPTER 3: Hardware Implementation
In this project, the PIC microcontroller at the transmission side converts the analog
quantities to values within range from (0-255). As the voltage reference for the ADC is the
same as PIC VDD voltage which is 5v. Thus, the values from 0V to 5V can be represented as
a De Facto number from 0 to 255 using the equation below:
255
𝑋=𝑌∗
5𝑉
Where X denotes the De Facto number and Y is voltage across the flex sensor.
3.2.2 Receiving circuit source code
The flex sensor voltage is represented (as a De Facto number) in 8-bits (byte) when it
is transmitted/received, or processed inside the PIC microcontroller. As the register size used
to store the ADC read values is 8-bit size, all the converted analog signals values will be ranged
between (0-255). The program segment of pulse width modulation for servomotors must be
developed before writing the receiving circuit source code. The servo library in CCS-C
compiler is sophisticated to use as it contains timers and other flags. Also, to have wider control
over the generated PWM, a new PWM library needs to be developed as listed in Figure 3.21.
27 | P a g e
CHAPTER 3: Hardware Implementation
From the servomotor datasheets, the servomotor control signal period is 20ms, its
duration is from 0 to 2ms, and at 1500µs it is at 0 degree. This library shows how to make the
servomotor rotates to 0 degree angle. Ten pulses are given periodically with a Mark of 1500µs
and a Space time of (20ms – 1.5ms) to ensure that the second pulse begins after 20ms of the
original pulse. Simply, ten periods of duration 1.5ms is given in this library. Table 3.2
illustrated how this library is used.
As mentioned earlier, there are five flex sensors connected to the transmission circuit.
Thus, it is expected to receive five consecutive packets from the transmission circuit every time
a new gesture is formed by user’s hand. These packets usually are sent and received in a
particular order that ensures that right servo motors movements. To ensure the transmitting and
receiving synchronization, a character flag is sent periodically. This is shown in the block
diagram of Figure 3.22. The capitol letter ‘A’ is the character flag sent sequentially to ensure
synchronizing. The data is also represented as a character because it is sent as a character.
After ensuring synchronizing process, the data is now ready to enter the PIC microcontroller
and processed. By using “getc” command in the C-compiler, the users would be able to receive
the data form XBee via UART port. This is shown in the program segment of Figure 3.23. This
variable is now ready to be programmed to do its part of rotating the servomotor to the specific
angle degree.
28 | P a g e
CHAPTER 3: Hardware Implementation
It is obvious from Figure 3.22 that the transmission XBee is sending six characters.
Five of which represent the voltage drop across the flex sensor and one is a flag. The program
segment shown in Figure 3.24 illustrates how the synchronizing actually happened. X variables
waits for the flag. If the received value is the character flag, the microcontroller start receiving
the other five packets, otherwise, no change occurs.
The received variables are represented (as a De Facto number) in 8-bits (byte), and all
the values will be ranged between (0-255). Table 3.3 shows the received values ranged from
(0-255), and the rotation angle corresponded to it. The servomotor rotation angle is managed
to the specific finger movement using this table.
29 | P a g e
CHAPTER 3: Hardware Implementation
By combining all the program segments for the receiving circuit, the user would be able
to make an efficient program. The flowchart shown below represents how the receiving
program is written.
30 | P a g e
CHAPTER 3: Hardware Implementation
The face area of the servo motor is (5.4*2) cm2. Also, the motor gear used in this project
is 3.5 cm. Therefore, an area of (15*10) cm2 is required for fives servomotors to rotate without
gear interference. Besides of adding the same area of the transmission circuit which includes
XBee shield, PIC microcontroller, crystal and capacitors. All reasons above lead to using a
veroboard of (10*22) cm2. The circuit is implemented similar to that in transmission circuit,
but in the receiving circuit port ‘B’ pins are soldered to pass the PWM signals to the servo
motors. This circuit is shown in Figure 3.27.
31 | P a g e
CHAPTER 3: Hardware Implementation
Pin headers are soldered in the implementing circuit as the Arduino standard foot print.,
so that the XBee shield would mount over it. There are two main objects that need to be
discussed in this circuit.
32 | P a g e
CHAPTER 3: Hardware Implementation
Figure 3.31 represents different views of the receiving circuit. The XBee chip is
mounted over the XBee shield which is also mounted over the veroboard header pins. Also,
port ‘B’ pins are soldered to the pin headers which carries the pulse width modulated signal
responsible for rotating the servomotor. Besides, five servomotors are placed with distance to
avoid gear interference. Finally, the rechargeable batteries are glued behind the veroboard
where the soldering is placed, and they are responsible for supplying the servomotors.
33 | P a g e
CHAPTER 3: Hardware Implementation
In this project, the cord is tied and glued with silicon to the servomotor’s gear as shown
in Figure 3.33. Thus, when the servomotor rotates, the robotic finger curls inward.
34 | P a g e
CHAPTER 3: Hardware Implementation
After the two circuits start to run and the glove is worn without tilting any finger, the
finger strings were tightly pulled without leaving any loose area in the string. This is considered
to be the normal state of the motors, as if any finger moves the motors will then be powered.
35 | P a g e
CHAPTER 4: Conclusion and Future Work
CHAPTER FOUR
Conclusion and Future Work
This work is resorted to robot-human interaction system. It gives promising results
especially when it is needed to mimic human movements. The interaction between human and
robot may have a significant impact on the industry and shapes our future. Typically, the
interaction can be achieved by recording human movements accurately and translating it into
control signals controlling the developed robotic platform. The robotic hand is assembled as a
ready one and the work is confined to developing a control circuit that primarily captures any
human hand gesture and translates it into equivalent signals that control five servo motors
connected to a robotic hand.
Figure 4.1: The project is completed and presented in the Scientific Exhibition
This project is implemented using wireless technology which is becoming more and
more popular because of its low cost and ease-of-use. In many cases wireless has become
cheaper than the wired alternative. This technology allows us a faster and more convenient
access to the world. XBee technology provides the world with a variety of wireless
applications. The direct interfacing of analog sensors and digital I/O, makes Xbee widely
acceptable in variety of areas.
36 | P a g e
CHAPTER 4: Conclusion and Future Work
The applications of this project are limitless if it is developed for a special usage. This
project can be used in both medical and industrial sectors. If voice commands are introduced
in this project, the robotic hand can be developed to be an artificial hand for a disabled person,
or an artificial leg since the servomotors are considered to be a high accurate motors.
Figure 4.2: The project represented to Dean of the Faculty of Engineering with MR.Thamir
and other Guests
37 | P a g e