INFRARED OBJECT POSITION LOCATOR
OLADAPO, OPEOLUWA AYOKUNLE EEG/2001/129SUBMITTED TO DEPARTMENT
OF ELECTRONIC AND ELECTRICAL ENGINEERING OBAFEMI AWOLOWO
UNIVERSITY, ILE IFE OSUN STATE, NIGERIA IN PARTIAL FULFILLMENT FOR
THE AWARD OF BACHELOR OF SCIENCE IN ELECTRONIC AND ELECTRICAL
ENGINEERING
JANUARY 2008
1
CHAPTER 1 INTRODUCTION There are numerous locating, tracking and
monitoring protocols in use today, for use in conjunction with
physical boundaries and fences, as necessary to locate, track and
monitor the location and proximity of an object relative to the
physical boundary. Such objects may be animate or inanimate, such
as pets, livestock, valuables, inventory, equipment, personnel, and
the like. Tracking systems have in recent times been on increasing
demand this is because security is of paramount importance and the
use of tracking systems is one of the simplest and most effective
ways in security systems. A position location system is used to
determine the location or direction of a target on a
near-continuous basis. An ideal tracking system would maintain
contact and constantly update the target's bearing (azimuth), range
and elevation. Locating an object to be tracked may be readily
achieved using transmitter/receiver-based technology. Many devices
used by police, security, and military organizations, including
user-wearable, gun mounted, vehicle-mounted, missile-mounted, and
orbital systems, exploit some form of infrared detection
technology.
Possible uses for this project include security surveillance for
inside buildings and surrounding areas. By using an infrared
camera, the design can also have military applications. The camera
can be attached to a gun turret which could then track moving
targets.
2
1.1
OBJECTIVE The aim of this project is to design and build a
device that will track an object
(IR transmitter) in 3600 azimuth using an IR tracking system.
The object position locator is to comprise of an IR receiver, sweep
dish and an intelligent controller (implemented with
Microcontroller PIC 16F877A), which is to activate the scanning
process of the sweep dish and also determine the position of the
target. The IR transmitter is attached to the object to be tracked
while the IR receiver receives signal sent by the transmitter and
sends it to the computer. Tracking is done by comparing signal
strengths received from the IR receiver. This is to achieve a
continuous monitoring process to cause a real-time tracking of the
object.
3
CHAPTER 2 LITERATURE REVIEW The purpose of this project is to
develop a motion tracking device, which will be able to recognize
an object, and follow its motion on a horizontal plane. To reach
this goal, the motion tracking algorithm must perform within
certain limits to keep up with the real-time. Therefore, the most
important factors of the project in these regards are speed, cost
and transmission signal strength
2.1
VARIOUS DESIGNS AND THEIR LIMITATIONS Commercially, past
research on the project have been carried out using
different tracking methods. These methods include: Radio
Frequency Tracking, Global Positioning System Tracking and Infrared
Tracking Technologies.
2.1.1
RADIO FREQUENCY (RF) IDENTIFICATION TRACKING This method is
commonly used to implement the tracking systems by various
engineering institutes in design. Normally, a suitable frequency
band for the design would be selected considering factors such as
cost, interference with other transmitting stations around,
effectiveness with the range of operation being considered e.t.c.
The Radio frequency design was first implemented using radio
frequency (RF) tags by Harry Stockman. He used the RF tags to
reflect power ensuring continuous reception from the receiver.
Radio path between the transmitter and receiver obstructed by
surface with sharp irregular objects even when line-of-sight (LOS)
dont exist, waves bend around the objects by diffraction. It has an
advantage of good enough range for most applications
4
but also has disadvantages which include issue of cost,
multi-path, fading and interference (Steven Depp et al, 2002)
2.1.2
GLOBAL POSITIONING SYSTEM (GPS) TRACKING This is another very
effective method used in tracking objects. The GPS is a
space-based radio-positioning and time transfer system developed
in the early 1940s by Decca Navigator. The GPS has three major
segments: Space Division, Control Segment, and User Equipment
Division. As a universal positioning system, GPS provides several
characteristics not found in other existing equipment which will
enhance the conduct of mission operations: Extremely accurate
(3-dimensional) position, velocity and time (PVT) determination; a
worldwide common grid easily converted to other local data;
passive, all weather operation; real-time and continuous
information; and survivability in a hostile environment (Lockheed
et al, 1999). A GPS receiver's job is to locate four or more
satellites in space, figure out the distance to each, and use this
information to deduce its own location. This operation is based on
a simple mathematical principle called trilateration1. One of the
limitations of the GPS tracking method is that certain atmospheric
factors (ionization) and other sources of error can affect the
accuracy of GPS receivers.
2.1.3
INFRARED (IR) TRACKING Infrared technology is one of the
earliest tracking methods discovered in the
18th century by William Herschel. Infrared light consists of
electromagnetic radiation that is too low in frequency (i.e., too
long in wavelength) to be perceived by the human eye, yet is still
too high in frequency to be classed as microwave radio. Infrared
(IR) light that is just beyond the human visual limit (>1.0 1014
to 4.0 1
A method of determining the relative position of object using
geometry of triangles
5
1014 Hz) is termed near IR, while light farther from the visible
spectrum is divided into middle IR, far IR, and extreme IR.
Military and security systems utilize mostly near IR and a narrow
band in the far IR centered on 3.0 1013 Hz, because the Earth's
atmosphere happens to be transparent to IR radiation2 Infrared
tracking technology employs the transmitter-receiver model. It is
very cost effective and easy to manage. Its main limitation is in
its signal strength coverage in transmission.
2.2
DESIGN IMPROVEMENTS The Infrared tracking Technology was
selected because of its cost
effectiveness and flexibility. The Transmitter-Receiver model
can be easily implemented on a small scale level. The IR tracking
will be improved using a dish to focus the IR radiation on the
receiver to enable a better reception of the infrared signals sent
by the infrared transmitter.
2.3
HARDWARE COMPONENTS The hardware components used in the IR
tracking implementation include;
-
An Infrared light-emitting diode (LED) A Phototransistor (used
as an infrared receiver) Current Amplifier (ULN2003) Field Effect
Transistors (FET) Stepper motors (1) PIC 16F877A microcontroller. A
brief description and theory of the hardware components employed
is
discussed in the following sections.2
Spontaneous emission of a stream of particles or electromagnetic
rays in nuclear decay
6
2.3.1
PIC 16F877A MICROCONTROLLER A microcontroller is a
computer-on-a-chip developed by Intel3. It is a type of
microprocessor emphasizing high integration, low power
consumption, selfsufficiency and cost-effectiveness, in contrast to
a general-purpose microprocessor (the kind used in a PC). PIC
16F877 is a 40-pin 8-Bit CMOS FLASH Microcontroller from Microchip.
The core architecture is high-performance RISC CPU with only 33
in-out pins. Since it follows the RISC architecture, all single
cycle instructions take only one instruction cycle except for
program branches which take two cycles. 16F877A comes with 3
operating speeds with 4, 8, or 20 MHz clock input. Since each
instruction cycle takes four operating clock cycles, each
instruction takes 0.2 ms when 20MHz oscillator is used.
3
largest semiconductor company and inventor of the X86 series of
microprocessors
7
Figure 2.1
PIC16F877A Microcontroller
In addition to the usual arithmetic and logic elements of a
general purpose microprocessor, the microcontroller typically
integrates additional elements such as read-write memory for data
storage, read-only memory, such as flash for code
8
storage, EEPROM (Electrically Erasable Programmable Read Only
Memory), for permanent data storage, peripheral devices, and
input/output interfaces. At clock speeds of 20MHz or even lower,
microcontrollers often operate at very low speed compared to modern
day microprocessors, but this is adequate for typical applications.
They consume relatively little power (milliwatts), and will
generally have the ability to sleep while waiting for a peripheral
event such as a button press to wake them up again to do something.
Power consumption while sleeping is a few nanowatts, making them
ideal for low power and long lasting battery applications. The
PIC16F877A microcontroller is a single integrated circuit, also
with the following features: serial input/output such as serial
ports (MCCP, USARTs), parallel input/output such as (PSP) other
serial communications interfaces like IC, Serial Peripheral
Interface and Controller Area Network for system interconnect
peripherals such as 3 timers, event counters, 2 PWM generators, and
watchdog 368 bytes of volatile memory (RAM) for data storage ROM,
EPROM, 256 bytes of EEPROM, 8K flash memory for program and
operating parameter storage a clock generator - an oscillator for a
quartz timing crystal eight 10-bit analogue-to-digital modules
in-circuit programming and debugging support 2.3.2 STEPPER MOTOR A
stepper motor is an electromechanical device which converts
electrical pulses into discrete mechanical movements. The shaft or
spindle of a stepper motor 9
rotates in discrete step increments when electrical command
pulses are applied to it in the proper sequence. The motors
rotation has several direct relationships to these applied input
pulses. The sequence of the applied pulses is directly related to
the direction of motor shafts rotation. The speed of the motor
shafts rotation is directly related to the frequency of the input
pulses and the length of rotation is directly related to the number
of input pulses applied. A motor that rotates in short and
essentially uniform angular movements rather than continuously;
typical steps are 30, 45, and 90; the angular steps are obtained
electromagnetically rather than by the ratchet and pawl mechanisms
of stepping relays. A stepper motor is a brushless, synchronous
electric motor that can divide a full rotation into a large number
of steps, for example, 200 steps. Thus the motor can be turned to a
precise angle.
10
Figure 2.2
Stepper Motor
When energized in a programmed manner by a voltage and current
input, usually dc, a step motor can index in angular or linear
increments. With proper
11
control, the output steps are always equal in number to the
input command pulses. According to Smith (1999), each pulse
advances the rotor shaft one step increment and latches it
magnetically at the precise point to which it is stepped. Advances
in digital computers and particularly microcomputers revolutionized
the controls of step motors. These motors are found in many
industrial control systems, and large numbers are used in computer
peripheral equipment, such as printers, tape drives, capstan
drives, and memory-access mechanisms. Step motors are also used in
numerical control systems, machine-tool controls, process control,
and many systems in the aerospace industry.
There are many types of step motors. Most of the widely used
ones can be classified as variable-reluctance, permanent-magnet, or
hybrid permanent-magnet types. A variable-reluctance step motor is
simple to construct and has low efficiency. The permanent-magnet
types are more complex to construct and have a higher
efficiency
The advantages of the stepper motor are as listed below: 1. The
rotation angle of the motor is proportional to the input pulse. 2.
The motor has full torque at standstill. 3. Precise positioning and
repeatability of movement. 4. Excellent response to
starting/stopping/reversing. 5. Very reliable since there are no
contact brushes in the motor. 6. The motors response to digital
input pulses provides open-loop control, making the motor simpler
and less costly to control.
12
7. It is possible to achieve very low speed synchronous rotation
with a load that is directly coupled to the shaft. 8. A wide range
of rotational speeds can be realized as the speed is proportional
to the frequency of the input pulses.
The stepper motor also has some disadvantages as stated below;
1. Resonances can occur if not properly controlled. 2. Not easy to
operate at extremely high speeds.
2.3.3
INFRARED TRANSMITTER The transmitter usually is a battery
powered handset. It should consume as
little power as possible, and the IR signal should also be as
strong as possible to achieve an acceptable control distance.
Preferably it should be shock proof as well. Many chips are
designed to be used as IR transmitters. The older chips were
dedicated to only one of the many protocols that were invented.
Nowadays very low power microcontrollers are used in IR
transmitters for the simple reason that they are more flexible in
their use. When no button is pressed they are in a very low power
sleep mode, in which hardly any current is consumed. The processor
wakes up to transmit the appropriate IR command only when a key is
pressed.
13
Figure2.3
Infrared Light Emitting Diode
14
2.3.4
PHOTOTRANSISTOR Like diodes, all transistors are
light-sensitive. Phototransistors are designed
specifically to take advantage of this fact. The most-common
variant is an NPN bipolar transistor with an exposed base region.
Here, light striking the base replaces what would ordinarily be
voltage applied to the base, so a phototransistor amplifies
variations in the light striking it. Note that phototransistors may
or may not have a base lead (if they do, the base lead allows you
to bias the phototransistor's light response.)
15
Figure 2.4
Phototransistor
16
2.3.5
INFRARED RECEIVER Infrared receivers pick up infrared signals
within line-of-sight, and within 30
feet or so, and turn the signal into electrical impulses. These
electrical impulses can be carried around the home on wires and
then turned back into infrared signals by emitters. Many different
receiver circuits exist on the market. The most important selection
criterion is the modulation frequency used.
17
Figure 2.5
Block diagram representation of the Infrared receiver
18
Figure 2.5 is a typical block diagram of such an IR receiver;
everything is built into one single electronic component. The
received IR signal is picked up by the IR detection diode on the
left side of the diagram. This signal is amplified and limited by
the first 2 stages. The limiter acts as an AGC circuit to get a
constant pulse level, regardless of the distance to the handset and
the AC signal is sent to the Band Pass Filter. The Band Pass Filter
is tuned to the modulation frequency of the handset unit. Common
frequencies range from 30 kHz to 60 kHz in consumer electronics.
The next stages are a detector, integrator and comparator. The
purpose of these three blocks is to detect the presence of the
modulation frequency. If this modulation frequency is present the
output of the comparator will be pulled low.
2.3.6
FIELD EFFECT TRANSISTOR (FET) Such a transistor operates on the
principle of repulsion or attraction of charges
due to a superimposed electric field. It is basically a
transistor, with three or more electrodes, in which the output
current is controlled by a variable electric field. Amplification
of current is accomplished in a manner similar to the grid control
of a vacuum tube. Field-effect transistors operate more efficiently
than bipolar types, because a large signal can be controlled by a
very small amount of energy. The field-effect transistor (FET) is a
type of transistor that relies on an electric field to control the
shape and hence the conductivity of a 'channel' in a semiconductor
material. It is basically used for weak-signal amplification (for
example, for amplifying wireless signals). The device can amplify
analog or digital signals. It can also switch DC or function as an
oscillator. In the FET, current flows along a
19
semiconductor path called the channel4. At one end of the
channel, there is an electrode called the source. At the other end
of the channel, there is an electrode called the drain. The
physical diameter of the channel is fixed, but its effective
electrical diameter can be varied by the application of a voltage
to a control electrode called the gate. The conductivity of the FET
depends, at any given instant in time, on the electrical diameter
of the channel. A small change in gate voltage can cause a large
variation in the current from the source to the drain, thus the FET
amplifies signals.
4
Medium for transmission used in semiconductor devices
20
CHAPTER 3 METHODOLOGY The various methods used in the
implementation of the infrared (IR) position locator include; the
search algorithm, stepper motor controlling, IR transmitter and
receiver range detection and the interconnection of all the
components. These methods are as enumerated in the following
sections.
3.1
SEARCH ALGORITHM The algorithm being used for tracking involves
the detection of the point of
maximum strength of the signal transmitted from the transmitter.
The receiver in conjunction with the program (written and executed
by PIC 16F877A) used to detect the point of maximum signal strength
detects the point of maximum strength and the program written for
the proper stepping of the motor is executed so as to give the dish
instructions on the proper direction to point towards. A flowchart
showing the control process is as shown in Figure 3.3.
21
Figure 3.1
The Control Process
22
Figure 3.2
Model plot of Signal Strength Vs Azimuth
23
START
Signal
Input
Data Acquisition INITIALSIGNAL strength = A
SIGNAL strength 2 = B
IS A>B ? YESS OUTPUT=A STOP
Figure 3.3
Flowchart Process Showing Signal Comparisons
24
The receiver sends various analogue inputs of the signal
strengths into the PICs analogue-to-digital (A/D) converter which
converts the signals into digital form that can be easily used for
comparison and the detection of the maximum point of signal
strength. This same digital form is translated and used for the
proper stepping of the motor for directing the dish and the
receiver. The sample of the code written for controlling the
stepper motor and for detecting the point of maximum signal
strength is shown in appendix A1.
3.2
STEPPER MOTOR CONTROL The stepper motor being used is the
PJJQ113ZA-P Matsushita Line feed
motor which is a unipolar stepper motor having a step size of
7.5 degrees, 48 steps per revolution, resistance of 36 ohms and a
gear diametrical pitch of 50. The stepper motor has six wires (out
of which 2 are common) and four separate electromagnets which were
used to turn the motor. Each electromagnet was energized one at a
time by giving current to its corresponding coil. Four of those
wires were each connected to one end of one coil. The extra wire
(or 2) is called "common." To operate the motor, the "common" wires
were connected to the supply voltage, and the other four wires are
connected to ground through transistors, so the transistors control
whether current flows or not. The microcontroller was used to
activate the transistors in the right sequence. To drive the motor
forward by one step (7.5o) the following sequence of signals needs
to be applied to the coil connections:
Step
Q1 Q2 Q3 Q4 25
1 2 3 4 Repeat step 1 etc.
1 0 0 0
0 0 1 0
0 1 0 0
0 0 0 1
To drive the motor backwards by one step the sequence is:
Step 1 2 3 4 Repeat step 1 etc.
Q1 1 0 0 0
Q2 0 0 1 0
Q3 0 0 0 1
Q4 0 1 0 0
26
IR TRANSMITTER3V IR LED Powered by Batteries
RECEIVER
MICRO CONTROLLER PIC16F877A
STEPPER MOTORS
Figure 3.4
Block diagram showing the control movement of the sweep dish
27
3.3
INFRARED (IR) TRANSMITTER AND RECEIVER RANGE DETECTION
The maximum permissible range of operation of the receiver was
tested and discovered to be 35 meters. The testing was carried out
using the principle of line-ofsight. The distance between the
transmitter and receiver was increased gradually and the signal
strength received was detected. The maximum permissible range was
chosen as the distance at which the signal strength becomes so
small that it becomes useless as an input to the
microcontroller.
3.4
INTERCONNECTION OF ALL THE COMPONENTS
After all the components had been tested, the connections were
made according to the design of the circuit shown in Figure 3.5
which had been simulated. The infrared transmitter is driven with a
+5 volts D.C power supply and the transmitter transmits infrared
signals continuously. The PIC is also driven with a +5 volts D.C
power supply through terminals VDD and the VSS terminals connected
to ground. The emitter of the phototransistor is taken as an input
to port Ra0 which is an analogue input port and the A/D converter
module is used to convert the signals into its corresponding
digital form. The PIC is clocked at 8MHz using a crystal oscillator
through the CLKIN and CLKOUT pins of the microcontroller. The
output which is used to drive the stepper motor is taken from pins
RD4, RD5, RD6 and RD7 into the gate of each field effect transistor
(FET). The output (i.e. the source) of the FET is then an amplified
voltage used to drive the stepper motor by energizing the
corresponding coil while the drain is grounded. The stepper motor
is driven by a +24 volts D.C power supply.
28
Figure 3.5
The Schematic Design of an Object Position Locator
29
CHAPTER 4 RESULTS
4.1
PROJECT EXPECTATIONS The design was expected to be able to
locate an object on the same platform
(same line-of-sight) with the receiver within a range 35 meters
from the location of the receiver and align itself to the direction
of position of the object. This is to be done continuously as long
as the object being located is changing its location.
4.2
LIMITATIONS The design is not 100 percent perfect to perform all
of its operations in all
conditions. It was observed that the design has some limitations
as listed below; The design will not be able to locate any object
outside the range (35 meters) of the infrared receiver. The speed
of movement of the object to be located should not be greater than
the speed of rotation of the stepper motor involved. In
applications where the object to be located is to be tagged
secretly, the tag might be removed and this will cause the design
not to perform its work. The position of the transmitter should be
in line-of-sight of the receiver else, the design will not perform
its operations. Any blockage in the line-of-sight will make the
device not functional.
4.3
RESULTS After the design and construction, testing of the device
was carried out to
ascertain the working conditions of the device. The design
performed the operations
30
expected i.e. locate an object that has been tagged and point in
the direction of location. The transmitter and the receiver have to
be on the same level for the device to work and also the device
works only for a distance of seven meters between the transmitter
and receiver.
31
CHAPTER 5 CONCLUSION AND RECOMMENDATION
5.1
CONCLUSION This project locates an object that has been tagged
with an infrared transmitter
which is in the range of the receiver. The receiver upon
location of the object turns the dish mounted on the stepper motor
in the direction of the location of the object. It can be concluded
that the device will work in it specified limits.
5.2
RECOMMENDATION The project is recommended for use in the
following areas; The location of an athlete on a track. Location of
objects in a perimeter within the specified range of the
device.
32
REFERENCES
Campbell T.D, Naik A.L., Stone R.E (2002), "Biological Infrared
Imaging and Sensing". Delmar Publishing Inc.
Depp Steven (2002), Optical Fiber Communication: From
Transmission to Networking, (English). IEEE
Gorbunov V. and Tsukruk S.L. (2006), "Thermal Detection of
Biological Infrared Receptors". Longman Limited, London.
Lockheed S.K. (1999), Wavelength Technology Seventh Edition,
Infrared Spectroscopy, Michigan State University.
33
APPENDIX A1 MIKROBASIC CODE FOR THE CONTROL PROCESS
program object position locator_1_1_08 dim counter, counter2 as
word dim counter3 as byte sub procedure interrupt if intcon.1 = 1
then counter = counter + 1 intcon.1 = 0 end if if pir1.0 = 1 then
counter2 = counter2 + 1 pir1.0 = 0 end if end sub main:
pwm_init(5000) trisb = %00000001 trisa = 255 portb = 0
pwm_change_duty(16) pwm_start adcon0 = 0 adcon1 = %00000110 intcon
= %11000000 option_reg = 0
34
pie1 = 1 pir1 = 0 tmr1l = $e8 tmr1h = $fd t1con = %00110001
intcon.4 = 1 while true if counter2 = 1 then intcon.4 = 0 t1con.0 =
0 if (counter >= 3) and (counter = 1) and (counter = 1) and
(counter VDD)..20 mA Output clamp current, IOK (VO < 0 or VO
> VDD)20 mA Maximum output current sunk by any I/O
pin......................................................25 mA
Maximum output current sourced by any I/O pin
................................................25 mA Maximum
current sunk by PORTA, PORTB and PORTE
(combined)..........................................................................200
mA Maximum current sourced by PORTA, PORTB and PORTE
(combined)..................................................................................200
mA Maximum current sunk by PORTC
38
and PORTD
(combined)......................................................................200
mA Maximum current sourced by PORTC and PORTD
(combined)......................................................................200
mA Note 1: Power dissipation is calculated as follows: PDIS = VDD x
{- IOH} + {(VDD VOH) x IOH} + (VO1 x IOL) Note 2: Voltage spikes
below Vss at the MCLR pin, inducing currents greater than 80 mA,
may cause latch-up. Thus, a series resistor of 50-100 should be
used when applying a low level to the MCLR pin rather than pulling
this pin directly to Vss.
39
APPENDIX A3 PHOTOTRANSISTOR (QSE114) DATASHEET
40
41
42
APPENDIX A4 INFRARED LIGHT EMITTING DIODE DATASHEET
43
44