Patrick Costello

The Project

Applied Science Research is a course for students interested in studying advanced topics in science and engineering. The main philosophy of ASR is to let students set themselves an ambitious goal and then learn the science/engineering needed to accomplish it. The course is geared toward students who envision a career in science or engineering or are simply curious about how things work. In the first semester, students undertake four projects designed to build important universal skills that will serve them well in their spring semester projects and also in future careers as scientists or engineers. By conducting two assigned experiments and building two energy projects in the fall, students acquire detailed knowledge of Stirling engines, atmospheric science and data analysis, electric motors, signal-to-noise studies, engineering design and optimization, all different types of green energy possibilities, and how to design, conduct and analyze an experiment. In the second semester students specialize on a science or engineering research topic of their choice. The course is student-centered and student-driven. Students choose the topics, experiments and projects that interest them. At the conclusion of the second semester students compile their work, write a final science or engineering paper, and give a full presentation of their work and results.

from his nomination....

"Patrick literally went above and beyond in his final project for Applied Science Research. He sent a weather balloon data-acquisition system and camera up 50,000 feet above the Earth, pretty much into space. In addition to storing the data he collected on a flash drive, he also sent the data down telemetrically over ham radio signals. His experiment was a success, his data excellent, and the pictures beautiful. He even recovered the balloon by ingeniously installing a GPS chip and transmitting the signal on ham radio wavelengths in order to track the balloon throughout its course. To accomplish all this he programmed a pic processor to work with three data chips---as well as the GPS chip, which took him quite a bit of work. He also programmed the data-transmission system to relay the data down to a receiving antenna he attached to his car. What Patrick did was truly amazing. I have very high expectations for the students in ASR and he completely surpassed them. I learned a lot myself through working with Patrick. He would come to me with a problem one week and thoroughly explain it, and the next week he would come back and thoroughly explain how he had solved it.." Dr. James Dann, Science teacher

Patrick Costello '09,
High Altitude Weather Balloon Project

High Altitude Weather Balloon Project
Applied Science Research
Patrick A. Costello
April 14, 2008

pdf version of article

See Images from Space!!!!!

ABSTRACT
The goal of the High Altitude Weather Balloon Project is to send a balloon with a payload to acquire weather data into near space, approximately 33 km. The project entailed designing both hardware and software and modifying existing hardware. The project is still in progress at this time.

Keywords
high altitude, weather balloon, ATV, PIC microcontroller

1. MOTIVATION
The motivation for this project came from the author’s interest after the Applied Science Research class did a small-scale tethered balloon experiment to 300 meters. Further motivation came from J. Meehan’s balloon project on http://vpizza.org/~jmeehan/balloon/, which was found via http://www.hackaday.com.

2. HISTORY
Amateur high altitude weather balloons are becoming increasingly popular with amateur radio operators. Many people have used weather balloons to transmit messages and to take aerial photography from the edge of space.

3. HARDWARE
The hardware schematics are available in Appendix A. The bill of materials for the hardware design is available in Appendix B. A picture of the flight control board is in Appendix F.

3.1. Purchased Parts
The major portion of spending has gone to purchasing equipment for radio transmitting. Unfortunately, this is completely necessary because without it there would be no data recovery and the balloon would be lost. A complete list of purchased parts is in Appendix D. Copies of order forms are in Appendix F.

3.2. Flight Controller
The flight controller is a 40-pin DIP (Duel In-line package) dsPIC30F3014 from Microchip Technology Inc. Other considered devices were the PIC16F887 and the PIC16F917. The dsPIC30F3014 was chosen because of its DIP packaging, its UART (Universal Asynchronous Receiver Transmitter) Module, and its support for the Microchip C30 Compiler.[1] The DIP packaging is important because it makes integration into the circuit much easier because it can fit on normal prototyping board without the need of an additional socket. The double UART module with alternate pins is important because 2 UART modules are needed, one for GPS connection (see GPS) and one for connection to the radio and PC (see Radio). The Microchip C30 compiler allowed the dsPIC30F3014 to be programmed in the C programming language. Photos of the hardware are in Appendix F.

3.2.1 UART
The UART configuration requires several initialization registers to be set. An important set up is the baud rate generator in the special function register UxBRG. Equation 1 contains the equation used to calculate the UxBRG
eqn1

eqn1_1

special function register. Other initialization needs are shown in the code in Appendix E.

3.2.2 Crystal
The crystal oscillator used is a 9.8304 MHz crystal. 9.8304 MHz is optimal because when used in baud rate calculations for typical baud rate values, it generates clean numbers with no error for the baud rate generator. Typical values are 1200 baud and 9600 baud. When the UxBRG is calculated, there will normally be a slight error, for example with a 4 MHz clock frequency the error is 0.16 percent. [2] This error can offset UART data transmission, which could lead to jumbled data. Using the 9.8304 MHz crystal, this error becomes 0 percent.

3.3. GPS
The GPS module chosen was the Jupiter TU30-D140 OEM (Original Equipment Manufacturer) module from Rockwell International. The Jupiter module was chosen because of its low cost and lightweight. It has no unnecessary buttons, screens, etc. that are included on normal commercial GPS devices. It has a UART module that outputs at 4800 baud on TTL levels. This is perfect for integration with the PIC UART. The GPS outputs data that is based on NMEA-0183 mode protocols.[3] The antenna used for the GPS is an active antenna, which increases the signal strength by a gain of 26dB.[4]

3.4. Memory
The memory chips chosen were 16- megabit DataFlash chips (AT45DB161D) made by Atmel. This chip is ideal because of its SPI (Serial Peripheral Interface) that can interface directly with the PIC. Unfortunately, the chip can only be written in 512 page increments, so each page will contain a significant amount of filler bits. Writing to the flash is very easy and only requires a single opcode.

3.4.1 MicroSD Option
The other memory device that was considered was a microSD card [6], similar to those found in digital cameras. The microSD card would allow for more data, an elegant FAT32 file system, and easy transfer of data to the PC. However, implementing the FAT32 file system and using the SD card would be difficult to implement and would add unnecessary complexity to saving data.

3.5. Sensors
The sensors on board the payload are two temperature sensors, one pressure sensor, and one accelerometer. Data sheets for the sensors are in Appendix J.

3.5.1 Temperature Sensor
The two temperature sensors used are the LM335 from National Semiconductor and the LM135 from National Semiconductor. [8] The LM335 has an operating range of -40 ̊C to 100 ̊C while the LM135 has an operating range of -55 ̊C to 150 ̊C. The LM135 is necessary for the external sensor because the temperature between 0 meters and 30,000 meters can reach temperatures as far as -65 ̊C. [9

] 3.5.2 Pressure Sensor
The pressure sensor used is the MPXM212D/A from Freescale Semiconductor. [10] The pressure sensor is optimized for a 10-volt power supply, so additional amplification was necessary for proper data acquisition.[11]

3.5.3 Signal Amplification
Both pressure and temperature data was amplified using the LMC6042 Duel Op Amp (Operational Amplifier). [12]

3.5.4 Accelerometer
The accelerometer selected was the MMA1270 from Freescale Semiconductor. [13] The MMA1270 is a single-axis accelerometer, allowing the measurement of z-axis acceleration. The z-axis is of most interest because side-to-side acceleration should be very minimal.

3.6. Radio
The radio system will transmit data using packet radio. ITU (International Telecommunications Union) codes requires using radio bands specific to packet radio. Most of these bands require at least a technician class amateur radio license from the FCC. The most used packet radio frequencies are in the 2 meter band, between 144.90 and 145.10 MHz. Packet radio in this range operates on odd frequencies every 20 kHz. This means the operating frequencies are 144.91 MHz, 144.93 MHz, ... 145.09 MHz. [14]

3.6.2 Balloon Radio
The radio finally chosen for transmission from the weather balloon was the Kenwood TH-D7A. This radio is preferred because it has a built-in terminal node controller (TNC). The TNC is what converts the data signals to radio signals (and vice-versa).

3.6.3 Recovery Vehicle Radio
The radio chosen for the recovery vehicle was the TH-D7A’s mobile counterpart, the Kenwood TM-D710A. This radio is built just like the TH-D7A, but it runs off the car battery supply, and has higher sensitivity, allowing it to pick up and transmit better signal. The TM-D710A also has a built-in TNC with a serial port connection.

3.7. Camera
The payload will be equipped with 5 cameras, one on each side and one pointed directly down. The cameras used are Digital Single-Use Cameras from Longs Photo. The cameras are made by Pure Digital Technologies, and are model 400. These digital cameras have a photo limit of 25 pictures, and must be returned to the store for processing. However, it is possible to unlock the firmware [15], allowing the photos to be processed using a USB connection and allows the cameras to be used more than once. The cameras were unlocked and wired to allow for power-on and shutter control to be controlled by the flight controller. The eyepiece, flash, and flash capacitor were removed from the flash because they are not needed. Photos of the camera are in Appendix F.

fig 1
Figure 1: Data transmitted from flight controller. The data transmitted from the flight controller includes GPS, pressure, acceleration, internal temperature, external temperature, sample number, and a checksum. All values—besides GPS—are hex values. Following the GPS data, there are four comma separated values, followed by a checksum. The first number is the packet number. The second number is the pressure, the third acceleration, the fourth internal temperature, and the fifth is external temperature.

3.8. Cut-down Device
The cut down device was designed as a U shaped metal piece with a bolt through the top of the U (making it into a ring). This bolt would be attached to a motor, and then when the cut-down call is made, the PIC microcontroller will supply power to the motor, removing the bolt and allowing the balloon to float freely away from the payload. See Appendix C for the cut-down device sketch design.

3.8.1 Problems with Cut-down Device
The cut-down device was never implemented due to the problem of supplying power to the cut-down. A wire may have interfered with the parachute, causing the payload to descend too quickly. An option in implementing the cut-down device would be providing power and the cut-down signal remotely, but this would require a separate power source and implementation of a short-range wireless device. This option was not explored due to lack of time.

3.9. Landing Device
The landing device consists of a piezo beeper that begins beeping after 90 minutes. This allows the device to be found if it lands out of line-of-sight. The beeper has a power-off switch, allowing the finder to turn it off.

4. SOFTWARE
The software was programmed in the C programming language using Microchip’s MPLAB integrated development environment. The code was compiled using a student edition of Microchip’s C30 Compiler. For the complete code, see Appendix E.

4.1. Program modes
The flight controller has 3 different program modes, determined by jumper configurations in hardware. The three modes are: Acquire Data, Erase Flash, and Transmit to PC.

4.2. Acquire Data
The acquire data program mode handles all acquisition of hardware and in-flight operations. Operation is controlled by a combination of interrupts and hard- coded commands. The operation is as follows:


1.Initialize UART1 for GPS receiving.
2.Initialize UART2 for radio interaction.
3.Wait for GPS packet to be read.
4.Read A/D values.
5.Add a checksum.
6.Write packet to flash and radio.
7.Repeat steps 3-6.

4.3. Erase Flash
The erase flash program fully erases the flash, which must be done one page at a time. This will be done pre-launch to ensure maximum acquisition of data.

4.4. Transmit to PC
The transmit-to-PC program transmits all the data on the flash to the PC. This program also parses the data to eliminate all meaningless data. This increases the speed at which the flash can be read, because reading the entire flash over the UART would take approximately 30 minutes.

5. DATA
The data syntax transmitted from the flight controller is very similar to that of the NMEA protocol data. A sample of the data can be seen in Error! Reference source not found. The data values are hex values, and each sample is separated by a carriage return.

5.1. Sample Number
The sample number counts up by one every time a sample is sent (every second). This is useful because it resets when the chip resets, so if the chip resets during flight, which will interrupt data communication, the packet number will be able to confirm a flight controller reset. If the flight controller stops receiving GPS data, the sample number will allow the flight controller to keep track of time and collect data at a slower rate of one sample per 2 seconds.

6. PAYLOAD AND FLIGHT STRING

6.1. Payload
The payload was constructed from a insulated cooler from Target. The top half of the payload was dedicated to the flight controller and radio, and the bottom half was used for the cameras. The camera was placed in the bottom because they were less important to the recovery of the balloon, and in the result of a hard landing would be the first to go.

6.2. Flight String
The flight string was designed to prevent the balloon from becoming entangled in the parachute, forcing the payload to descent too rapidly. The flight string was assembled, top to bottom, as follows:

1. Balloon
2. 4 feet string
3. Small parachute (dangling)
4. 12 feet string
5. large parachute (in-line)
6. payload The purpose of the small parachute is to hold the balloon shards far above the main parachute.

6.3. GPS Antenna
The GPS antenna, which was initially designed to go directly on top of the payload box, had to be placed 6 feet to the side of the payload due to radio interference from the radio antenna. At first, the GPS antenna wire was coiled around the wood post holding it away from the payload, but it would not receive GPS data in that position. The only position it successfully received GPS data in was when the antenna wire was dangling. While the radio was the main factor in interfering with the GPS signal, the antenna may also have been broken from transit.

7. RESULTS
All raw data is available in the excel spreadsheet “Raw Data.xls”, which is available from the author of this paper or on http://www.pcostello.com.

7.1. Pressure
The pressure data follows the expected trend of moving inversely to the altitude, as shown in Figure 2. However, as show in Figure 3, there is some error. This may be a result of the accuracy of the sensor, or the fact that it was placed inside the payload rather than on the outside, effecting both the pressure and the temperature of the air around the sensor.

fig2
Figure 2: Pressure versus Time. This graph shows pressure data acquired over the length of the flight (red). Altitude data is included on the right y-axis as a reference (purple).

fig3
Figure 3: Calculated altitude from pressure compared with altitude acquired from GPS versus time. The blue line represents the calculated altitude from pressure and external temperature in Equation 2. The purple line represents the altitude data acquired from GPS readings.

! h= kTln(Ph P 0 ) mg

Equation 2: Altitude equation based on the barometric equation. Variables are Ph and T. This equation is derived in Appendix G.

7.2. Temperature

7.2.1 External Temperature
The external temperature reached lows of -40.3 oC. This is slightly warmer than the expected minimum of -60 oC. A possible reason for this temperature difference could be the particular area in the atmosphere, or close proximity to the payload could have led to higher temperatures due to radiating heat from the internal electronics and heating devices.

fig4

Figure 4: External Temperature (oC) versus time. The external temperature data in orange is ploted against flight time, with a purple altitude for reference. As seen in Figure 4, the external temperature decrease with an increase in altitude until it reaches approximately 40oC. The reason for this is that at approximately that altitude the troposphere ends and the stratosphere begins. In the stratosphere (also know as the ozone layer), radiation from the sun cause O3 to break into O2 and O, releasing heat in the process, as shown in Diagram 1.

diagram1

Diagram 1: Temperature versus height in the troposphere and stratosphere. [16] Figure 5 shows altitude versus temperature in the same format as Diagram 1 for a better comparison.

fig5

Figure 5: Altitude versus Temperature. The purple line represents the changing altitude versus the external temeprature. The line has multiple data for each temperature point due to data being acquired on both the ascent and the descent.

7.2.2 Internal Temperature
The internal temperature was kept in a relatively safe range between approximately -1oC and 20oC. The internal temperature is very important because all of the electrical components have a temperature operating range. If the temperature inside the payload exceeded this range (either by being too hot or too cold), the electronics could stop working causing a loss in data acquisition or transmission, causing the payload to be lost.

fig6

Figure 6: Internal temperature versus time. The internal temperature (green) is plotted against flight time with the external temperature (orange) and altitude (purple) as references. The internal temperature, as shown in Figure 6, had a small range in comparison to the external temperature. Reasons for this include heat warmers placed in the balloon and heat generated by the electronics.

7.3. Acceleration
The acceleration data, as shown in Figure 7, is much less stable and linear than the temperature and pressure data, and as a result is more difficult to interpret. Areas of note are the balloon burst and the landing. A significant change in the acceleration data is shown at these two points.

fig7

Figure 7: Acceleration versus time.
The acceleration (blue), measured in G-forces versus time with altitude (purple) as a reference. The acceleration data is zeroed around -1g, the gravitational force. Acceleration in the negative direction indicates acceleration towards the ground.

(see pdf version for the figures)

7.4. Photos from the Payload Cameras
Photos from the payload cameras are available HERE

8. LAUNCH AND FLIGHT PATH
The launch took place at 40°49'58.23"N, 119°20'57.75"W at 14:21:28 Z on May 4, 2008. Flight lasted 1 hour and 16 minutes, touching down at 15:37:31 Z on May 4, 2008 at 40°58'36.84"N, 119° 5'54.32"W. The straight-line path from the launch point to the landing point was 26.5 km. The approximate over-land distance traveled by the balloon was 36.6 km.

fig8
Figure 8: Balloon flight path via Google Earth. The blue represents the flight path of the balloon. The flight path and predicted flight path are available as “Flight Path.gpx” and “Predicted Flight Path.kml”, respectively. Predicting the flight path also used an ascent rate calculator, provided as “Ascent Rate Calculator.xml”.

9. CONCLUSION
This project brought together the need for both hardware and software design. Building, coding, and debugging on a large project is incredibly time consuming and at times painful. Finally launching, and the recovering, was very rewarding.

9.1 Furthering Research
A major thing that needs to be changed is the type of balloon. The balloon used was from Scientific Online, but there are much better balloons available from Kaymont Consolidated. Another major change may be GPS. The GPS antenna definitely should be replaced with a better one, or at least a new one. However replacing the GPS module may also be a good idea. The current GPS module seems to be falling apart, and it may make sense to get a new, not discontinued GPS. Another change would be to add additional sensors. There were many sensors that would be interesting additions, such as CO 2, oxygen content, etc. Another interesting addition would be an ATV board and a video camera in order to stream live video.

10. ACKNOLEDGEMENTS
This project could never have been completed without help from Peter Costello. He acted as a mentor, a guide, and a source of knowledge. Thank you.

11. REFERENCES
[1] “dsPIC30F3014, dsPIC30F4013 Data Sheet.” Microchip Technology Inc.

[2] “dsPIC30F Family Reference Manual.” Microchip Technology Inc.

[3] “Rockwell Jupiter GPS Module.” Available from: http://www.gpskit.nl/gps- readme.html. Accessed on: April 14, 2008.

[4] “Antenna GPS 3V Magnetic Mount MCX.” Sparkfun Electronics. Available from: http://www.sparkfun.com/commerce/product_info.php?products_id=8254. Accessed on: April 14, 2008.

[5] “AT45DB161D.” Atmel Corporation.

[6] “SD Specifications: Part 1. Physical Layer: Simplified Specification.” Version 2.00, September 25, 2006. SD Group.

[7] “Microsoft extensible Firmware Initiative FAT32 File System Specification.” Version 1.03, December 6, 2000. Microsoft Corp.

[8] “LM135/LM235/LM335, LM135A/LM235A/LM335A Precision Temperature Sensors.” November 2000. National Semiconductor.

[9] “Radiosonde Data.” University of Wyoming. Available from: http://weather.uwyo.edu/cgi-bin/sounding?region=naconf&TYPE =TEXT%3ALIST&YEAR=2008&MONTH=04&FROM=0312&TO=0312&STNM=72489. Accessed on: April 14, 2008.

[10] “100 kPa On-Chip Temperature Compensated & Calibrated Silicon Pressure Sensors.” Rev 4, September 2005. Freescale Semiconductor.

[11] Schultz, Warren. “Amplifiers for Semiconductor Pressure Sensors.” Rev 3, May 2005. Freescale Semiconductor.

[12] “LMC6042 CMOS Dual Micropower Operational Amplifier.” August 2000. National Semiconductor.

[13] “Low G Micromachined Accelerometer.” Rev 4, Septemberr 2005. Freescale Semiconductor.

[14] “ARRLWeb: ARRL Band Plans.” American Radio Relay League. December 14, 2006. Available from: http://www.arrl.org/FandES/field/regulations/bandplan.html. Accessed on: 15 April 2008.

[15] Camerahacking.com. Available from: “http://camerahacks.10.forumer.com/” Accessed on: April 20, 2008.

[16] “The Stratosphere.” Available from: http://apollo.lsc.vsc.edu/classes/met130/ notes/chapter1/vert_temp_strat_o3.html. Accessed on: May 15, 2008.