1 introduction - uvic.caelec499/2003a/group13/docs/final... · web viewthe antenna used by the...

50
Ricochet Technologies Ricochet Technologies The Homing Disc The Homing Disc Table of Contents Table of Contents 1 List of Tables 2 List of Figures 3 Abstract 4 1. Introduction 5 2. Background Information 6 2.1 Small Size 6 2.2 Ruggedness 6 2.3 Economical 7 2.4 Power Efficient 7 3. Electrical & Mechanical Design 8 3.1 Transmitter and Receiver 8 3.2 Antennas 9 3.2.1 Transmitter Antenna 10 3.2.2 Receiver/ Handheld Antenna 12 3.3 Data Processing 13 3.3.1 Microcontroller Options 14 3.3.2 The 16F876 15 3.3.3 PIC Programmer 16 3.3.4 The Code 17 3.4 Visual Output 19 3.5 Transmitter and Handheld Casings 20 4. Project Analysis 23 Matthew Beau Nychka Matthew Beau Nychka Page Page 1 of 34 of 34 Niilo Van Steinburg Niilo Van Steinburg

Upload: others

Post on 28-Mar-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

Table of ContentsTable of Contents 1

List of Tables 2

List of Figures 3

Abstract 4

1. Introduction 5

2. Background Information 6

2.1 Small Size 6

2.2 Ruggedness 6

2.3 Economical 7

2.4 Power Efficient 7

3. Electrical & Mechanical Design 8

3.1 Transmitter and Receiver 8

3.2 Antennas 9

3.2.1 Transmitter Antenna 10

3.2.2 Receiver/ Handheld Antenna 12

3.3 Data Processing 13

3.3.1 Microcontroller Options 14

3.3.2 The 16F876 15

3.3.3 PIC Programmer 16

3.3.4 The Code 17

3.4 Visual Output 19

3.5 Transmitter and Handheld Casings 20

4. Project Analysis 23

4.1 Power Analysis 23

4.2 Cost Analysis 24

4.3 Problems Encountered 25

5. Conclusions 27

6. Cited References 28

7. References 29

Appendix A: PIC Code 31

Matthew Beau NychkaMatthew Beau Nychka Page Page 11 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 2: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

Matthew Beau NychkaMatthew Beau Nychka Page Page 22 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 3: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

List of Tables

TABLE 1: MICROCONTROLLER COMPARISONS 14

TABLE 2 : 16F876 RELEVANT PINOUT DESCRIPTIONS 16

TABLE 3 : VOLTAGE RANGES FOR LEDS 19

TABLE 4: CURRENT DRAWS OF PRIMARY COMPONENTS WITHIN HOMING BEACON 23

TABLE 5: COSTS ($CAD) OF PRIMARY COMPONENTS WITHIN HOMING BEACON 24

Matthew Beau NychkaMatthew Beau Nychka Page Page 33 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 4: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

List of Figures

FIGURE 1 - VERTICAL DIPOLE AZIMUTH PATTERN 10

FIGURE 2 - TURNSTILE ANTENNA AZIMUTH PATTERN 11

FIGURE 3 : 16F876 PIN DIAGRAM 15

FIGURE 4 - PIC PROGRAMMER CIRCUIT DESIGN 16

FIGURE 5 - HANDHELD DATA FLOW DIAGRAM 17

FIGURE 6 - HAND HELD SIGNAL STRENGTH 19

FIGURE 7 - BASIC TRANSMITTER CIRCUIT DIAGRAM 21

FIGURE 8 - BASIC RECEIVER CIRCUIT DIAGRAM 22

Matthew Beau NychkaMatthew Beau Nychka Page Page 44 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 5: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

Abstract

This report details the design process followed in the creation of the Homing Disc, a

transmitter-receiver combination that will help a golfer find his missing disc. The

transmitter is attached to an existing golf disc and is designed to meet the primary

specifications of being small, power efficient, and to withstand a variety of rugged

environments. The antenna used by the transmitter is a turnstile antenna with folded

dipoles to have an omnidirectional radiation pattern without a vertical dipole antenna.

The receiver is contained within a small hand-held device and measures the signal

surrounding it, displaying the varying power levels to the user in order to pinpoint the

disc's location. The antenna used by the receiver is a half-wave dipole antenna. It reads

the signal strength of the signal and transforms that into a usable analog voltage.

The receiver outputs a measure of the received signal strength and it is taken into the PIC

microcontroller, where it is analyzed. The PIC differentiates between the different signal

levels and outputs them using port B to six LEDs.

This report will provide the reader with information covering the choice in transmitters,

receivers, antennas, power sources, microcontrollers, and other components. It will also

detail the alternatives to these choices.

Finally an overview of the project and discussion regarding power and cost efficiency

will be presented, along with information on any problems encountered, and whether or

not this endeavor is marketable or not.

Matthew Beau NychkaMatthew Beau Nychka Page Page 55 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 6: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

1.Introduction

Ricochet Technologies is a university group consisting of Matthew Beau Nychka, an

electrical engineering undergraduate student, and Niilo Van Steinburg, a computer

engineering undergraduate student, supervised by Dr. Peter Dreissen. Our research focus

is in developing a miniature, power efficient homing beacon to be used on a Frisbee golf

disc. The time duration for this work is three months as per University of Victoria’s

ELEC/CENG 499A course guidelines.

Frisbee disc golf is a sport that has been rapidly growing since 1995. A player searching

for a lost disc through bushes on a course is an all too familiar sight. As most courses are

heavily treed and on rugged terrain, a disc that sails off course is often a disc lost.

Nighttime golfing adds its own obvious difficulties. A homing device designed to locate

discs hidden by brush or darkness can save both playing time and money.

Ricochet Technologies set out to solve this problem by designing a small, aerodynamic,

and lightweight transmitter that could be attached to the bottom of a Frisbee golf disc.

The purpose of this transmitter would be to radiate a high frequency radio (RF) signal

during a game so that a user would be able to track down a lost disc during a game. The

user would carry with him a pocket sized receiver that he could use to find his disc. The

receiver reads the signal strength and outputs it to a visual display to indicate to the user

whether or not he is pointing the receiver in the direction of the beacon.

With this in mind, please read on as we dive right into the details.

Matthew Beau NychkaMatthew Beau Nychka Page Page 66 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 7: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

2.Background Information

This portion of the report will focus on the goals of the project, both electrical and

mechanical, and will act as a constant base for the design and materials used to create the

homing beacon.

2.1 Small Size

In the sport of disc golf, a modified Frisbee disc is thrown towards a target. The sport is

usually played in a setting with a lot of brush and harsh terrain; consequently, the discs

are made to respond to the thrower very precisely. The typical Frisbee golf disc weighs

approximately 165 grams, is approximately 20cm in diameter, and has a height of 2cm.

Due to this small size and the aerodynamics of the disc, anything substantial added to the

body of the disc would result in an unfavorable performance. Therefore it was in our

user’s best interests that we create the device attached to the disc to be small enough to

have a negligible effect upon flight.

2.2 Ruggedness

The challenge and novelty of the sport are based upon the harsh nature of the courses.

The number of trees and rocks the disc contacts at high speed during one game are

countless. As well, cliffs and swamps are regular obstacles within a course.

Our designed casing reflects the need to have a transmitter contained within a water and

dust- proof casing for protection. The hand-held unit, though not subjected to the same

stresses as the disc unit, would also have to be made durable and as resistant to the

elements as possible.

Matthew Beau NychkaMatthew Beau Nychka Page Page 77 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 8: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

2.3 Economical

The average golf disc costs $15 CAD and has a lifetime of around 15 games. An avid

disc golfer will carry close to five discs with him during a game. This mirrors traditional

golf in that there are discs made for a variety of purposes: long-range, short-range, left

curve, S-curve, etc. When the costs of the discs themselves and their lifetimes are

factored in with the possibility of losing one to brush or darkness, the disc golfer’s costs

may increase drastically.

Our goal was to create a device that could be sold for close to $20, as suggested by polled

disc golfers. The device was designed to have a long lifetime, as well as an easily

replaceable and commercially sold battery.

2.4 Power Efficient

As a result of need to keep the device economical, we needed to address the requirements

of the transmitter. A long life, as well as the right power source meant that we addressed

all of our design with the concept of power efficiency in mind.

One of the smallest and most commercially available batteries to date is the coin cell

battery. Typically these run at a 3V supply and have a lifetime of between 190 and 320

mAh, depending on size of the coin cell itself. For an average game of 45 minutes over

the time of 15 games, a drain of 11.25mA, while activated, would be required for the

homing beacon to last as long as a disc before battery replacement.

An additional component necessary to the design of a power efficient device is the

addition of an LED to alert the user as to whether the device is on or off. This small extra

would potentially save the user the cost of dozens of batteries while draining only a

minute amount of current itself.

Matthew Beau NychkaMatthew Beau Nychka Page Page 88 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 9: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

3.Electrical & Mechanical Design

3.1 Transmitter and Receiver

To begin our research, we looked into a number of similar devices commercially

available today. Our research led through wildlife tracking units, avalanche beacons,

garage door openers, and remote key finders. Each product, while it taught us a great

deal about RF propagation, was perfect for its own application and impossible to use as a

template for our own.

Our goal in the use of the transmitter and receiver is to transmit a signal from disc to

hand-held receiver and to have that receiver measure the signal strength to notify the user

as to whether or not they were facing the right direction in search of his disc. The data

being sent across from transmitter to receiver is, in itself, unimportant. The significant

information is the Received Signal Strength Indication (RSSI). The receiver would need

to read the level of the signal and output it in a form that can easily be translated to a

visual display for the user.

The initial transmitter and receiver chosen were the surface mounted TXM/RXM-433-

LC-S [1], based solely on size and cost. After further research into antenna size and

specifications; however, we came to the conclusion that we needed to increase our

frequency to decrease the antenna size and make them more compatible with our goals.

Narrowing down our search parameters to receivers with an RSSI output at a 600MHz +

frequency offered any number of choices, but only a few reasonable ones. A number of

receiver/transmitter pairs, such as the Radiometrix RX2A-433-64 [2] were ideal for our

purposes but were too large for our compact design.

The final choice was the TDK5101 and TDA5201 [3], transmitter and receiver

respectively, by Infineon Technologies. Although they are one of the most versatile

Matthew Beau NychkaMatthew Beau Nychka Page Page 99 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 10: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

wireless communication sets on the market and coincidentally a very heavy-handed

solution to a simple problem, it was also one of the smallest and most economical

solutions.

The signal was sent from the TDK5101 ASK transmitter at 650MHz. Because the signal

itself, not the data, is the concern in this application we tie the data input high at power-

up of the circuit. The transmitter is a very low cost and power efficient device as detailed

further in section 4.

The receiver TDA5201 is where the solution turns out to be overkill. The receiver

contains a low noise amplifier, a double balanced mixer, a fully integrated VCO, a PLL

synthesizer, a crystal oscillator, a limiter with RSSI generator, a data filter, a data

comparator, and a peak detector. While we only use the RSSI generator to out put an

analog 0.8 to 2.8 Volt signal, the chip incorporates most of these features into calculating

the best-filtered RSSI possible.

3.2 Antennas

The greatest difficulty in our design was the choice of antennas to be used with either the

transmitter or receiver. For each side of our transmission, we required very different

behaviors from our antennas. Our choice in antennas is based upon five main

requirements [4]:

Gain/ Directivity

Pattern

Frequency

Polarization

Input Impedance

When looking over these criteria, we can choose our primary requirements to be pattern,

frequency, polarization, and input impedance. We will incorporate our gain requirements

into our need for specific radiation patterns. We choose not to concentrate on gain itself

specifically due to the short range this device will be used over.

Matthew Beau NychkaMatthew Beau Nychka Page Page 1010 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 11: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

For our project, we look specifically at designing our antennas around a 630MHz signal,

chosen after much research into availability and cost of transmitters and receivers. This

information is discussed in more detail in section 3.1 above. The importance of this in

regards to antenna calculations is that we have an effective wavelength of λ = 46.15cm.

The input impedance, as per the transmitter and receivers chosen was to be 50 Ohms for

optimal performance.

3.2.1 Transmitter Antenna

The transmitter antenna had a number of requirements. Due to the need for size and the

design goal of making a transmitter that would be reusable from disc to disc, we needed

to fit the transmitter with a small antenna that would fit within the casing. Focusing on

the criteria we had to choose our antenna by we realize the ideal pattern would be that of

an omni-directional antenna. The disc would need to radiate a signal 360 degrees around

it while it lies flat on the ground. The ideal azimuth (horizontal plane) pattern is shown

below:

Figure 1 - Vertical Dipole Azimuth Pattern

Matthew Beau NychkaMatthew Beau Nychka Page Page 1111 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 12: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

Due to the nature of the game it would be impossible to mount a vertical dipole, the

obvious choice for such a pattern, on the disc. We analyzed a number of alternatives in

our search for the right choice. Below I will discuss two to the options and the

conclusions reached.

We began with looking at the full wave loop antenna due to its almost isotropic response

when lying flat on the ground. The effective nulls in the transmitted signal run parallel to

the ground and should not adversely affect the user. Due to its construction, the loop

antenna is very easy to match as well. The full wave loop antenna would have a diameter

of 0.147 m or 14.7 cm and an effective gain of approximately 3.14dB over isotropic

performance.

Finally we studied the turnstile antenna[5]. Essentially, the turnstile antenna consists of

two folded dipoles perpendicular to each other. One dipole is connected to the main feed

line, the 50-Ohm line from the transmitter. Between the feed point of the first and second

folded dipole, we run a 1/4 wavelength (11.5cm) section to effect the required 90-degree

phase shift between the two dipoles. It is this phase shift that gives the turnstile its nearly

omni-directional pattern. The resulting pattern is a blunted circle with only a 1-dB

decrease from maximum gain along two of the flattened edges. We see the radiation

pattern below:

Figure 2 - Turnstile Antenna Azimuth Pattern

Matthew Beau NychkaMatthew Beau Nychka Page Page 1212 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 13: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

The chosen turnstile antenna radiates a near isotropic pattern and has an approximate gain

of 0.86dB less than isotropic performance. While we can note that the circular antenna

does have a better gain overall, our priority is to have a small antenna, and therefore a

small homing device.

We also note that the turnstile antenna has a horizontal polarization. Therefore, whatever

antenna is used for the receiver will need to be horizontally polarized as well.

3.2.2 Receiver/ Handheld Antenna

Our initial approach to designing the receiving antenna was to choose an antenna with a

narrow beam width in order to isolate the direction of the transmitted signal. Following

this rationale we invested a great deal of time into researching yagi, helical, parabolic,

horn, and microstrip antennas. However, due to either size or orientation within the

handheld device, each was rejected.

Yagis, parabolic, helical, and horn antennas, while they have a preferred pattern and

directivity, are far too large for our designed product. The microstrip antennas have two

unfortunate problems. They are most suitable when the maximum dimension of the

antenna is a quarter or half wavelength. With that in mind, using either patch antennas or

waveguides will lead to a bulky hand held device due to antenna orientation. As well,

due to dielectric loading, the operating frequencies of small transmitter/receiver systems

are typically restricted to bands above 800MHz, which would not work well with our

system. [6]

We investigated antennas used in other applications. The coast guard uses a dual

perpendicular full wave loop antenna to calculate exact directions of received signals.

However, while we could calculate exact direction by signal phase/comparison analysis

without moving the hand-held unit; the antenna, itself, would be far too large to

Matthew Beau NychkaMatthew Beau Nychka Page Page 1313 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 14: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

incorporate into a compact design and too expensive, as well as being out of the scope of

our project.

Noting that directionality in an antenna pattern was not going to work due to various

reasons we looked into the idea of using the nulls and reversing our calculations, which

brought us to our ideal solution. Using a half-wave dipole antenna, we could make a thin,

compact hand-held unit that would show a null when pointed directly at the receiver and

would output a high RSSI analog voltage when pointed any other direction. The only

hurdle from that point was to test the received signals and null-width to correctly output

the 0.8-2.8V RSSI to the visual display for the user. This is covered in more detail in

sections 3.3 and 3.4.

The one problem encountered with this approach is that if the user is standing no-where

near the transmitter, or facing directly away from it. The hand held display will show

display indicating that the user is pointing in the right direction. While this is a large

potential problem we must remember that the user will have a general idea of where the

disc landed and should not end up facing this predicament in any case.

3.3 Data Processing

The hand-held unit basically houses the brains of this homing system. The signal

strength is captured by the receiver, which then feeds it to a microcontroller. This

microcontroller is required to process the signal data and present it to the user in a useful

form.

We went through several stages in determining what sort of microcontroller to use in the

hand-held unit. As neither of us was familiar with microcontrollers other than the

Motorola 68HC11, we first started to conduct research on what our options were. From

the beginning we knew that we only needed something simple: we wouldn't need much

space for code, we would only need a few input/output pins, and there wasn't much in the

way of size constraints (most chips are much smaller than a 9V battery). The main

Matthew Beau NychkaMatthew Beau Nychka Page Page 1414 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 15: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

requirement that we kept an eye out for was A/D conversion capability, as we would

likely need that for analysis of the information gained from the receiver. Also, we

wanted to select a chip that we could easily acquire the necessary peripherals for (to

program it). Of course, price was a factor as well, as we desired to keep the components

as cheap as possible.

3.3.1 Microcontroller Options

After a great deal of online research and meetings with microcontroller experts, we

narrowed it down to three options. Internet research first led us to the PIC 12F675. This

microcontroller is quite cheap yet has A/D capabilities.

One microcontroller type that was recommended to us was the Atmel brand. The main

reason for this was that they were familiar with it and all software and equipment needed

for programming these chips was already in the Engineering Lab Wing. After some

research on these chips, it seemed that the AT90LS4433 was suitable for our needs at a

modest price.

A friend, a hobbyist in PIC programming, strongly recommended the PIC 16F876

microcontroller. He felt that it was our best option, as it is durable, small in size, and has

a small, easy-to-learn instruction set. As well, he would be able to help us set up our own

programmer for the PIC.

The following is a table that compares some of the more pertinent aspects of these chips:

Chip Package I/O Code A/D Cost ($US)PIC 12F675 dip 8 6 1k 4 Ch. 10 Bit 3.05AT90LS4433 dip 28 20 4k 6 Ch. 10 Bit 8.44PIC 16F876 dip 28 22 8k 5 Ch. 10-Bit 11.81

Table 1: Microcontroller Comparisons

Matthew Beau NychkaMatthew Beau Nychka Page Page 1515 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 16: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

We first decided that the 12F675 was probably not a good choice, since it only had 6 I/O

pins. As we had not yet decided what sort of visual display we'd implement, this number

of pins could easily turn out to be inadequate. In the end, we decided to go for the PIC

16F876. Even though it was more expensive than the Atmel chip, we felt that having the

knowledge of a friend at our disposal would be a great boon. Due to its popularity, there

are a lot of sample programs available on the internet to speed up the learning process.

As well, should we decide to expand upon the capabilities of the Homing Disc's

capabilities, the 16F876 would be able to accommodate us further.

3.3.2 The 16F876

PIC microcontrollers are a popular family of microcontrollers developed by Microchip

Technology. As mentioned already, the 16F876 is a fairly versatile chip and will be more

than adequate for our needs. It has a wide operating range, from 2.0 V to 5.5 V, which

will facilitate its coupling with the receiver.

Figure 3 : 16F876 Pin Diagram

Pin Name Pin# DescriptionMCLR'/VPP 1 Master Clear (Reset) input or programming voltage input. This

pin is an active low RESET to the device.AN0 2 Pin 0 of Port A. This pin will be initialized as the analog input for

our signal strength.VSS 8, 19 Ground reference for logic and I/O pins.

Matthew Beau NychkaMatthew Beau Nychka Page Page 1616 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 17: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

OSC1/CLKIN 9 Oscillator crystal input/external clock source input.OSC2/CLKOUT 10 Oscillator crystal output. Connects to crystal or resonator in

crystal oscillator mode.VDD 20 Positive supply for logic and I/O pins.RB0 - RB5 21-26 Port B is a bi-directional I/O port. These 6 pins will be designated as

output pins to control the LED display.

Table 2 : 16F876 Relevent Pinout Descriptions

3.3.3 PIC ProgrammerMicrocontrollers need to be programmed, so programmers must be purchased or built in

order to do this. After looking into our options, we decided it would be much cheaper to

build our own programmer. We were designed a schematic (Figure 4) to build a

controller for our PIC and purchased the necessary parts for it. Programming the PIC

involved connecting the serial connection to a Com port on the back of the computer.

Then MP Lab IDE, a software program intended for programming PICs, is used to

download code onto the microcontroller.

Figure 4 : PIC Programmer Circuit Design

Matthew Beau NychkaMatthew Beau Nychka Page Page 1717 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

16F876

Max 232

VoltageRegulator

Page 18: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

The extra microchip used in this programmer set-up is a Max 232. It is a driver/receiver

and acts as an interface between the PIC and the computer during programming.

3.3.4 The Code

The code that we needed to operate the hand-held was kept very simple. Once we

determined the exact nature of the input from the receiver, we knew we only needed to

read the data, process it, and output the result to our visual display (6 LEDs). All data

flow was in a single direction as indicated by figure 5.

Figure 5 : Handheld Data Flow Diagram

The code follows a very simple process of reading the signal strength and comparing the

digital representation of it to several pre-defined values. The microcontroller stays in a

continuous loop doing this. Since the signal strength is lowest when the hand-held is

pointing directly at the disc, this must correspond with all 6 LEDs being turned on.

Therefor, the code will turn on the LEDs as the signal strength decreases and shut them

off again as the signal gains strength. Note that the base LED will always be turned on

when the hand-held is operating. The entire algorithm is summarized in the following

pseudo-code:

; define parametersLEVEL0 equals 2.5 VoltsLEVEL1 equals 2.35 VLEVEL2 equals 2.2 VLEVEL3 equals 2.1 V

Matthew Beau NychkaMatthew Beau Nychka Page Page 1818 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Receiver DisplayProcess Signal

Send signalStrength

ActivateLEDs

Page 19: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

LEVEL4 equals 2.0 V

LOOP1Turn off the 2nd LED

LOOP2Turn off the 3rd LED

LOOP3Turn off the 4th LED

LOOP4Turn off the 5th LED

LOOP5Turn off the 6th LED

LOOP6STRENGTH = signal strength from receiverif (STRENGTH < LEVEL0)

Turn on LED #2else

GOTO LOOP1if (STRENGTH > LEVEL3)

Turn on LED #3else

GOTO LOOP2if (STRENGTH > LEVEL2)

Turn on LED #4else

GOTO LOOP3if (STRENGTH > LEVEL1)

Turn on LED #5else

GOTO LOOP4if (STRENGTH > LEVEL0)

Turn on LED #6else

GOTO LOOP5GOTO LOOP6

Originally, our PIC was programmed to read the signal strength and turn on LEDs as the

signal showed itself to be strong. However, due to RF reflection and scattering in the

signal over such a short-range [7], we typically received a stronger signal than we should

have. Because of this, we decided upon a new antenna set-up, as described in section

3.2.2. We then re-programmed the microcontroller to reflect the change. See Appendix

A for final source code.

Matthew Beau NychkaMatthew Beau Nychka Page Page 1919 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 20: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

The A/D converter changes the analog input to a value relative to VDD. With the receiver

sending a voltage from 0.8V to 2.8V to the microcontroller, we had to designate which

values would correspond to which LEDs. Once the divisions were made, the binary

values for these voltages had to be calculated for use in code. We did this by first

dividing the boundary voltages by the reference voltage (5V). We then multiplied these

results by 255 (the maximum value for 8 bits). The results, once rounded and converted

to binary, became our binary boundary values. Note that the A/D converter is 10 bits; it

was easiest in terms of programming to simply drop the lowest two bits and work with an

8-bit number. The error resulting from this is insignificant (the maximum error would be

for our lowest signal value - 0.8V - and this gives approximately a 0.39% error).

Voltage Range # LEDs On Boundary Voltage Boundary Voltage /

Reference Voltage (5V)

Ratio times 255 then

converted to binary

2.5 - 2.8 V 1 n/a n/a n/a

2.35 - 2.5 V 2 2.5 0.5 1010110

2.2 - 2.35 V 3 2.35 0.47 01111000

2.1 - 2.2 V 4 2.2 0.44 01110000

2.0 - 2.1 V 5 2.1 0.42 01101011

0.0 - 2.0 V 6 2.0 0.4 01100110

Table 3 : Voltage Ranges for LEDs

3.4 Visual Output

The results from the microcontroller needed to be displayed to the user in some form. In

the beginning, we contemplated using an analog display, an LCD, or simple LEDs. Due

to time and budgetary constraints, we felt that it would be best to start off with the

simplest display. Six LEDs were then incorporated into our hand-held design (please

refer to Figure 6 below).

Matthew Beau NychkaMatthew Beau Nychka Page Page 2020 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 21: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

Figure 6 - Hand Held Signal Strength Indicator

These LEDs will be turned on or off according to the signal strength picked up by the

receiver. Refer to section 3.3.4 (Table 3 above) to see what values were designated for

each LED.

3.5 Transmitter and Handheld Casings

The majority of the constraints involved in this project are applicable more to the

transmitting side of this pair of devices. The four main goals regarding the casings were

to make them:

water and dust-proof,

easily accessible to change batteries,

shock resistant,

aerodynamic, and

easy to move from one disc to another

In order to keep the beacon water and dust resistant, it is sealed completely. The on/off

switch is a reed switch, turned on by a small magnet that is attached to the base of the

hand-held unit. The only opening on either device will be for the batteries. The 3 volt

battery in the beacon is accessable by using a coin or other similar object to open or close

the compartment where the coin is stored. This will be sealed with a simple O-ring. The

beacon is shock resistant due to the extremely tight specifications in the plastic moulding

around the components, allowing no movement, banging, or bumping.

Matthew Beau NychkaMatthew Beau Nychka Page Page 2121 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 22: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

By making the beacon as small as possible, the size and weight are kept down, and

therefore, the aerodynamics of the original product are unaffected by the beacon. The

schematic of the transmitter is shown in Figure 7 below:

Figure 7 - Basic Transmitter Circuit Diagram

We can note that this figure is not at all to scale and quite a bit larger than the device

would be. The largest dimension in the design is the antenna itself, measuring 11.5 cm

across at its largest. The largest component is the battery, which is as large as the rest of

it put together.

The beacons are interchangable due to the construction of the plastic moulding. The

combination of the sticky substance on the flat of the beacon and the tiny metal barbs will

allow the user to attach it to any disc.

As mentioned above, the hand-held unit does not need to stand up to the rigors that the

beacon will need to endure, but it is important that it can tolerate some abuse as it’s not at

all strange to see a disc golfer climbing a cliff mid-game. A disc golfer traversing rugged

courses also does not want a bulky contraption to carry around.

Matthew Beau NychkaMatthew Beau Nychka Page Page 2222 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 23: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

To solve these concerns, first, the hand-held unit is sealed except for in two spots. The

end of the unit (sketched in Figure 6 above) is accessable for replacement of the 9 volt

battery and there will be a small on/off switch on the side of the device.

Secondly, our design for the hand-held kept the need for a small size in mind, leaving the

golfer with nothing to carry but a device the size of an average candy bar. As with the

transmitter, the largest dimension of the hand-held receiver is the 23cm dipole antenna, as

shown in the figure 6 above.

Figure 8 - Basic Receiver Circuit Diagram

The hand-held unit also had to be small. A disc golfer traversing rugged courses would

not want a bulky contraption to carry around. Our design for the hand-held kept this

important constraint in mind, leaving the golfer with nothing to carry but a device the size

of an average candy bar. As with the transmitter, the largest dimension of the hand-held

receiver is the 23cm dipole antenna, as shown in the figure 8 above.

Matthew Beau NychkaMatthew Beau Nychka Page Page 2323 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 24: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

4.Project Analysis

4.1 Power Analysis

As analyzed above, in section 2.4, we would like our homing beacon to run at

approximately 11.25mA on average in order to have it outlive the average golf disc.

Looking at the breakdown in current draws from the parts used in the existing circuit, we

see the following:

Component Power On Power off

D-Type Flip Flop 11 μA 11 μA

TDA5101 Transmitter 7 mA 0.3 nA

Dual NAND Gate Debouncer 1.1 μA 1.1 μA

Total ≈7.012mA ≈12.1μA

Table 4: Current Draws of Primary Components Within Homing Beacon

We see that the current draws from the added components, running at 3V, add up to near

7.012 mA when the device is turned on. This will allow the user to have at most 27.1

hours of continuous use. If the disc remains off, the battery will last 15702 hours or 654

days in a powered down state.

We see that this is a very reasonable expectation of the product and can conclude that

from a power efficiency standpoint, it has superior performance.

The hand-held device is much easier to deal with. As its requirements are not nearly as

stringent in terms of size or power efficiency, we have a number of options to provide it

with an acceptable power source. The two major components in the hand-held receiver

are the PIC microcontroller and the receiver, each requiring 3 and 5V respectively. The

Matthew Beau NychkaMatthew Beau Nychka Page Page 2424 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 25: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

best solution for this is to use a simple, commercially available 9-volt battery. These

have a long life and are very easy to replace.

4.2 Cost Analysis

A major consideration as to whether or not this is a marketable product is the cost

analysis. As mentioned above, a reasonable price for the product is approximately $20

CAD. We can view our major component costs as the primary expenses due to the fact

that small components such as resistors, capacitors, inductors and production costs can be

done for pennies once start-up costs have been taken care of. We see the breakdown of

primary component costs below.

Component Cost ($CAD)

Single

Cost ($CAD)

Bulk

PIC 16F876 Micro-controller 10.73 6.85

TDA5101 Transmitter 3.43 2.80

TDA5201 Receiver 5.98 4.88

Reed Switch 1.19 0.44

Single D-type Flip Flop 0.63 0.23

3V Coin Cell Battery 0.66 0.32

Ceramic IF Filter 2.01 0.85

10MHz Crystal Oscillator 1.38 0.54

9.8438MHz Crystal Oscillator 2.86 1.72

3.58 MHz Ceramic Resonator 0.79 0.37

9V Battery 3.10 1.19

Total parts cost: 20.19

Table 5: Costs ($CAD) of Primary Components Within Homing Beacon

Matthew Beau NychkaMatthew Beau Nychka Page Page 2525 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 26: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

We see that our costs are over our target costs by a fair amount and can conclude that

while the product is power efficient, without some significant changes to our design and

components used, the product is not marketable.

4.3 Problems Encountered

While it was a major aspect of our project to build the smallest, least obtrusive, solution

to our problem, it was also our downfall. With the equipment available to us in the UVic

labs, we were not able to complete the prototype on a printed circuit board (PCB). This

in itself is not a problem, but due to the methods used to prepare a working prototype on a

breadboard, we faced one very large obstacle. Using the breadboards, necessary wiring,

and soldering lead wires into the vias in the adapter PCBs increased the impedances

within the circuit and led to unfavorable reactions from the receiver and transmitter.

Such problems would be avoided moving the prototype from a breadboard setting to a

properly laid out PCB.

Another problem we faced, however within our control it was, was the side effects that

came from using a high frequency signal. Using a radio frequency (RF) as large as

650MHz we were able to make our antennas smaller, but had to sacrifice directivity of

our signal. As we see in the following equation from [8], the directivity is directly related

inversely to frequency squared

D = 2ka + (ka)^2

= 4πa/λ + (2πa/λ)^2

α 1/ f^2

where a is the radius of the antenna.

On the transmitter side, this is not a bad thing as it helps us achieve a more isotropic RF

pattern. However, on the receiver side we would like to have a clear distinction between

the areas where the signal is strong and where the loss is complete. With this lack of

Matthew Beau NychkaMatthew Beau Nychka Page Page 2626 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 27: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

directivity due to high frequency and small antenna size it complicates our signal strength

processing as was described in more detail within section 3.3.

Matthew Beau NychkaMatthew Beau Nychka Page Page 2727 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 28: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

5.Conclusions

After coming to several dead-ends during our research, design, and implementation of

this project, we feel that we have developed a fairly good product. In the end, we chose

to go with a receiver and transmitter operating at 650 MHz to drop the antenna size. After

a great deal of research, we decided to use a turnstile antenna with folded dipoles for the

transmitter due to its resulting omnidirectional radiation pattern. We chose a dipole

antenna for the receiver, because of its omnidirectional coverage, but counted on reading

for the transmitter by lack of signal, using the nulls in the received signal. The

microcontroller we used is the PIC 16F876 which more than adequately met our

processing needs in the hand-held device.

Our final design is quite power efficient, small, aerodynamic, and strong meeting most of

our objectives. Unfortunately, the cost of the components altogether would be

prohibitive to trying to market the Homing Disc as a product. Continue our work from

here, we will next look at ways to reduce the cost, the first act being to replace the

microcontroller with one that is cheaper. Perhaps we could replace other parts with

cheaper alternatives if given the time.

Overall this project has been a great learning experience for the two of us. Not only have

we learned and applied specific technical knowledge that we weren't previously familiar

with, but we have learned a great deal what is involved in project management.

Matthew Beau NychkaMatthew Beau Nychka Page Page 2828 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 29: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

6.Cited References

[1] Lynx Technologies, “LC Series Receiver Modules”, 2003, Available HTTP:

http://www.linxtechnologies.com/ldocs/pdfs/lcsreceivdg.pdf

[2] Radiometrix, “UHF FM Receiver Module with RSSI”, July 2003, Available

HTTP: http://www.radiometrix.co.uk/products/rx2a.htm

[3] Infineon Technologies, “Infineon Technologies Wireless Controls”, July 2003,

Available HTTP: http://www.infineon.com/cgi/ecrm.dll/ecrm/scripts/prod_cat.jsp?oid=-

9470

[4] R. Karumudi, private communication, 2003.

[5] L.B. Cebik, W4RNL, “The Turnstile Antenna on 10”, December 2001, Available

HTTP: http://www.cebik.com/a10/ant34.html

[6] K. Siwiak, “Radiowave Propagation and Antennas for Personal

Communications”, Norwood, MA, pp. 237: Artech House, 1995.

[7] D. Djonin, private communication, 2003.

[8] University of St. Andrews, “Directionality and Gain”, 2003, Available HTTP:

http://www.st-andrews.ac.uk/~www_pa/Scots_Guide/RadCom/part6/page2.html.

Matthew Beau NychkaMatthew Beau Nychka Page Page 2929 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 30: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

7.References

Analytical Graphics, Inc., “Antenna Beam Types and Antenna Polarization”, May 1996,

Available HTTP: http://www.stk.com/resources/help/help/stk43/comm/CommRadar03-

02.htm#AntPolType

C. Balanis, Antenna Theory: Analysis and Design, New York: chapter 4, Wiley 1982.

Colorado Geographical Survey, ‘Summary of the Avalanche Beacon Test”, December

1998, Available HTTP:

http://geosurvey.state.co.us/avalanche/transceivers/LVS98/LVS98_summary.html

Digikey.com, Product Information and private communication, 2003, Available HTTP:

http://dkc1.digikey.com/ca/digihome.html

Infineon Technologies, “Infineon Technologies Wireless Controls”, July 2003, Available

HTTP: http://www.infineon.com/cgi/ecrm.dll/ecrm/scripts/prod_cat.jsp?oid=-9470D.

Jefferies, University of Surrey, “Antennas”, 2003, Available HTTP:

http://www.ee.surrey.ac.uk/Personal/D.Jefferies/antennas.html

R. Johnson, “Antenna Engineering Handbook”, 3rd ed., New York: McGraw-Hill, 1993.

Laboratory Manual for Elec 404: Microwave and Fiber Optics, UVic, Feb. 2002.

Lynx Technologies, “Antennas: Design, Application, Performance Notes”, July 1998,

Available HTTP: http://www.linxtechnologies.com/ldocs/zips/APNOTPDF.ZIP

MG Chemicals, “Positive Photo-fabrication Process Instructions”, 2003, Available

HTTP: http://www.mgchemicals.com/techsupport/photo_inst.html

Maxim/ Dallas Semiconductor, “Designing Remote Keyless Entry (RKE) Systems”,

2003, Available HTTP:

http://www.maxim-ic.com/appnotes.cfm/appnote_number/1773/ln/en

Matthew Beau NychkaMatthew Beau Nychka Page Page 3030 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 31: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

The Millennium Education Group, “Antenna Systems”, 1998, Available HTTP:

http://www.tmeg.com/tutorials/antennas/antennas.htm

Dr. N. K. Nikolova, McMaster University, “Modern Antennas in Wireless Applications”,

Jan. 2002, Apr. 2003, Available HTTP:

http://www.ece.mcmaster.ca/faculty/georgieva/antenna_dload/

Omega Research Ltd., “Prototyping Surface Mount (SMD) adapters”, 2003, Available

HTTP: http://www.omega-research.co.uk/

D. M. Pozar, “A Review of Aperture Coupled Microstrip Antennas: History, Operation,

Development and Applications”, May 1996, Available HTTP:

http://www.ecs.umass.edu/ece/pozar/aperture.pdf

D. M. Pozar, Microwave Engineering, 2nd ed., Crawfordsville: John Wiley & Sons, Inc.,

1998

Radiometrix, “UHF FM Receiver Module with RSSI”, July 2003, Available HTTP:

http://www.radiometrix.co.uk/products/rx2a.htm

T.S. Rappaport, Wireless Communications, Principles and Practice, 2nd ed., Upper

Saddle River: Prentice Hall PTR, 2002

Reed Switch Developments Corp., “Bare Reeds and Magnets”, 2003, Available HTTP:

http://www.reedswitchdevelopments.com/

K. Siwiak, Radiowave Propagation and Antennas for Personal Communications,

Norwood, MA: Artech House, 1995.

University of St. Andrews, “Directionality and Gain”, 2003, Available HTTP:

http://www.st-andrews.ac.uk/~www_pa/Scots_Guide/RadCom/part6/page2.html

Wireless World, Aerocomm Inc., “Antenna Tutorial”, 2000, Available HTTP:

http://www.awirelessworld.ch/appnotes/aerocomm/ant-tut.pdf

L.B. Cebik, W4RNL, “The Turnstile Antenna on 10”, December 2001, Available HTTP:

http://www.cebik.com/a10/ant34.html

Matthew Beau NychkaMatthew Beau Nychka Page Page 3131 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 32: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

Appendix A: PIC Code

;--------------------------------------------------------------------;; SHOWSIGNAL.ASM Reads an analogue signal and displays its ;; strength on LEDs ;; (some of this code grabbed from ftp.microchip.com) ;;--------------------------------------------------------------------;

list p=16f876 ; list directive to define processor #include <p16f876.inc> ; processor specific variable definitions ERRORLEVEL -224 ; suppress annoying message because of tris __CONFIG _CP_OFF & _WDT_ON & _BODEN_ON & _PWRTE_ON & _RC_OSC & _WRT_ENABLE_ON & _LVP_ON & _CPD_OFF

;--------------------------------------------------------------------;; Define the values that measure the different levels of ;; signal strength. ;;--------------------------------------------------------------------;

LEVEL0 EQU 10101101b ; 1 LED, 2.5V LEVEL1 EQU 01111000b ; 2 LEDs, 2.35V LEVEL2 EQU 01110000b ; 3 LEDs, 2.2V LEVEL3 EQU 01101011b ; 4 LEDs, 2.1V LEVEL4 EQU 01100110b ; 5 LEDs, 2.0V

ORG 0 ; start at program memory location zero

;--------------------------------------------------------------------;; Set up 6 pins of PORT B to act as output (to the LEDs) ;; and turn all of them initially on. ;;--------------------------------------------------------------------; movlw B'11000000' tris PORTB ; Set 6 lower bits of PORT B as outputs movlw B'00111111' movwf PORTB ; Turn on all 6 LEDs (start-up flash)

;--------------------------------------------------------------------;; Initialize the A/D converter ;;--------------------------------------------------------------------;

clrf ADCON1 ; clear ADCON1 (AN0-4 set to analogue input ; Vref+ is Vdd and Vref- is Vss)

;--------------------------------------------------------------------;; Turn off any LEDs that should not be on ;;--------------------------------------------------------------------;

Begin1 bcf PORTB, 1 ; Clear the 2nd LEDBegin2 bcf PORTB, 2 ; Clear the 3rd LEDBegin3 bcf PORTB, 3 ; Clear the 4th LEDBegin4

Matthew Beau NychkaMatthew Beau Nychka Page Page 3232 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 33: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

bcf PORTB, 4 ; Clear the 5th LEDBegin5 bcf PORTB, 5 ; Clear the 6th LEDBegin6

;--------------------------------------------------------------------;; Begin A/D conversion ;;--------------------------------------------------------------------;

bsf ADCON0,GO ; Start A/D conversionWait btfsc ADCON0,GO ; Wait for the conversion to complete goto Wait

;--------------------------------------------------------------------;; Compare the measured signal strength to predetermined values ;; to determine how many LEDs to light up. ;;--------------------------------------------------------------------;

movf ADRESH, W ; Put signal strength into working register sublw LEVEL0 btfss STATUS, C ; If carry bit in status register is 1, ; then the signal strength < LEVEL0 goto Begin1 bsf PORTB, 1 ; Light up the second LED

movf ADRESH, W ; Put signal strength into working register sublw LEVEL1 btfss STATUS, C ; If carry bit in status register is 0, ; then the signal strength < LEVEL1 goto Begin2 bsf PORTB, 2 ; Light up the third LED

movf ADRESH, W ; Put signal strength into working register sublw LEVEL2 btfss STATUS, C ; If carry bit in status register is 0, ; then the signal strength < LEVEL2 goto Begin3 bsf PORTB, 3 ; Light up the fourth LED

movf ADRESH, W ; Put signal strength into working register sublw LEVEL3 btfss STATUS, C ; If carry bit in status register is 0, ; then the signal strength < LEVEL3 goto Begin4 bsf PORTB, 4 ; Light up the fifth LED

movf ADRESH, W ; Put signal strength into working register sublw LEVEL4 btfss STATUS, C ; If carry bit in status register is 0, ; then the signal strength < LEVEL4 goto Begin5 bsf PORTB, 5 ; Light up the sixth LED

goto Begin6

end ; end of program

Matthew Beau NychkaMatthew Beau Nychka Page Page 3333 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg

Page 34: 1 Introduction - UVic.caelec499/2003a/group13/docs/Final... · Web viewThe antenna used by the transmitter is a turnstile antenna with folded dipoles to have an omnidirectional radiation

Ricochet TechnologiesRicochet Technologies The Homing DiscThe Homing Disc

Matthew Beau NychkaMatthew Beau Nychka Page Page 3434 of 34 of 34 Niilo Van SteinburgNiilo Van Steinburg