High Altitude Balloon Tracking
Like all good movies we believe a good blog should have a car chase scene, so we have included it in our latest project: High Altitude Balloon Tracking. We have been wanting to send up one of our radios in a balloon for some time. Not because it would give us some important data on long distance radio transmission, and test our radio modules in harsh conditions over long distances but, let’s be honest, what’s cooler than a picture of one of our devices in space? This is just the beginning and it may not take off (really?) but we have developed a GPS interface for our popular Flex radio module.
Here is how it works:
The idea is you send up a weather balloon approx 35km above earth into “near space” (sky becomes dark and you can see the curvature of the Earth), you take some great pictures and collect lots of data, and then the balloon eventually bursts and parachutes back to Earth where you retrieve the payload with your chase car and the GPS coordinates.
Here is a picture of the Flex module connected to a GPS receiver. It’s not exactly what will go into the payload of the balloon but its close. We will solder the parts together in the final build and use an external antenna for the radio module.
Wiring
Taking a closer look at the wiring in the above breadboard prototype both modules take the same power source (3.3V). The GPS receiver outputs clear text over a serial connection. The white and yellow wires connect the two devices via their serial ports (tx and rx). In reality, you only need to connect TX from the GPS to RX on the Flex module because the GPS continuously feeds GPS data and takes no serial input.
GPS Protocol
One of the great discoveries we made investigating GPS devices is there is a GPS standard. This meant we could develop the Flex Module GPS interface to the standard and be able to connect any GPS unit that complies with said standard - great!
The standard is called NMEA 0813 and has been created by the National Marine Electronics Association. The protocol is extremely easy to understand, mainly because it is in plain text. Here is an example of the NMEA 0813 data:
$GPGGA,092750.000,5321.6802,N,00630.3372,W,1,8,1.03,61.7,M,55.2,M,,*76
$GPGSA,A,3,10,07,05,02,29,04,08,13,,,,,1.72,1.03,1.38*0A
$GPGSV,3,1,11,10,63,137,17,07,61,098,15,05,59,290,20,08,54,157,30*70
$GPGSV,3,2,11,02,39,223,19,13,28,070,17,26,23,252,,04,14,186,14*79
$GPGSV,3,3,11,29,09,301,24,16,09,020,,36,,,*76
$GPRMC,092750.000,A,5321.6802,N,00630.3372,W,0.02,31.66,280511,,,A*43
$GPGGA,092751.000,5321.6802,N,00630.3371,W,1,8,1.03,61.7,M,55.3,M,,*75
$GPGSA,A,3,10,07,05,02,29,04,08,13,,,,,1.72,1.03,1.38*0A
$GPGSV,3,1,11,10,63,137,17,07,61,098,15,05,59,290,20,08,54,157,30*70
$GPGSV,3,2,11,02,39,223,16,13,28,070,17,26,23,252,,04,14,186,15*77
$GPGSV,3,3,11,29,09,301,24,16,09,020,,36,,,*76
$GPRMC,092751.000,A,5321.6802,N,00630.3371,W,0.06,31.66,280511,,,A*45
$GPGGA is where the most important data for this project is contained, like:
- GPS Coordinates,
- Number of satellites being tracked,
- Altitude
Here is the full breakdown of a GGA record:
Example:
$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47
Where:
GGA - Global Positioning System Fix Data
123519 | Fix taken at 12:35:19 UTC |
4807.038,N | Latitude 48 deg 07.038' N |
01131.000,E | Longitude 11 deg 31.000' E |
1 | Fix quality: 0 = invalid |
1= GPS fix (SPS) | |
2 = DGPS fix | |
3 = PPS fix | |
4 = Real Time Kinematic | |
5 = Float RTK | |
6 = estimated | |
7 = Manual input mode | |
8 = Simulation mode | |
08 | Number of satellites being tracked |
0.9 | Horizontal dilution of position |
545.4,M | Altitude, Meters, above mean sea level |
46.9,M | Height of geoid (mean sea level) |
(empty field) | time in seconds since last DGPS update |
(empty field) | DGPS station ID number |
$GPRMC also contains a useful element for this project : Speed. We will be able to track the horizontal speed of the balloon at any given time.
Here is the full breakdown of an RMC record:
$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A
RMC - Recommended Minimum Sentence
Where:
123519 | Fix taken at 12:35:19 UTC |
A | Status A=active or V=Void. |
4807.038,N | Latitude 48 deg 07.038' N |
01131.000,E | Longitude 11 deg 31.000' E |
022.4 | Speed over the ground in knots |
084.4 | Track angle in degrees True |
230394 | Date - 23rd of March 1994 |
003.1,W | Magnetic Variation |
*6A | The checksum data, always begins with * |
- $GPGSV is Satellites In View and shows data about the satellites it can find in its view.
- $GPGSA describes the nature of the fix and
More details of all sentences supported by the standard can be found here.
We sourced a few GPS receivers from UBLOX (NEO-M8N and NEO-6M) and both work very well. In fact so well I have one sitting on my desk indoors about 3 meters from the closest windows and it is connected to 8 satellites.
The Flex Module
The Flex Module translates the GPS sentence into our LLAP standard and transmits the data in the usual 12 character packet lengths. For example the following GPS sentence:
$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47
gets transmitted as follows:
a03$GPRMC,12
a033519,A,48
a0307.038,N,
a0301131.000
a03,E,022.4,
a03084.4,230
a03394,003.1
a03,W*6A----
Where:
a | Packet start character |
03 | the device ID of the radio module |
[9 chars] | The raw NMEA sentence broken down into 9 chars at a time |
For those of you familiar with LLAP the above will look familiar. Details of LLAP can be found in our wireless sensor manual.
Now we have the GPS coordinates delivered to the IoT gateway we are ready to proceed to the final step: the chase car scene! Type the GPS coordinates into a sat nav unit, or trusty Google maps and off we go.