GNSS Module | Reading Time and Buffer Synchronization
Update #10131  |  18 Nov 2014

 GNSS module (positioning) key constraints

  • How often the system should read the data coming from the GNSS receiver, in order to maintain an accurate track of the hot air balloon.
  • The right size of the reading-buffer for data coming through UART interface.


Context Description and Values Considered


Hot Air Balloon relevant characteristics | size and speed

As was described on the update “Hot Air Balloons and Data Acquisition Systems - Relevant Information”, the size of a typical hot air balloon is 63 feet in height (almost seven stories high) and 55 feet in diameter [1] of a hot size. Regarding with the speed, based on [2] [3] [4] [5] [6] [7] the speed range of a typical hot air balloon is between 4mph and 20mph, depending mainly of the wind speed and the altitude. For our timing analysis we take the worst case scenario for tracking the hot air balloon, which means maximum speed of 20mph.

Baud rate of the UART interface

As was explained in the last update, the baud rate selected is 9600 bits per second.

GNSS Performance Requirements

Federal radio navigation plan (FRP) and international civil aviation organization (ICAO) rules stands the following performance requirements [8]


 Table 1

APV : approach operations with vertical guidance [9]

CAT I: Category I precision approach, for a detail description please refer to [10]

We based on the values of the red area from the table above due is where is required more horizontal accuracy. It is important to highlight that these are values for navigation system requirements, which is out of the scope of our system, however are used as a reference values.


Timing Calculations

The following calculations are based in the following values as was explained in detail above:

  • Speed : 20 mph
  • Average balloon width : 55 ft
  • Accuracy suggested: 16 m.

First we transform the values to our desired metrics (meters and seconds)

  • Speed : 8.94 m/s
  • Width : 16.76 m
  • Accuracy : 16 m



The maximum and minimum time that the system should read the data coming from the GNSS receiver, in order to maintain an accurate track of the hot air balloon, and set a point into the tracking plot (map).



Taking into consideration a width value as 16.76m, and the accuracy suggested as 16m, we suggest the following steps to get a good approach:

  1. We analyze a distance traveled with maximum speed.
  2. Find certain distance value, long enough to represent a significant change in the tracking process,
  3. Find certain distance value, short enough to keep a good accuracy level.
  4. Evaluate the value with respect of the system time to read, log, parse, log, transmit and display the data.

The appropriate evaluation of the 4th point will be deploy in the next updates. For now, we will focus on the first three.

The first step, to analyze the distance traveled we build the following table with the maximum speed as reference for time vs distance travelled.


Speed of 8.94 m/s


Distance traveled

1 sec

8.94 m

2 secs

17.88 m

3 secs

26.82 m

4 secs

35.76 m

5 secs

44.7 m

6 secs

53.64 m

7 secs

62.58 m

8 secs

71.52 m

9 secs

80.46 m

10 secs

89.4 m

11 secs

98.34 m

12 secs

107.28 m

Table 2

Second and third steps: We assume that a distance between 2 and 5 times the size of the balloon will have a representative change in the tracking plot, with twice the size (32m) we will fulfil the performance requirements suggested of 16m and with five times the size (80m) we still are below of the 220m of Non precision approach reference (Please review the table 1 above).




With a short value of 32m (size x 2) and a long value of 80m (size x 5) as distance range we have a time range between 4secs (35.76m) and 9secs (80.46m). It is important to highlight that we are taking as reference the maximum speed of 8.94m/s, the slower the speed the higher accuracy.


The system should read data coming from the GNSS module every 4secs to 9secs. However this value is not take into account yet the step 4th mention above.


Buffer size calculations


The following calculations are based in:



The right size of the reading-buffer for data coming through UART interface.


Taking into consideration the following three constraints:

  • Read new data every 4 secs to 9 secs, which means we have between 4 secs to 9 secs to fill the buffer
  • Baud rate of 9600.
  • New block of NMEA sentences every 1 sec.
  • Receive buffer is a data type char, which means the storage size has to be in terms of bytes.

We proposed the following formulas to calculate the buffer’s size:



  • Fill time of the buffer: we take the maximum value as 9secs and minimum as 4secs
  • Transmitted bits per one byte: The UART configuration used by the GNSS module = Start bit + Data bits + Stop bits + Parity bits = 1 + 8 + 1 + 0 = 10 bits
  • Baud rate = 9600

 Replacing the values in the formulas:



Buffer size range = 3840 to 8640 Bytes


Complementary analysis and conclusion

With these sizes, we will be taking all the data coming every second during the time waiting (4 to 9secs) for the next read of the system. However as was mention in the timing calculations, we have to take into account the time that the MCU is taking to process the data, issue that we will approach in next updates.

But to get one position point, we just need one block of NMEA sentences, giving us the option to take one block every 9secs as a worst case scenario in the reading process of the GNSS module. Any case with better conditions will increase our tracking accuracy for example:

  • Reading time less than 9 SECONDS
  • Reception of more than one NMEA sentences block in one read.
  • Hot air balloon speed less than 8.94 m/s





For this part we mainly used the following functions:

For its description and examples please follow the links above.

Key Issues

During the development of this stage we have faced some challenges:

-> Synchronization between:
  • Task [counting the “Reading time” (9secs)] and task [reading the port/receivebuffer].
  • Task [create a unique GPS.txt file], synchronize with task [reading the port], task [writing the file], task[closing the file] and task [cleaning the buffers].

-> Special care to cleaning buffers and closing the files





[1] All about hot air ballooning. https://www.udel.edu/PR/UpDate/98/4/all.html

[2] Ballooning. http://www.yorkshire.com/what-to-do/outdoors/airsports/ballooning =  the maximum forecast wind speed that can be flown is 15 mph at 2000 ft

[3] Balloon Launch Weather Criteria http://www.bcballoons.com/balloons/balloon-launch-weather-criteria = Balloons will never fly in winds higher than 12 mph.

[4] Aerohot, hot air balloon flights FAQ. http://www.aerohot.fi/ukk_eng.php = 5m/s

[5] U-Ken-Do Ballooninghttp://www.hotairballoon.org/vermont/faq.html = 8 mph

[6] http://www.californiacats.org/sehotairballoonr.html

[7] Balloon Flying Handbook, FAA. 2008


[9]  Global Navigation Satellite System (GNSS) Manual

[10] http://www.skybrary.aero/index.php/Precision_Approach


More info www.globodaq.co


gmail       pinterest   twitter   wordpress