Educating myself on meteorology to enhance my understanding of paraglider flight and being inspired by the story of Mike Vergalla, who utilizes paragliders to collect atmospheric measurements, I ordered a handheld weather meter from Tempest.
The device’s intended use is to measure local meteorological conditions for a short period of time, one minute by default, and then calculate the averages in a smartphone app, Wind and Weather Meter. This scenario is suitable for a shooter, a windsurfer, or a paraglider pilot who wants to know accurate local weather conditions at the current moment.
As for me, I want to track the changes in the atmospheric conditions during the flight. The Tempest customer support didn’t help:
<…> we don’t have any products that I would recommend for this specific application. I see you purchased a handheld device, a WeatherMeter for Precision Shooting. This does log observations to the mobile app with a CSV export option but it provides an averaged reading over the duration of the sampling period. It is not a continuously reporting device that provides timeseries data.
It is not exactly true. The device continuously reports time-series data: we know this because the smartphone app displays changing readings over the duration of the sampling period. After that, the app aggregates the time series. We need to read the Bluetooth data.
A bunch of applications from Nordic Semiconductor allows connecting to Bluetooth devices and storing received data. nRF Connect provides the connection to the application. nRF Logger keeps the log and exports it as a CSV file. In my experience, nRF Connect is more reliable in establishing the connection with the WeatherMeter than the native app from Tempest.
Recording the track of meteorological observations
The order is the following:
- Activate Bluetooth and GPS on the phone.
- Start nRF Connect.
- Shortly press the button on the WeatherMeter.
- Start scanning with nRF Connect. The WeatherMeter should appear anything like WFPSM-02-e 837.
- Connect to the device.
- Press the Unknown Service section on the device tab in nRF Connect. A list with several items called Unknown Characteristics opens.
- It is challenging to specify here which of those Unknowns the user should look for next. In my case, it is the second element from the bottom.
- Click the corresponding icon with three arrows. From this moment, nRF Connect displays the changing value, similar to the examples in the next section of this post. Simultaneously, the nRF Logger starts recording the values to the log.
- To stop measuring and recording, you can press the button on the Weather Meter for a couple of seconds. The nRF Logger will show Error 8: GATT CONN TIMEOUT.
- Save the log file using the menu in the nRF Logger.
I suspect the procedure above can be optimized. The nRF Connect app provides automation functions. A user can likely start to record the log just by launching the app.
Decoding the raw data
A 17:21:16.498 "(0x) 00-00-97-FF-6A-FF-14-00-CB-00-22-00-C1-26-00-00" received
A 17:21:17.488 "(0x) 00-00-99-FF-6A-FF-18-00-CB-00-22-00-C1-26-00-00" received
A 17:21:18.478 "(0x) 00-00-98-FF-6A-FF-1B-00-CB-00-22-00-C1-26-00-00" received
A 17:21:19.511 "(0x) 00-00-96-FF-69-FF-19-00-CB-00-22-00-C1-26-00-00" received
It is an extract from the log produced by the nRF Logger.
- A means a message from the app.
- The timestamp is from the smartphone’s clock. I expect the clock to match the one used for recording a GPX/IGC track, so combining the meteorological readings with location data will be easy later.
- The string in quotes contains the actual readings from the meteometer.
(0x)
indicates the numbers are hexadecimal. A single-digit hex number represents a decimal from 0 (0x0) to 15 (0xF). A double-digit hex holds a value up to a decimal of 255.
I played with the meteometer in various conditions: I blew on it, rotated it, put it on an air humidifier, put it on a heater, and put it on a ventilation duct. It spent a few minutes in a freezer. I ran with it from the ground floor to the fourth and back. Below is my deciphering of the structure of a Weathermeter message.
- Each type of measurement is represented by a pair of hexadecimal numbers.
- The first pair indicates the wind speed. I don’t need this data for now, so I haven’t decoded its units. By analogy with other metrics, the wind speed should be represented with the metric system units. So, it’s something like meters per second.
- The device reports the air temperature in the fifth pair: the 9th and 10th numbers. The 9th hex number provides the temperature in tenths of a Celcius degree. Since a double-digit hexadecimal number represents a decimal from 0 to 255, we would end up with a temperature in the range of 0° to 25.5° C. Here, the 10th hex comes into play. It is a signed number, i.e. it can take values like -1, 0, 1, etc. To calculate the temperature in degrees of Celcius, I use the following formula:
(numb9 + numb10 * 255) / 10
. For example, a temperature of 10° C would be represented withnumb9 = 100, numb10 = 0
, a temperature of -10° C –numb9 = 100, numb10 = -1
, and 30° C withnumb9 = 45, numb10 = 1
. The device’s declared temperature range is from -23.3° C to 60° C. The accuracy is ±0.4° C. - Relative humidity takes the 11th number and is reported in percentage points. Thus, no conversion is required. The claimed range is 0-95% with accuracy ±3% up to 85%.
- The pressure is reported in millibars and encoded by the 13th and 14th numbers. The structure is similar to the temperature one, but the second number is not signed.
(numb13 + numb14 * 255 + 39) / 10
. The number 39 here is likely the result of the calibration of my device. The declared range of atmospheric pressure measurement is 301.4 to 1100.6 mbar. The claimed accuracy in ±0.014 millibars seems unrealistic since the device reports on the 0.1-millibar level.
A Python script
I implemented the described procedures in Python scripts. I published their source code on a GitLab repository: https://gitlab.com/Matrunich/weathermeter. To get a Pandas data frame with columns timestamp, relative_humidity_percent, celsius, and mbar, run the function convert_weathermeter_nrf_log
with the file path to the log file as the first parameter. An optional second parameter allows to set the timezone of the timestamp. By default, it is Europe/Tallinn
.