EE 477 Final Report - Purdue University



ECE 477 Final Report

Spring 2004

Team Code Name: ______Spacely’s Sprokets ______________________ Team ID: ______

Team Members (#1 is Team Leader):

#1: Tyler Olsen Signature: ____________________ Date: _________

#2: Nick McCarroll Signature: ____________________ Date: _________

#3: Phil Vorsilak Signature: ____________________ Date: _________

#4: Gennady Vayl Signature: ____________________ Date: _________

REPORT EVALUATION

|Component/Criterion |Score |Multiplier |Points |

|Abstract |0 1 2 3 4 5 6 7 8 9 10 |X 1 | |

|Project Overview and Block Diagram |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Team Success Criteria/Fulfillment |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Constraint Analysis/Component Selection |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Patent Liability Analysis |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Reliability and Safety Analysis |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Ethical/Environmental Impact Analysis |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Packaging Design Considerations |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Schematic Design Considerations |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|PCB Layout Design Considerations |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Software Design Considerations |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Version 2 Changes |0 1 2 3 4 5 6 7 8 9 10 |X 1 | |

|Summary and Conclusions |0 1 2 3 4 5 6 7 8 9 10 |X 1 | |

|References |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Appendix A: Individual Contributions |0 1 2 3 4 5 6 7 8 9 10 |X 4 | |

|Appendix B: Packaging |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Appendix C: Schematic |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Appendix D: Top & Bottom Copper |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Appendix E: Parts List Spreadsheet |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Appendix F: Software Listing |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Appendix G: User Manual |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Appendix H: FMECA Worksheet |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Technical Writing Style |0 1 2 3 4 5 6 7 8 9 10 |X 5 | |

|CD-R of Website Image |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

| |TOTAL | |

TABLE OF CONTENTS

|Abstract |4 |

| 1.0 Project Overview and Block Diagram |4 |

| 2.0 Team Success Criteria and Fulfillment |8 |

| 3.0 Constraint Analysis and Component Selection |9 |

| 4.0 Patent Liability Analysis |13 |

| 5.0 Reliability and Safety Analysis |21 |

| 6.0 Ethical and Environmental Impact Analysis |29 |

| 7.0 Packaging Design Considerations |35 |

| 8.0 Schematic Design Considerations |41 |

| 9.0 PCB Layout Design Considerations |47 |

|10.0 Software Design Considerations |50 |

|11.0 Version 2 Changes |61 |

|12.0 Summary and Conclusions |62 |

|13.0 References |63 |

|Appendix A: Individual Contributions |A-1 |

|Appendix B: Packaging |B-1 |

|Appendix C: Schematic |C-1 |

|Appendix D: PCB Layout Top and Bottom Copper |D-1 |

|Appendix E: Parts List Spreadsheet |E-1 |

|Appendix F: Software Listing |F-1 |

|Appendix G: User Manual |G-1 |

|Appendix H: FMECA Worksheet |H-1 |

Abstract

We designed and built a global positioning satellite (GPS) Personal Trainer. The user will be able to input workout data to monitor, view global position, and view previously completed workouts. The device will provide the user with real-time data on the user’s performance as well as keeping an exercise history stored in memory. The design was completed over a fifteen week period. The major flaws in the design include inadequate power supplies, which prevented us from testing our GPS communication, and insufficient flash memory size for the stored program.

1. Project Overview and Block Diagram

The GPS Personal Trainer will allow a user to input how far they wish to go, how long they wish to exercise, and what their minimum heart rate should be. The device will provide the user with real-time data on the user’s elapsed time, total distance, current heart rate, and current mile pace. It will also automatically store an exercise history so the user can view the last twenty six workouts that he or she completed.

The GPS Personal Trainer is broken up into three different parts: the chest unit, the shoulder unit, and the wrist unit. The chest unit is comprised of a commercially available heart rate transmitter, the Polar T-31, which transmits a 5 KHz signal, and a heart rate antenna, which picks up the transmitted signal and sends it to the shoulder unit. The antenna needs to be attached to the transmitter in order to function correctly, and the transmitter is attached to the user’s chest. The chest unit is connected via a 2-wire cable to the shoulder unit. The shoulder unit contains the heart rate signal processing circuitry, as well as the GPS sensor and antenna, the batteries required for the power supply, and the printed circuit board (PCB) containing the microcontroller. The shoulder unit sits on the user’s upper arm, with an 8-wire cable connecting it to the wrist unit. The wrist unit provides the interface to the user and is located on the user’s wrist. It contains the LCD screen, the RPG and the push button. The block diagram in Figure 1-1 better illustrates this concept.

Figure 1-1. Block Diagram

[pic]

Figure 1-2. Chest Unit (above) and Shoulder Unit (below)

[pic]

Figure 1-3. Wrist Unit

2. Team Success Criteria and Fulfillment

1. Ability to interpret data from GPS unit

Assessment: Due to problems in the power supply during the final phases of the project, we were unable to test our GPS driver routines. Because of this we failed to meet this success criterion.

2. Ability to detect and measure heart rate

Assessment: As demonstrated in the demonstration video, we successfully measured the heart rate of the user. Due to the “bouncy” nature of this signal however, our reading may not have been entirely accurate but was still within a reasonable estimation of the user’s real heart rate. We succeeded in meeting this design criterion.

3. Ability to successfully accept user input

Assessment: Using the RPG and push button we successfully entered workout data as demonstrated in our presentation video. We succeeded in meeting this design criterion.

4. Ability to interface to an LCD and have successful output

Assessment: As demonstrated during the “stopwatch” operation of our device in the video, we successfully displayed time, distance, pace, and heart rate data to the user. We succeeded in meeting this design criterion.

5. Ability to store and retrieve workout and history information from non-volatile memory.

Assessment: We were able to save workout data and retrieve it successfully. The only conflict was that exercise history saving requires getting the current date and time from the GPS satellites. Since we were unable to communicate with the GPS satellite networking as stated in the first criterion, we had to enter this data manually. However, we still feel we successfully demonstrated this criterion.

Constraint Analysis and Component Selection

Introduction

This design project proposes to use a global positioning system (GPS) as an aid to personal training. Keeping track of how far and how long the runner and/or biker has traveled, they can easily monitor exactly how much they have worked out, and to see how well they have done. In addition to monitoring the simple racing statistics, this design has a wireless heart monitor as feedback to the user, and possibly a digital thermometer. The user can also choose from a selection of built in preprogrammed distances to run through an on-screen menu and input device. All of these devices will have to be as small as possible, not being to bulky as to get in the way of a runner, and use as little power as possible, for longer distance and endurance applications. This can provide the user a very useful tool in training, perhaps for marathon use.

Analysis

With all the data supplied by the GPS, there will not be a huge amount of calculation needed. The biggest calculations require the “Great Circle Distance Formula”[12]. This gives a detailed number for the distance traveled from the latitude and longitude data collected from the GPS receiver. However, a considerable part may be to convert all of the units into the common US standard units. In the middle of a program, a progress monitor will display if the user is ahead or behind of a desired time limit, and calculate the percentage difference. An additional feature includes the heart rate monitor which will calculate the user’s current pulse. This also will compare the current heart rate to a specified input, and tell the user whether or not they are above or below the desired pulse.

The interfacing between all of the components has been kept to a bare minimum to try to keep the size of the device as small as possible. Using CMOS signals for the design keeps the interfacing between components very simple and keeps the amount of hardware down by not needing any voltage translators. Keeping the idea of not using extra board space, a rotary pulse generator is going to be used for the user input as a rotary dial for different options with a push button as a selector. The heart rate monitor is going to be strapped to the user’s chest, so a wireless device will keep the runner from feeling too tethered and be more comfortable for the user. The speaker, the only other output device will be made from a PWM output and a digital-to-analog converter as feedback to the user. These last two parts of the circuit, pulse receiver and D/A converter may take up the most space, but will not make the device to big to wear.

Being a portable device, power consumption has a vital role in the design of this product. Every chip chosen has been a low power device and chosen to run at a voltage as low as possible. At the same time, most of the devices chosen should be able to run at 3.0V, except for the display. The LCD display requires a 5.0V regulated power supply, and it will use about 200mW of power[6]. Only the GPS receiver will draw more power than this, due to the active antenna, where it will draw about 280mW nominally[1]. The microcontroller however, being that it can be clocked down, and at a lower supply voltage will only draw about 10mW of power[4]. The power consumption of the heart rate circuitry is still approximate, but after testing, the current drawn was approximately 250mA total, right near then typical output of the step-up voltage regulators[17].

Again, as a device that is to be worn by an athlete, size is of utmost consideration. Weight will not play too much of a factor, most of the parts only weigh a couple of ounces at most. The size of the unit will in the end be determined by the packaging, but a two part device will serve the user the best retaining the most mobility and being as ergonomic as possible. The heart monitor will be a strap that wraps around the users chest, which transmits to the main unit which will be on the upper arm. This part of the device will house the GPS receiver, heart rate receiver, speaker and the micro controller. The second part will be just the display and user input device which will be attached to the user’s wrist or forearm.

The total cost of the unit, mainly caused from the price of a single GPS receiver would be under $200. The Garmin 15 GPS receiver is $90, the heart rate monitor is $40, LCD display is $13.25, and the microprocessor is $4.50. And in addition, the antenna for the GPS will be about $20. The total cost, not counting the simple receiver circuitry will be about $168. This was a value that was within the expectations of the group. If this unit was in full production, and all components could be bought in bulk, the selling price could easily be between $100 and $150, which is presently the cost for many GPS devices similar to this on the market now.

Component Selection

Of the components in this design, the three main components that needed to be chosen were the micro controller, GPS receiver, and the LCD display. For the micro controller, the three viable candidates that the group came up with were the Atmel ATtiny26L[4] and ATmega8L[3], and the PIC16LF747[7]. All of these micro controllers were low power devices. The PIC stood above the rest with an astounding .2mW power consumption. The Atmels were not far behind where the tiny consumed 2.1mW and the mega controller consumed 10.8mW. These numbers are probably high compared to what will be consumed on our unit, because we will not clock them at the highest speed. The tiny Atmel chip has the advantage of taking up less board space, yet providing all the same functions. However the Atmel mega version provided the best all around features with many more port pins available with all the needed peripherals. Also if any more port pins would be needed, this will allow us some breathing room for worst case scenarios.

The GPS units were very abundant, and there were many from which to choose. The units for consideration were the Garmin GPS 15[1], µ-Blox[3] , and the Tyco A1025[2]. Again, these are all low power devices, and the all have the option for active antennas. Size was a big consideration, the µ-Blox unit measured to be 2.8”x 1.6” in area and came with a 2x20 pin header for easy connection. The Garmin GPS 15-W, along with its great reputation, measures 1.4”x 1.8” and has a header of pins that are more readily accessible for prototyping. And the Tyco A1025 measures 1.2”x 1.2”, and has a surface mount package, which will make the end product fit easier. The Garmin unit only uses about 250mW power, while the µ-Blox and the Tyco unit can consume up to 500mW power, nominally. Knowing Garmin’s reputation with GPS modules, using the least power, and costing relatively less than the µ-Blox, the GPS 15-W’s benefits far outweighed the other two GPS receivers.

For the units LCD output, size and interfacing were two big issues. Three different sizes were considered: 2x16, 2x20 and 4x16. It was agreed that the 2x20 and the 4x16 could display more information to the user, but it was the ease of connection and small size that determined our choice. The 2x16 display by Images SI[6], Inc was chosen because it can accept true CMOS signals serially, and it was only 3.1”by 1.4”.

3. Patent Liability Analysis

Introduction

The GPS Personal Trainer will be a fitness device mainly intended for use during outdoor excursions, such as running or cycling long distances. It will be able to keep track of the user’s location and determine the distance traveled and the user’s speed via a global positioning system receiver. The device will include a heart rate monitor strapped to the user’s chest which communicates wirelessly with the base unit. With input from the user such as the distance desired to travel and the time in which to do it in, the GPS Personal Trainer will be able to notify the user whether he or she is traveling too fast or too slow.

During the design process, a close look at patent liability should be performed. To avoid financial repercussions if the GPS Personal Trainer was marketed, it would be desirable to have no patent infringement. Currently there are several products on the market that perform substantially the same function as the GPS Personal Trainer, so careful scrutiny of these products’ patents is needed.

Patent Search Results

There are at least two products on the market similar to the GPS Personal Trainer. The first one is the Timex BodyLink System T59551 ([25] and [27]) pictured in Figure 4-1.

Figure 4-1: Timex BodyLink System T59551.

The heart rate transmitter is strapped to the user’s chest while the GPS receiver is strapped to the user’s upper arm. The GPS sensor is provided Garmin [26], the same company providing the GPS sensor for the Personal Trainer. The BodyLink system contains many of the same functions provided by the GPS Personal Trainer, such as current speed, distance traveled, and the user’s heart rate. Fortunately no patent has been filed with the US Patent and Trademark Office (USPTO) [31].

Another product similar to the GPS Personal Trainer is the Garmin Forerunner 201 ([29] and [30]) pictured in Figure 4-2. It is contained in only one unit sitting on the wrist, and it also performs speed and distance calculations. It does not track the user’s heart rate however. This product also does not have a patent on file with the USPTO.

Figure 4-2: Garmin Forerunner 201.

The above two products are very similar to the GPS Personal Trainer, and if they had patents protecting them the design of GPS Personal Trainer would be in serious trouble. The following two products have patents and implement some of the functions of the GPS Personal Trainer, but they are not as similar to it as two products above are. Both were invented by William R. Fry.

The first product is a portable physiological monitor including body-part-encircling GPS antenna and is protected by US Patent 6,685,634 [32]. The abstract states:

A portable unit provides location-related data and physiological information to a person. The preferred embodiment includes a GPS receiver, a physiological sensor receiver, a computation unit to determine location-related data from the GPS receiver and a physiological condition from the physiological sensor, and a GPS antenna configured to encircle a body part of the user. As examples, a chest strap, wrist strap, or head strap may carry at least a part of the antenna. The physiological sensor may be a heart rate sensor, an electrocardiograph sensor, or other physiological sensor. The electronics associated with the data processor, GPS receiver or physiological sensor may be contained in an enclosure separate from the antenna, or such components may be built into the body-part-encircling antenna portion.

From the abstract it appears as though it performs “substantially the same function” in “substantially the same way” as the GPS Personal Trainer.

The second product is a sports computer with GPS receiver and performance tracking capabilities and is protected by US Patent 6,463,385 [33]. Its abstract says:

A sports computer having an integral global satellite positioning (GPS) receiver and computer interfacing capability enables functional and/or performance characteristics to be tracked and analyzed as a function of geographical position and/or elevation. The computer includes a mount and/or interfaces to one or more sensors to measure operational and/or physiological parameters such as heart rate, or weather conditions such as temperature. Stored geographical and sensor parameters may be downloaded to an external personal computer so that the data collected during a workout may be reviewed and analyzed on the screen of the PC. Preferably, map data may also be stored enabling the collected data to be viewed relative to the map information, for example, in superposition.

This also appears to perform “substantially the same function” in “substantially the same way” as the GPS Personal Trainer.

Patent Liability Analysis

Literal Infringement

At first glance it would seem that the GPS Personal Trainer literally infringes upon US Patent 6,685,634. In other words, it performs “exactly the same function” in “exactly the same way”. However, upon closer inspection of the individual claims, literal infringement does not pose a problem. Following are some of the claims:

1. A portable unit for providing location-related data and physiological information to a person, comprising: a housing; a GPS receiver, contained within the housing; a physiological sensor receiver, contained within the housing and operable to receive a sensor signal from a physiological sensor; a computation unit, contained within the housing, wherein the computation unit is adapted to determine location-related data from GPS data provided by the GPS receiver, and to determine a physiological condition from physiological data provided by the physiological sensor; and an antenna, in electrical communication with the GPS receiver, adapted to encircle a body part of the person.

3. The portable unit of claim 1, wherein the physiological sensor is a heart rate sensor.

7. The portable unit of claim 1, wherein the antenna is also in electrical communication with the physiological sensor receiver.

12. A portable unit for providing location information to a person, comprising: a headwear item, adapted to be supported on a head of the person; a GPS receiver, supported by the headwear item; an antenna, in electrical communication with the GPS receiver, substantially encircling the headwear item so that the antenna substantially encircles the head of the person when the headwear item is supported by the head of the person; a computation unit, receiving GPS data provided by the GPS receiver, adapted to determine location-related data to the person.

It would seem from claims 1 and 3 that there is literal infringement upon US Patent 6,685,634. Claims 7 and 12 just build upon the fundamental claims. The GPS Personal Trainer does have a housing, a GPS receiver, a physiological sensor and sensor receiver (in this case a heart rate sensor), a computation unit, and a GPS antenna. Even though the GPS Personal Trainer does not have a headwear item as stated in claim 12, it can not be safely concluded that the GPS Personal Trainer does not perform “exactly the same function” in “exactly the same way” as the patented product. Packaging does not matter. It is enough for the GPS Personal Trainer to infringe upon claims 1 and 3 to have literal infringement.

Literal infringement with US Patent 6,463,385 is also nonexistent. Claim 1 proclaims:

A sports activity monitor adapted for use with a remote computer accessible through a network, comprising: a mobile recording unit adapted to travel with a user engaged in the activity, the unit including: a sensor for detecting a quantity which varies as a function of the activity, a global positioning (GPS) satellite receiver, a memory, and a controller connected to the sensor, the GPS receiver, and the memory, the controller being operative to perform the following functions: (a) receive a signal from the GPS receiver relating to the geographical position of the user while engaged in the sports activity, (b) store the geographical position information in the memory, and (c) receive a signal from the sensor and store information relating to the quantity in the memory; and an interface between the mobile recording unit and the remote computer, enabling the computer to display, over the network, the information relating to the quantity as a function of the geographical position of the user while engaged in the sports activity.

The GPS Personal Trainer comprises a mobile recording unit which contains a sensor, a GPS receiver, a memory, and a controller. It can perform functions (a), (b), and (c). But it is not accessible via a remote computer through a network. It is this last claim that prevents literal infringement.

Doctrine of Equivalents

From the arguments presented during the discussion of literal infringement on both patents, it could be construed that the GPS Personal Trainer performs “substantially the same function” in “substantially the same way” as both patented objects. All three products monitor a user’s heart rate, although both patented items left it open for other physiological sensors to be used. All three keep track of the user’s locations via GPS, and all three have a main controller to interpret the data from the sensor and the GPS receiver. The GPS Personal Trainer has some extra features such as temperature gathering and audible output, but these additional options do not eliminate infringement.

While claims 7 and 12 from US Patent 6,685,634 could make a case for refuting the “substantially the same way” statement, they don’t. The manner in which the system is packaged does not constitute a substantial difference under the Doctrine of Equivalents. Therefore, even though in the patent everything seems to be concentrated in the headgear, and in the GPS Personal Trainer the various functions are split into three main units. This method is not substantially different from the headgear approach, so there may be infringement under the Doctrine of Equivalents.

Claim 1 from US Patent 6,463,385 clearly states that a sports activity monitor is to be used in conjunction with a remote computer through a network. Based solely on this statement, it can be concluded there is no infringement under the Doctrine of Equivalents. However, murky waters arise when the words “adapted to use” are considered. This could imply that the sports activity monitor can be disconnected from remote access and used exactly like the GPS Personal Trainer. If US Patent 6,002,982 is considered, of which US Patent 6,463,385 is an extension, then this disconnection from remote access is feasible. There is no doubt that this sports activity monitor and the GPS Personal Trainer perform “substantially the same function”. The images of these two patents imply one main unit containing everything from the GPS receiver and heart rate sensor to the controller and memory; however as with claims 7 and 12, the packaging does not constitute a substantial difference. It therefore unfortunately seems as though there would be infringement.

Avoiding Infringement

Since both literal infringement and infringement under the Doctrine of Equivalents occurred with the GPS Personal Trainer, avoiding infringement will be a difficult matter. Even though no infringement was hoped for, a court of law could easily change this verdict. If so, certain actions short of ceasing production could be taken.

One action would be to license the products from the inventor. This seems like the most reasonable approach, and hopefully the price of the license would not be too exorbitant. Another option would be to acquire a subject patent, although this has the disadvantage of taking a long time during which market share could be lost.

4. Reliability and Safety Analysis

Introduction

The GPS personal trainer is a device which will allow the user to get a better running or biking workout. It keeps track of the user’s speed and distance covered and makes sure that the user will get a consistent exercise. For example, the user may select that he wants to run 2 miles in 15 minutes. In order to accomplish this, the device will calculate the speed that the user needs to be pursuing during each step of the exercise and inform the user if they are below this speed and need to accelerate.

In this project a design will be implemented for a GPS personal trainer. This device will function from a set of 4 AA batteries and will have two modules, the shoulder and the wrist module. The shoulder module will hold the batteries, main board housing the microcontroller, GPS receiver, power supply, and the thermometer. The wrist module will hold the LCD screen and the controls.

This report will talk about the reliability and safety of the GPS personal trainer. Since the device has to work on the person, it is especially important that critical failures do not occur. Two of the four devices considered are part of the power supply for the GPS personal trainer: the voltage regulator and the low dropout regulator. The third is the level shifter. The last device that is considered is the microcontroller.

Reliability

For this report, four least reliable devices were selected. These devices were selected because in the life of this product they were the most likely to fail since most will work above room temperature according to their datasheets. All data and formulas for the part failure calculations was obtained from the Military Handbook[13].

2.1 Voltage Regulator MAX1796 DC-DC Converter[17]

Classification: BiCMOS

Equation: λp = (C1 * πT + C2 * πE) * πQ * πL Failures / 10^6 Hours

|Value |Justification |Description |

|C1 = .02 |101-300 Transistors |Die Complexity Failure Rate |

|C2= .0026 |8 pins |Package Failure Rate |

|πT= 32 |@150(C |Temperature Factor |

|πE = 4.0 |Gm |Environment Factor |

|πQ = 10.0 |Commercial part |Quality Factor |

|πL = 1.0 |4 years production |Learning Factor |

-Tj for πT calculation is given in page 2 of the datasheet (150°C). Therefore πT will be 32.

• λp = 6.504 failures/10^6 hr = 6.504-6

• MTTF = 1/(6.504-6) = 153752 hours ~ 17.55 years

2.2 Microcontroller Atmel ATmega8L[4]

Classification: Linear Gate/Logic Array

Equation: λp = λBD * πMFG * πT * πCD + λBP * πE * πQ * πPT + λEOS Failures / 10^6 Hours

|Value |Justification (Section) |Description |

|λBD = .16 |Logic device (5.3) |Die Base Failure Rate |

|πMFG = 2 |Non QML/Non QPL (5.3) |Manufacturing Process Correction Factor |

|πT= 1.5 |@100(C(5.8)(5.11) |Temperature Factor |

|πCD = 8.9 |See below(5.3) |Die Complexity Correction Factor |

|πE = 4.0 |Gm(5.10) |Environment Factor |

|πQ = 10.0 |Commercial part(5.10) |Quality Factor |

|πpt = 1.0 |Surface mount non-hermetic pack(5.3) |Package Type Correction Factor |

|λBP = .0028 |32 pin package(5.3) |Package Base Failure Rate |

|λEOS=.065 |.5kV ESD susceptibility(5.3) |Optical Overstress Failure Rate |

-πT was selected using the Tj equation. Tc = 50°C for ground mobile device(Gm). P = 6V*400mA = 2.4W(Page 237,238 ATmega8l datasheet). θJC = 22 °C/W since die area is less then 14000 mil. Therefore Tj = 50 + 2.4*22 = 102.8°C

-πCD was selected based on the Atmel datasheet and a 1 micron feature size. The width and length of the chip is about .7 cm. The total area would be .49 cm2. Therefore the 0.4 < A < 0.7 cm2 yielding a πCD value of 8.9.

-λBP is an average of the 28 pin(.0027) and 40 pin(.0029) configuration since the ATmega8l has 32 pins.

-λEOS was base don the website: . .5kV results is between 0 and 1000 V. Therefore the optical overstress failure rate is .065.

• λp = 4.449 failures/10^6 hr = 4.449e-6

• MTTF = 1/(3.32e-6) = 224770 hours ~ 25.65 years

2.3 Comparator LM339[18]

Classification: BiCMOS

Equation: λp = (C1 * πT + C2 * πE) * πQ * πL Failures / 10^6 Hours

|Value |Justification |Description |

|C1 = .02 |Linear 101-300 gates |Die Complexity Failure Rate |

|C2= .0048 |14 pins |Temperature Factor |

|πT= 2.5 |@85(C |Package Failure Rate |

|πE = 4.0 |Gm |Environment Factor |

|πQ = 10.0 |Commercial part |Quality Factor |

|πL = 1.0 |>2 years production |Learning Factor |

Max Tj = 85(C πT= 58

• λp = .692 failures/10^6 hr = 6.92e-7

• MTTF = 1/(6.92e-7) = 1.44509e6 hours ~ 165.4 years

2.4 Low Voltage Dropout Regulator LT1528[19]

Classification: Linear Bipolar

Equation: λp = (C1 * πT + C2 * πE) * πQ * πL Failures / 10^6 Hours

|Value |Justification |Description |

|C1 = .02 |Linear 101-300 gates |Die Complexity Failure Rate |

|C2= .0019 |5 pins |Temperature Factor |

|πT= 5.2 |@81.4(C |Package Failure Rate |

|πE = 4.0 |Gm |Environment Factor |

|πQ = 10.0 |Commercial part |Quality Factor |

|πL = 1.0 |>2 years production |Learning Factor |

Max Tj = 81.4°C (Datasheet). Therefore πT= 5.2.

• λp = 1.116 failures/10^6 hr = 1.116e-6

• MTTF = 1/(1.116e-6) = 896057 hours ~ 102.29 years

Conclusion

The most critical device prone to failure is to no surprise, the MAX1796 voltage regulator. According to the calculations, under the most strenuous use, this device will fail in about 17 years. The next piece of equipment is the Atmel ATmega8L microcontroller which will theoretically fail in about 25 years. To increase the product life, to that of the microcontroller, we could search for a voltage regulator with a lower maximum operating temperature. To increase the life of the microcontroller, we can run it at a lower voltage, and therefore decrease its temperature. Decreasing heat output of devices by running them at lower voltages will greatly increase the lifespan of the device. We can also purchase military grade parts. They are more expensive, but theoretically have longer life spans.

Failure Mode, Effects and Criticality Analysis (FMECA)

Table 1. Block descriptions

|Block Name |Description |

|A |Power Supply Circuitry |

|B |Microcontroller |

|C |Sensors |

|D |Output |

|E |Input |

As seen in the above table, there are five major blocks in the design of the GPS personal trainer. These blocks have been labeled A through E. On the FMECA analysis, the failures are listed for each block, and numbered.

Criticality

For the FMECA analysis there are three criticality modes: danger(to human), high and low. The only possibility of danger from our product is battery leakage. The other is incorrect heart measurements, leading to overworking/under working the body. Therefore this criticality will be classified as danger. The other two criticality modes are high and low. Under a high criticality the device will stop functioning completely. The major function of this device is to provide speed and distance information. A malfunction where this cannot be achieved will be classified as high criticality. Under the low criticality mode only certain parts of the device would not function. An example would be if the thermometer malfunctions, the device would still perform its main function, but the user will not know what the exact outside temperature is.

5. Ethical and Environmental Impact Analysis

Introduction

This report outlines the ethical and environmental impact analysis design considerations for a GPS personal trainer device. The primary use of the device is for monitoring the distance, speed, and heart rate of an athlete and also keep an exercise history. The components of the device which acquire these statistics are the Atmel ATMega8L microprocessor, Polar T31 heart rate monitor, and Garmin 15L GPS receiver. The battery-powered device will be used primarily outside in various climate settings and environments. The primary ethical concern for this device will be ensuring that the product does not cause physical harm to the user. Being a battery powered device, proper battery disposal is a primary environmental concern, as well as the impact device manufacturing will have on the environment. To keep safe the public welfare and be aware of the health of our only planet, environmental and ethical standards are critical for our product to satisfy.

Ethical Impact Analysis

Unquestionably, the most important factor when considering the ethical impact of this device is the proper and thorough testing of the end product. Since the device is actually attached to the user's body, a malfunction in the packaging that could cause harm to the user. In addition, during the operation of this device the user is actively exercising which makes the safety analysis of the product even more important. One must also consider what could happen to the user if the product displays incorrect information.

The device is separated into three components, which are secured on the chest, upper arm, and wrist of the user's body. The packaging will be constructed out of molded plastic, which should be suitable for some users. However, plastic allergies are not all that uncommon, and this should be taken into consideration. As [8] states, “Allergies to Plastics and Latex are very real and very unaccounted for. Allergic reactions should not go un-noticed or pushed aside, because those having severe attacks could end up in anaphylactic shock and this can be deadly! Repeated contact with Plastics or Latex can increase your chances for allergic reactions.” Some of the more severe symptoms of plastic allergies include rashes, headaches, and faintness [8]. If a user with a plastic allergy were to be using the device during a workout and faints because of an allergic reaction, they could be put into an extremely dangerous situation. To prevent this scenario from occurring, two warnings about plastic allergies would be included with the product. The first would go in the user manual, while the second will go on the store packaging itself. This prevents the user from purchasing the product without being aware of the consequences of using the device with a plastic allergy.

The second major ethical concern for our device would be battery acid leakage. If leakage occurs while the user is exercising, they may be unaware that the leakage has occurred, and considerable physical harm to the user to occur. To counter this, the battery casing will be designed to be resistant to internal acid leakage. In addition, the user will be warned in the manual about battery acid leakage and be given preventive measures to do so. These measures include never mixing batteries of different charges, different voltages, different brands, or different chemistries [9]. The chemicals contained in battery acid are toxic and if the user comes in physical contact with the acid, the user should thoroughly wash the areas of skin where contact occurred and go see a medical doctor [10]. This advisory will also be included in the user manual, as well as on a label on the inside of the battery case.

Mechanisms need to be in place to ensure that the product does not get detached from the user during a workout. With the amount of movement and shaking the product would experience, if the device flew off of the user's arm or chest it could cause considerable damage if it hit the user or a nearby person. If the packaging breaks open, the small, electrical components inside may fly off as shrapnel and puncture the user's skin or injure the eyes. The mechanisms that prevent this injury from occurring would include, for example, a lock or latch for keeping the velcro strap from becoming disconnected. A notice in the user manual should also be included warning the user that the velcro straps should be tight and restrict all movement of the three units during exercise.

Another critical ethical factor is ensuring the proper operation of the unit. If a user has programmed a 10 mile workout and the GPS unit malfunctions, a user may end up running a greater distance, and could exhaust themselves physically trying to complete the workout. Physical exhaustion could cause several severe health hazards such as heat exhaustion or heat stroke which may lead to permanent damage of internal organs or even death[11]. Therefore it is imperative not to allow the Garmin 15L GPS unit to function at all, if it functions improperly. During boot-up of the device, a power on self test (POST) is activated to test each I/O device, and should any I/O device fail, the user will be informed of the matter. However, we want the product to be fault-tolerant of individual device failures so the user can still use the device with reduced functionality. In other words, a single failure should not stop the operation of the entire unit. The Garmin 15L GPS unit has an accuracy between 3 to 15 meters, depending on the availability of GPS satellites, and may lose function if used indoors or around tall buildings[5]. This is critical information for the user to be constantly reminded about the unit, and thus a warning label should be printed on the underside of the base unit, as well as in the user manual.

The most effective way to ensure that our design meets ethical standards is to test each unit thoroughly and rigorously. Since there is a severe amount of movement and vibration of the unit during operation, solder joints, wiring between components, and the packaging need to be secure and ready to meet these rugged criteria. Vibration testing of each individual unit before it is shipped to market will ensure that the device can handle these conditions. In addition, the accuracy of the device should be tested with external measuring devices that boast high accuracy. This may include running a measured distance for assessing the accuracy of distance, or a stopwatch for measuring the accuracy of the time. Also hooking up the tester to a medical heart monitor would be a great device to test the accuracy of the heart rate monitor. Since the device is to be used outdoors, a wide range of climates and environments need to be accounted for. Making sure the unit is operable under both extreme heat, extreme cold, and water resistance is an important factor to consider.

In conclusion, the health hazards that the GPSPT device imposes on the user are plastic allergies, contact with battery acid leakage, and physical injury due to package manufacturing defects. In addition, the accuracy that the device reports is an important ethical consideration, even though it is less likely to cause harm to the user. Consequences of failing to address these concerns could cause the user small to significant physical harm, and in extreme cases even death. To design the product with the user's health in mind, multiple warnings and labels must be created on both the user manual and the device itself. In addition, rigorous and thorough testing of the device prior to putting it out to market will ensure that the product is as safe as possible for the consumer.

Environmental Impact Analysis

The lifecycle of the GPS personal trainer consists of three stages: manufacturing, normal use, and disposal. The manufacturing stage is where the layout for the product gets sent to a manufacturing plant and is physically constructed. In order to be environmentally conscious engineers, we must carefully investigate the practices of PCB manufacturers before selecting a company. According to the Environmental Protection Agency (EPA), the traditional manufacture of printed circuit boards include[35]:

- Using toxic chemicals, such as formaldehyde, that pose potential health and environmental risks.

- Using substantial amounts of water and energy.

- Generating large volumes of hazardous waste.

Alternative, more environmentally conscious practices and methods exist to these traditional manufacturing processes. The first step to creating a product that is not an environmental hazard is to select a manufacturer that embraces these alternative manufacturing practices. When a manufacturer uses renewable sources of energy and materials, we can help conserver our non-renewable resources. When the amount of waste produced by manufacturing is minimized, we in turn minimize the space taken up in a landfill or reduce the air pollution caused by an incinerator. An even better solution would be to find a manufacturer that recycles their scrap and waste materials so they can be renewed again and again. Taking this critical step in environmental engineering awareness is essential to the environmentally sound nature of our product.

The second stage is the normal use stage. Our product uses non-rechargeable AA batteries for its operation, and thus safe battery recycling and disposal is essential to keeping our product from being a waste hazard. The responsibility of safe battery disposal is entirely on the shoulders of the user, but that is no excuse for the designer to sit back and do nothing. The most effective way of promoting safe battery disposal would be to include a warning label on the inside of the battery casing. This label would kindly suggest that the user find a safe and environmentally conscious mean to disposing his or her batteries. By keeping the label on the battery case, the user is forced to see it and be reminded every time he or she opens the case to change the batteries. Another disposal hazard could occur if a particular component of the device fails. A wasteful user may throw out the unit and either buy a brand new unit or buy a similar device (which may be more environmentally wasteful than our own product). A good solution here is to offer consumers a repair service should a component fail. By charging a minimal fee, users can mail their units into a support station which would diagnose the problem, fix it, test the unit, and re-send it back to the user. Not only is this an environmentally conscious act, it is also ethically sound since the user is not forced to re-purchase the device to regain their lost functionality. Finally, since there are three separate units to the device, one unit may become damaged or lost. By allowing users to order replacement units, we save the costs and environmental hazards of manufacturing a brand new product for the user.

The final life-cycle stage, disposal, is where the user no longer has a need for the unit and wishes to throw it out. PCBs can contain lead and other substances that are not bio-degradable. This ties back into the manufacturing cycle. By making sure we manufacture the product with environmentally safe PCBs, solder, and other materials, we help to reduce the amount of non-biodegradable waste at the disposal stage of the life cycle. The material that the device is packaged in also needs to be environmentally safe. The packaged material for the end product will probably be a bio-degradable plastic. Additionally since this device is programmable and can be used by any athlete, when one user no longer has a need for the device they can simply reset all the data and handed it down for another person to use. This reduces unnecessary and wasteful disposal of the working product.

6. Packaging Design Considerations

Introduction

The GPS Personal Trainer will be a fitness device mainly intended for use during outdoor excursions, such as running or cycling long distances. It will be able to keep track of the user’s location and determine the distance traveled and the user’s speed via a global positioning system receiver. The device will include a heart rate monitor strapped to the user’s chest which communicates wirelessly with the base unit. With input from the user such as the distance desired to travel and the time in which to do it in, the GPS Personal Trainer will be able to notify the user whether he or she is traveling too fast or too slow. The device will be comprised of three main units: the base unit, situated on the user’s upper arm; the heart unit, strapped to the user’s chest; and the wrist unit, located on the same arm as the base unit. All three units must be lightweight, compact, durable, and consume very little power to prolong battery life.

Analysis

One commercial device that is very similar to the GPS Personal Trainer is the Timex BodyLink System T59551 [25]. It comes in three separate units just like the GPS Personal Trainer design, one for the wrist, the upper arm and the chest. The upper arm unit uses a GPS receiver from Garmin [26], the same company supplying the receiver for the Personal Trainer. Each unit appears to be as conceivably small as possible. The wrist unit is nothing more than a modified sports watch encased in a standard plastic form. It is lightweight, durable, and water resistant to 50m. The upper arm unit seems to vary in packaging design as shown in Figure 1B. Both designs are splash-proof, however they are not made to be submerged for a significant amount of time. Also both designs come with an adjustable arm strap and a belt clip. When clipped to the belt the receiver is noticeable but does not hinder the user. The chest unit comes with an elastic strap and is water resistant to 30m.

[pic][pic][pic]

A. Wrist Unit from [27] B. Two different versions of the GPS receiver from [28] & [25]

[pic]

C. Chest Unit with Heart Rate Monitor from [28]

Figure 7-1: Timex BodyLink System T59551

There are some positive and negative aspects about the Timex BodyLink System T59551. The water resistance of the stopwatch and the heart rate monitor is nice; however the heart rate monitor will not be very accurate underwater. Also, since the GPS receiver cannot be submerged the water resistance of the system is compromised. The belt clip provided with the GPS receiver is a superfluous accessory; the user would most likely favor the arm strap over the belt clip. The idea of using a stopwatch as opposed to a bigger LCD screen is obvious: it’s smaller, lighter, and has more features, which is ideal for outdoor activities. The chest strap has the advantage of providing continuous heart rate monitoring, ideal for use during strenuous exercise.

There are some ideas that can be taken from the BodyLink system and integrated into the GPS Personal Trainer. The three unit system will be copied as such: the base unit, which will be situated on the user’s upper arm, will contain the power supply, the GPS receiver, the microcontroller, and the heart rate receiver; the heart unit, strapped to the chest and comprised of the heart rate transmitter; and the wrist unit, located on the same arm as the base unit, which will hold the 16x2 LCD screen and a rotary pulse generator for user input.

The wireless communication of the heart rate monitor will also be replicated. It will communicate with the base unit. The shape of the base unit will be adapted from the first GPS receiver shown in Figure 1B. The size will be slightly bigger since it will also house the power supply, microcontroller, and heart rate receiver, but the rectangular shape is preferred over the figure-eight design. All three units of the GPS Personal Trainer will ideally be splash-proof, however full water resistance is not needed. The reason the base unit and the wrist unit must be on the same arm is because they will not be communicating wirelessly as in the BodyLink system; they will be connected with an 8-pin wire instead. This will perhaps make the design more cumbersome, but without an extra transmitter and an extra receiver, the design will be less bulky.

Another commercially available product similar to the GPS Personal Trainer is the Garmin Forerunner 201 [29]. It performs speed and distance calculations but does not monitor the user’s heart rate. The power supply, GPS receiver, microcontroller, and LCD screen are all housed in one unit. It comes with an arm strap and is ideally meant to be worn around the wrist. The design is a waterproof rectangular package with a decent size of 3.26”W x 1.71”H x 0.69”D and a weight of 2.75 ounces [30]. The user interface is provided with four main buttons, and the display is clearly visible.

[pic]

Figure 7-2: Garmin Forerunner 201 [30]

The clear advantage of the Forerunner 201 is its all-in-one design. Its user interface is intuitive; the packaging is waterproof, lightweight, and compact. This design is excellent for speed and distance calculation. If it were possible to create such a design without custom parts, the GPS Personal Trainer would most likely be a two part design. Providing a heart rate monitor with a strap-on chest transmitter would add more functionality to the device, and adding a heart rate receiver onto the wrist unit would not increase its size dramatically. However, based on the size of the GPS antenna being used, 2.25”W x 1.75”H x 0.5”D, and the size of the batteries needed, either AAA cells or rechargeable cells, it would not be feasible to incorporate everything into the wrist unit. It is hoped that one rotary pulse generator will provide a user interface as intuitive as that of the Forerunner 201. The rectangular design of the Forerunner 201 will also be adapted to the wrist unit of the GPS Personal Trainer.

|Table 7-1: Packaging Materials List |

|Quantity |Description |

|1 |Rotary pulse generator |

|1 |8-pin wire |

|1 |Chest strap |

|1 |Arm strap |

|1 |Wrist strap |

|1 |85 x 40 x 15 mm polycarbonate enclosure (wrist unit) |

|1 |100 x 50 x 15 mm polycarbonate enclosure (chest unit) |

|1 |65 x 50 x 25 mm polycarbonate enclosure (base unit) |

The only tooling requirements will be creating holes in the polycarbonate enclosures to secure the parts inside and the straps outside of the enclosures. If resin is used instead of the polycarbonate enclosures then the mechanical engineering lab would be needed.

Estimate of packaging weight and cost:

|Table 7-2: Estimated packaging weight |

|Weight(grams) |Description |

|1 |Rotary pulse generator |

|3 |8-pin wire |

|10 |Chest strap |

|8 |Arm strap |

|7 |Wrist strap |

|30 |Internal electronics |

|88 |Batteries |

|30 |85 x 40 x 15 mm polycarbonate enclosure (wrist unit) |

|40 |100 x 50 x 15 mm polycarbonate enclosure (chest unit) |

|30 |65 x 50 x 25 mm polycarbonate enclosure (base unit) |

|41 |Subtotal wrist unit |

|50 |Subtotal chest unit |

|159 |Subtotal base unit |

|250 |Total all units |

|Table 7-3: Estimated packaging cost |

|Cost(US $) |Description |

|20 |Rotary pulse generator |

|5 |8-pin wire |

|8 |Chest strap |

|5 |Arm strap |

|5 |Wrist strap |

|9 |85 x 40 x 15 mm polycarbonate enclosure (wrist unit) |

|12 |100 x 50 x 15 mm polycarbonate enclosure (chest unit) |

|9 |65 x 50 x 25 mm polycarbonate enclosure (base unit) |

|39 |Subtotal wrist unit |

|20 |Subtotal chest unit |

|14 |Subtotal base unit |

|73 |Total all units |

7. Schematic Design Considerations

Introduction

The GPS Personal Trainer is an apparatus that will be the ultimate exercise companion. This device is specifically designed for runners, but will work for cyclists too. With the GPS Personal Trainer, runners and cyclists will be able to get balanced workouts, all controlled by the device. The GPS Personal Trainer will be responsible for tracking the users distance, speed, time, and heart rate. The user interface will be highly intuitive. There will be a custom mode where the user will be able to select what parameters he wants the device to track and whether he wants to store this run in his history. The second mode will have a set workout for beginners that would gradually increase their running or cycling abilities. This mode will have a preset number of exercises that would slowly convert a regular jogger into a runner.

Theory of Operation

Brief Description of Major Devices

Garmin GPS Receiver & Antenna

The theory behind GPS is as follows. Satellites in orbit around the earth send signals down to ground level. These signals must be sent at exactly the same time so that proper positioning could be determined. For this reason, each satellite has an embedded atomic clock. The satellites send time and their location data to the GPS receiver. Since the satellites are all in different locations around the Earth, the data from each satellite is received at different times. Using the theory of relativity, the GPS receiver calculates its exact location based on the data that it receives from the satellites and the time it receives this data. The more satellites that the GPS receiver gets data from, the more accurate the triangulation will be[20]. Average receivers are able to track 8-12 satellites. High end ones are capable of 16 and more. For position and altitude the GPS receiver needs data from at least four satellites. GPS is a tool for outside use only. GPS receivers are unable to receive satellite data indoors, and may not work accurately near high buildings.

The GPS receiver used for the GPS Personal Trainer, Garmin GPS 15L[1], is a fairly accurate device with an error of less then 15 meters. This device works on 3.3V and 85mA-100mA of current. The Garmin is capable of running at a baud rate of 4800. This unit is also very small. Its under 2 inches in length and less then 1.5 inches wide, it will work very well in hand held devices such as the GPS Personal Trainer.

The antenna for this receiver is the Gilsson Technologies GA26C which was recommended by Garmin. It is an active antenna which will give us more accurate readings according to the sales representative. The antenna is very durable and waterproof.

[pic]

Figure 8-1. Garmin GPS Receiver.

Atmel MP

The Atmel ATmega8L microcontroller is a low power 32 pin 8 MHz microcontroller. Running at 4 MHz it requires 3 Volts and 3.6 mA of current. This microcontroller has 512 bytes of EEPROM and 1K byte of SRAM. The microcontroller will be primarily responsible for processing data coming from the sensors, reading user input, and providing output via LCD and piezo speaker. The microcontroller will also receive data from the GPS receiver and calculate the distance and speed of the device.

Imagesco LCD Screen

Images SL Inc. has a LCD product that met our specifications. It is fully TTL/CMOS compatible. Therefore only a single serial pin from the microprocessor will be necessary for interfacing purposes. The input is 300, 1200, 2400, or 9600 baud selectable. The LCD screen has a fairly simple interface. It accepts single byte input which it interprets as ASCII text and outputs it to the screen. Furthermore, there are codes for erasing characters and clearing the screen. The LCD screen operates at 4.8V to 5.2V and uses approximately 40mA of current.

The LCD screen will be a major component in the user-device interface. Through the help of the LCD screen the user will be able to select settings of the device to achieve his best workout. During the actual workout the LCD screen will output the user’s heart rate, distance covered, speed, and time since start of run.

Heart Rate Monitor

The heart rate monitor has two parts. The chest strip of the heart rate monitor monitors the heart rate and outputs an RF signal every heart beat. The receiver is going to be implemented on a circuit board. Its major components include a magnetic pickup resonator which will sense the signal coming from the heart rate monitor. Then this signal is going to be filtered and amplified with a series of band pass filters. The output will consist of analog pulses that will be sampled by the A/D port of our Atmel microcontroller. The receiver needs to have 5V power supply.

[pic] [pic]

Figure 8-2. Signal from Heart Rate Monitor. Figure 8-3. Signal from Receiver sent to MP[21].

Input

The input to the GPS Personal Trainer will consist of one rotary pulse generator and two single pole single throw pushbuttons. The pushbuttons will be debounced with software from the microcontroller. The RPG will be connected to 4 input ports of the ATmega8L microcontroller.

Power Supply

The power requirements of the device range from 3V to 5V. Since the device has to be mobile, the power will come from a battery. The batteries of choice are 4 AA cells. These batteries should, according a calculation of ~250mA of current drawn by the device, last for 8 hours. The power supply will supply both the 5V and the 3V ranges by using MAX1796 voltage regulators[17]. These regulators can source up to .5A of current.

Description of GPS Personal Trainer operation

When turned on by pressing the RPG button, the GPS Personal Trainer will ask the user to enter the mode of operation. The two basic modes are Custom and Preset. In the Custom mode the user will be able to define various variables such as how long they want to run and the distance that they want to cover. The Preset mode will have a set of predefined exercises that the user can follow. After setting the mode of operation the user will be asked to select start, to begin his exercise. From there on the GPS Personal Trainer starts tracking the user through its onboard sensors such as the GPS, heart rate, and temperature tracking.

The GPS tracking functions as follows. The GPS signal from satellites around the earth read by the Gilsson antenna and received by the Garmin GPS receiver. The receiver will triangulate its position and will output this data in NMEA 0182 standard[22]. This format outputs 37 bytes of data. Bytes 14-34 deliver the latitude and longitude information. Unavailable data is null. This data will be interfaced with the ATmega8L microcontroller. The ATmega8L will process the NMEA data and will determine the speed and distance covered of the GPS Personal Trainer. Then this data will be sent to the LCD screen and updated with a 4800 baud signal rate.

The heart rate sensor is comprised of two main devices. The transmitter, which will be worn on the user’s chest, and the receiver, located on the user’s arm. The receiver will output analog data to the A/D port of the ATmega8L. This data will be digitized and the heart rate will be calculated by the microcontroller. The heart rate will be then sent to the LCD screen and updated for the user to view. Finally the temperature sensor will output data to the microcontroller which will then send the temperature to the LCD screen.

Throughout the run the user will be informed by the device of their progress via a small speaker. This speaker[24] will be connected to a PWM of the microcontroller and will output a sequence of beats to tell the user that they are half way done with the race, or that they have completed their program.

Once the exercise program is complete, the GPS Personal Trainer will store the data about the exercise in memory and will continue displaying the exercise’s statistics until user input has been selected which will take the user back to the main menu. After two minutes have passed with out use input, the microcontroller will turn off all unnecessary functions and go into power save/sleep mode.

8. PCB Layout Design Considerations

Introduction

This design project proposes to use a global positioning system (GPS) as an aid to personal training. Keeping track of how far and how long the runner and/or biker has traveled, they can easily monitor exactly how much they have worked out, and to see how well they have done. In addition to monitoring the simple racing statistics, this design has a wireless heart monitor as feedback to the user and a digital thermometer. The user can also choose from a selection of built in preprogrammed runs through an on-screen menu and input device. This design will have to consider all of the sensitive digital signals coming into and being transmitted to all of the peripherals and the analog input of the heart rate receiver circuit. All of these devices will have to be as small as possible, not being too bulky as to get in the way of a runner. This can provide the user a very useful tool in training, perhaps for marathon use.

Layout Considerations

This GPS personal trainer can first be broken up into all of its power source components and all of its analog or digital components [34]. It was of the first priority to isolate all of the power source IC’s on one side of the board to lessen the effects of noise and interference of the sources. The battery connector is located on the far left side in the middle, so that it is near both the 5V and the 3.3V supplies. The 5V supply was located in the bottom left corner such that it could reach all of the components that require the higher Vcc on the bottom half, which are the LCD screen and the rotary pulse generator (RPG). The 3.3V supply is located in the upper left of the board, where the 3.3V regulator is right beside it, so that the input, output, and bypass capacitances can keep it as regulated as possible. The output capacitors were also arranged so that the ground can help isolate the supply circuits from the rest. The ground was run down the middle of the board to help with intrinsic capacitances seen between the digital part of the board and the power supplies.

With careful consideration of which signals are sent to which pins on the Atmel micro controller, the components which require the 5V and 3.3V were separated respectively. Along the bottom edge of the board are the connections for the 5V components. The RPG was located closer to the power sources, because its input signals are not as sensitive as the LCD. The LCD however has a sensitive signal that will have to be transmitted serially from bit banging a port pin, and a few incorrect bits could easily corrupt the signal sent to the display. The wire connections physically going to the wrist unit will have a couple extra ground windings to help lessen possible corruptions in this signal as well. The 3.3V devices are located along the top-right and the right edges of the board, again corresponding pins on the Atmel were chosen to help placement on the board in this fashion. Similar to the 5V devices, the more sensitive devices were placed farthest away from the power sources, the greatest being the GPS receiver connections. The regulated 3.3V supply line that was necessary for the GPS unit was run along the outside of the board with the ground line just inside it, to help reduce power noise and to isolate it as much as possible. Along the far right side also is the digital thermometer. This was positioned here to keep its serial line as clean as possible, but mainly to keep it away from the greater amount of heat dissipated by the power circuitry. The programming header was also placed on the extreme right hand side of the board to keep its signal as isolated as possible from noisy circuitry. Closer to the power circuitry is the input of the heart rate monitor receiver. This connection is somewhat isolated because of its analog signal however it can almost be considered digital, because the expected signal should just be pulses. Its traces were made to cross the other traces at 90º angles as much as possible to not corrupt any of the digital signals crossing it [34].

For the Atmel micro controller, there was a supplied recommended placement of decoupling capacitors in the layout [4]. These were placed beneath the processor allowing them to be physically as close as possible to handle any high current draws. Decoupling capacitors were also placed between the power supply MAX1796 [17] and battery connectors for the same reason. The LT1528 required a bank of 4x 47µF capacitors to make sure its output was as steady as needed to be [19]. These can be found along side the regulator.

In general, 10 mil tracing was used for everything. For the small power application of this unit, this should provide enough sizing for the traces. The traces also used 45º angle turns everywhere. All input and output connections were placed along the outside of the board, with the exception of the headers for debugging purposes [34]. And all of the unused pins of the micro controller will also be enabled as inputs and tied low to prevent some possible strange effects.

9. Software Design Considerations

Introduction

This report outlines the software design considerations taken into account for a GPS personal trainer device. The primary uses of the device are for monitoring the distance, speed, and heart rate of an athlete and also for keeping an exercise history. The embedded software must manage several external I/O devices which include an LCD screen, heart rate monitor, GPS receiver, digital thermometer, RPG, piezo speaker, and user input switches. Since the user is assumed to be actively exercising during operation of the device, speed is not a critical factor in the design. Because this is a battery-powered application, the software must be designed in a way to minimize the power consumption by the device. The microprocessor used with this design, the Atmel Atmega8L, has several power-saving modes that will be used by the embedded application code. Due to the minimal user interaction needed, number of I/O devices, and power-saving feature required, our software will be an interrupt-based code design.

Software Design Considerations

Memory models

The microprocessor used in the device is the Atmel ATmega8L. This microprocessor has three memory types available: 8 kilobytes of Flash memory, 512 bytes of EEPROM, and 1 kilobyte of SRAM. The Flash memory module has a guaranteed 10,000 write/erase cycles before failure and will be used for the application code. The large size (8KB) of this memory module is large enough to store the code and several message screens to send to the LCD, which will take up a significant amount of space. The EEPROM has a minimum of 100,000 write/erase cycles and will be used for saving user-programmed workouts as well as exercise history. The size of this memory module (512B) will be sufficient enough to store a limited amount of user data and the high number of write/erase cycles makes this the ideal location to save this information. Assuming a user saves and deletes a single history item daily, and programs or erases a new workout routine bi-weekly, this gives the EEPROM over 130 years of operation before failure, which is more than sufficient for the needs of this product. The volatile SRAM memory will be used to save run-time data and information from the various I/O devices. All three memory modules are byte accessible and erasable.

Memory sections/mappings

Before an explanation of how the memory sections are mapped for this project, it is necessary to discuss what needs to be retained in memory, especially regarded the user-programmed workouts and exercise history to be stored in EEPROM. A user-programmed workout consists of a user entering a name for the workout, the distance, time, and heart rate monitoring. The name can be no larger than 14 characters (due to the 16 character per line limitation of the LCD screen). Distance requires 2 bytes, time requires 4 bytes, and heart rate will require 2 bytes. A user may opt to not monitor distance, time, or heart rate during the workout which would require no memory consumption and could save space in the EEPROM. However, this would introduce the problem of dynamic memory allocation, and designing code to address this situation would be more time-consuming than its worth. Thus, each user-programmed workout will consume exactly 22 bytes of memory.

Each exercise history item will retain the date and time the workout took place, time the workout took to complete, and the total distance. The average pace (or speed) of the workout is also important to retain, but since this can be computed from dividing distance by time it need not be stored in the EEPROM. Storing the date will require 3 bytes of data. The time the workout took place will require a total of 2 bytes. The time the workout took to complete (which needs to be a more precise time) requires 4 bytes. Finally, the distance will require 2 bytes. This means that each exercise history item will occupy 11 bytes of memory.

The Flash memory layout consists solely of the embedded application code. The EEPROM has to be divided between user-programmed workouts and exercise history. It was decided that the device will be able to retain 10 user-programmed workouts (consuming 220 bytes) and 26 exercise history items (requiring 286 bytes). The SRAM retains all the data from the I/O devices as well as the running total of statistics such as distance, time, and average speed. Figure 10-1 summarizes the memory management for the EEPROM and SRAM blocks.

Figure 10-1. Memory Layout for the SRAM, EEPROM and modules

Start-up code

The start-up code for this device performs a power-on self test (POST) to ensure that all external I/O devices are operational and functioning properly. If any one device fails, a warning beep is sent to the speaker and a message is sent to the LCD screen informing the user of the failure. Even if a particular device fails, the personal trainer should still operate properly, but with reduced functionality. For example, if the user forgets to wear his or her heart rate monitor prior to booting up the device, the software will not display any heart rate data to the user during their workout.

Organization of embedded application code

Due to the large number of I/O devices and the interrupt-driven nature of the software for this design, the most efficient way of writing the software is to create a function to service each I/O device. Some of these functions may serve as interrupt service routines for when an interrupt is generated by a device. Yet most of the I/O devices will not generate their own interrupts, and will need to have their service routines called directly by an internal timer interrupt. Table 10-1 summarizes the service routines for those devices, and indicates whether it is interrupt driven (I) or called (C). Note that the RPG and user switches do not have a specific service routine because their interrupt function is dependent on the current state of the main program.

|Device | |Service Routine Function |

|LCD screen |C |send a message to the LCD screen |

|Heart Rate Receiver |I |determine time between rising edges |

|GPS Receiver |C |get current position |

|Digital Thermometer |C |get current temperature |

|Piezo Speaker |C |output a warning beep to the user |

Table 10-1. Summary of I/O Device Service Routines

Software Design Narrative and Documentation

The main section of the code will be similar to a finite state machine. There are several modes of operation available to the user, which will be presented upon start-up. Figure 10-2 shows a state transition diagram of the overall application. Following in Table 10-2 is an explanation of each individual state. Finally, a detailed description of each code module is outlined.

Figure 10-2. State Transition Diagram of Main Program

|Mode |Operation |

|Reset |the state the device is in when powered off |

|Start-up |runs the POST and displays a boot-up screen |

|Mode Select |allows a user to select one of five modes of operation |

|Display Time/Date |displays the time and date to the user, akin to a standard watch |

|Delete Workout |allows user to browse through workouts for deletion |

|Delete Workout Item |displays details about selected workout to delete and asks for confirmation from user |

|New Workout |user can create a new workout from this mode |

|Save Workout |asks user if he/she wishes to save the new workout for later use |

|Load Workout |loads a saved user-programmed workout for use |

|Delete History |allows user to browse through history items for deletion |

|Delete History Item |displays details about selected history item to delete and asks for confirmation from user|

|View History |allows user to browse through exercise history directory |

|View Item |displays detailed information about exercise history item |

|Ready |when in this state, a workout has already been loaded and the device is waiting for the |

| |user to hit the RPG to start |

|Running |main mode of operation where all I/O devices are fully active and the exercise timer is |

| |running |

Table 10-2. Brief explanation of states

sendLCD(char *message, int line)

- Sends the string message out to display on the selected line of the LCD screen. Called from all modes of operation in the program.

updateLCD(char newC, int position)

- Updates the LCD string at position position to display the new character newC. Called from the New Workout and Save Workout states for actively updating a user input on the LCD (ex. entering a workout name or distance amount)

readGPS()

- Prompts the GPS unit for current positional data and determines how far the user has traveled since the last time the function was called. The total distance traveled in memory is then updated. This function is only called during the Start-up and Running states.

readTemp()

- Reads the current temperature and replaces the old temperature stored in memory. This function is only called during the Start-up and Running states.

isrHRM()

- The interrupt service routine for the heart rate monitor. When a rising edge is detected on pin D3 (external interrupt 1 pin), this routine is called and increases the heart beat value stored in a register by one.

sendSpeaker(int signal)

- Sends a frequency to the piezo speaker to notify the user of an important event. Depending upon the value of signal, different frequencies and lengths of sounds may be played. This function is called from various states of operation.

update()

- This routine is only called during the Running state. After a 6 second period, this function disables interrupts and gets updated data by calling the readGPS and readTemp routines. It re-calculates the average speed based upon the new position and elapsed time. It then computes the new heart rate by taking the amount of heart beats stored in a register and multiplying by ten to get beats per minute (BPM). It then resets this register value to zero. After this it calls the sendLCD function to display the new data. Finally it sets the microcontroller to a power-saving state and waits until another 6 seconds has elapsed until it wakes the microcontroller up again.

Software Design Narrative and Documentation

Algorithms

Most of the calculations done in this design are extremely simple, such as integer division or finding an average. The only complicated algorithm is located in the readGPS() routine, which must convert the change in latitude and longitude coordinates to a change in the number of kilometers. The algorithm to do this computation is called the GDCF, or Great Distance Circular Formation [12]. This formula uses spherical geometry to give an accurate distance measurement. With the very small changes in latitude and longitude between successive positions, this type of accuracy is needed for our application.

Great Circle Distance Formula using radians:

3963.0 * arccos[sin(lat1) * sin(lat2) + cos(lat1) * cos(lat2) * cos(lon2 – lon1)]

The flowchart on the preceding two pages shows a detailed operation of the entire device. Note that a user decision arrow is an event that occurs when a user gives input to the device by pushing a button, or twisting or pushing the RPG switch. Program decision arrows are triggered by internal events by the code (ex: a timer reaching a certain value).

10. Version 2 Changes

• Use a different microcontroller (like the ATmega16) that has more flash memory (at least 16KB) and more external interrupt pins

• Add back in features removed (because of memory constraints). Includes: the ability to save/load a workout, the ability to monitor temperature, and POST/fail-safe routines.

• Spend more time building a better heart rate receiver circuit so the HR signal can be received from a distance.

• Get the GPS unit and the entire main code module working together

• Use a less-bulky LCD screen to minimize size and weight in the wrist unit.

Summary and Conclusions

In this design, we did learn a lot. In such a short period of time to design, build, and test a single product of our choice, mistakes were made and accomplishments achieved, but lessons were learned from all. Once the GPS Personal Trainer was agreed upon, we successfully realized the design by choosing what components were to be used in the design, and learned how to design and build a PCB from concept to solder. Because of limited memory in our chosen micro controller, using digital signal processing was not an option for deciphering the heart rate. There was a big challenge of converting the analog heart rate signal including the carrier frequency over to a single digital heart beat. This was accomplished, and we could calculate the user’s heart rate from the chosen heart rate sensor. The group also successfully integrated input and output from the micro controller with the rotary pulse generator and the LCD screen. From the given interfaces to the GPS-PT, the programmed micro controller effectively ran through the desired menu options, and ran through the exercise routines as desired. It also was successful in writing the old data to the EEPROM for saving the information from previous workouts.

From this design we learned from the beginning that the datasheets must not be skimmed over. A complete understanding of how the different components must be achieved before items can get placed on the schematic. It was found out that errors left unchecked early in the design process can lead to really big problems later when things need to be wired and soldered on the PCB. A third party receiver circuit was the first proposed idea for the heart rate circuit, but was found to be useless. For something that integral to our design, we had to design it ourselves. We also learned we need to look at our resources early. Our micro controller that we had chosen proved to be not enough for our design. An understanding of what the peripherals need is to be discussed early in the process. After going through such an intensive design in this amount of time, we learned a considerable amount and will be able to apply much of this to our careers as we move on after graduation.

References

1) “Garmin GPS-15”,

2) “Tyco Electronics A1025”,

3) “u-blox RCB-LJ Receiver Board”

4) Atmel “ATMega8L”,

5) “Atmel ATtiny26L”,

6) “Images SI Inc., LCD-02”,

7) “PIC, PIC16F747”

8) “Plastic and Latex Allergies – Suite ”

9) “Battery Safety”

10) “Battery Health and Safety”

11) “eMedicine: Heat Exhaustion and Heat Stroke”

12) “Distance Calculation: How to calculate the distance between two points on the Earth”

13) MIL-HDBK-217F (PDF)

14) Lecture Notes Module 9

15) Reference Article:Designing for Reliability, Maintainability, and Safety. George Novacek

16) Thermometer

17) Voltage Regulator

18) Comparator

19) Low Voltage Dropout Regulator

20) Theory behind GPS

21) Heart Rate Monitor/Receiver

22) NMEA FAQ

23) Debouncer

24) Piezo speaker

25) Timex BodyLink System T59551 Official Site,

26) Garmin International,

27) Timex BodyLink System T59551 on HDO Sport,

28) Sark Products,

29) Garmin Forerunner 201 Official Site,

30) Garmin Forerunner 201 on HDO Sport,

31) United States Patent and Trademark Office,

32) US Patent 6,685,634,

33) US Patent 6,463,385, ';

tmpBuff[1] = ' ';

for (i = 0; i < 14; i++) { // Read name (14 bytes)

tmpBuff[i + 2] = EEPROM_read(addr);

addr++;

}

tmpBuff[16] = '\0';

if (nameOnly == 1)

return;

// Read distance (2 bytes)

goal_dist = EEPROM_read(addr); // Non-decimal portion of distance

addr++;

goal_dist += (EEPROM_read(addr) / 100); // Decimal portion of distance

addr++;

// Read time (3 bytes)

goal_hour = EEPROM_read(addr);

addr++;

goal_min = EEPROM_read(addr);

addr++;

goal_sec = EEPROM_read(addr);

addr++;

// Write minimum HR (1 byte)

goal_HR = EEPROM_read(addr);

addr++;

// Re-enable interrupts

#asm("sei");

}

//*******************************************************

// Function: deleteWorkout

// Description: Deletes a workout in EEPROM

// Author: Tyler Olsen

//*******************************************************

void deleteWorkout(unsigned char position) { // Position = 0-9

unsigned int addr = 0;

unsigned char i = 0;

// Disable interrupts

#asm("cli");

addr = position * WO_SIZE; // EEPROM address

for (i = 0; i < WO_SIZE; i++) { // Read name (14 bytes)

EEPROM_write(addr, 0);

addr++;

}

// Re-enable interrupts

#asm("sei");

}

//*******************************************************

// Function: saveHistory

// Description: Saves a new history item to EEPROM

// Author: Tyler Olsen

//*******************************************************

void saveHistory(unsigned char position) { // Position = 0-25

unsigned int addr = 0;

unsigned char tmp = 0;

// Disable interrupts

#asm("cli");

addr = position * HIS_SIZE + 200; // EEPROM address

// Write current date

EEPROM_write(addr, month);

addr++;

EEPROM_write(addr, day);

addr++;

EEPROM_write(addr, year);

addr++;

// Write current time

EEPROM_write(addr, timeH);

addr++;

EEPROM_write(addr, timeM);

addr++;

// Write workout finish time

EEPROM_write(addr, hours);

addr++;

EEPROM_write(addr, minutes);

addr++;

EEPROM_write(addr, seconds);

addr++;

EEPROM_write(addr, millsecs);

addr++;

// Write workout finish distance

tmp = goal_dist % 1; // Non-decimal portion of distance

EEPROM_write(addr, tmp);

addr++;

tmp = (goal_dist - tmp) * 100; // Decimal portion of distance

EEPROM_write(addr, tmp);

addr++;

// Re-enable interrupts

#asm("sei");

}

//*******************************************************

// Function: loadHistory

// Description: Loads a new history item from EEPROM.

// If dtOnly == 1, only load in the date and time

// Author: Tyler Olsen

//*******************************************************

void loadHistory(unsigned char position, unsigned char dtOnly) { // Position = 0-25

unsigned int addr = 0;

// Disable interrupts

#asm("cli");

addr = position * HIS_SIZE + 200; // EEPROM address

// Read stored date (3 bytes)

month = EEPROM_read(addr);

addr++;

day = EEPROM_read(addr);

addr++;

year = EEPROM_read(addr);

addr++;

// Read stored time (2 bytes)

timeH = EEPROM_read(addr);

addr++;

timeM = EEPROM_read(addr);

addr++;

if (dtOnly == 1)

return;

// Read workout finish time (4 bytes)

hours = EEPROM_read(addr);

addr++;

minutes = EEPROM_read(addr);

addr++;

seconds = EEPROM_read(addr);

addr++;

millsecs = EEPROM_read(addr);

addr++;

// Read distance (2 bytes)

run_dist = EEPROM_read(addr); // Non-decimal portion of distance

addr++;

run_dist += (EEPROM_read(addr) / 100); // Decimal portion of distance

addr++;

// Re-enable interrupts

#asm("sei");

}

//*******************************************************

// Function: deleteHistory

// Description: Deletes a workout in EEPROM

// Author: Tyler Olsen

//*******************************************************

void deleteHistory(unsigned char position) { // Position = 0-25

unsigned int addr = 0;

unsigned char i = 0;

// Disable interrupts

#asm("cli");

addr = position * HIS_SIZE + 200; // EEPROM address

for (i = 0; i < HIS_SIZE; i++) {

EEPROM_write(addr, 0);

addr++;

}

// Re-enable interrupts

#asm("sei");

}

//*******************************************************

// Function: findFreeHist

// Description: Returns the first free available

// history EEPROM memory location

// Author: Tyler Olsen

//*******************************************************

unsigned char findFreeHist() { // Position = 0-25

unsigned int addr = 0;

unsigned char i = 0;

unsigned char dat = 1;

// Disable interrupts

#asm("cli");

for (i = 0; i < HIS_SIZE; i++) {

addr = i * HIS_SIZE + 200; // EEPROM address

dat = EEPROM_read(addr);

if (dat == 0) // This memory location is free

return i;

}

return HIS_SIZE; // No free memory!

// Re-enable interrupts

#asm("sei");

}

//*******************************************************

//

// LCD, Temperature, and Speaker routines

//

//*******************************************************

//*******************************************************

//

// Function: outchar

// Description: Bangs bits to the LCD screen

// Author: Gennady Vayl

//

//*******************************************************

void outchar(char letter) {

if (delayf == 0)

{

byteout = letter;

delayf = 1;

}

while (delayf); //waits while a 1 byte is transmitted

} //outchar

//*******************************************************

// Function: clear_screen

// Description: Clears the screen

// Author: Gennady Vayl

//*******************************************************

void clear_screen() {

int i;

outchar(254);

outchar(128);

for(i=0; i Mode select screen

mode = M_SELECT;

changeMode();

}

else if (subMode == 1) { // Display Detail -> Display List

changeMode(); // Sets subMode, cursor = 0 and re-displays list. Doesn't change mode

}

}

// ********** M_SAVEWO **********

// else if (mode == M_SAVEWO && RPG_PSH == 0) { }

// else if (mode == M_SAVEWO && PSH_BUT == 0) { }

// ********** M_SAVEHIS **********

// else if (mode == M_SAVEHIS && RPG_PSH == 0) { }

// else if (mode == M_SAVEHIS && PSH_BUT == 0) { }

// ********** M_READY **********

else if (mode == M_READY && RPG_PSH == 0) {

// Start timer 1

mode = M_RUNNING;

}

else if (mode == M_READY && PSH_BUT == 0) {

mode = M_SELECT;

changeMode();

}

// ********** M_RUNNING **********

else if (mode == M_RUNNING && RPG_PSH == 0) {

// Stop timer 1

mode = M_RUNDONE;

}

// else if (mode == M_RUNNING && PSH_BUT == 0) { } // Do nothing

// ********** M_RUNDONE **********

else if (mode == M_RUNDONE && RPG_PSH == 0) {

// Save to history automatically

if (GPS_OK == 1) {

date_timeGPS();

eValue = findFreeHist();

if (eValue == HIS_SIZE) { // Out of memory

strcpyf(line0, lcdBuff[20]); // ERROR: Out of

strcpyf(line1, lcdBuff[21]); // memory!

beepme( 'D' );

delay_ms(1500);

}

else {

strcpyf(line0, lcdBuff[19]); // Saved...

strcpyf(line1, lcdBuff[0]); // (blank line)

delay_ms(1500);

}

}

}

else if (mode == M_RUNDONE && PSH_BUT == 0) {

// Resume timer 1

mode = M_RUNNING;

}

#asm("sei");

}

// External Interrupt 1 service routine (HRIN, rising edge)

interrupt [EXT_INT1] void ext_int1_isr(void)

{

#asm("cli");

if ((mode == M_RUNNING && HRM_OK == 1) || (mode == M_START))

hr_beats++;

#asm("sei");

}

//*****************************************************************************

//

// Timer 0 overflow interrupt service routine

// Description: This interrupt is for bit banging the LCD screen.

// Author: Gennady Vayl

//

//*****************************************************************************

interrupt [TIM0_OVF] void timer0_ovf_isr(void)

{

TCNT0=0xD0;

if(delayf == 1)

{

if(shift_cnt == 0)

{

LCD_PIN = 0;

shift_cnt = shift_cnt +1;

}

else if(shift_cnt == 9)

{

LCD_PIN = 1;

shift_cnt = 0;

delayf = 0;

}

else

{

LCD_PIN = byteout & 0x01;

byteout = byteout >> 1;

shift_cnt = shift_cnt + 1;

}

}

}

// Timer 1 overflow interrupt service routine

// (the code actually runs in main because of

// conflicts with using timer 0 for the LCD).

interrupt [TIM1_OVF] void timer1_ovf_isr(void)

{

TM1_ISR = 1;

millsecs++;

}

// Timer 2 compare interrupt service routine

interrupt [TIM2_COMP] void timer2_ovf_isr(void)

{

// I/O devices share use of this routine (speaker, GPS)

}

void main(void)

{

// Local variables

// Input/Output Ports initialization

// Port B initialization

// Func0=In Func1=In Func2=In Func3=Out Func4=Out Func5=In Func6=In Func7=In

// State0=T State1=T State2=T State3=0 State4=0 State5=P State6=P State7=P

PORTB=0xE0;

DDRB=0x18;

// Port C initialization

// Func0=In Func1=In Func2=In Func3=Out Func4=In Func5=In Func6=In

// State0=P State1=T State2=T State3=0 State4=T State5=T State6=T

PORTC=0x01;

DDRC=0x08;

// Port D initialization

// Func0=In Func1=In Func2=In Func3=In Func4=In Func5=In Func6=In Func7=In

// State0=P State1=P State2=P State3=P State4=P State5=P State6=P State7=P

PORTD=0x00;

DDRD=0x02;

// Timer/Counter 0 initialization

// Clock source: System Clock

// Clock value: 125.000 kHz

TCCR0=0x02;

TCNT0=0xD0;

// Timer/Counter 1 initialization

// Clock source: System Clock

// Clock value: 1000.000 kHz

// Mode: Normal top=FFFFh

// OC1A output: Discon.

// OC1B output: Discon.

// Noise Canceler: Off

// Input Capture on Falling Edge

TCCR1A=0x00;

TCCR1B=0x01;

TCNT1H=0x00;

TCNT1L=0x00;

OCR1AH=0x00;

OCR1AL=0x00;

OCR1BH=0x00;

OCR1BL=0x00;

// Timer/Counter 2 initialization

// Clock source: System Clock

// Clock value: 1000.000 kHz

// Mode: Normal top=FFh

// OC2 output: Disconnected

ASSR=0x00;

TCCR2=0x01;

TCNT2=0x00;

OCR2=0x00;

// External Interrupt(s) initialization

// INT0: On

// INT0 Mode: Rising Edge

// INT1: On

// INT1 Mode: Rising Edge

GICR|=0xC0;

MCUCR=0x0F;

GIFR=0xC0;

// Timer(s)/Counter(s) Interrupt(s) initialization

TIMSK=0x01;

// USART initialization

// Communication Parameters: 8 Data, 1 Stop, No Parity

// USART Receiver: On

// USART Transmitter: On

// USART Mode: Asynchronous

// USART Baud rate: 4800

UCSRA=0x00;

UCSRB=0x98;

UCSRC=0x86;

UBRRH=0x00;

UBRRL=0x0C;

// Analog Comparator initialization

// Analog Comparator: Off

// Analog Comparator Input Capture by Timer/Counter 1: Off

// Analog Comparator Output: Off

ACSR=0x80;

SFIOR=0x00;

// Watchdog Timer disabled

WDTCR=0x00;

// Global enable interrupts

#asm("sei")

// Display boot screen, beep, run POST

sendLCD( 0 );

sendLCD( 1 );

beepme( 'A' );

delay_ms(500);

testGPS();

if (GPS_OK == 0) { // GPS POST failed

beepme( 'B' );

strcpyf(line0, "ERROR: GPS power");

strcpyf(line1, "on test failed ");

sendLCD( 0 );

sendLCD( 1 );

delay_ms(2500);

}

// Wait ~2 seconds for heart beat

delay_ms(2000);

if (hr_beats == 0) { // No HR detected, failed POST

beepme( 'B' );

HRM_OK = 0;

strcpyf(line0, "ERROR: No heart ");

strcpyf(line1, " rate detected ");

sendLCD( 0 );

sendLCD( 1 );

delay_ms(2500);

}

//readTemp(); // Because G said we need to initialize it or some crap...

mode = M_SELECT;

changeMode();

while (1)

{

// ***** Timer 1 ISR! Time to lay the smack down! *****

if (TM1_ISR == 1) {

TM1_ISR = 0;

// Overflow every 10 ms, update LCD line0

itoa(millsecs, tmpBuff);

if (sizeof(tmpBuff) == 1) { // Less than 10 millisecs

updateLCD('0', 14);

updateLCD(tmpBuff[0], 15);

}

else {

updateLCD(tmpBuff[0], 14);

updateLCD(tmpBuff[1], 15);

}

if (millsecs >= 100) {

millsecs = 0;

seconds++;

itoa(seconds, tmpBuff);

if (sizeof(tmpBuff) == 1) { // Less than 10 seconds

updateLCD('0', 11);

updateLCD(tmpBuff[0], 12);

}

else {

updateLCD(tmpBuff[0], 11);

updateLCD(tmpBuff[1], 12);

}

if (seconds >= 60) {

seconds = 0;

minutes++;

itoa(minutes, tmpBuff);

if (sizeof(tmpBuff) == 1) { // Less than 10 minutes

updateLCD('0', 8);

updateLCD(tmpBuff[0], 9);

}

else {

updateLCD(tmpBuff[0], 8);

updateLCD(tmpBuff[1], 9);

}

if (minutes > 60) {

minutes = 0;

hours++;

itoa(hours, tmpBuff);

if (sizeof(tmpBuff) == 1) { // Less than 10 hours

updateLCD('0', 5);

updateLCD(tmpBuff[0], 6);

}

else {

updateLCD(tmpBuff[0], 5);

updateLCD(tmpBuff[1], 6);

}

}

}

if ((mode == M_RUNNING) && (hours >= goal_hour) &&

(minutes >= goal_min) && (seconds >= goal_sec) &&

(goal_hour != 0 || goal_min != 0 || goal_sec != 0)) { // Time's up!

// Stop timer 1 (do NOT clear!)

goal_hour = 0;

goal_min = 0;

goal_sec = 0;

beepme( 'D' );

mode = M_RUNDONE;

changeMode();

}

}

runner++;

if (runner = 600) { // 6 seconds expired

// Do we need to disable interrupts?

runner = 0;

if (mode == M_POSITION)

changeMode(); // Updates position

else { // Mode is running

if (GPS_OK == 1)

readGPS();

// readTemp();

if ((goal_HR != 0) && (hr_beats < goal_HR)) // User is below minimum heart rate

beepme( 'C' );

hr_beats = 0;

// Cycle through line1 of LCD

cursor = (cursor + 1) % 3;

if (cursor == 0) { // Display distance

strcpyf(line1, "DIS: ");

ftoa(run_dist, 2, tmpBuff);

strncat(line1, tmpBuff, 5);

strncatf(line1, " miles", 6);

sendLCD( 1 );

}

else if (cursor == 1) { // Display speed

strcpyf(line1, "PAC: ");

itoa(run_speed / 60, tmpBuff); // Number of minutes per mile

strncatf(tmpBuff, ".", 1);

strncat(line1, tmpBuff, sizeof(tmpBuff) + 1);

itoa(run_speed % 60, tmpBuff); // Number of seconds per mile

if (run_speed % 60 < 10) {

tmpBuff[1] = tmpBuff[0];

tmpBuff[0] = '0';

}

tmpBuff[2] = ' ';

tmpBuff[3] = '\0';

strncat(line1, tmpBuff, 3);

strncatf(line1, "mile ", 5);

sendLCD( 1 );

}

else if (cursor == 2) { // Display heart rate

strcpyf(line1, "HRM: ");

itoa(hr_beats * 10, tmpBuff);

if (sizeof(tmpBuff) == 2) {

tmpBuff[2] = tmpBuff[1];

tmpBuff[1] = tmpBuff[0];

tmpBuff[0] = '0';

}

tmpBuff[3] = '\0';

strncat(line1, tmpBuff, 3);

strncatf(line1, " BPM", 4);

sendLCD( 1 );

}

// else if (cursor == 3) { } // Display temperature

if (run_dist >= goal_dist && goal_dist != 0.0) { // Distance is up!

// Stop timer 1 (do NOT clear!)

goal_dist = 0.0;

beepme( 'D' );

mode = M_RUNDONE;

changeMode();

}

}

}

}

// ***** Poll RPG turning *****

if (RPG_SUP != last_rpgsup || RPG_SDN != last_rpgsdn) {

// upward/increase

if (((RPG_SUP == 0 && RPG_SDN == 0) && (last_rpgsup == 0 && last_rpgsdn == 1))

|| ((RPG_SUP == 1 && RPG_SDN == 0) && (last_rpgsup == 0 && last_rpgsdn == 0))

|| ((RPG_SUP == 1 && RPG_SDN == 1) && (last_rpgsup == 1 && last_rpgsdn == 0))

|| ((RPG_SUP == 0 && RPG_SDN == 1) && (last_rpgsup == 1 && last_rpgsdn == 1))) {

if (mode == M_SELECT) {

cursor++;

if (cursor > 5)

cursor = 0;

strcpy(line0, line1);

line0[0] = '>';

if (cursor == 5)

strcpyf(line1, lcdBuff[1]);

else

strcpyf(line1, lcdBuff[2 + cursor]);

line1[0] = ' ';

sendLCD(2);

}

else if ((mode == M_DELWO || mode == M_LOADWO) && subMode == 0) {

cursor++;

if (cursor >= WO_NUM)

cursor = 0;

strcpy(line0, line1);

line0[0] = '>';

loadWorkout(cursor, 1);

strcpy(line1, tmpBuff);

line1[0] = ' ';

sendLCD( 2 );

}

else if (mode == M_NEWWO) {

if (subMode = HIS_NUM)

cursor = 0;

strcpy(line0, line1);

line0[0] = '>';

loadHistory(cursor, 1);

dtToBuff(1);

strcpy(line1, tmpBuff);

sendLCD( 2 );

}

last_rpgsup = RPG_SUP;

last_rpgsdn = RPG_SDN;

}

// downward/decrease

else if (((RPG_SUP == 0 && RPG_SDN == 0) && (last_rpgsup == 1 && last_rpgsdn == 0))

|| ((RPG_SUP == 1 && RPG_SDN == 0) && (last_rpgsup == 1 && last_rpgsdn == 1))

|| ((RPG_SUP == 1 && RPG_SDN == 1) && (last_rpgsup == 0 && last_rpgsdn == 1))

|| ((RPG_SUP == 0 && RPG_SDN == 1) && (last_rpgsup == 0 && last_rpgsdn == 0))) {

if (mode == M_SELECT) {

if (cursor == 0)

cursor = 5;

else

cursor--;

strcpy(line1, line0);

line1[0] = '>';

strcpyf(line0, lcdBuff[1 + cursor]);

sendLCD(2);

}

else if (mode == M_NEWWO) {

if (subMode ' character to the left of the name. Following is a detailed description of each mode:

New Workout: This mode lets the user create a new workout. The user will be prompted with four screens for inputting information about the new workout. First the user is prompted to select distance. Using the RPG dial, the user may change the distance (in miles) that the workout will cover. Pushing the RPG switch moves forward to the next digit, while the push button will move backwards through the digits. The maximum distance a user may enter is 99.9 miles. Figure 4 shows the display distance screen. Next the user is prompted to enter the time the workout will take. In a fashion similar to entering the distance, the user will enter seconds, minutes, and hours (maximum allowed entry is 99 hours, 59 minutes, 59 seconds). During a workout when either the workout distance or time is reached, the device beeps and automatically stops.

[pic]

Figure 4: Entering Distance During New Workout Mode

The next screen is for entering the minimum heart rate to monitor during the workout. If the user's heart rate is less than or equal to this threshold value, the device will be left off a warning beep during operation. Note that should the user enter a zero value for distance, time, or minimum heart rate, the device will not monitor these running statistics during a workout, but it will still report them to the user via the LCD screen. After the minimum heart rate has been entered, the user is asked if he/she would like to save the workout for later use. If the user selects yes, the device will wait for the user to enter a name (up to 14 characters) and the workout will be saved in the first available workout location it finds (up to 10 workouts may be saved). If there is no space in memory, an error message is displayed to the user informing them that the save operation failed. Whether the workout was saved or not, the device now automatically proceeds to the Ready state.

Load Workout: This mode lets a user load a previously saved workout from memory. The user is brought to a workout selection screen where the RPG dial is used to scroll through the saved workouts, which are listed by name. Upon pushing the RPG, detailed information about the selected workout is displayed. Pushing the RPG once more loads the workout and the user is brought to the Ready state. The push button may be used to go back to the previous menu at any time.

[pic]

Figure 5: Workout List Screen

Delete Workout: If the user has saved too many workouts and wishes to remove one from memory, this mode allows the user to do that. A list of workouts is displayed similar to the Load Workout mode. Upon pushing the RPG, detailed information is displayed about the selected workout. When the RPG is pushed from this screen, the user is asked to confirm the deletion of the workout. If the RPG is pushed again, this confirms the deletion and the user is returned to the workout list screen. To cancel deletion, push the push button to go back to the previous screen.

[pic]

Figure 6: Detailed Workout Information Screen

View History: This mode lets the user view detailed exercise history information. A list of the saved history items is displayed by the date the workout took place and may be scrolled through by using the RPG dial. After pushing the RPG, detailed information about the workout is displayed, including the date and time the workout took place, the total distance run, the elapsed time of the workout, and the average speed (mile pace) during the workout. Pushing the button will return the user to the previous menu.

[pic]

Figure 7: Exercise History List

Delete History: This mode allows a user to delete a history item. Similar to the View History mode, first a list of workouts is displayed and then detailed information about the selected workout is shown once the RPG has been pressed. Upon pressing the RPG once more, the user is asked to confirm the deletion of this exercise history item. Pressing the RPG again will delete the item and return the user to the exercise history list, while pushing the push button cancels deletion and returns the user to the previous screen.

[pic]

Figure 8: Detailed Exercise History Item

Display Position: This mode will display the global position (latitude and longitude) of the user. It updates the position every six seconds. Pressing the push button returns the user to the mode select screen.

[pic]

Figure 9: Display Global Position

Ready: This mode can not be reached from the mode selection screen. It indicates that a workout has been stored (from either the New Workout or Load Workout mode) and the device is ready to begin the workout. The device waits until the RPG is pressed and then proceeds to the Running mode.

Running: This is the main mode of operation for the device. During this mode the user is exercising and the GPSPT is monitoring the workout. The elapsed time is always displayed on the top line of the LCD screen, while other information is displayed on the bottom line. Every six seconds, the GPSPT will update the total distance and current speed (mile pace), check the heart rate of the user, and update the lower line of the LCD screen. If the user's heart rate has fallen below the minimum heart rate specified for the workout, a warning beep is emitted. The bottom line of the LCD cycles through displaying the distance, current speed, heart rate, and ambient temperature every six seconds. Once the RPG is pressed or the distance or time workout criteria is reached, the device lets off a notification beep and proceeds to the Paused mode.

[pic]

Figure 10: Running Mode of Operation

Paused: Upon entering this mode the elapsed timer is stopped and the device waits for input from the user. If the user presses the push button, the device will go back to the Running mode and resume operation. Otherwise if the RPG is pressed, the workout is finished and the user is asked if they want to save it in the exercise history. Pushing the RPG will save it and create a new exercise history item (if there is sufficient space in memory; 26 exercise history items may be saved). The user will then be brought back to the mode select screen. Pressing the push button will bring the user to the mode select screen without saving.

[pic]

Figure 11: Saving a New Exercise History Item

After you are finished with the device, please turn it off properly by turning off the power switch on the shoulder unit.

Product Troubleshooting

Q. Why won't the device turn on (the LCD screen isn't displaying anything)?

A. Most likely the batteries are dead and need to be replaced. After replacement, if there is a beep played when the device is turned on but the LCD screen still refuses to display anything, it is likely that the LCD screen has been damaged or the cable connecting the wrist unit and shoulder unit has become disconnected.

Q. During boot-up, there is a message that the GPS unit is not functional. What's

wrong?

A. The GPS unit functions poorly or not at all when indoors or around tall buildings

(the signals from the satellite are obstructed). If this is not the case, it is likely that

the GPS unit inside the shoulder unit has been damaged. The GPSPT can still be

used with limited functionality (monitor distance, speed, and global position can

not be monitored).

Q. During boot-up, there is a message that the HRM (heart rate monitor) is not

functional. What's wrong?

A. During boot-up the device waits for two seconds to see if it can detect a heart beat

from the chest unit. If it can not, this message will be displayed. The chest unit

must be put on before powering on the device. If this message still displays, make

sure the chest unit is positioned properly (see Figure 2) and apply water on your

chest. If there is still no response after this, it is likely that the wire connecting the

chest unit with the shoulder unit has become disconnected or damaged.

Q. Why can I not save any new workouts?

A. You have too many workouts saved. The maximum allowed amount is 10 stored

workouts. You need to delete an old workout to save the new workout.

Q. Why can I not save any new exercise history items?

A. Your exercise history is full. A maximum of 26 items may be stored at any given

time. Delete old exercise items in order to free up space.

Appendix H: FMECA Worksheet

|Failure No. |Failure Mode |Possible Causes |Failure Effects |Method of Detection |Criticality |Remarks |

|A1 |No 3 Volt Power |Low battery, MAX1796(U7), LT1538 |GPS/thermometer will not |Observation via LCD Screen|High |LED monitor can be added |

| | | |output data, uC non | | | |

| | | |functional, LCD not updated. | | | |

|A2 |No 5 Volt Power |Low battery, MAX1796(U8) |LCD shuts off. |Observation via LCD Screen|High |LED monitor can be added |

|A3 |Unstable power |LT1538 |GPS malfunction |Observation |High |LED monitor can be added |

|A4 |No power due to battery |Battery |LCD turns off. |Observation |Danger |Battery indicator can be added to |

| |leakage | | | | |inform the user |

|B1 |All pins output high/low |uC error, decoupling capacitor |LCD screen malfunction |Observation |High | |

| | |failure, software failure | | | | |

| | | | | | | |

| | | | | | | |

| | | | | | | |

|Failure No. |Failure Mode |Possible Causes |Failure Effects |Method of Detection |Criticality |Remarks |

|B2 |Incorrect outputs |Software error, memory error |Unpredictable |Observation |High |Try resetting the uC. |

|C1 |Incorrect temperature |Software error/thermometer |No temperature, or incorrect |Observation |Low | |

| | |malfunction |temperature displayed. | | | |

| | | | | | | |

|C2 |No GPS measurements |Interference from buildings/GPS |The location variable is not |Observation |Low |If the problem is interference from |

| | |malfunction |updated | | |buildings, move to a more open area. |

| | | | | | | |

| | | | | | | |

|C3 |No heart rate signal |No moisture between body and heart|Heart rate not updated on LCD|Observation |Low |If you are still running, and the LCD|

| | |rate monitor, Heart rate monitor |screen | | |says 0 heart rate, chances are that |

| | |malfunction | | | |the user is still alive and the heart|

| | | | | | |rate monitor malfunctioned. |

| | | | | | | |

|D1 |No sound signals from device.|No signal to piezo speaker/piezo |User does not receive sound |Observation |Low | |

| | |speaker malfunction |information signals | | | |

| | | | | | | |

|Failure No. |Failure Mode |Possible Causes |Failure Effects |Method of Detection |Criticality |Remarks |

|D2 |LCD outputs random data |The LCD controller chip SER pin is|LCD outputs random data or is|Observation |Low |Replace LCD Screen |

| | |burned |blank | | | |

|E1 |Improper signals come from |RPG malfunction |Loss of control over device |Observation |High |Device no longer controllable |

| |the RPG | | | | | |

|E2 |No reset signal coming to the|Pushbutton malfunction |Can’t reset uC |Observation |Low | |

| |uC | | | | | |

|E3 |No select signal coming to |Pushbutton malfunction |Can’t select menu options on |Observation |High | |

| |the uC | |LCD screen | | | |

-----------------------

Tyler Olsen Nick McCarroll Phil Vorsilak Gennady Vayl

Comments:

SRAM

EEPROM

1KB

512B

user programmed[pic]workouts[pic](220B)

exercise[pic]history[pic]

(286B)

I/O device data

run-time variable [pic]data

POST

OK?

reset

ACTION

DECISION

LEGEND

MODE SELECT

Display Device

Warning(s)

NO

YES

Display Date & Time

1 sec

Time/Date

Display

history list

Display

history list

Display

workout list

Display

history item

Display

history item

Deletion[pic]Confirmed?

Delete Item

Display “Deleted”

NO

YES

Program Decision

User Decision

Display

workout item

Deletion[pic]Confirmed?

Delete Item

Display “Deleted”

NO

YES

Delete

Workout

Delete

History

Display History

OFF

ON

Load

Workout

To: Display workout list[pic](see next page)

To: Set distance type[pic](see next page)

New

Workout

NOTE: The reset node may be reached from any other node if the device is powered off

Initialize

Display “Ready”

NOTE: Mode Select node copied from previous page

MODE SELECT

Display

workout list

Display

workout item

Selection

Confirmed

YES

NO

Set distance

Enter distance

Enter time

Enter pulse

(min & max)

Save for later[pic]use?

Load

Workout

New

Workout

Sufficient

memory?

Display “Saved”

Display Error

NO

YES

Enter workout name

YES

NO

SUPERNODE (during this operation, the elapsed time and LCD are updated every 0.01 seconds)

Wait 6 seconds

Get new position

Calculate "dist.

Add ∆dist.

Add ∆dist. to total dist

Get current temp.

Calculate heart rate

Reset heart rate reg

Calculate new d

Disable interrupts

Workout

finished?

Pause timer

Save history?

Sufficient[pic]memory?

Display “Saved”

Display Error

To: MODE SELECT

NO

NO

NO

YES

YES

YES

Get new position

Start timer

Resume timer

Update LCD

D

C

B

A

E

16x2 line

LCD Screen

Piezo

Speaker

Wrist Unit

Shoulder Unit

Chest Unit

On/Off Switch

Atmel uP

HRM Transmitter

Power

Supply

Push Button

RPG

GPS Unit

HRM Receiver

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download