i - buoycape - homebuoycape.wikispaces.com/file/view/final_report_ii_rev_2.doc · web view4.3.3...

136
1 Satellite Communications Buoy Senior Design II Fall 2008

Upload: lytruc

Post on 29-Mar-2018

217 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

1

Satellite Communications BuoySenior Design II

Fall 2008

Members: Mentors:John DeBlanc Elias Ellsworth Nick PughPeter Bankole Luis Chinchilla Mark Fenstermaker

Page 2: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

2

Table of Contents

1. Introduction……………………………………………………………….71.1. What is a picosatellite?………………………………………………71.2. What is a buoy?……………………………………………...………71.3. What does it do?……………………………………………………..81.4. Functional Specs……………………………………………………..8

2. Overall Block Diagram……………………………………………………102.1. PIC…………………………………………………………………..122.2. Power System………………………………………………………..122.3. Batteries……………………………………………………………..122.4. Solar Cells…………………………………………………………...122.5. Sensors………………………………………………………………122.6. GPS…………………………………………………………………..122.7. Flash memory………………………………………………………..132.8. TNC………………………………………………………………….132.9. Radio…………………………………………………………………132.10 Mechanical…………………………………………………………..13

3. Preliminary Design………………………………………………………..143.1. Creating Excel Model………………………………………………..14

3.1.1. DataTX time TX power Power Reg………………….143.1.2. Assumptions…………………………………………………..14

3.2. Sat Access Schemes…………………………………………………..153.2.1. Intelligent Buoy ……………………………………………….153.2.2. Beacon Buoy…………………………………………………..153.2.3. Waiting Buoy…………………………………………………..15

3.3. Conclusions……………………………………………………………173.3.1. Based on model predictions…………………………………..26

4. Subsystems………………………………………………………………..264.1. Communications……………………………………………………..26

4.1.1. Alternatives / Tradeoffs……………………………………….264.1.1.1. Antenna Theory…………………………………………..27 4.1.1.2. Radio………………………………………………………30

4.1.2. Feasibility……………………………………………………..304.1.2.1. Testing ……………………………………………………31

4.1.2.1.1. Procedure………………………………………….324.1.2.1.2. Hardware…………………………………………..32

4.1.2.2. Data………………………………………………………..334.1.2.3. Conclusion…………………………………………………33

4.1.3. Design Document………………………………………………354.1.3.1. Explanation…………………………………………………364.1.3.2. Schematic…………………………………………………..37

4.2. Power………………………………………………………………….374.2.1. Alternatives / Tradeoffs………………………………………..38

4.2.1.1. Batteries……………………………………………………39

Page 3: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

3

4.2.1.1.1. Capacity, size, weight……………………………...384.2.1.2. Panels + Batteries…………………………………………..41

4.2.1.2.1. Theory………………………………………………414.2.1.3. Conclusion…………………………………………………44

4.2.2. Feasibility………………………………………………………444.2.2.1. Testing……………………………………………………...44

4.2.2.1.1. Battery Charging…………………………………..444.2.2.1.2. Procedure / Hardware……………………………..464.2.2.1.3. Peak Power Point………………………………….47

4.2.2.2. Data………………………………………………………..484.2.2.3. Conclusions………………………………………………..49

4.2.3. Design Document……………………………………………..504.2.3.1. Explanation………………………………………………..504.2.3.2. Schematic………………………………………………….50

4.3. Sensors………………………………………………………………..52

4.3.1. Alternatives & Tradeoffs………………………………………52

4.3.1.1. Air Temperature…………………………………………..52

4.3.1.2. Water Temperature………………………………………..55

4.3.1.3. Pressure……………………………………………………55

4.3.1.4. Wind Speed………………………………………………..55

4.3.1.5. Salinity…………………………………………………….56

4.3.1.6. Humidity…………………………………………………..58

4.3.2. Feasibility………………………………………………………58

4.3.2.1. Time………………………………………………………..58

4.3.2.2. Cost………………………………………………………...58

4.3.3. Design Documents……………………………………………..59

4.3.3.1. Explanation………………………………………………...59

4.3.3.2. Schematic…………………………………………………..61

4.4. Command & Data Handling…………………………………………..62

4.4.1. Alternatives & Tradeoffs………………………………………62

4.4.2. Feasibility………………………………………………………63

4.4.2.1. Test Code…………………………………………………..63

4.4.2.2. Results…………………………………………………….63

Page 4: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

4

4.4.2.3. Conclusion…………………………………………………64

4.4.3. Design Documents…………………………………………….64

4.4.3.1. Explanation………………………………………………..64

4.4.3.2. Schematic…………………………………………………65

4.4.3.3. Flowcharts………………………………………………..66

4.4.3.4. State Machine Design…………………………………….

4.4.3.5. External Timer……………………………………………

4.4.3.6. External Memory…………………………………………

4.4.3.7. Watchdog Timer………………………………………….

4.5. Mechanical…………………………………………………………...69

4.5.1. Alternatives & Tradeoffs……………………………………..69

4.5.1.1. Discus Buoy………………………………………………69

4.5.1.2. Spar Buoy………………………………………………...70

4.5.2. Feasibility…………………………………………………….70

4.5.2.1. Flotation ………………………………………………….71

4.5.3. Design Documents…………………………………………….71

4.5.3.1. CAD drawing……………………………………………..71

5. Prototype Construction……………………………………………………71

5.1. Electrical System…………………………………………………….72

5.1.1. PIC……………………………………………………………72

5.1.2. GPS……………………………………………………………72

5.1.3. Radio / TNC Box……………………………………………..72

5.2. Buoy Structure………………………………………………………..73

5.2.1. PVC……………………………………………………………73

5.2.2. Mounting Solar Panels…………………………………………73

5.2.3. Antenna ½ Wave………………………………………………73

6. Future Plans………………………………………………………………..73

Page 5: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

5

6.1. Communications………………………………………………………73

6.1.1. Switch from handheld Radio to 3V custom low power radio….73

6.1.2. Switch from pico packet TNC to TNC-X………………………73

6.2. Power…………………………………………………………………..74

6.2.1. More efficient solar panels……………………………………..74

6.2.2. Research possibility of an entire system running at 3 volts……74

6.3. C&DH…………………………………………………………………74

6.3.1. Upgrade to PIC18F6722……………………………………….74

6.3.2. Create interface for 3rd party devices…………………………..74

6.4. Mechanical…………………………………………………………….75

6.4.1. Improve stability……………………………………………….75

6.4.1.1. Static and dynamics calculations…………………………...75

6.4.1.2. Placement of sensors……………………………………….75

7. Appendix……………………………………………………………………75

7.1. Website Wiki…………………………………………………………...75

7.2. Source Code……………………………………………………………76

7.3. Data Sheets……………………………………………………………..89

7.4. Schematics……………………………………………………………..93

Page 6: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

6

1. Introduction

Scientists, meteorologists, mariners, offshore companies, and countless other groups depend on timely reports of current oceanic conditions. However, there are considerable challenges associated with gathering oceanic data. It is impractical and perhaps dangerous to station humans at remote offshore locations in potentially harsh weather conditions. Furthermore, unacceptable inefficiencies arise with manual data collection. Therefore, scientists and engineers prefer to design autonomous data collection devices with remote communication capabilities.

A remote data collection device possesses an inherent design challenge; namely, how to establish a reliable communication link. If an offshore device attempts to communicate with terrestrial stations, distance and line-of-sight limitations can pose significant obstacles to reliable communication.

To overcome these obstacles, engineers have chosen satellites for telecommunications that would be impractical or impossible with land-based solutions. Typically, for oceanic environmental data collection, scientists and engineers have designed floating or moored buoys which relay their data via satellites back to a ground station.

This design projects aims to create a similar satellite communications buoy with one main difference. This buoy will communicate with a Low Earth Orbiting (LEO) CubeSat; namely, the C.A.P.E. II (Cajun Advanced Picosatellite Experiment) satellite. With a LEO CubeSat, a constant communications link is impossible unlike geostationary satellites. However, as an advantage over geostationary satellites, a LEO CubeSat is much closer to Earth, which dramatically reduces the necessary signal strength for communications. Therefore, this project will combine the desirable features of satellite communications and low power requirements for future buoys and other remote applications.

1.1 What is a CubeSat?

A CubeSat is a miniaturized satellite with 10cm X 10cm X 10cm dimensions and a 1-kilogram weight. Generally, CubeSats are built with commercial off-the-shelf components for research

Page 7: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

7

purposes. CubeSats can be built and launched for approximately $60,000 to $80,000. Due to these satellites’ relative low costs, universities and companies find CubeSats to be an attractive means to enter the previously high-cost fields of space science and space exploration.

1.2 What is a weather buoy?

A weather buoy is a floating device that gathers environmental data while positioned in a large body of water, usually the ocean. Weather buoys monitor atmospheric parameters such as temperature, pressure, humidity, rainfall, wind speed, and wind direction. However, they can also monitor oceanic parameters such as salinity, wave height, and wave period. Weather buoys normally link with weather stations via satellite communications with geostationary satellites.

1.3 What is the purpose of the C.A.P.E. II weather buoy?

This design will demonstrate the usefulness of CubeSats in the area of data collection and forwarding. The buoy will gather environmental data and then upload it to the C.A.P.E. II satellite as it passes over the buoy’s location. This design’s success will create a new arena for opportunities and applications within the CubeSat community. Futhermore, future University of Louisiana at Lafayette senior design teams could develop other terrestrial applications with satellite link functionality.

1.4 Functional Specifications

Description:

This project is to design and build an expendable weather buoy with satellite communication abilities. The weather buoy will collect environmental conditions, store them on onboard memory, and relay them to the CAPE II satellite. This buoy system will ether have batteries that will keep the buoy active for 3 years or have a combination of solar panels and batteries to achieve a three year life. The cost of this buoy should be less that $150 including a GPS receiver. This buoy will have a data interface such that other devices may store data and transmit data to the satellite.

Specifications:(1) Compatibility with the Naval Academy buoy. (2) Contain an on board GPS receiver.(3) Report its location.(4) Collect water temperature.(5) Time stamp all data samples.(6) Memory storage > 100 Meg bits.(7) Transmitter 144 MHz and or 435 MHz.(8) Transmitter power sufficient to close a link to CAPE II Cubesat.(9) Satellite access scheme TBD.

Page 8: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

8

(10) Life of the buoy three years.(11) Cost of the buoy $150.(12) Data interface TBD probably I2C.

Deliverables:(1) Produce one operational and fully tested buoy.(2) Documents that the buoy has been tested with on an orbit satellites. (3) Likely to be the International Space Station.(4) A survey of likely originations that might want to collect data.(5) Software for the ground station to feed the data collected to the Internet.(6) Software that will organize the data in to a spreadsheet interface.

Page 9: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

9

Figure 1. Functional Specifications Diagram Power Options

Inputs Outputs Solar/Batteries

(1) Environmental Data

(2) Location

(3) Time (4) Sunlight

(5) Satellite Commands

Environment Large Body Of Water

Potentially Harsh Weather

Final Products1 Operational and Fully-Tested BuoyDocumentation On Testing With An Orbiting Satellite (e.g. International Space Station)Ground Station Software To Upload Buoy Data To InternetSoftware To Organize Buoy Data Into A Spreadsheet Format

BuoyCompatible

w/ Naval Academy Buoy

On-board GPS Receiver

Memory > 100 Megabits

Data Interface (I2C)

Cost: $1503 Year Lifespan

(1) 145MHz and/or 435MHz Transmission Frequency

(2) Sufficient Transmission Power To Close Link With CAPE2 (3) Transmit Location, Time, and

Environmental Data

Page 10: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

10

2. Overall Block Diagram

Our solution is to design a system which will utilize a microcontroller to manage the gathering and communication of environmental data. The system will awaken every hour and gather environmental data via a collection of sensors. Then, a GPS unit will provide time, date, and location information to accompany the environmental data. Next, the system will format and store the current batch of data. Following this, the system will broadcast its most recent data to the satellite when the satellite passes over its location. In order to broadcast data, a terminal node controller (TNC) will format the data into AX.25 packets and then modulate the packets into an analog signal. Finally, the radio will transmit the modulated signal.

See the overall block diagram in Figure 2.

Page 11: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

11

Figure 2. Buoy Functional Block Diagram

Sensors

GPS

PIC

Flash Memory

Solar Cells Batteries

Power System

TNC RadioTX TX

RX RX

Mechanical

PVC Structure

Page 12: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

12

2. Overall Block Diagram

2.1 PIC Block

This block represents the microcontroller. This microcontroller will most likely belong to the Microchip PIC18 family. The microcontroller will control all other buoy subsystems. The microcontroller will retrieve data from the sensor array and the GPS unit. After formatting and storing the data, the microcontroller will send the data to the communication subsystem for transmission. The microcontroller will also accept commands from the satellite which may alter its task schedule or task list.

2.2 Power System Block

The power system directs power from the batteries (and possibly solar cells) to the rest of the system. If solar cells are used, the power system will handle the recharging of the batteries. The power system will step down voltage to the appropriate level for each component. Also, the power system will protect against destructive currents.

2.3 Batteries Block

The batteries will store power for the system.

2.4 Solar Cells Block

Solar cells will absorb solar energy and convert it into electrical energy. Then, the power system will store that electrical energy in the batteries.

2.5 Sensors Block

Sensors will measure analog environmental values and convert these values into electrical signals which the microcontroller will read.

2.6 GPS Block

The GPS (Global Positioning System) receiver compares signals from several GPS satellites to determine its location, time, speed, and direction. The GPS receiver will forward this information to the microcontroller. Using this information, the microcontroller will associate data with specific time and location details.

Page 13: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

13

2.7 Flash Memory Block

Flash memory will provide long-term storage for environmental data.

2.8 TNC Block

As part of the communication subsystem, the TNC formats digital data and then converts the data into an analog signal. Likewise, when receiving a signal from the radio, the TNC will demodulate the signal and transmit the digital data to the microcontroller.

2.9 Radio Block

The radio and its antenna are key components of the communication subsystem. The radio will transmit a modulated signal from the TNC over its antenna. Also, the radio will receive signals from its antenna and direct them to the TNC.

2.10 Mechanical Block

This block represents the physical aspects of the buoy, such as its shape, size, and weight. We will address the buoy mechanical issues later in the design process.

Page 14: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

14

3. Preliminary Design

After the block diagram was created, the design process continued with a quantitative buoy system model which included a data budget, a power budget, and a link budget. Using Microsoft Excel, this system model was drafted as a spreadsheet with preset functions that expressed the mathematical relations between design parameters. As potential design choices were typed in, the spreadsheet buoy model would instantly calculate the system-wide consequences of those choices. Therefore, the spreadsheet model was a powerful development tool which informed the team on the interrelationships of system characteristics.

3.1 Creating The Buoy System Model

The buoy is essentially a data collection and transmission system. The buoy system model began as a link budget to ensure that the buoy could indeed successfully transmit its data to the satellite. Once the necessary transmission power was calculated from the link budget, the buoy system model’s development continued with the creation of a data budget.

The data budget started with an assumption about the quantity of data gathered during each collection period. Then, assuming one data collection every hour, a total data amount per day was calculated.

Next, the buoy system model was expanded to include the underlying calculations and system requirements of a satellite access scheme. A satellite access scheme is a means by which the buoy will establish a reliable communications link with the satellite. The satellite access scheme will be discussed in further detail in a later section.

With a data budget, a link budget, and a communications schedule, the buoy system model was ready to add a power budget. The power budget first calculated the total system power needed from the two major draws of power, the communications system and the command and data handling system. Next, given our power system design, the power budget calculated the power generated from the buoy’s solar panel array. Finally, the power budget demonstrated that the buoy harnessed more solar power than it consumed each day.

Before summarizing the buoy system model conclusions, this report will outline the design and choice of the satellite access scheme.

Page 15: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

15

3.2 Satellite Access Scheme Design

The satellite access scheme describes the algorithm for establishing contact between the buoy and the satellite. The satellite access scheme poses a crucial engineering challenge. With a drifting buoy and an orbiting satellite, when will a line-of-sight transmission opportunity become available? There are three major approaches to a satellite access solution:

(1) Intelligent Buoy: The buoy uses sophisticated software to predict satellite passes based on orbital data.

Advantages: The buoy will only transmit during actual satellite passes and thus will save power because it can power down until the predicted satellite pass.

Disadvantages: The buoy will require a more powerful microcontroller and a more complex operating system. These two features could drastically increase system power requirements. Also, the implementation of a complex operating system could introduce further engineering challenges and consequently delay project completion.

(2) Beacon Buoy: The buoy transmits on a set schedule such that, inevitably, it will establish a link with the satellite.

Advantages: A software implementation of this algorithm is relatively straightforward and therefore reliable.

Disadvantages: The buoy will consume more power as it broadcasts to “deaf ears” when the satellite is not in the line-of-sight.

(3) Waiting Buoy: The buoy remains in a receive mode as it waits for the satellite to make first contact. The satellite can then choose when it wishes to extract data from the buoy. The buoy functions as a passive data repository that the satellite can access at will.

Advantages: The software implementation of this algorithm is even simpler than the two previous algorithms. The buoy adopts a more passive, slave role with respect to the satellite. Perhaps more software development time could be spent adding programmable features to the buoy such that the satellite may program the buoy’s behavior. This would further designate the buoy as a slave device of the satellite.

Disadvantages: The buoy must provide power to its radio all the time. There is an appreciable current draw from a radio in receive mode. This constant current

Page 16: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

16

draw will grow the power requirements so large that batteries alone will not be sufficient for the buoy.

See Figure 3 for a table summarizing the Satellite Access Scheme comparison.

Figure 3. Satellite Access Scheme Comparison

Scheme Description Advantages DisadvantagesIntelligent Buoy Use software to

predict satellite passes.

1. Buoy only transmits when satellite is present.2. Uses less power for transmission.3. A more elegant design. The buoy is aware of the satellite’s current behavior.

1. Requires an operating system.2. Requires a more advanced processor which will demand more power.3. Power savings from transmission will be spent on computing power.

Waiting Buoy In constant receive mode while waiting for satellite to initiate communication.

1. Simple implementation.2. Buoy is always ready for communication.3. May allow for other parties to communicate with buoy.

1. Requires constant draw of current.2. The batteries will drain quickly. Many batteries will be needed.3. Our solar panels cannot timely replenish the power consumed.

Beacon Buoy Transmit an aloha according to a schedule. Listen for acknowledgement.

1. Straightforward implementation.2. Less power consumed.3. Commonly accepted scheme for buoys.

1. The buoy will beacon even when the satellite is not present.2. The beacon will consume power, but only for brief periods every 4 minutes.

Page 17: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

17

Although each scheme is capable of establishing a reliable and periodic link with the satellite, the schemes differ significantly in terms of their power consumption. Moreover, this project can be classified as an embedded system which must operate in the field. Typically, low-power consumption is essential for embedded system designs. Therefore, the decision process focused on power consumption as the criterion to select a satellite access scheme.

Therefore, this project will implement the Beacon Buoy scheme because it boasts the lowest power requirements. This conclusion is the result of inputting the quantitative equivalent of each scheme into the buoy system model. Ultimately, the buoy system model predicted that the Beacon Buoy scheme would require the least amount of power.

The Beacon Buoy satellite access scheme algorithm relies on an “aloha” method of establishing a satellite link. An “aloha” is a brief transmission which, if received, informs the satellite that it is in the line-of-sight of the buoy. If the satellite acknowledges the aloha, the buoy will begin transmitting its data.

The Beacon Buoy satellite access scheme algorithm is as follows:

(1) Every 4 minutes, broadcast aloha. (Assumption: aloha size = 100 bytes)(2) Listen for 30 seconds.(3) If aloha is acknowledged,(4) Then send current day’s data.(5) Else, stop, loop to #1.

3.3 Buoy System Model

This section will present, in its entirety, the buoy system model, which has served as the main instrument for assisting design decisions. The buoy system model features the theory, the assumptions, the data, and the decisions surrounding this project. This system model has been created from the contributions of each team member’s research and engineering judgment.

See Figure 4 for the Buoy System Model in spreadsheet form.

Page 18: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

18

Figure 4. Buoy System Quantitative Model

Page 19: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

19

Figure 4, Continued.

Page 20: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

20

Figure 4, Continued.

Page 21: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

21

Figure 4, Continued.

Page 22: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

22

Figure 4, Continued.

Page 23: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

23

Figure 4, Continued.

Page 24: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

24

Figure 4, Continued.

Page 25: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

25

Figure 4, Continued.

Page 26: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

26

3.4 Buoy System Model Conclusions

In summary, the buoy system model proves two main conclusions.

(1) The buoy’s link budget demonstrates that 6 watts of transmission power will produce the necessary signal strength to link with the satellite.

(2) The buoy’s solar panels generate roughly 13 watt-hours of power per day. Yet, the buoy only consumes about 5 watt-hours of power per day. Therefore, the buoy has plenty of power to recharge its battery each day.

4. Subsystems

4.1 Communication Subsystem

4.1.1 Alternatives & Tradeoffs

To make a judgment on what antenna will be the most advantageous for our project it would be of importance to learn about antennas in general. The best place to start to comprehend antenna theory is with radio waves. Radio waves are waves of energy that resemble closely to light waves and in fact they travel through air at the speed of light. A radio wave is usually visualized to be a sine wave and the period of this wave or cycle is known as its wavelength. (See figure below)

Figure 5 Radio Wave

Page 27: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

27

To better follow antenna theory one be would be prudent to understand how an antenna radiates electromagnetic waves or radio waves. This radiation occurs due to the time varying properties of the current, or an acceleration or deceleration of charge. Radiation however will still take place in a bent wire with a uniform velocity of its charges. The intensity of the magnetic field can be calculated by

H (2I) R . The radiation that is produced can be shown using Figure 2.This magnetic field is the signal and when it strikes another antenna such as the satellite it induces a current on the antenna surface and the current produced is then converted into data.

Figure 6 Antenna Radiation

The ability of an antenna to increase the field strength is measure in decibels (dB) and is called the gain of an antenna. According to wikipedia “Antenna gain is the ratio of the power density of an antenna’s radiation pattern in the direction of strongest radiation to that of a reference antenna.” The reference antenna is usually either an isotropic antenna (dBi) or a dipole antenna (dBd).

Standing Wave Ratio is a complex subject needing you to comprehend a few other properties involved in antennas. On such factor is impedance when we think of impedance we think of something that impedes or acts as a force. Impedance in antennas refers to the ratio of voltage to current at any place on the antenna. This ratio is different throughout the antenna, which means that its impedance also differs along the antenna.

This talk of impedance has to refer to our 50-ohm coaxial cable used to connect our radio to its antenna. To achieve maximum power transfer so well taught to us by Dr. Kumar we need match our impedances, which is known as tuning your antenna. So what happens with mismatched impedances? Well the coax connection on the antenna causes some of our wave to be reflected

Page 28: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

28

back depending on how out of tune your antenna is. This combination of our original wave toward the antenna and the reflected wave is known as Standing Wave Ratio. This ratio is generally tried to keep low, preferably less then 2:1.

The last fundamental theory part to tackle is the theory of polarization. As mentioned above a radio wave is composed of two fields an electric field and a magnetic field. These fields are perpendicular to each other and their sum is called the electro-magnetic field (figure 3). The fields transfer energy back and forth to each other to what is called oscillations.

Our primary field of interest is the electric field. The position and direction in relation to the ground determines its wave polarization. So if the antenna is vertical then the polarization is vertical and the same goes for horizontal. This can affect radiation pattern and will be part of what we are testing.

Figure 7 Electromagnetic Wave

Quarter Wave

The type of antenna that was used on our test was a ¼ wave antenna, which has an omni directional pattern meaning it radiates equally well in all directions. This works well with the design of the buoy, as our bearing to the satellite is unknown and randomly changing. It does however have the least amount of gain (3dBi), which makes it poor for antenna reciprocity, which is a feature that allows an antenna to both transmit and receive signals. It also needs a ground plane, which can be either constructed or can be substituted by the ocean.

Page 29: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

29

Figure 8 1/4 & 1/2 Wave Antenna Radiation

The quarter wave antenna does however need a good ground plane to work properly. A ground plane is a flat surface usually made of metal that limits the downward radiation of the antenna and extends a minimum of one wavelength in each direction from the antenna.

If a quarter wave antenna is used without a ground plane or one that is not functioning properly then two things can happen. One is that the radiated power will tend to go out in every direction up / down as well as towards the horizon. The other problem is the antenna can become mismatched and a high Standing Wave Ratio will be seen. Which causes the power that the transmitter generates to “bounce” back into the transmitter and be lost as heat. This in turns reduces the signal that our satellite will see causing more problems.

Half Wave

A half wave antenna however does not need a ground plane, which makes it more conducive to our environment and contains all of the other positives and negatives that was mentioned above for the ¼ wave antenna. The only other difference is in length, which is a consideration that was addressed in the mechanical design of our buoy.

Five-Eighth’s Wave

Another antenna that was included in our design discussions was the 5/8-wave antenna, which has a greater gain then the ½ wave and ¼ wave antennas at 4.2 dBi. Like the 1/4 wave antenna a ground plane is needed.

Figure 9 5/8 Wave Antenna Radiation

Conclusion:

These were the only antennas that were feasible as they are all omni directional antennas. Due to the constant moving of the buoy a directional antenna would not be feasible for our project such as a Yagi antenna. With this knowledge of antennas the team decided on a ¼ wave antenna to be used on the buoy to help with the mechanical structure stability.

Page 30: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

30

Crystal Radio:

There were two types of radios discussed for use of transmitting, one using crystals as an electrical oscillator to transmit at certain frequencies. These are very low power radios, which made them very attractive for power budget considerations. However crystal radio are susceptible to aging and environmental factors like temperature and vibration. This will cause them to drift from there nominal frequency. They do however have low phase noise, which gives them extremely stable signals.

Synthesized Radio:

These radios are the most popular radios seen today. They can be used over a wide variety of frequencies unlike crystal radios but need a constant power source. Our transmission will be sent using the frequency of 145.825 MHz at 6 watts so this has limited the number of handheld radios that we could use. Looking at most companies data sheets we were able to select one that would both transmit and receive at a reasonable power budget. Most synthesized radios today are transceivers so the need for a crystal radio for receive was deemed unnecessary according to our power budget.

4.1.2 Feasibility

To validate our communications from our buoy to the CAPE II satellite one must see if it is possible to do so and at what power. This can be easily done by the use of a link budget. As per previous Cube Sat buoy projects we chose an uplink frequency of 145 MHz, which will be transmitted at a distance of roughly 2000 miles with a bandwidth of 30 KHz. In communication systems, channel noise is tied to bandwidth as all objects that have heat emit RF energy in the form of random noise. This can be calculated by:

N = kTB = 3 watts where:N = noise power (watts)k = Boltzman’s constant (1.38 x 1023 J/K)

T = system temperature, usually 290KB = channel bandwidth (Hz)

Another key consideration is the issue of the range between our buoy and the satellite. This distance can cause a loss in signal strength of the electromagnetic wave that results from a line of sight path through free space, with no obstacles nearby to cause reflection or diffraction. This is called free space loss and can be calculated by:

FSL = 96.6 + 20log(F) + 20log(D) = 145.848 db where:F = uplink frequency (Hz)D = distance (miles)

Page 31: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

31

So what is our received signal level (RSL)? Well first we have to know our transmission power, transmission gain, receiver gain, and the FSL to calculate. Our PTX = 37 dbm , GainTX = 0, GainRX = 0, FSL = 145.848 db.

RSL = Power + TX Gain + RX Gain – FSL = -108.848 dbm

So is this above our minimum detectable signal (MDS)? Is our link budget feasible? To do this we next calculate our MDS, by this equation:

MDS = 10*log[(k*B*T)/.001] + N = -126k = Boltzman’s constant (1.38 x 1023 J/K)

T = system temperature, usually 290KB = channel bandwidth (Hz)N = noise figure (db)

This shows that our RSL is greater then our MDS that makes our link budget feasible in terms of transmission strength.

However the most important aspect of link budget is the signal to noise ratio (Eb/No), which was given to us to be 8. Now with RSL, MDS, and Eb/No we still have to design an allowance that provides sufficient sensitivity to accommodate fading. Fading is the distortion of a signal over a certain propagation media. To calculate our fade margin all we need to do is another simple calculation:

Fade Margin = RSL – MDS - Eb/No = 9

Our last calculation will to calculate our transmission power (PTX) that will be needed. We were given a spec of 30% transmitter efficiency (Teff), so to calculate PTX all we need to do is:

PTX = 10^(P/10) * .001/Teff = 17 watts

Link Test

1.1 Description of Test

The link budget test is a measure of the power needed on our buoys to perform reliable communications with the CAPE II satellite. It will also measure the effects of antenna angle from the ground plane on our transmission success.

1.2 Unit of Measure

The transmission success rate will be measured by our repeated signals viewed on HyperTerminal.

2.1 Equipment

Page 32: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

32

The transmission to the satellite will be performed by a TinyTrak3 and sent out by a radio. Our Byonics GPS1 will send out the GPS location. All enclosed in a waterproof pelican case. We will be using a PVC pipe with an 18” copper wire as our ¼ wave antenna.

Test Setup

A. Verify battery is charged to 12.4 Volts DC or greater.

1. If battery voltage is < Volts DC refer to the battery charging procedure.

B. Place antenna and box (with radio, battery, and tiny tracker) on the roof of Madison hall

C. Connect the following leads inside the box.

1. Connect the male DB-9 to the Radio / Power end of the tiny tracker.2. Connect the female DB-9 to the GPS / Computer end of the tiny

tracker.3. Connect the BNC on the antenna to the box and situate antenna as

described for the days test.4. Connect the black lead to the negative terminal of the battery.5. Connect the red lead to the positive terminal of the battery.

D. Verify the power light on the tiny tracker illuminates.

E. Verify the radio’s frequency is selected to 145.825 MHz

F. Wait a few minutes to allow the GPS to “lock on” and then the transmit light should illuminate once every 30 seconds.

G. Verify inside CAPE lab that the radio is transmitting at prescribed frequency by the use of the ground station.

1. To turn on the ground station first turn on the Elevation-Azimuth dual controller G-5500, mystery box, and the Astron RS-35M.

2. Verify the Kenwood TS-2000 is on the 145.825 MHz frequency.3. Every 30 seconds you should here a transmission over the radio.

Conclusion

With our calculations and testing we feel confident that we will be able to transmit our data using the equipment we have selected. We hope to continue testing to build a more efficient buoy that will not jeopardize our transmission success. Shown below in figure 10 is the data collected during our testing.

Page 33: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

33

Figure 10

Day # of Transmission # of Successful

Transmission

% of Successful

Transmissions

Antenna Polarization

2/21/08 27 15 55.56% 90 Vertical2/22/08 48 30 62.50% 90 Vertical

DAY 2/21/08 OVERCAST

Transmission Time (AM)

Corresponding Successful

Transmission Time

Antenna Polarization

Azimuth Elevation Range Height

4:52:35 4:52:36 90 Vertical 62.1 8,5 2493 8014:54:04 4:54:05 90 Vertical 52.4 3.9 2913 8026:24:14 n/a 90 Vertical 217.8 0.6 3262 7966:24:44 6:24:44 90 Vertical 218.6 2.2 3073 7966:25:13 n/a 90 Vertical 219.6 4 2886 7966:25:43 6:25:44 90 Vertical 220.8 6 2699 7966:26:12 n/a 90 Vertical 222.1 8.1 2515 7966:26:42 6:26:43 90 Vertical 223.7 10.4 2332 7976:27:12 6:27:13 90 Vertical 225.5 13 2153 7976:27:42 6:27:42 90 Vertical 227.7 15.9 1978 7976:28:11 n/a 90 Vertical 230.4 19.1 1808 7976:28:41 6:28:42 90 Vertical 233.8 22.7 1645 7976:29:10 n/a 90 Vertical 238.2 26.8 1492 7986:29:40 6:29:41 90 Vertical 243.9 31.4 1353 7986:30:09 6:30:10 90 Vertical 251.5 36.3 1231 7986:30:39 6:30:39 90 Vertical 261.9 41.3 1134 7996:31:09 6:31:09 90 Vertical 275.6 45.5 1066 7996:31:38 6:31:39 90 Vertical 292.5 47.6 1036 7996:32:08 n/a 90 Vertical 310.2 47 1045 8006:32:38 n/a 90 Vertical 325.9 43.8 1093 8006:33:07 6:33:08 90 Vertical 338.1 39.2 1174 8006:33:37 6:33:37 90 Vertical 347.1 34.2 1283 801

DAY 2/22/08 OVERCAST

Transmission Time

Corresponding Successful

Transmission Time

Antenna Polarization

Azimuth Elevation Range Height

4:14:27 4:14:27 90 Vertical 143.9 4 2890 796

Page 34: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

34

4:14:57 n/a 90 Vertical 140.4 5.2 2772 7964:15:27 4:15:27 90 Vertical 136.5 6.4 2664 7964:15:56 4:15:57 90 Vertical 132.4 7.5 2567 7974:16:26 4:16:26 90 Vertical 127.9 8.5 2482 7974:16:56 n/a 90 Vertical 123.1 9.4 2411 7974:17:25 4:17:26 90 Vertical 118 10.2 2355 7974:17:55 4:17:55 90 Vertical 112.7 10.7 2315 7974:18:25 n/a 90 Vertical 107.2 11 2292 7984:18:55 n/a 90 Vertical 101.7 11.1 2288 7984:19:24 4:19:24 90 Vertical 96.1 10.9 2300 7984:19:54 n/a 90 Vertical 90.7 10.5 2331 7984:20:23 4:20:24 90 Vertical 85.5 9.9 2378 7994:20:53 n/a 90 Vertical 80.5 9.1 2441 7994:21:23 n/a 90 Vertical 75.9 8.2 2519 7994:21:53 n/a 90 Vertical 71.6 7.1 2610 8004:22:23 n/a 90 Vertical 67.6 5.9 2713 8004:22:53 n/a 90 Vertical 63.9 4.7 2827 8014:23:18 4:23:21 90 Vertical 60.6 3.5 2949 8014:23:48 4:23:52 90 Vertical 57.5 2.3 3080 801

5:54:33 5:54:48 90 Vertical 210 2.4 3048 7965:55:02 5:55:03 90 Vertical 210.5 4.3 2856 7965:55:32 5:55:03 90 Vertical 211.1 6.3 2565 7965:56:02 5:56:02 90 Vertical 211.7 8.6 2475 7965:56:31 5:56:32 90 Vertical 212.5 11.1 2286 7965:57:01 5:57:02 90 Vertical 213.4 13.8 2099 7975:57:31 n/a 90 Vertical 214.5 17 1915 7975:58:00 5:58:01 90 Vertical 215.9 20.6 1735 7975:58:30 n/a 90 Vertical 217.7 24.9 1561 7975:59:00 5:59:00 90 Vertical 220.1 29.9 1394 7975:59:29 5:59:30 90 Vertical 223.4 36 1239 7985:59:59 5:59:59 90 Vertical 228.4 53.2 1100 7986:00:29 6:00:29 90 Vertical 236.6 51.8 983 7986:00:59 n/a 90 Vertical 251.7 60.8 900 7996:01:27 6:01:28 90 Vertical 280.4 67.4 857 7996:01:57 n/a 90 Vertical 318 66.4 863 7996:02:27 6:02:27 90 Vertical 343.2 58.9 916 8006:02:57 n/a 90 Vertical 356.2 49.8 1008 8006:03:25 6:03:26 90 Vertical 3.5 41.6 1130 8006:03:55 n/a 90 Vertical 8.1 34.6 1274 8016:04:24 6:04:24 90 Vertical 11.2 28.9 1432 8016:04:53 6:04:54 90 Vertical 13.4 24 1600 8026:05:23 n/a 90 Vertical 15.2 19.9 1776 8026:05:53 n/a 90 Vertical 16.5 16.4 1956 8026:06:23 n/a 90 Vertical 17.6 13.4 2141 8036:06:53 n/a 90 Vertical 18.5 10.7 2327 8036:07:23 n/a 90 Vertical 19.3 8.3 2516 8036:07:53 n/a 90 Vertical 20 6.1 2706 8046:08:23 n/a 90 Vertical 20.6 4.1 2897 8046:08:53 n/a 90 Vertical 21.1 2.2 3089 8046:09:23 n/a 90 Vertical 21.6 0.6 3281 805

Page 35: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

35

4.1.3 Design Documents

TNC – X

TNC-X is a new Terminal Node Controller design based on the Chepponis/Karn KISS protocol. It is implemented using a Microchip PIC 16F628 microcontroller, a CML MX614 Bell 202 modem chip, an 8K Ramtron FRAM, a Maxim MAX232A level converter chip, and a dual op-amp which provides active audio filtering for the modem. From the beginning, this TNC was designed to be small, have low power consumption, and, most importantly, be expandable.

Page 36: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

36

Page 37: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

37

Schematic

Page 38: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

38

3-Volt Radio

The 3-volt radio uses a crystal radio to decrease power consumption and an RF amplifier to increase the RF output of the radio to our tested and calculated transmission power level. It will also use the TNC-X we hope to develop to packetize and for digital to analog conversion.

Schematic

4.2 Power

The most important subsystem of the Buoy project is the Power Subsystem. The Power Subsystem will be in charge of providing energy to all of the other subsystems. Energy is always an important factor to consider since all of the components of the buoy will not function without it.

The Design project consists of implementing different subsystems together to create a buoy that will communicate with other systems. Since the buoy has a life expectancy of 1 year, the power subsystem will have to provide energy to all of the subsystems so that they can function for this lifetime. Therefore, in order to design a successful power subsystem, the power requirements of the other subsystems should be considered and studied.

After going through research our team was able to provide an approximate amount of energy that the buoy would require; also satisfying the Design Project’s requirements. The team realized that the communication subsystem would be using a large amount of energy when compared to

Page 39: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

39

other subsystems. This energy consumption occurs since the communication subsystem will need to communicate with other devices according to our access scheme. The buoy would send an “aloha” to the device every 4 minutes followed by 30 seconds of listening. If the aloha is acknowledged, the buoy would send data. If not acknowledged the buoy would try again by sending an “aloha”.

Our calculations showed that our buoy would consume 1382.0352 Watt/Hours or 115.1696 Amp/Hours in communication purposes. Therefore our team would have to design a power system capable of proving a minimum of the Watt/Hours needed. Our two major power schemes are: Powering the buoy by using of batteries and powering the buoy by using batteries that recharge with the help of solar panels.

4.2.1 Alternatives and Tradeoffs

Batteries

The first power scheme that could be implemented in our project was the use of batteries to power up the buoy. If this scheme would be followed, there are important factors to consider when choosing batteries. The first factor to consider is weight. Batteries that provide a high Amp/Hour rate tend to be heavier. Another factor to consider when choosing batteries is the cost. These two factors will affect the decisions made when choosing batteries since they have to fit to our power requirement.

After doing some research we were able to distinguish the main differences of batteries and their chemistries. The following are different types of batteries considered and their characteristics.

Types of Batteries:

Batteries work by generating an electrochemical reaction. This reaction moves electrons from one pole to the other. The actual metals and electrolytes used control the voltage of the battery. This means that each different reaction has a different characteristic voltage.

Zinc-carbon battery:These batteries are also known as a standard carbon battery. Zinc-carbon chemistry is used in all inexpensive AA, C and D dry-cell batteries. The electrodes are zinc and carbon, with an acidic paste between them that serves as the electrolyte.

Alkaline battery:Alkaline chemistry is used in common Duracell and Energizer batteries; the electrodes are zinc and manganese-oxide, with an alkaline electrolyte. These batteries are inexpensive and may give a lot of power if arranged in parallel. They may provide different voltages like 1.5, 3, 6, 9 or 12 volts.

Some disadvantages include the fact that alkaline batteries lose their voltage gradually as opposed to rechargeable batteries; which maintain most of their voltage over the whole charge

Page 40: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

40

and then suddenly plummet. Alkaline batteries might leak if they're used only lightly or not at all for a long period of time.

Lithium-iodide battery: Lithium-iodide chemistry is used in pacemakers and hearing aides because of there long life. These batteries are small and light weight. These are designed for very high-drain devices, like digital cameras, motorized toys, and portable CD players. They're more efficient than standard alkaline batteries for high-drain devices. These batteries are expensive and are not rechargeable.

Lead-acid battery:

Lead-acid chemistry is used in automobiles; the electrodes are made of lead and lead-oxide with a strong acidic electrolyte. These batteries are inexpensive and simple to manufacture. In terms of cost per watt-hours, the lead-acid battery is the least expensive when compared to others. Lead acid batteries are mature, reliable and well-understood technology; when used correctly the lead acid battery is durable and provides dependable service. Also these batteries have a low self-discharge, having among the lowest in rechargeable battery systems.

On the other hand, lead acid batteries cannot be stored in a discharged condition. These batteries have a low energy density. This means that they have a poor weight-to-energy density, which limits use to stationary and wheeled applications. Lastly lead acid batteries allow only a limited number of full discharge cycles.

Nickel-cadmium battery:The electrodes are nickel-hydroxide and cadmium, with potassium hydroxide as the electrolyte. These type of batteries do not last very long before needing a recharge. They typically have 50 to 67% less capacity than alkaline batteries and Nickel-Metal Hydride batteries. Another downside of both Nickel-Metal Hydride batteries is that they self-discharge quickly. This type of battery is rechargeable.

Conclusions

After going over the different types of batteries and their characteristics the team considered in using alkaline batteries to power up the design project. The team decided to use so-called “lantern” batteries for the buoy due to their shape and size. This type of battery would provide 6 volts and each would weight 885 grams. The idea is to arrange about 16 of these batteries in parallel to provide the amount of amp-hours needed for our project.

We know that 16 alkaline batteries would provide about 160 amp-hours, which will satisfy our minimum of 115.16 amp-hours. This battery can be purchased for about $10 to $15. Therefore our battery expenses may add up to $160 to $240. The only problem would be that once the batteries are completely discharged, the buoy and all of its components would not function. The following picture displays the dimensions of the alkaline battery.

Page 41: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

41

Figure 11 Lantern Battery Dimensions

Solar Panels and Batteries

The second power scheme that was considered by the team was using solar cells to charge up our batteries to satisfy our power needs. Solar cells are tools that will help us transform energy from light to electric energy. The idea is to absorb energy from the sun since the sun is an eternal source of energy. Solar cells make electricity without waste, noise or pollution. These are solid-state devices in which there are no moving parts; therefore nothing wears out.

When light strikes a substance it causes the surface of the material to emit electrons. Also, when light strikes other substance it causes the material to accept electrons. The combination of these two substances can be used to cause electrons to flow through a conductor. This is called the photoelectric effect. The process when sunlight is converted into a flow of electrons (or simply electricity) is called Photovoltaic.

The source of energy used in this system is photons. Photons are the particles generated by sunlight; they carry a large amount of energy to earth. Solar panels use this large amount of energy by using silicon crystals with impurities added. This process of mixing materials is called doping. When two doped materials are bonded against each other an electric current can be induced.

In short, photovoltaic cells are made of special materials called semiconductors. Basically, when light hits a cell a portion of it is absorbed within the semiconductor. This energy causes electrons to move freely in the semiconductor. As we all know, this flow of electrons will cause a current.

Page 42: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

42

Figure 12 Solar Cell Theory

Solar Panels Implementation

The use of solar panels will provide our system a good source of “eternal” energy. This is a good idea to consider since solar panels will let our power subsystem recharge when needed. This will provide the energy needed to other subsystems and avoid the change of batteries in the future. But in order to absorb photons correctly, the solar panels must be pointed in direction to the sun. There are a number of different variables to consider when figuring out the best direction.

First, we assume that the solar panels are fixed. Solar panels should always face south. If they are located in the southern hemisphere, solar panels should face north. In our case, the use of multiple solar panels will let them always face the appropriate direction. Next, we need to figure out the angle from the horizontal.

Since the winter season has always the least amount of sun, we will have to find an optimal angle that will let the solar panels collect as much energy as possible. This means that if our need for energy is evenly the same throughout the year, we will want to leave the tilt at the winter setting. This is because the angle of the solar panels will be fixed.

Page 43: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

43

Figure 13 Sun Path

To calculate the best angle from horizontal of tilt during winter season we will use the following formula:

Angle = (Current Latitude * 0.9) + 29

The following table will show some examples of different locations with their corresponding angle from horizontal. Notice that the Angle from Horizontal is directly proportional to the latitude from the location.

Location Latitude Angle from HorizontalGuatemala City 14 (14 * 0.9) + 29 = 41.6

Mexico City 19 (19 * 0.9) + 29 = 46.1La Havana, Cuba 23 (23 * 0.9) + 29 = 49.7

Houston, TX 29 (29 * 0.9) + 29 = 55.1Lafayette, LA 30 (30 * 0.9) + 29 = 56

These calculations are assumed to be true only if energy is collected from an unobstructed sky. Also, it assumed that the solar panels are located at an altitude near sea level. This is important since at higher altitudes there is little atmosphere to absorb light from.

Lead Acid Batteries

The team has planned to implement a lead acid battery in the power system due to several reasons. One of the main reasons is following the fact that lead-acid batteries have a poor weight-to-energy density. This is important because the battery will be used to stabilize the buoy in the water. By placing the battery in the bottom of the buoy the weight of the battery will be able to compensate the weight of the mechanical structure. The team is planning to use a battery with a capacity no less than 14 Amp-Hours.

The following picture shows the weight and dimensions of a 12V 14Amp-hour Lead Acid battery.

Page 44: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

44

Weight: 9.25 lbs (4.20 kg)Length: 5.95 in (151 mm)Width: 3.86 in (98 mm)Height: 3.70 in (94 mm)

Height to Terminals: 3.94 in (100mm)

Another reason is because lead-acid batteries have a low self-discharge. This is important because the team is planning to manufacture a buoy with a lifetime of 1 year. Therefore, we would want to prevent our batteries from self-discharging. Lastly, lead acid batteries are inexpensive when compared to the prices of other types of batteries; our task is to design a buoy that is relatively cheap.

Advantages

Some of the advantages when using solar panels correctly include provide power for long deployments. This means that our system will not be dependent on any number of batteries since it will have solar panels to recharge the batteries. We know that the weather is constantly changing; some days may be cloudier than others. This will decrease the effectiveness of the solar panels. On the other hand, recharging will not be required every day. This means that our solar panels will not be used constantly; they will be used only when needed. Panels are generally fully enclosed in glass, so that there is no problem surviving in marine applications where washed with waves. The lifetime of solar panels is really high. Manufacturer warranty generally says that after 10 years of use the solar panel will output >90% original power.

Page 45: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

45

Disadvantages

Some disadvantages of using solar panels include the fact that the batteries may be overcharged. Also panels can be damaged if not protected by a cover. More than one solar panel may be needed to satisfy our power needs. We know that the weather is constantly changing; some days may be cloudier than others. This will decrease the effectiveness of the solar panels. The solar panels have to be at a constant angle of incidence in order to charge the batteries correctly. The prices of solar panels may be high depending on the size and power. They can be purchased for about $50 - $200 depending on mostly on size. Rechargeable batteries may be needed to use the solar panels.

Conclusions

After working on research and experiments, the team was able to decide which would be the best power scheme for the design project. The team chose to implement solar panels on the power subsystem due to many reasons. Firstly, solar panels will expand the lifetime of the buoy since it will not need battery replacement due to battery discharge.

The prices of solar panels may be higher, but the team believes that paying extra will benefit the project as a whole. Weight may also increase when using solar panels since rechargeable batteries are needed. For example, lead-acid batteries may be really heavy when compared to alkaline batteries. Since our buoys are placed in water, weight is not an issue. The team will design individual power systems for all subsystems to make them independent in power terms.

The team plans to use lead acid batteries that will be charged by the solar panels. The battery will be positioned in the bottom part of the buoy. The idea is to compensate the weight of the battery with the weight of the rest of the buoy. The weight of the battery will be located underwater. In order to satisfy the needs of the design, the team has planned to use a lead acid battery that can provide a minimum of 14 Amp-Hours.

The solar panels may only work properly if they are fixed in the right angle of incidence with the sun. The team will use multiple solar panels to collect as much sunlight as possible. This is because the buoy may rotate on its y-axis, causing the fixed solar panels to move. By implementing multiple solar panels, the buoy will always receive sunlight.

4.2.2 - Feasibility

Battery Charging Procedures

A. Measure the voltage in order to calculate the time the battery will charge.a. Connect alligator clips to the battery according to positive (red) and negative

(black) poles.b. Set the digital meter to read DC voltage.

B. Refer to the following chart to approximate the voltage charge of the battery.

Page 46: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

46

State of Charge 12 V Battery Volts per cell

100% 12.7 2.1290% 12.5 2.0880% 12.42 2.0770% 12.32 2.0560% 12.20 2.0350% 12.06 2.0140% 11.9 1.9830% 11.75 1.9620% 11.58 1.9310% 11.31 1.89

0 10.5 1.75

a. These voltages are for batteries that have been at rest for 3 hours or more.b. Batteries that are being charged will be higher – the voltages while under

charge will not tell anything, therefore the battery must sit for a while.c. Chart Zones:

1. For better life, batteries should stay in the green zone of the chart.2. Occasional uses of battery during yellow zones are not harmful.

i. Continual discharges to yellow levels will shorten battery life.C. Set the DC source to deliver 14.6 volts.

a. Make sure to connect cables on the +25 ports of the DC source.b. Scroll voltage until 14.6 volts are being delivered.

D. Set the DC source to deliver a minimum of 3 mA.a. Create a short between the positive and negative ports +25 ports.

i. This will allow user to set the current to 3 mA.b. Scroll current until 3 mA are delivered.c. Disconnect cables to undo the short.

E. Connect cables with alligator clips to positive and negative terminals of the battery with the respective ports of the DC source.

a. Notice the voltage of the source will change from 14.6 volts to a lower voltage depending on the initial battery voltage.

F. Allow battery to charge for a couple of hours depending on the charge needed.a. Current * voltage * hours charged = Power measured in Watts/ hrs

G. After the battery is fully charge disconnect alligator clips and turn off equipment.H. Allow battery to rest a minimum of 3 hours before being used.

Solar Panel Experimentation

The team was able to run experiments on a solar panel to learn more about its functions. A solar panel was connected across a resistance box and a voltmeter to see how the change in resistance would affect our output voltage

Page 47: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

47

The following table shows the results of the experiment.

Resistance Voltage Current (mA)1 77 mV 64.8 10 0.56 V 64.60 100 5.15 V 63.50 1 K 18.10 V 17.95 10 K 19.06 V 1.896 100 K 19.17 V 0.1906 1 M 19.21 V 0.0191

Notice that as the resistance increases the voltage output will increase as well. During this experiment the team also tried changing the angle of incidence of the solar panels. The data was collected while using a constant angle of incidence. With this information the team was able to approximate the power delivered if 4 solar panels were used.

Experiment’s Conclusions

We know that the project will consume approximately 115 amp-hours / year, meaning that it will consume about 0.315 amp-hours / day or 3.78 watt-hours / day. Assuming that we will be using a 1000 resistance to regulate the voltage, the solar panels will collect 0.136 amp-hours /day. This is assuming that everyday has at least 8 hours of direct sunlight.

This means that each solar panel will be able to deliver 1.632 watt-hours / day. The team is planning to use four solar panels at a correct angle of incidence according to the buoy’s location.

Therefore, the buoy’s solar panels would be able to collect 6.52 watt-hours / day for 8 hours on 1 day. Notice that the amount of energy that can be collected from the sun is greater that the amount of energy that is presumed to be used by the communication subsystem (6.52 watt-hours / day > 3.78 watt-hours / day).

In cases when the weather is constantly sunny, the solar panels may accidentally overcharge the batteries. For this type of issue, the team is planning to design a circuit that will prevent the solar panels from overcharging the batteries.

Peak Power Point

When a solar panel is set across a resistance box voltage and current delivered may vary according to the resistance value. From our last experimentation the team was able to learn that when the solar panels are set across an increasing resistance voltage will also increase. As a result, the current flowing through the circuit will decrease.

This means that at a low operating voltage a solar panel output current will be high but the output power will be low. This is because power is the product of voltage times current; P = V * I. Also, at a high operating voltage the current will be low and so the output power will be low as well. Somewhere in the middle is the panel’s peak power point, which is where the product

Page 48: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

48

voltage time’s current is maximized. It is important to find the peak power point of out solar panels so that we can use these devices effectively.

To find the solar panel’s peak power point the team ran some experiments on a sunny day. Again, a solar panel was set across a resistance box and a voltmeter. In addition, an ammeter was implemented in the circuit to measure the values of current flowing.

Figure 14 Peak Power Point Test Circuit

The resistance was varied and values of voltage and current were recorded. The following chart shows the experiment’s results.

Note: The resistance column shows the varying resistances used. The Vout column shows the voltage delivered across the resistance box, measured by a voltmeter.

The measured current column shows the values current collected by using an ammeter.

Calculated current column were calculated by using I = Vout / Resistance, which helped us prove we were recording correct values.

Measured power column = Measured Current * Vout.

Calculated power column = Calculated Current * Vout, used to prove if we were on the right track when recording measured value

Page 49: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

49

Resistance Ohms Vout

Measured Current Amps

Calculated Current Amps

Measured Power Watts

Calculated Power Watts

1 0.077 0.0648 0.07700 0.0050 0.005910 0.56 0.0646 0.05600 0.0362 0.0314

100 5.66 0.05380 0.05660 0.3045 0.3204150 7.47 0.04780 0.04980 0.3571 0.3720200 9.29 0.04218 0.04645 0.3919 0.4315

Page 50: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

50

250 10.49 0.03950 0.04196 0.4144 0.4402300 11.40 0.03485 0.03800 0.3973 0.4332350 12.09 0.03289 0.03454 0.3976 0.4176400 12.79 0.02912 0.03198 0.3724 0.4090450 13.24 0.02870 0.02942 0.3800 0.3896500 12.66 0.02526 0.02532 0.3198 0.3206550 12.95 0.02420 0.02355 0.3134 0.3049600 14.36 0.02230 0.02393 0.3202 0.3437650 14.55 0.02128 0.02238 0.3096 0.3257700 14.82 0.01992 0.02117 0.2952 0.3138750 14.97 0.01908 0.01996 0.2856 0.2988800 15.21 0.01791 0.01901 0.2724 0.2892850 15.32 0.01726 0.01802 0.2644 0.2761900 15.50 0.01633 0.01722 0.2531 0.2669950 15.58 0.01577 0.01640 0.2457 0.2555

1000 15.73 0.01516 0.01573 0.2385 0.24741050 15.81 0.01461 0.01506 0.2310 0.23811100 15.88 0.01401 0.01444 0.2225 0.22921150 15.97 0.01352 0.01389 0.2159 0.22181200 16.07 0.01294 0.01339 0.2079 0.21521250 16.14 0.01254 0.01291 0.2024 0.20841300 16.22 0.01209 0.01248 0.1961 0.20241350 16.28 0.01173 0.01206 0.1910 0.19631400 16.36 0.01128 0.01169 0.1845 0.19121450 16.40 0.01098 0.01131 0.1801 0.18551500 16.48 0.01062 0.01099 0.1750 0.1811

10000 19.06 0.001896 0.00191 0.0361 0.0363100000 19.17 0.00019 0.00019 0.0036 0.00371000000 19.21 0.000019 0.00002 0.0004 0.0004

Experiment’s Conclusions:

From the results the team was able to learn that the peak power point was when:Voltage = 10.49 voltsCurrent = 0.03950 ampsPower = 0.4144 watts

Page 51: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

51

With this experiment the team also learned that previous conclusions on calculations of the value of watt-hours delivered by a single solar panel might be erroneous. This is because the previous calculations were made assuming solar panels would be across 1000-ohm resistances.

If a single solar panel is used across a 250-ohm resistance then it will deliver 0.316 amp-hrs. This is assuming that on average a day has 8 hours of sunlight. 0.316 amp-hrs = 0.03950 amp * 8 hrs.

Therefore this single solar panel will then deliver 3.3152 watt-hrs. This is assuming that on average a day has 8 hours of sunlight.3.3152 watt-hrs = 0.4144 watt * 8 hrs.

These results show that the rate of power generation is almost the same as the rate of power consumption. Since the task of solar panels is to charge the lead-acid batteries, the use of solar panels with its peak power point is still feasible.

4.2.3 - Design Document

Schematic

Page 52: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

52

Description

Solar Panels:

This basic schematic shows the different components of the power subsystem. The power system will feature four solar panels connected in parallel. The panels will be connected in parallel because we want the current to change and not the voltage. Therefore the voltage will stay constant when the panels are in parallel. To be able to control the amount of current flowing into the battery a resistance will be used as shown in the schematic. The value of this resistance is related with the value of the resistance that gives us the peak power point.

LM7805:

Next a voltage regulator is implemented in the circuit. The LM7805 is a voltage regulator that will change 12 volts into 5 volts. Port 1 represents the input of voltage, in our case 12 volts. Port 3 represents the output of voltage, in our case 5 volts. Lastly, port 2 is connected to the circuit’s ground. This 5-volt line will be used to power the GPS subsystem.

LM317:

Page 53: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

53

These components are another voltage regulators needed for our system to function properly. These regulators will have an input of 12 volts and will generate an output of 3 volts and 3.8 volts. The 3-volt line will be used to power the receive communications subsystem. The 3.8-volt line will be used to power the transfer communications subsystem. The two resistances connected to these devices are used to regulate the voltage and obtain the output voltage needed.

In operation, the LM317 will develop a nominal 1.25V reference voltage or VREF, between the output and adjustment terminal. Output voltage is determined by the values established on resistors R1 and R2. The output voltage can be approximated by using the following formula: Vout = 1.25 * [1 + (R2 / R1)]. The voltage across R1 is a constant 1.25 volts and the adjustment terminal current is less than 100uA. A minimum load of 10mA is needed to assure that the value for R1 can be selected to drop 1.25 volts at 10mA or 120 ohms.

When power is shut off to the regulator the output voltage should fall faster than the input voltage. In case this does not happen a diode will protect the regulator from possible reverse voltages. The 1uF capacitor placed across the output will improve transient response. Next, the 0.1uF capacitor is set across the input only if the regulator is located at distance from the power supply filter (more than 6 inches away).

12V Lead Acid Battery:

This battery will be in charge of storing all of the power collected by the solar panels. It will be able to deliver 12 volts to the system.

NPN Transistor

This transistor is charge of controlling the flow of current from the solar panels to the battery. The transistor will work as a switch, turning on when the battery needs current to charge and off when the battery does not need charge. This transistor is implemented in the circuit with the objective of preventing the battery to overcharge.

The collector will be connected to the solar panels positive end. The emitter will be connected to the resistance in series. The base will be connected directly to the PIC. The PIC will be in charge of sending a voltage to the base of the transistor in order to open or close the switch. The battery’s voltage will be sent directly to the PIC. This will tell the PIC the current battery voltage. When the voltage of the battery reaches a certain value, the PIC will send a signal to the base of the transistor.

4.3 Sensor Subsystem

Page 54: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

54

The oceanic and atmospheric environmental conditions, which can be categorized as physical quantities are converted into signals that an observer or an instrument can easily read and understand, using environmental sensors. These analog data vary in a long range from the ocean’s substances, solutions and compositions to the atmospheric conditions such as wind speed, objects’ distance, wind direction and much more. These data are converted to digital outputs, which would be handled in the command & data handling subsystem. In this section six different sensors that contributes to the implementation of the buoy would be discusses. This section includes different design or device alternatives, the feasibility of the devices and an overall schematic of sensor subsystem.

4.3.1 Alternatives and Tradeoffs

Air Temperature

The title of this section explicitly describes the purpose of this sensor, however in general term the temperature sensor senses the temperature of the atmosphere in terms of the units, Celsius or Fahrenheit. The inputs of these temperatures would be some analog voltage, but essentially would be converted to a digital output. The temperature is interpreted from the digital output based on a voltage to temperature reference and a mathematical calculation or I2C interface, which would be discussed later. In other to discuss the alternatives and trade offs of the air temperature sensor, it is important to understand the different types of temperature sensors available. Thermocouple:

Thermocouple is pair of junctions from two dissimilar metals. One junction includes the measured voltage and the other junction includes a voltage from a known reference temperature. The voltage measurement would be determined by the SeeBack effect. The SeeBack effect describes the voltage or electromotive force (EMF) induced by the temperature difference along the copper wire shown in the diagram below. The voltage output would change with respect to the change in measured temperature from the tip of the thermocouple. It is normally advisable to make the reference temperature a constant 0 degree Celsius by making a reference junction in ice water, thereby there would be no slight change in the reference temperature.

Page 55: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

55

Figure 15 Thermocouple

NTC (Negative Temperature Coefficient) Thermistor

Thermistor basically stands for thermal and resistor and they are typically temperature dependent resistors. The resistance decreases has the temperature increases, in a nonlinear predefined way, due to the properties of the semiconductor materials used to make the thermistor. Most NTC thermistors are made from various compositions of metal oxides of manganese, nickel, cobalt, iron, copper and titanium.

RTD (Resistance Temperature Detectors)

The difference between NTC thermistors and RTDs is the material used to make them. The materials used for RTDs experience an increase in resistance when their temperature increases. Therefore, RTDs could be referred to have PTC (Positive Temperature Coefficient) thermistors.As written in wikipedia, the higher the coefficient, the greater an increase in electrical resistance for a given temperature increase. Both the PTC and NTC thermistors have a high temperature coefficient. the most commonly used material for RTDs is platinum, because it has the best temperature range. They also have low system cost, they are very linear (analog), and can measure temperature over a useful range, from -55 C to 155 C.

Integrated Circuit (analog and digital output)

Analog Integrated Circuits(IC), output voltages or currents that are Proportional to the temperature and digital ICs converts analog signals to digital output, which are basically 1s and 0s. Some advantages of the ICs temperature sensors over thermocouples, NTC thermistors and RTDs Is that it requires no external circuit to connect to the microprocessor (microprocessors usually come with analog to digital converters to convert the analog signal to digital.)

There are a lot of different ICs temperature sensors, all ranging from a 1 to 3-wire interface of both analog and digital. For example, the DS60 is a 1-wire analog temperature sensor. It has three pins. One pin is used to power up the device, another is connected to ground, and there is a 1-wire output pin connected to the microcontroller. Most 1-wire temperature sensors are analog,

Page 56: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

56

except for a few like the DS18S20, which as a built-in ADC(Analog to digital Converter.) However the temperature sensor is considered to be used in this Project is the 2 wire I2C Interface, DS1621 temperature sensor because It requires no external circuitry for connections, the pins are easy to Solder, the availability at the time for testing, and because multiple I2C devices/sensors can be connected to an I2C bus. I2C stands for Inter-integrated circuits, and it used to communicate with two or more digital devices using addresses. I2C supports master mode, multi-master mode(to of the devices in mater mode.), and slave mode, where as the microprocessor could act as the master, and the sensor could act as the slave. From the18f4520 datasheet it says that the master can initiate the data transfer at any time. The master determines when the slave is to broadcast data by the software protocol. The two wire interfaces for I2C are SDA, for serial data input, and SCK (serial clock.), which schedules and initiates the sending of data.

Water Temperature. Sensing the temperature of the water can be done numerous ways, but two Major ideas were considered.

Thermocouple

Remember that a thermocouple needs a reference temperature sensor in other to determine a gradient temperature output, so what if the reference Temperature is acquired from the sea. The main problem with this is that the temperature of the sea would change so often that a précised Temperature for both the water and the air temperature would not be determined. Also the output of the air temperature would depend on the input of the water temperature, so if there were any fault with the water temperature sensing wire that would affect the air temperature.

Temperature Sensor

Most Water temperature sensors are very expensive; costing hundreds of dollars and most of the sensors are mounted temperature sensors, whereby the temperature sensors are calibrated to only function for domestic use. Therefore a suggestion was made to put an air temperature sensor inside a resin. The resin would then be put under the water, and wires would connect to the pins of the temperature sensor to read the data – the temperature of the resin would determine the temperature. By doing these, we could avoid water from destroying the temperature sensor and avoid the expensive cost of water temperature sensors.

. What is a Resin? A resin is a compound that hardens when mixed with a solution. It is Not soluble in water, but soluble in alcohol. There are a number of different classes of resin, depending on what it is been used for or the chemical composition. A DS1621 would be inserted inside a non-conductive epoxy (contains resin)

Page 57: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

57

Pressure Sensor

Pressure sensor measures the force of fluid or air over an area. It is usually measured in Pascal (newton/meter2), bars or in pounds per square inch with respect to the type of pressure measurement. The three main pressure measurements are Differential, Gauge, and Absolute pressure, which were alternatives for the pressure sensor. Differential Pressure Sensor Differential Pressure Sensor measures the pressure difference between two measuring points Therefore, there are two measuring port on the device that would take the measurement; the output would then be determined by the difference in the measurement. The unit for differential pressure is pounds per square inch differential (psid). It measures in reference to a perfect vacuum, which would have zero psi output.

Gauge Pressure Sensor

There two types of gauge pressure measurement. The first type is the vented gauge pressure measurement, which compares the pressure from an opened vent gathering the ambient pressure, to the atmospheric pressure. The vented input pressure is positive if it exceeds the atmospheric pressure and it is negative if falls below. Essentially, by adding the vented gauge pressure with the atmosphere pressure input, an absolute pressure is retrieved. Now, if the atmospheric measuring point is sealed up, the type is called sealed gauge pressure measurement. Vented gauge pressure is measured in psivg, and sealed gauge pressure is measured in psisg.

Absolute Pressure Sensor This type of sensor would measure the atmospheric pressure with respect to pure vacuum with has 0 psig. Since our concentration in this project is gathering atmospheric data, it seemed like the perfect type of sensor to use because it is uniform. Measuring with the gauge and differential sensor could also give the desired output, but other considering needs taken into effect, whether it is doing some addition with the gradient of the differential pressure or ignoring the ambient pressure from the gauge sensor.

Wind Speed Detector

Due to the budget in the building of the buoy, and the expense of the wind speed sensor, we came up with two ideas to record the speed of the wind. Cups and Mouse The general idea of the cups and mouse is integrating a computer ball mouse with a 3-cup anemometer assembly, which would connect through a PVC pipe. Under a computer ball mouse is a ball, which moves as an individual moves the mouse. The ball is connected to two rollers that detect the position of the ball; when the ball moves the roller moves as well. These rollers are then connected to a shaft that spins a disk with hole in it (essentially, an optical encoder). In

Page 58: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

58

front of the optical encoder are infrared LEDs and the back is an infrared sensor, which detects the motion. The beams of light emitted by the LEDs (the purpose the two LEDs is catch missed signals by the other) are broken by the rotation of the encoder, which create digital pulses and is sensed by the infrared sensor. The signal detected by the infrared sensor is then passed to chip, which transfers the pulses through the mouse cord. The pulses are related to the distance the mouse as traveled and the speed. By mounting the cup assembly through the PVC, on the ball, taking cautious mechanical notation, as in, in a manner which rotation of the cups would spin the ball, one could read the binary output serially through the cord.

Cups and motor The idea of the motor is basically the same as with the mouse; the difference is that the motor would represent the ball and the rollers would touch the motors’ axles. The fault in this method is that the motor would produce fiction against the wind. In order to avoid this, one could loosely up the axle of the motor internally. But an advantage of the cups and mouse over the cups and motor is that it is already structured; that is, it would take more time developing a basic structure in mounting the cups assembly on the motor, than it would with the cups and mouse.

Salinity Detector

What is Salinity? Salinity is the measurement of the concentration of dissolved salt in water. The concentration is the amount of salt in the water(weight) and could be expressed as parts per million(ppm), or in grams/milliliter(grams/mililiter = g/ml = milligrams/micro-liter = mg/ul. 1ug/ml = 1mg/l = 1 ppm.) Our interest with the salinity sensor is measuring the amount of salt in the water, but it important to note that the salt would also include the impurities in the gulf from factors like the dissolved substances like mud in the water. Salinity can be measured using a hydrometer or a refractometer but these devices are used for lab experiment only. Another method used to measure salinity is deeping two electrodes water, then connecting the electrodes to a voltage supply, and a multimeter in other to measure resistane across the electrode or the current that flows through the electrodes.

Figure 16 Salinity Measurement Diagram

In other to measure the resistance or current the fundamental idea that needs to be used is the idea of conductivity. Conductivity is usually measured in Siemens or in mho; it is also the reciprocal of resistivity. it is more ideal to measure the resistance in terms of the resistivity

Page 59: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

59

because of the length and the cross sectional area of the electrodes, R = (P*L)/A, which as a unit of ohm*cm ( P stands for the resistivity, L stands for the length, and A is the cross sectional area.) The cross sectional area (A) ) = radius2*pi or (diameter2 * pi)/4.

When the electrodes are inserted in the water they create positively charged hydrogen ions and negatively charged oxygen ions. The positively charged ions migrate to the cathode electrode and collect electrons causing an addition of more electrons at that end. The negatively charged ions at the same time migrate to the anode electrode to drop off electrons and oxides (loss of electrodes, gain of holes.) The separation of these ions is called electrolysis. Salt that dissolves in water break into positively charged sodium ions that are attracted by the cathode electrode, and negatively changed chloride ions, which are attracted by the anode electrode. If the negative charged ions discover that there are excess holes by the anode, the chloride ions drop off their electrons into the holes. The movement of these electrons in and out of the electrodes creates the flow of current in and out.

Obviously, a very important instrument in this sensor is the electrode. Therefore, Finding the right electrode as to be taken into consideration. Since electrodes are Typically conductors, any material that conducts electricity can be used in this Measurement. Two important factors that needs to be known, when looking at Conductors are: 1. The small about of resistance (the smaller the resistance, the greater The condutivity.) 2. The temperature of the melting point, because the more the Temperature, the slower the metal disintegrate over time because of the thermal conductivity of the material. Here are a list of three good conductors.

Copper:

Copper is part of the elements in the chemical element table. Its symbol is Cu and its atomic number is 29. The electrical resisitivy at 20 C is 16.78 nΩ·m. Its thermal conductivity is (300 K) 401 W·m−1·K−1 and its melting point is at 1,084.6 °C. Aluminum The atomic number of aluminum is 12. Its symbol is Al. The electrical resistivity at 20 C is 26.50 nΩ·m. Its thermal conductivity is (300 K) 237 W·m−1·K−1, and its melting point is at 660.32 °C

Pure Tungsten Pure tungsten is a steel-gray to tin-white metal. It atomic number is 74.It as the highest melting point of all the chemical elements. The electrical resistivity at 20 C is 52.8 n Ω·m, which is still quite good. Its thermal conductivity is (300 K) 173 W·m−1·K−1, and its melting point is at 3,407 °C.

Page 60: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

60

Humidity

Humidity measures the amount of water vapor in the air. Below explains the most common terms used for humidity. Absolute Humidity

This calculated the mass of water vapor over the volume of the air or Gas (Mass/Volume.) It is usually measure in terms of grams per cubic meter or grains per cubic foot. Absolute humidity could be calculated if the Relative humidity (RH) is known.

Relative Humidity These sensor measures how much water vapor is present in the air, over the amount of water vapor that would be in the air if the air were saturated. This is measure in percentage. Humidity is usually referred to In terms of percentage, therefore for the design we are using the HIH-3610 that could be measured percentage. 4.3.2 Feasibility Two main factors that are very important in the construction of this low cost buoy are the cost of the devices and the timeline given to complete the implementation.

The Cost Four of the sensors that would be used in retrieving the data are Packaged ICs. These ICs are known to be very cheap and basically priceless, for instances, the cost of getting 114 hih-4000 humidity sensors (which has the same features has hih3610) from digi-key is only for $23 in U.S currency. However, the price of this devices might very with the size, for example the 37.60 to 29.85 millimeter MXP4115AP pressure sensor, which is the biggest IC sensor in our design cost only $15 U.S dollars from freescale semiconductors. The salinity and the wind speed sensor on the other hand include a combination of a few different materials to contribute to their price. However, there are only a few devices that would have a significant cost, just like in the case of the salinity sensor, where the main components are the electrodes, which has considerably high price. A cheap pure tungsten electrode could range from $3 U.S dollars to $20 dollars; this is essentially, the main component of the device. The wind speed sensor on the other hand consist of three main components – the ball-mouse, the cups and the PVC to connect the devices; combining the three, adds to a cost of about $17.00, a prices division of $1 for the mouse, $12 with the 7905L anemometer cups and the $4 is the PVC. Therefore, as far as cost is concerned, having all this sensors would be feasible.

TimeLine The time for the completion of this project is one year. The timeline mainly depend on the testing, accuracy and the mechanical aspect/configuration of each sensor. (see testing section)

Page 61: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

61

4.3.3 Design Documents This section shows the code that would be used in measuring the analog variables of the Humidity and Pressure Sensor, it also discuss the procedure taking when testing the electrodes. Also, it has a general schematic of the IC sensors.

TestingBelow shows , the code that would be used to get the data from the Analog sensors. The program used in this code is a basic C program and the Software used for compiling the code is MPLAB.

For the Salinity Sensor on the other hand, certain procedure had to be taken in other to find a relationship between the resistivity of the electrode and the amount of salt in water. This procedures were tried using aluminum and copper but the because of their thermal Conductivity, they started to disintegrate, therefore there was no constant reading of the Output voltage.

Procedure

1. Connect the circuit (see circuit below) . 2. Pour a 50,000uS/cm calibrated solution in a beaker up to 200ml (make sure the temperature is about 25C to avoid worry about specific conductivity.) 3. Record the DC output Voltage. 4. Pour the Solution out of the beaker until it reaches about 100ml in the beaker.

5. Add some distilled water in the beaker to reach 200ml. (This basically reduces the conductivity by half.)

6. Measure the DC output voltage. 7. Repeat procedure (4 – 6) until 20 measurements are made. 8. Plot the Data: The concentration of Salt in the water, VS electrode impedances. NOTE: PPM = (Electrical Conductivity(EC)) * 500.

Circuit for testing:

Page 62: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

62

The purpose of the Operation amplifier is to give a cleaner and stable output, it was not necessary to include this in the testing.

Result:

The graph above shows 17 measurements that were taking following the procedure. Notice that right between the voltage 5.85 and 5.9 there is a huge difference between the Graph data. The reason for this is because a one-minute elapsed time was given before each measurement, except for this data. For this data, a 5-minute elapsed time was given to make a comparison. Other than that, the graph gives a mathematic formula of y = ln(x). However further testing needs to be taking, to test for accuracy .

Salinity Graph

5.75

5.8

5.85

5.950

,000

6250

781.

25

97.6

56

24.4

14

3.05

18

COnductivity

V1-V

2

Series1

Page 63: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

63

Schematics

Page 64: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

64

4.4 Command and Data Handling

The command and data handling (CDH) subsystem will control and coordinate all the tasks of the buoy. The CDH subsystem will schedule data collections, then store and catalog that data. The CDH subsystem also implements the satellite access scheme by handling all data transfers to the satellite. The CDH subsystem will also provide a standard interface for all third-party piggyback devices. These piggyback devices can avail themselves to the resources provided by the buoy; namely, power, memory, and satellite connectivity.

The CDH subsystem will also selectively power on components only when needed to conserve power. Moreover, the CDH subsystem will monitor the battery voltage and enable/disable the solar panel charging system.

The CDH subsystem comprises the onboard microcontroller, the external memory, and the system software. The microcontroller manages a collection of input and output signals that connect it with the other subsystems. The external memory provides extra storage for environmental data when it cannot be transmitted to the satellite. The system software constitutes the algorithms, which will guide the buoy data collection and transmission tasks.

4.4.1 Alternatives / Tradeoffs

Before choosing a microcontroller, the number of inputs and outputs was estimated. Considering both the Terminal Node Controller and the GPS, at least two USART ports were desirable. Next, to allow compatibility with I2C sensor integrated circuits, an I2C serial port was deemed necessary. To accommodate plenty of analog environmental sensors, the number of analog to digital channels was identified as a critical factor. Additionally, a suitable microcontroller would be a low-power device. Finally, the microcontroller should support a C language development environment rather than the more tedious assembly language programming.

The C.A.P.E. lab was already outfitted with Microchip PIC programmers and development software as well as plenty of experienced PIC users. Therefore, a Microchip PIC microcontroller was an obvious choice. However, PIC microcontrollers are divided into several families mainly organized into increasingly more feature-rich models.

The lower and midrange families, such as the PIC12 and PIC16 devices, did not offer enough I/O pins or serial ports. At the upper end of Microchip’s product line, the PIC24 devices required up to 300mA of current, which was unacceptable with respect to the power budget.

Ultimately, the PIC18 series provided an appealing balance between features and low power consumption. Starting with the arrival of the PIC18 series, the C language became the primary development language. The team’s programming experience focuses mainly on C and its successor, C++, so this was an attractive feature. Moreover, a PIC18 series processor controls the still operative C.A.P.E. satellite.

Page 65: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

65

Microcontroller

The PIC 18F4520 microcontroller was the first PIC18 series processor considered. Several of the team members were already familiar with the microcontroller from a previous project. Also, the 40 pin DIP package would facilitate the breadboarding of prototype circuits. However, the PIC 18F4520 has only one USART port and the buoy design called for multiple peripherals to interface via the USART port. Later, this limitation was circumvented by the use of multiplexing signals with TTL logic. The 18F4520 also features I2C and SPI capability which is shared by the same pins. So, this would force the choice of either I2C or SPI peripherals but not both. This was not a problem either because the team chose to use only an I2C bus which would support multiple clients with the microcontroller as the host. The 18F4520 offers 13 analog to digital channels which would be plenty for our sensors. Also, 36 I/O ports would provide enough lines for the microcontroller to individually control the power supply for each subsystem.

Next, the PIC 18F6722 was considered. Compared to the 18F4520, this microcontroller offers more features. In particular, the PIC 18F6722 provides 2 USART ports and 2 serial ports, which is ideal for this application. Both the GPS and TNC would have dedicated USART ports. Also, with 54 I/O pins and 12 analog to digital channels, the 18F6722 can handle plenty of analog sensors. The 18F6722 features almost 4MB of RAM and 1MB of data memory. This abundance of working memory will facilitate multi-tasking and allow for more complex programs if needed.

Despite the 18F6722’s enhanced feature set, the 18F4520 sufficiently met the design demands in practice. Originally, the 18F6722 was thought to be an advantageous choice. However, throughout prototyping, the 18F4520 was accomplished all tested system tasks. Futhermore, the 18F4520’s lean feature set translated to less power consumed, which was a very attractive characteristic for our low-power system.

Watchdog Timer

The watchdog timer is a fail-safe device that is external to the microcontroller. The watchdog timer requires that the microcontroller send it an acceptable signal within a certain time frame. This timely signal informs the watchdog that the processor is running fine. Otherwise, if the expected signal is not received, the watchdog will conclude that the processor has hanged, i.e. an infinite loop or some other unanticipated fault condition.

The inclusion of a watchdog timer is the admission that the mission code may not be perfect. But rather than allow a single, rare software bug derail the entire mission, the microcontroller can be rebooted and resume its tasks.

First the 18F4520’s internal watchdog timer was considered. However, this watchdog timer seemed too closely coupled with the device it is supervising. Furthermore, the watchdog timer and the microcontroller would share the same power source. This prevents more sophisticated watchdog functionality like disconnecting microcontroller or even total system power in the

Page 66: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

66

event of latchup, a dangerously high current condition. In conclusion, an external watchdog timer was deemed preferable.

Next, a simple external watchdog timer was considered. This watchdog timer requires a periodic pulse on one of its pins. The pulse must occur before a timer expires. This gives the microcontroller some flexibility for when it pulses the watchdog line. It may service the watchdog through quick pulses then less frequent pulses depending on its other activities. However, if rogue code would somehow randomly pulse the watchdog line, the software fault could go uncorrected.

Finally, the team examined the external windowed watchdog timer. The windowed watchdog requires the service pulses to be delivered only during certain valid periods. This restriction prevents random line pulses or noise from successfully servicing the watchdog. Although, now tending to the watchdog necessitates more time-sensitive care from an essentially non-deterministic system. At some points, the buoy is waiting an indeterminate amount of time for a satellite acknowledgement (up to 30 seconds). Also, high speed data transmission could make timely watchdog pulses somewhat troublesome.

Ultimately, the team concluded that a simple external watchdog timer would suffice for the buoy design. A watchdog such as this could be programmed for relatively long periods (in terms of seconds). This feature was appealing because the buoy loops in terms of seconds and minutes, not microseconds.

4.4.2 Feasibility

The team developed test code to explore how a PIC microcontroller would handle the fundamental tasks of the buoy. For this testing, the 40 pin DIP (Dual-Inline Pin) form factor 18F4520 microcontroller was inserted into a ZIF (Zero Insertion Force) socket which allowed the microcontroller to be tested on a standard breadboard.

Three test programs were developed: (1) a USART communications port test, (2) a GPS data receive and string parsing test, (3) a sensor data acquisition test, (4) an AX.25 packet and KISS protocol test, and (5) a system state machine test.

The source code for the above-mentioned programs can be found in Section 11.2 Appendix: Source Code.

The USART communications port test verifies that the USART port is opened at the correct baud rate and that data can be send via that port at will. The USART port transmits at TTL (Transistor-Transistor Logic) levels so a RS-232 level converter was utilized to change the signal levels to +5V and –5V before routing the signal lines into a DB-9 serial connector and then into a PC’s serial port. The PC listened to its serial port using HyperTerminal, which is a program that displays ASCII traffic on a PC’s serial port. The USART communications port test was successful and performed as expected.

Page 67: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

67

Next, a GPS data receive and string-parsing test was conducted to check that the microcontroller could read data from the GPS and extract the data fields of interest. Once the GPS and its antenna are provided with a +5V power source, there is an approximately 50-60 second delay before valid data is acquired from a satellite fix. Once valid data was present on the USART receive pin, the program successfully extracted the time, the longitude, and the latitude, and then sent this data to a laptop running HyperTerminal via the USART transmit pin. Because the test microcontroller, the 18F4520, only has one USART port, the GPS and PC serial cable were multiplexed into the transmit and receive pins with standard TTL logic gates. Then, the desired signals were enabled using output pins connected to AND gates which were configured as Enable lines. The GPS test proved successful. The test verified that (1) the GPS unit was accurate and (2) the code correctly handled the GPS data.

Also, a sensor code program was developed. This program was designed to test the humidity and pressure sensors. Also, the microcontroller’s analog-to-digital converter was tested. Both sensors output a voltage proportional to their environmental values. This program checked if those voltages could be converted to sensible values by the analog-to-digital converter. Then, this program checked that we could convert these ADC counts into familiar units. The test successfully reported the correct pressure and humidity values. This proved that our test code could serve as a basis for any other analog sensors in the design.

Next, an AX.25 packet test program was developed. This program formatted a message into an AX.25 packet and then wrapped that packet in KISS protocol. AX.25 is a common protocol used in packet radio networks. The KISS protocol allows for an AX.25 packet to be sent over a serial channel to a TNC for transmission. The KISS wrapper is not transmitted but it does guide the operation of the TNC. The AX.25 packet protocol and KISS protocol will be discussed further in the Command and Data Handling design documents section.

Finally, a state machine test program was developed. This program proves that the buoy can accomplish its mission by transitioning between system states via clearly defined events. The state machine program simulated the natural pattern of the buoy’s activities.

4.4.3 Design Documents

Explanation

The command and data handling subsystem will coordinate the operation of all the other subsystems. At the conceptual level, the command and data handling subsystem is the actual implementation of the satellite access scheme. More specifically, the command and data handling subsystem will schedule the cycle of data collection, data storage, and data transmission.

At a lower level, the command and data handling subsystem will convert and format sensor data into usable information. Next, the command and data handling subsystem will associate a date, time, and location stamp with this formatted sensor data. Following that, the data will be stored

Page 68: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

68

chronologically in non-volatile memory. Finally, once a satellite link is established, the data gathered since the last satellite transmission will be relayed to the satellite.

Schematic

Flowcharts

Data Cycle

The buoy’s essential program cycle is pictured below.

Page 69: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

69

Satellite Access Scheme

The beacon buoy algorithm is pictured below.

Page 70: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

70

Data Collection

Page 71: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

71

The below method aims to minimize power consumption by keeping peripherals active only when they are needed.

OBC State Diagram

Page 72: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

72

NOTES:Enter “Wait Long” state after successfully uploading a day’s worth of environmental

data.

Wait Short State – Gather data throughout the day while attempting to contact with satellite.

Wait Long State – Gather data for 24 hours without attempting to contact the satellite.

Low Power State – Do nothing until batteries have recharged.

Page 73: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

73

OBC State Descriptions

Wait Short State – The buoy idles until either three possible conditions become true. If four minutes passes, the buoy will transition to the Aloha state. If sixty minutes passes, the buoy will transition to the Data Gathering state. If there is a low voltage detected on the batteries, the buoy will transition to the Low Power state. Essentially, the buoy sits in the Wait Short state while alternating between attempts to contact the satellite and collections of environmental data.

Aloha State – In this state, the buoy is attempting to contact the satellite. The buoy transmits an AX.25 frame with an APRS-formatted data field with position information. If the satellite recognizes this message, it will reply with an acknowledgement. Upon reception of that acknowledgement, the buoy will transition to the Data Transmission state. If the buoy does not receive an acknowledgement within 30 seconds, the buoy will return to the Wait Short state.

Data Gathering State – Every hour, the buoy will transition to this state. The buoy will be coming from either the Wait Short state or the Wait Long state. In this state, the onboard computer will query the GPS and the environmental sensors for information about its current surroundings. First, the GPS and sensors are powered on. Then, environmental data is obtained from the sensors. Once 90 seconds pass, the GPS is checked for a location and time fix. The 90 seconds should be able time for a GPS fix. The current environmental data is then stamped with location/time information before the data is stored. After the data collection is complete, the

Page 74: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

74

GPS and sensors will be powered down. Then, the buoy will transition to its previous state, either Wait Long state or Wait Short state.

Data Transmission State – Only the Aloha state may transition to this state. This ensures that the satellite is listening to the data transmission. The buoy will transmit 24 hours worth of environmental data in AX.25 packets. Each packet will correspond to one hour’s worth of data. The data packet will include date, time, latitude, longitude, air temperature, water temperature, humidity, wind speed, wind direction, and salinity.

Wait Long State – In this state, the buoy refrains from trying to contact the satellite. Instead, the buoy continues to wait for the hourly data collections. That way, a significant amount of data is accumulated before transmitting to the satellite. Once 24 hours pass, the buoy transitions to the Wait Short state, which will eventually resume satellite alohas. Also, low battery voltage can trigger a state transition to Low Power state.

Low Power State – This state suspends all buoy activity until the buoy batteries are recharged. The microcontroller ensures that the solar charging FET is on to provide a channel between the solar panels and the batteries. The battery voltage is sampled until the voltage has reached an acceptable level. No data gathering or radio transmission is attempted. Any unnecessary power-draining task could further jeopardize the mission’s livelihood. This state is designed so that the buoy will never go completely dead due to insufficient power.

External Timer

State transitions governed by time passage are implemented via an external timer. The Maxim DS1371 timer was chosen because it counts in terms of seconds and it is an I2C device. Buoy time intervals of interest are either 30 seconds, 4 minutes, 60 minutes, and 24 hours. However, upon closer inspection, only two distinct intervals are needed: 30 seconds and 4 minutes. This is because 60 minutes can be divided into 15 four minute intervals. Likewise, 24 hours can be interpreted as 360 four minute intervals. Only two values need to be loaded into the timer, 30 seconds or 4 minutes. The 4 minutes could be further reduced to several 30 second intervals, but the 30 second interval is only pertinent in the Aloha state. On the other hand, minutes and hours are key to both of the waiting states.

Wait Short state loads the value 240 seconds (4 minutes) into the DS1371 timer. Then, an I/O pin is checked until a pulse from the timer is detected. Once the timer expires, a static 4 minute interval variable is updated and the buoy transitions to Aloha. Upon return from Aloha, if the static 4 minute interval variable equals 15 counts (60 minutes), the buoy transitions to Data Gathering state.

Likewise, the Wait Long state uses the DS1371 timer to track 60 minute and 24 hour intervals. Again, 60 minutes can be interpreted as 15 counts of 4 minute intervals. At each 60 minute interval, the buoy transitions to the Data Gathering state. Therefore, timer code can be shared across states. Furthermore, after 360 counts of 4 minute intervals, the Wait Long state transitions to the Wait Short state. From there, the buoy will resume attempts to contact the satellite.

Page 75: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

75

The Aloha state uses the DS1371 timer as a signal to transition back to the Wait Short state. The timer is loaded with a 30 second value. Then, either two events will occur. The satellite will respond to the aloha within 30 seconds or the timer will expire in 30 seconds. If the satellite responds, the buoy will transition to the Data Transition state. If the timer expires, the buoy will cease listening for satellite acknowledgement and return to the Wait Short state.

External Memory

The PIC 18F4520 features only 256 bytes of non-volatile EEPROM memory. This is insufficient given that a day’s worth of environmental data was calculated at 1440 bytes. Therefore, external memory was necessary. The team decided that the external memory should be interfaced via the I2C bus with the other external peripherals, such as the timer and temperature sensors. Also, EEPROM memory was selected instead of flash memory because memory writes would occur in smaller transfers rather than huge block writes. Also, EEPROM memory could be obtained for cheaper and with more smaller size options.

The amount of external memory needed was based on two assumptions. First, the team decided that the buoy should retain up to 6 months worth of data. This would allow the buoy to retain a significant amount of data even if satellite communication fails. Six months of data would provide ample environmental information in the scenario that the data was retrieved by other means. Second, aside from the ability to host 6 months of data, extra memory could be used for future expansions to the buoy design, such as extra sensors or more frequent data gathering.

Next, the desired memory size was calculated. At 1440 bytes of data per day, 30 days of data amounted to 43,200 bytes. Therefore, 6 months of data required 259,200 bytes of space. This memory space is just under the common 256 kilobyte EEPROM size. So, a 256K I2C EEPROM was selected, the Microchip 24AA256.

The 24AA256 supports input VCC from 1.8V to 5.5V with a maximum standby current of 400nA at 5.5V. The 24AA256’s CMOS technology translates to low power requirements such as a maximum current of 400uA reads and 3mA writes.

Watchdog Timer

Based on the alternatives and tradeoffs study, the team decided that the buoy needed a watchdog timer which required only a single pulse within a certain time period. The low-power TI UCC3946 watchdog timer was chosen for its typical 10uA current and programmable timer period and reset threshold. The UCC3946 is flexible such that it can function on VDD anywhere in the range of 2V to 5.5V.

The watchdog period is calculated as T = 25 x C, where T is time(milliseconds) and C is capacitance(nanofarads). With a 0.1uF capacitor, the watchdog period is 2.5 seconds, which

Page 76: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

76

seemed appropriate for our application. If our buoy locks up, 2.5 seconds lost makes virtually no impact on the mission. Also, with a 2.5 second period, servicing the watchdog is not as demanding as if the period was much shorter; for example, 2.5 milliseconds.

Next, the reset voltage threshold was calculated. If the system VDD drops below a certain voltage, the watchdog can assert a reset signal on the microcontroller until the supply voltage rises above the threshold for a user-programmed period. Using this feature, we can ensure that the microcontroller does not attempt to run code while its supply voltage is insufficient. During testing, we did notice that the microcontroller running on insufficient voltage would make noticeable errors related to its analog-to-digital converter. The reset threshold voltage is calculated by Vreset = 1.235x((R1+R2)/R2). Solving for a chosen voltage of 4.6V and assuming R2 is 1Mohm, we find that R1 should be 2.7Mohm. The resistors were picked in the Mohm range to limit quiescent currents.

Then, the reset period is calculated using T = 3.125 x C, where T is time(milliseconds) and C is capacitance(nanofarads). The reset period is how long the supply voltage must rise back above the reset voltage threshold before the watchdog releases the microcontroller reset, allowing the microcontroller to restart execution. Picking a capacitance value of 0.1uF, we find that the reset period is 312.5ms. So, about the system voltage must recover and stabilize for about one-third of a second until the watchdog will allow the microcontroller to reboot.

Finally, we decided to utilize the watchdog as a recovery method for latch-up conditions. Due to its CMOS technology, our microcontroller is susceptible to high current conditions known as latch-up. During latch-up, paired transistors conduct in such a way that a low resistance path is created between VDD and ground. For our application, a nearby lightning strike could create sudden transients on the VDD or ground lines that could cause latch-up. Therefore, if the watchdog is not serviced, the watchdog will disconnect DC power to the system such that a latch-up condition can hopefully reset itself. Naturally, the watchdog will not be cutting power to itself but rather the other system components; namely, the microcontroller.

Source Code

Please consult the appendix for the source code of the test programs mentioned in Section 7.2.

4.5 Mechanical

4.5.1 Alternatives & Tradeoffs

Discus Buoy

Woods Hole Oceanographic Institute originally developed discus buoys for our specific task. They consist of 3 major components, which include the hull, the superstructure, and the substructure. The discus design allows it to easily move with waves providing a more accurate

Page 77: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

77

platform for wave height, period and direction. They are typically constructed using aluminum with zinc anodes attached to mitigate corrosion.

The Hull is typically where they house the electronics and batteries. The superstructure is usually of a tripod design with cross braces that allows for the attachment of sensors, solar panels, and antennas. The substructure improves upon the stability of the buoy to minimize pitch and roll and is attached to the bottom of the hull. This is usually where the zinc anodes are attached for corrosion purposes.

Some advantages of discus buoys are there proven track record as they have been used by NOAA for many years, their ability to wave follow, and the ability to be modified easily by adding more sensors or solar panels to the superstructure.

The disadvantages however of discus buoys are the cost, due to the use of aluminum compared to PVC. They are also more susceptible to pitch and roll then that of a spar buoy, which can seriously effect communications shown by our testing.

Figure 16 Typical Discus BuoySpar Buoy

Spar buoys are usually constructed with a wide variety of materials from polyurethane, to PVC (polyvinyl chloride), to aluminum. This was one of the key points for us selecting a spar buoy design to that of a discus buoy. PVC is easily available at many home improvement stores for relatively low cost and with no knowledge of welding needed it greatly simplified our construction.

Page 78: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

78

Figure 17 Spar Buoy Design

4.5.2 Feasibility

To make sure that our buoy will be able to float we need to see how much water we have to displace. This can be easily done by using the weights of all of our components including the hull of our buoy to see how much displacement. To do this you need to find the total weight you will be housing inside the buoy.

Buoy Components Weight (grams)Structure or Hull 8470.1 gElectronics (GPS, PIC, board) 932.2 gSolar Panels (including mounts) 2727 gBatteries 4195.79 gTotal Weight = 16325.09 g

Page 79: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

79

We know that one cubic foot of salt water weights approximately 64 pounds. Since our weights were originally measured in grams we can easily convert them over to pounds (1 pound = 453.59 grams) so the total weight of the buoy in pounds is 35.99 pounds. This means we have to displace a half a cubic foot of water. This is easily achievable with a spar designed PVC buoy.

4.5.3 Design Documents

AutoCAD Drawing of Hull

5. Prototype Construction

Toward the end of the first semester, construction began on a proof of concept prototype. The prototype comprised an electrical system and a mechanical structure. The prototype was built from mostly components on hand in the C.A.P.E. lab. Consequently, the prototype is not an exact design implementation but rather a combination of substitute components. Nevertheless, the prototype serves as a trial implementation which can be incrementally improved upon and tested as development continues. Currently, the prototype’s electrical system can acquire GPS data and broadcast that data. However, further development was delayed due to technical difficulties with a PICStart Plus microcontroller programmer. Eventually, the team determined that the programmer’s firmware was outdated. Unfortunately, additional difficulties have prevented the necessary firmware upgrade. More time will be needed to rectify these problems.

Page 80: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

80

On the other hand, the mechanical structure constitutes a fairly close approximation to the final buoy structural design. Moreover, the mechanical structure features an array of four solar panels mounted at its top. At the bottom, the mechanical structure provides a housing for the payload.

5.1 Electrical System

The electrical system was built on a large breadboard. The electrical system featured an 18F4520 PIC 8-bit microcontroller, a GPS unit, a TNC/radio unit, a humidity sensor, a pressure sensor, a lead acid battery, and additional ICs and TTL logic.

5.1.1 Microcontroller

The microcontroller successfully ran test code that verified the functionality of the USART (Universal Synchronous Asynchronous Receive Transmit) port. This involved sending messages via the USART port to the TNC/radio unit for broadcast. Also, the test code managed the USART port to receive data strings from the GPS unit. Sensor test code was developed but was never actually tested on the microcontroller due to problems with the programmer.

5.1.2 GPS Unit

The GPS unit was a standard 5V device which would continuously stream NMEA (National Marine Electronics Association) strings once the receiver had acquired a sufficient signal. A NMEA string is an ASCII string that concatenates various position and time data fields. Typically, a NMEA string is parsed to extract certain data fields of interest.

5.1.3 TNC/Radio Unit

The TNC/Radio unit was an integrated unit that offered a serial port and power terminals. The unit required a 9V power source. Once powered on, the TNC/Radio unit would automatically transmit a 435MHz signal from incoming serial port data.

5.1.4 Lead Acid Battery

A 12V lead acid battery supplied the power to the prototype. The battery voltage was stepped down to 5V using a voltage regulator. This rudimentary power system made the prototype portable such that it could work outdoors. This was important because the GPS unit could not acquire a satellite signal inside the engineering building.

5.2 Buoy Structure

5.2.1 PVC Hull

Page 81: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

81

The hull of the buoy is constructed out of off the shelf PVC parts that were purchased at a local hardware store. The enclosure for the electrical system is a t-pipe that has an outside diameter of 6” and a length of 14” with a 4” opening on the top that was used for the mast. This 4” opening was converted over to a 1.5” buy a serious of converters so as to decrease its top weight.

5.2.2 Solar Panel Mounts

The solar power mounts were also made of PVC that was UV treated. The PVC was drilled out to decrease weight and bent so as to maximize sunlight. They were then mounted on top of the buoy and affixed with zip ties to prevent birds from landing on them.

5.2.3 Antenna

The antenna was constructed using non-braided copper wire and a SO-239 connector. This was joined by a BNC 50 ohm coaxial cable. The other end was then attached to the output of the radio.

6. Future Plans

6.1 Communications

6.1.1 Three-volt low power radio

As part of the teams specifications on building a buoy that will decrease design cost and increase sustainability the team has designed a low power radio that will help aid in decreasing the battery size and rating. It will cause no decrease in efficiency for transmitting or receiving either. It will be done using the schematic shown previously. We hope to construct and test this during our next semester so as to test our design.

6.1.2 TNC-X

The TNC-X will also be constructed next semester using the design of John Hansen the developer of the TNC-X. The parts are all accessible in the lab and should be constructed fairly easily. It will provide a lower power option over the TNC currently being used.

6.2 Power

6.2.1 - Solar Panel Efficiency.

Page 82: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

82

The team is planning to run experiments to determine the efficiency of different solar panels used. Solar panel prices may increase accordingly with solar panel efficiency. The team plans to find a better efficient solar panel to be used on the final design. Currently generic solar panels are used in the project. These panels do not have a brand or a data sheet. This made it hard for the team to rely on this product. These cheap solar panels were used by the team with the objective of running some tests and getting a basic idea on how solar panels could be implemented on the project. Therefore further research will be done to implement a solar panel that will fit into the project’s needs and at the same time it will be efficient.

6.2.2 - Research Possibility of an entire system running at 3 volts.

The team is also planning to do some research in order to find a way of implementing a system that will run all on a same voltage. This idea was first introduced by one of the team’s mentors as a challenge. If this can be possible, the system will run on 3 volts, which alters the voltage of other subsystems. Currently the system runs on 12 volts and voltage regulators are used to power up subsystems like GPS that require only 5 volts. This will make our system consume less power. Regulators will still be needed since radio transmitters need more than 3 volts to function.

6.4 Command and Data Handling

6.4.1 PIC 18F6722

Next semester, the prototype processor will be upgraded to the 18F6722. Due to its TQFP (Thin Quad Flat Pack) packaging, some type of breakout board will be needed to access the individual pins. Eventually, a printed circuit board will be designed and manufactured once development is closer to a final hardware setup. With the 18F6722, the prototype will have one USART dedicated to the GPS and one USART dedicated to the radio rather than the current multiplexed configuration with the 18F4520.

6.4.2 Create Interface For 3rd Party Devices

Once the buoy’s core functionality is established, a standard port and interface will be designed for additional payload devices. These devices could range from extra sensors to science experiments to any sort of compatible peripheral. By plugging into a standard port, the device will be provided power, long-term memory storage, and satellite communication. Software scheduling protocol will allow the device to schedule its tasks such that they do not interfere with the buoy’s main program loop. Through software, the device will designate which data it wants to upload to the satellite. Also, commands and data from the satellite can be forwarded to the device. Through this standard interface, new and creative functionality can easily be added to the buoy. This is similar to PCs that offer a standard interface for peripherals which can then expand and extend capabilities in unexpected ways.

6.5 Mechanical

Page 83: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

83

6.5.1 Improve Buoy Stability

A key aspect to improving our communication reliability and success rate is to provide the most stable platform for the communication system. As our testing has shown antenna polarization has a major effect on our transmission success. With more testing and calculations we hope to improve upon our initial design.

6.5.2 Sensor Placement

Currently our buoy is totally enclosed with no penetrations in the hull, this will have to change so as to take the environmental data that is needed. As our sensors are developed and tested we will have to discuss their placement and affect on stability. This will need more testing to make sure our hull has no water intrusion and that the sensors operate properly in there location and have no effect on stability.

7 Appendix

7.1 Wiki

As a way for the team to stay organized and the mentors to have access to our work the team created a wiki that allowed all users to upload there work. This allowed us to have a library of information each team member collected during our research phase and a place for our designs and schematics to be analyzed. This was of great help not only to the students working on the project but for our mentors who could easily access the work we have done so to ask questions or guide us.

7.2 Source Code

USART code

Page 84: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

84

// File: Main Function// Purpose: Test USART Functions// Author: John DeBlanc// Created: 04/11/2008// Tested: 04/13/2008 : Verified

#include <p18f4520.h>#include <stdlib.h>#include <usart.h>#include <delays.h>#include <string.h>

#pragma config OSC = HS /* Sets the oscillator mode to HS */#pragma config WDT = OFF /* Turns the watchdog timer off */#pragma config LVP = OFF /* Turns low voltage programming off */#pragma config DEBUG = OFF /* Compiles without extra debug code */

void InitializeUSART();void InitializePorts();void LightLEDs();void EnableRadio();

void InitializeUSART(){

//Open USART for 1200 BaudOpenUSART ( USART_TX_INT_OFF &

USART_RX_INT_OFF &USART_ASYNCH_MODE &USART_EIGHT_BIT &USART_CONT_RX &USART_BRGH_LOW,129 );

}

void InitializePorts(){ // All PORT D Pins Are Set As Outputs LATD = 0x00;

TRISD = 0x00;

}

void LightLEDs(){

Page 85: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

85

LATDbits.LATD0 = 1;LATDbits.LATD1 = 1;

}

// Enable AND Gate For Multiplexing Radio/GPSvoid EnableRadio(){

LATDbits.LATD6 = 1;

}

void main(void){

InitializePorts();EnableRadio();InitializeUSART();

LightLEDs();

while(1){

while(BusyUSART());

putrsUSART( "Hello World!\r\n" );

Delay10KTCYx( 255 );Delay10KTCYx( 255 );Delay10KTCYx( 255 );Delay10KTCYx( 255 );

}

}

GPS Code

// File: main_gps.c// Purpose: Test GPS Functions

Page 86: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

86

// Author: John DeBlanc// Created: 04/11/2008// Tested: 04/15/2008 Test Passed

// This code should grab $GPGGA strings from the GPS and output those strings// to the USART, which will be connected to Hyperterminal.

/****************************************************************************************// GPS String: $GPGGA,hhmmss.ss,ddmm.mmmm,n,dddmm.mmmm,e,q,ss,y.y,a.a,z,g.g,z,t.t,iii*CC// hhmmss.ss in UTC (coordinated universal time zone). UTC used be known as GMT.// ddmm.mmmm,N latitude of the GPS position fix// dddmm.mmmm,W longitude of the GPS position fix// q quality of the GPS fix (1 = fix, but no differential correction)// ss number of satellites being used// y.y horizontal dillution of precision// a.a,M GPS antenna altitude in meters// g.g,M geoidal separation in meters// t.t age of the deferrential correction data// iiii deferential station's ID// *CC checksum for the sentence****************************************************************************************/

#include <p18f4520.h>#include <stdlib.h>#include <usart.h>#include <delays.h>#include <string.h>

#pragma config OSC = HS /* Sets the oscillator mode to HS */#pragma config WDT = OFF /* Turns the watchdog timer off */#pragma config LVP = OFF /* Turns low voltage programming off */#pragma config DEBUG = OFF /* Compiles without extra debug code */

#define GPS_BUFFER_LENGTH 100

void InitializeUSART_GPS();void InitializeUSART_Radio();void InitializePorts();void LightLEDs();void OffLEDs();void EnableRadio();

Page 87: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

87

void EnableGPS();void ReadGPS( char * GPS_buffer );void PrintToUSART(char * buffer);void ParseGPS(char * buffer);void PrintTime(char * buffer);void PrintLocation(char * GPS_str);

void InitializeUSART_GPS(){

//Open USART for 4800 BaudOpenUSART ( USART_TX_INT_OFF &

USART_RX_INT_OFF &USART_ASYNCH_MODE &USART_EIGHT_BIT &USART_CONT_RX &USART_BRGH_LOW,31 );

}

void InitializeUSART_Radio(){

//Open USART for 1200 BaudOpenUSART ( USART_TX_INT_OFF &

USART_RX_INT_OFF &USART_ASYNCH_MODE &USART_EIGHT_BIT &USART_CONT_RX &USART_BRGH_LOW,129 );

}

void InitializePorts(){

LATD = 0x00;TRISD = 0x00;

}

void LightLEDs(){

LATDbits.LATD0 = 1;LATDbits.LATD1 = 1;

}

Page 88: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

88

void OffLEDs(){

LATDbits.LATD0 = 0;LATDbits.LATD1 = 0;

}

void EnableRadio(){

LATDbits.LATD7 = 0;LATDbits.LATD6 = 1;

}

void EnableGPS(){

LATDbits.LATD6 = 0;LATDbits.LATD7 = 1;

}

void ReadGPS( char * GPS_buffer ){ char compareGGA[] = "$GPGGA"; int stringPosition;

int count;int prefix_is_GGA;

int loop_done;

prefix_is_GGA = 0;loop_done = 0;

// Grab a $GPGGA string. // Only exit do-while once a $GPGGA string is found.

do{while(!DataRdyUSART());GPS_buffer[0] = ReadUSART();

// Is char from USART the beginning of a string?if( GPS_buffer[0] == '$' ){

// Collect the next 5 chars of GPS stringfor(count = 1; count < 6; count++){

while(!DataRdyUSART());GPS_buffer[count] = ReadUSART();

}

Page 89: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

89

// Is this the $GPGGA string? if ( strncmp(GPS_buffer, compareGGA, 6) == 0 ) { loop_done = 1; }

}// end if $

}while(!loop_done);

// Get the rest of the GPS string. // End after the newline character. do{ while(!DataRdyUSART()); GPS_buffer[count] = ReadUSART(); count++; }while( GPS_buffer[count] != '\n' );

count++;

// Terminate string with NULL character. GPS_buffer[count] = 0x00;

}

void ParseGPS(char * buffer){ // Not yet implemented.

}

void PrintToUSART(char * buffer){ putsUSART(buffer);}

void PrintTime(char * GPS_str){ char hours[3]; char minutes[3]; char seconds[3];

hours[0] = GPS_str[7]; hours[1] = GPS_str[8]; hours[2] = 0x00;

minutes[0] = GPS_str[9];

Page 90: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

90

minutes[1] = GPS_str[10]; minutes[2] = 0x00;

seconds[0] = GPS_str[11]; seconds[1] = GPS_str[12]; seconds[2] = 0x00;

putrsUSART("The time is "); PrintToUSART(hours); putrsUSART(" hours, "); PrintToUSART(minutes); putrsUSART(" minutes, and "); PrintToUSART(seconds); putrsUSART(" seconds.\r\n");

}

void PrintLocation(char * GPS_str){ char longitude_degrees[3]; char longitude_minutes[3]; char longitude_direction[2];

char latitude_degrees[3]; char latitude_minutes[3]; char latitude_direction[2];

longitude_degrees[0] = GPS_str[18]; longitude_degress[1] = GPS_str[19]; longitude_degrees[2] = 0x00;

longitude_minutes[0] = GPS_str[20]; longitude_minutes[1] = GPS_str[21]; longitude_minutes[2] = 0x00;

longitude_direction[0] = GPS_str[28]; longitude_direction[1] = 0x00;

latitude_degrees[0] = GPS_str[18]; latitude_degress[1] = GPS_str[19]; latitude_degrees[2] = 0x00;

latitude_minutes[0] = GPS_str[20]; latitude_minutes[1] = GPS_str[21]; latitude_minutes[2] = 0x00;

Page 91: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

91

latitude_direction[0] = GPS_str[28]; latitude_direction[1] = 0x00;

putrsUSART("Coordinates:\r\n"); putrsUSART("Longitude: "); PrintToUSART(longitude_degrees); putrsUSART(" degrees, "); PrintToUSART(longitude_minutes); putrsUSART(" minutes, "); PrintToUSART(longitude_direction);

putrsUSART("\r\nLatitude: "); PrintToUSART(latitude_degrees); putrsUSART(" degrees, "); PrintToUSART(latitude_minutes); putrsUSART(" minutes, "); PrintToUSART(latitude_direction); putrsUSART("\r\n");

}

void main(void){ char GPS_string[GPS_BUFFER_LENGTH];

InitializePorts();

while(1) {

EnableGPS(); InitializeUSART_GPS(); ReadGPS( GPS_string ); CloseUSART();

EnableRadio(); InitializeUSART_Radio(); PrintToUSART( GPS_string ); PrintTime( GPS_string ); PrintLocation( GPS_string);

CloseUSART();

LightLEDs(); Delay10KTCYx( 255 ); Delay10KTCYx( 255 ); Delay10KTCYx( 255 );

Page 92: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

92

Delay10KTCYx( 255 ); OffLEDs();

}}

Sensor Code

// File: Sensor_test.c

Page 93: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

93

// Purpose: Test Sensor Functions// Author: John DeBlanc// Created: 04/18/2008// Tested:

#include <p18f4520.h>#include <stdlib.h>#include <usart.h>#include <adc.h>#include <delays.h>#include <string.h>

#pragma config OSC = HS /* Sets the oscillator mode to HS */#pragma config WDT = OFF /* Turns the watchdog timer off */#pragma config LVP = OFF /* Turns low voltage programming off */#pragma config DEBUG = OFF /* Compiles without extra debug code */

void InitializeUSART();void InitializePorts();void LightLEDs();void EnableRadio();void InitializeSensors();float GetPressure();float GetHumidity();void PrintFloatToUSART(float value);

void InitializeUSART(){

//Open USART for 1200 BaudOpenUSART ( USART_TX_INT_OFF &

USART_RX_INT_OFF &USART_ASYNCH_MODE &USART_EIGHT_BIT &USART_CONT_RX &USART_BRGH_LOW,129 );

}

void InitializePorts(){ // All PORT D Pins Are Set As Outputs LATD = 0x00;

TRISD = 0x00;

Page 94: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

94

}

void LightLEDs(){

LATDbits.LATD0 = 1;LATDbits.LATD1 = 1;

}

// Enable AND Gate For Multiplexing Radio/GPSvoid EnableRadio(){

LATDbits.LATD6 = 1;

}

void InitializeSensors(){ TRISA = 0xFF;

OpenADC( ADC_FOSC_8 & ADC_RIGHT_JUST & ADC_12_TAD, ADC_CH0 & ADC_INT_OFF, 0 );

Delay10TCYx( 5 );}

float GetPressure(){

int value;float voltage;float pressure;

SetChanADC( ADC_CH0 );

Delay10TCYx( 5 );

ConvertADC();

while( BusyADC() );

value = ReadADC();

voltage = ( ( ((float)value)/1023 ) * 5 );

Page 95: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

95

pressure = ( (1/.009)( (voltage/5) + .095 ) );

return pressure;}

float GetHumidity(){ int value; float voltage; float humidity;

SetChanADC( ADC_CH1 );

Delay10TCYx( 5 );

ConvertADC();

while( BusyADC() );

value = ReadADC();

voltage = ( ( ((float)value)/1023 ) * 5 );

humidity = ( (1/.0062)( (voltage/5) - 0.16 ) );

return humidity;}

void PrintFloatToUSART(float value){

int integer;integer = (int)value;char value_str[20];

value_str = itoa( integer, value_str );

putsUSART( value_str );

}

void main(void){

float humidity;float pressure;

Page 96: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

96

InitializePorts();InitializeSensors();EnableRadio();InitializeUSART();

LightLEDs();

while(1){

while(BusyUSART());

putrsUSART( "Sensor Testing!\r\n" );

Delay10KTCYx( 255 );Delay10KTCYx( 255 );Delay10KTCYx( 255 );Delay10KTCYx( 255 );

pressure = GetPressure();humidity = GetHumidity();while(BusyUSART());putrsUSART( "Pressure: " );while(BusyUSART());PrintFloatToUSART( pressure );while(BusyUSART());putrsUSART( " kPa\r\n" );while(BusyUSART());putrsUSART( "Humidity: ");while(BusyUSART());PrintFloatToUSART( humidity );while(BusyUSART());putrsUSART( " %\r\n" );

}

}

7.3 Data Sheets

Page 97: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

97

TX1H

(Vcc = 3.8V / temperature = 20°C unless stated)

General pin min. typ. max. units notes

 DC supplySupply voltage 5 3.8 - 15 VTX Supply current (at 100mW) 5 - 80 - mA Antenna pin impedance 2 - 50 -

RF centre frequency (100mW) - 151.300 - MHz

Channel spacing - 25 - kHzNumber of channels 1 TransmitterRFRF power output (100mW) 2 +19 +20 +21 dBm 1Spurious emissions (100mW) 2 - -40 - dBmAdja. channel TX power (100mW) - -37 - dBmFrequency accuracy - 2.5 0 +2.

5 kHz 2

FM deviation (peak) ±2.5 ±3.0 ±3.5 kHz 3

 BasebandModulation bandwidth @ -3dB 0 - 5 kHzModulation distortion (THD) TBA %TXD input level (logic low) 7 - 0 - V 4TXD input level (logic high) 7 - 3.0 - V 4 Dynamic timingTX select to full RF - 5 - ms Notes: 1. Measured into 50 resistive load.2. Total over full supply and temperature range.3. With 0V - 3.0V modulation input.4. To achieve specified FM deviation.

Page 98: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

98

CVR-1

(Vcc = 3V / temperature = 20°C unless stated)

 RF centre frequency 173.225 (other VHF 120-180MHz by special order)Frequency stability +/- 2.5kHzChannel spacing 25Number of channels 1   Supply Voltage 3V (+/- 10% )                                       Current 7mA receive   Operating temperature -10°C to +60°C (Storage -30°C to +70°C)Size 33mm x 23mm x 8mmSpurious radiations Compliant with ETSI EN 300 220-3 and EN 301 489-3Interface  

User  9pin 0.1" pitch molexRF     3pin 0.1" pitch molex

   RF sensitivity @ 12dB SINAD -120dBmRF sensitivity @ 1ppm BER -115dBmRSSI range 60dBBlocking -85dB or betterImage rejection -60dB or betterAdjacent channel rejection -65dBSpurious response rejection -60dB or betterLO re-radiation -65dBm BasebandBaseband bandwidth @ -3dB 5kHzAF level 500mVDC offset on AF out 0.8V   Outputs RSSI, Data, AF

Page 99: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

99

TNC-X Parts

Capacitors: C1 10 uf C3 100 pf C2, C4, C5, C6 .1 ufC11, C14, C15, C16 .1 ufC17, C18, C19 .1 ufC20, C21, and C22 .1 ufC7, C8 . 1 uf C9, C10 18 pf C12, C13 22 pf

Resistors:R1, R2, R3 100k ohmR8 24,9 K ohm 1% R9 9.31K ohm 1% R10 18.7K ohmR11, R16 and R18, R20 10k ohm R12, R13 10k ohm potentiometer R14 6.8k ohm R4, R15, R17 and R19 1k ohm

Diodes:D1 green LED D2 1N4001 D4 red LED D5 yellow LED

Headers, Jumpers:JP1, JP2, JP3 2 Pin HeaderJP4 3 Pin HeaderJP5 8 Pin Header

Other:X1 3.57 MHz Crystal X2 20 MHz Crystal Q1 NPN Transistor

Page 100: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

100

U1 CML 614 Modem Chip - 16 pin U2 FM25640 FRAM memory chip - 8 pin U3 PIC16F628A (or PIC16F648A) - 18 pin U4 MPC6023 Op Amp - 8 pin U5 MAX232A, ST232A or similar - 16 pin U6 78L05 Voltage Regulator - 3 pin

Page 101: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

101

7.4 Schematics

Page 102: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

102

Page 103: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

103

Page 104: I - BuoyCAPE - homebuoycape.wikispaces.com/file/view/Final_Report_II_Rev_2.doc · Web view4.3.3 Design Documents This section shows the code that would be used in measuring the analog

104