Shop OBEX P1 Docs P2 Docs Learn Events
Need help with Ham radio Balloon Project Please — Parallax Forums

Need help with Ham radio Balloon Project Please

iceghosticeghost Posts: 1
edited 2008-05-02 02:41 in BASIC Stamp
I desperately need some help for a project I'm working on. I'm a HAM radio operator who launches weather balloons with research packages as a hobby. I've built a dual sensor thermometer to record the temperatures inside and outside my flight package as it ascends to 80k+ feet, the problem is I need to be able to match the temperature data with the altitude and or time and to transmitt this data if possible.

The heart of my flight package is a Kantronics KPC3+ TNC (Terminal Node Controller) its basically a modem that takes data converts into a format to be transmitted on HAM radio frequencies and then keys up a radio and transmits the data. I have another TNC connected to my laptop to recieve the transmitted data. Connected to the TNC is a GPS the TNC sends me the GPS coordinates of the flight package so I can track and recover it. this includes altitude and I think each transmitted packet is time stamped

So I need a way to match up the temperature readings with time, altitude or both. The important thing is to keep the temperature data and the GPS data from colliding, either that or a way for the temperature data and GPS data to be stored onboard and later downloaded. In short I'm open to suggestions and any solution that allows be to be able to determine the temperature inside and outside my flight package at a given altitude will work. below is a copy of the code I'm using.

Thanks for your time and attention

With highest regards,

Don KI4QVO

' {$STAMP BS2px}
' {$PBASIC 2.5}
' Program: DS1620.BS2 (interface DS1620 digital thermometer to BS2)
' This program interfaces the DS1620 Digital Thermometer to
' the BS2. Input and output routines can be combined to set
' the '1620 for thermometer or thermostat operation, read
' or write nonvolatile temperature setpoints and configuration
' data. In addition to using the BS2's new Shiftin and Shiftout
' instructions to communicate with the 1620, this program uses
' new math and display operators that work with signed integers.
' This makes it relatively easy to convert between degrees C and
' F and to display both positive and negative temperature
' readings. Note that after math operations on negative numbers
' it's necessary to "extend the sign bits." All this means is
' setting all of the bits to the left of actual value to 1s.
' Also note the use of the new */ (pronounced 'star-slash')
' operator. This works like multiplying by an integer (0-255)
' and a fraction (in units of 1/256). For example, to multiply
' 17 by Pi (approx 3.1416) would be written "17 */ $0324."
' The second value is written in hex to emphasize that it's being
' split into bytes: $03 is the integer and $24/$100 is the fraction.
' In the C-to-F conversion below, we multiply the C value by 1.8
' with "*/ $01CC" since $CC/$FF (204/256) = 0.8.
' ===================== Define Pins and Variables ================
RST1 CON 5 'Pin 5 <=> RST1 (high = active).
CLK1 CON 4 'Pin 4 => CLK1.
DQ1 CON 3 ' Pin 3 <=> DQ.
DQ CON 2 ' Pin 2 <=> DQ.
CLK CON 1 ' Pin 1 => CLK.
RST CON 0 ' Pin 0 => RST (high = active).
DSdata VAR Word ' Word variable to hold 9-bit data.
Sign VAR DSdata.BIT8 ' Sign bit of raw temperature data.
T_sign VAR Bit ' Saved sign bit for converted temperature.
' ===================== Define DS1620 Constants ===================
' >>> Constants for configuring the DS1620
Rconfig CON $AC ' Protocol for 'Read Configuration.'
Wconfig CON $0C ' Protocol for 'Write Configuration.'
CPU CON %10 ' Config bit: serial thermometer mode.
OneShot CON %01 ' Config bit: one conversion per start request.
Cont CON %00 ' Config bit: continuous conversions after start.
' >>> Constants for serial thermometer applications.
StartC CON $EE ' Protocol for 'Start Conversion.'
StopC CON $22 ' Protocol for 'Stop Conversion.'
Rtemp CON $AA ' Protocol for 'Read Temperature.'
' ===================== Begin Program ============================
LOW RST ' Deactivate '1620 for now.
LOW RST1
HIGH CLK ' Put clock in starting state.
HIGH CLK1
PAUSE 100 ' Let things settle down a moment.
HIGH RST ' Activate the '1620 and set it for continuous.
HIGH RST1
SHIFTOUT DQ,CLK,LSBFIRST,[noparse][[/noparse]Wconfig,CPU+Cont] ' ..temp conversions.
SHIFTOUT DQ1,CLK1,LSBFIRST,[noparse][[/noparse]Wconfig,CPU+Cont]
LOW RST ' Done--deactivate.
LOW RST1
PAUSE 50 ' Wait for the EEPROM to self-program.
HIGH RST ' Now activate it again and send the.
HIGH RST1
SHIFTOUT DQ,CLK,LSBFIRST,[noparse][[/noparse]StartC] ' Send start-conversion protocol.
SHIFTOUT DQ1,CLK1,LSBFIRST,[noparse][[/noparse]StartC]
LOW RST ' Done--deactivate.
LOW RST1
' The loop below continuously reads the latest temperature from
' the DS1620.
again:
PAUSE 2000 ' Wait a second between readings.
HIGH RST ' Activate the '1620.
SHIFTOUT DQ,CLK,LSBFIRST,[noparse][[/noparse]Rtemp] ' Request to read temperature.
SHIFTIN DQ,CLK,LSBPRE,[noparse][[/noparse]DSdata\9] ' Get the temperature reading.
LOW RST
T_sign = Sign ' Save the sign bit of the reading.
DSdata = DSdata/2 ' Scale reading to whole degrees C.
IF T_sign = 0 THEN no_neg1
DSdata = DSdata | $FF00 ' Extend sign bits for negative temps.
no_neg1:
DEBUG "smile.gif",CR
DEBUG SDEC DSdata,"degrees C Internal",CR ' Show signed temperature in C.
DSdata = (DSdata */ $01CC) ' Multiply by 1.8.
IF T_sign = 0 THEN no_neg2 ' If negative, extend sign bits.
DSdata = DSdata | $FF00
no_neg2:
DSdata = DSdata + 32 ' Complete the conversion.
DEBUG SDEC DSdata,"degrees F Internal",CR ' Show signed temperature in F.
DEBUG "smile.gif",CR
PAUSE 4000 ' Wait a 4 seconds between readings.
HIGH RST1 ' Activate the '1620.
SHIFTOUT DQ1,CLK1,LSBFIRST,[noparse][[/noparse]Rtemp] ' Request to read temperature.
SHIFTIN DQ1,CLK1,LSBPRE,[noparse][[/noparse]DSdata\9] ' Get the temperature reading.
LOW RST1
T_sign = Sign ' Save the sign bit of the reading.
DSdata = DSdata/2 ' Scale reading to whole degrees C.
IF T_sign = 0 THEN no_neg3
DSdata = DSdata | $FF00 ' Extend sign bits for negative temps.
no_neg3:
DEBUG SDEC DSdata,"degrees C External",CR ' Show signed temperature in C.
DSdata = (DSdata */ $01CC) ' Multiply by 1.8.
IF T_sign = 0 THEN no_neg4 ' If negative, extend sign bits.
DSdata = DSdata | $FF00
no_neg4:
DSdata = DSdata + 32 ' Complete the conversion.
DEBUG SDEC DSdata,"degrees F External",CR ' Show signed temperature in F.
DEBUG "smile.gif"
PAUSE 4000 'Wait 4 seconds
GOTO again:

Comments

  • ercoerco Posts: 20,259
    edited 2008-05-01 22:13
    Quite a project! I found a downed radiosonde in my youth and thought it was the greatest thing ever. Started me on a long & circuitous hobby electronics/ham radio/robotics path.

    If you're able to track & retrieve the unit to download data later, seems like you could record temp, altitude & GPS data using the WRITE command into an industrial-rated (sub-32 degrees!) Stamp, and only transmit a tracking beacon signal. I'm curious if you've actually been able to recover one that has ascended to 80K feet so far.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • icepuckicepuck Posts: 466
    edited 2008-05-02 02:41
    Here's something that may help...
    http://www.parallax.com/tabid/567/Default.aspx

    the following was on a nasatv show this past fall...
    http://www.kd7lmo.net/
    -dan
Sign In or Register to comment.