Вы находитесь на странице: 1из 5

GPS Receiver Module

CanSat Kit

StenSat Group LLC


2005
Introduction
The GPS receiver module is an add on
module for the CanSat Kit. It attaches to the
end of the CanSat Kit where the parachute is
attached. The GPS receiver is a very low
power 12 channel receiver. The antenna and
receiver are integrated into one module
requiring one cable to be routed from the
receiver into the CanSat. This document
describes how to install the GPS receiver
module, how to connect it to the CanSat Kit,
and how to program the CanSat Kit
processor to extract position and time from
the GPS receiver. Figure 1, GPS Receiver Mount

Installation
The GPS receiver module requires a few
steps. A second hole in the end of the can
where the parachute is secured needs to be
made. The hole needs to be large enough to
let the connector fit through. Be careful with
the edge of the hole. It is very sharp. covering
the sharp edges with electrical tape will help
protect fingers and the wires of the GPS
receiver cable.

Figure 2, Mount attached to cansat structure

Figure 3, Cable Harness


The cable harness has three connectors
attached. The connector, shown in figure 3, at
the right plugs into the processor board where
the sensor board is plugged. The connector
on the short cable plugs into the sensor
board. The connector on the longer wire plugs
into the GPS receiver. Look at the picture in
Figure 4, GPS receiver mount bolted to
figure 5 on how to orient the connector. The cansat with can
pin with the red wire is pin 1.

Feed the GPS receiver cable through the hole leaving a couple inches of cable
outside. Connect the other end to the connector on the processor module where
the sensor board connects. Connect the remaining end to the sensor board.
Install the four standoffs to the
mounting plate using four 4-40
screws provide as shown in figure
1. Install the mounting plate with
the one inch 10-24 screw mounted
into the nut where the parachute
eye-bolt went as shown in figure 4.
Place the loops of the parachute
around the standoffs before
mounting the GPS receiver
module. Screw in the GPS receiver
module. Some parachutes have
only three loops. This is OK. The
cansat will be swinging around in
the air and being level is not
important. You may also want to
consider getting a larger parachute
since the GPS receiver adds
weight. A 14 to 16 inch parachute
should work.

Connect the cable to the GPS


receiver. Make sure the Red wire is
aligned with pin 1 as marked on
the GPS receiver module. The
CanSat is ready to go. Figure 5, GPS receiver mounted on Cansat

How to extract the Position Data

The BASICATOM Pro has syntax to make extracting strings easy. The GPS
receiver generates NMEA data through a serial interface at 4800 baud. The data
of interest starts with the characters “$GPGGA.” Refer to the GPS receiver
manual for the NMEA format for all the other data formats.

To detect the data of interest, the following can be used:

blk var byte(7) ' declare the variable


blk = “$GPGGA,” ' set blk to the string
serin P2,i4800,[waitstr blk\7] ' wait for string to appear

The “serin” command is used to read data from the GPS receiver. The GPS
receiver serial interface connects to pin P2. The “i4800” parameter tells the
processor that the serial data is at 4800 baud. In the brackets, the variable string
'blk' is specified. The modifier 'waitstr' tells the serin to not complete until the
serial data coming in matches the variable 'blk.' Once there is a match, the
program will continue. If there is never a match, the program is stuck. Just
remember that variable declarations must be made at the top of the program
before any program statements.
Once the match has occurred, the next statement should be to read in the data.
This is accomplished with more 'serin' commands.

Below is the format of the NMEA 0183 message that contains the position data
among other information.

$GPGGA,hhmmss.ss,llll.lll,a,nnnnn.nnn,b,t,uu,v.v,w.w,M,x.x,M,y.y,
zzzz*hh <CR><LF>

To extract the time stamp from the message, use the following instruction.

serin P2,i4800,[ str timestamp\10\","]

The command reads in the time tag up to 10 characters until a coma is reached.
The next page shows an example of extracting the position data from the
message stream. There are other messages that may be useful and are
explained in the GPS receiver reference manual on the CD.

You can integrate the software into your existing program. The program on the
next page reads the position data and displays it on the computer display. It is
left up to you to figure out how to send it out the transmitter. Remember that the
transmitter can send out up to 32 characters. You may have to do multiple
transmissions.
blk var byte(7) ' this is the variable for the header to wait
' for
longitude var byte(11) ' variable array to hold the longitude
latitude var byte(10) ' variable array to hold the latitude
timestamp var byte(10) ' variable array to hold the time stamp
alt var byte(8) ' variable array to hold the altitude
qual var byte(2) ' variable that holds the GPS solution quality
dhop var byte(6) '
satel var byte(2) ' variable for the number of satellites in view
diru var byte(2) ' North/South indication
durl var byte(2) ' East/West indication

blk = "$GPGGA," ' message header to wait for


loop1:
serin P2,i4800,[ waitstr blk\7] ' wait for header to appear

' get all the parts of the message


serin P2,i4800,[ str timestamp\10\",",str latitude\10\","]
serin P2,i4800,[ str diru\2\","]
serin P2,i4800,[ str longitude\11\","]
serin P2,i4800,[ str durl\2\","]
serin P2,i4800,[ str qual\2\","]
serin P2,i4800,[ str satel\3\","]
serin P2,i4800,[ str dhop\5\","]
serin P2,i4800,[ str alt\6\","]

' display the variables


debug [str latitude\7,str diru\1,"/",str longitude\8,str
durl\1,"-S:",str satel\2," /A=",str alt\5,13]
pause 4000
goto loop1
end

Вам также может понравиться