Skip to content

Commit

Permalink
Add more documentation regarding the measurements and data
Browse files Browse the repository at this point in the history
  • Loading branch information
Scrin committed May 1, 2018
1 parent 0aa66de commit 3d29cda
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
42 changes: 42 additions & 0 deletions MEASUREMENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Measurements

Saving and handling the measurements in the RuuviCollector is explained here. See the [Data Formats](https://github.com/ruuvi/ruuvi-sensor-protocols) for format-specific details regarding the resolution data and valid values.

### Saving measurements

Unless manually configured otherwise, the collector will always store each received measurement independently at the time of receiving it regardless of the data format of a particular measurement (depending on tag firmware), unless limited by the update interval (configurable, 9.9 seconds by default), which means up to one measurement per tag and per data format is persisted per 9.9 seconds.

Example: if a tag transmits every 1 seconds; after receiving (and saving) the first measurement, the next 9 measurements will be discarded and the 10th measurement (arriving about 10 seconds after the first) will be saved, unless it's missed in which case the 11th (11 seconds later) is saved. The time limit per tag per data format "resets" only up on saving such measurement, which means the interval will eventually start wandering off relative to "wall clock time".

The purpose of this default limit is to reduce the load on very low-end systems listening to multiple tags. If a strict "wall clock interval" is required, the collector should be configured to store all measurements (set the update limit to 0) and configure an appropriate retention policy and/or continuous query to InfluxDB to remove/aggregate values as needed.

For maximum accuracy, the update interval should be configured to 0 to save every single received measurement without discarding anything.

### Data format compatibility

Note: Extended values are enabled by default but can be disabled if only actual values from the tag are needed.

| Type | Unit (saved) | Data format 2 | Data format 3 | Data format 4 | Data format 5 |
| ------------------------------- | -------------------- | ------------- | ------------- | ------------- | ------------- |
| Temperature | Celsius | **Yes** | **Yes** | **Yes** | **Yes** |
| Relative humidity | Percent (0-100) | **Yes** | **Yes** | **Yes** | **Yes** |
| Air pressure | Pascal | **Yes** | **Yes** | **Yes** | **Yes** |
| Acceleration (x, y ,z) | Gravity of earth (g) | No | **Yes** | No | **Yes** |
| Battery voltage | Volt | No | **Yes** | No | **Yes** |
| TX power | dBm | No | No | No | **Yes** |
| RSSI | dBm | **Yes** *(1)* |**Yes** *(1)* | **Yes** *(1)* | **Yes** *(1)* |
| Movement counter | Number | No | No | No | **Yes** |
| Measurement sequence number | Number | No | No | No | **Yes** |
| **Extended values, if enabled** | | | | | |
| Total acceleration | Gravity of earth (g) | No | **Yes** | No | **Yes** |
| Absolute humidity | g/m³ | **Yes** | **Yes** | **Yes** | **Yes** |
| Dew point | Celsius | **Yes** | **Yes** | **Yes** | **Yes** |
| Equilibrium vapor pressure | Pascal | **Yes** | **Yes** | **Yes** | **Yes** |
| Air density | kg/m³ | **Yes** | **Yes** | **Yes** | **Yes** |
| Acceleration angle from axes | Degrees | No | **Yes** | No | **Yes** |

*(1)* RSSI is the (relative) signal strength at the receiver, it is not dependent on tag firmware.

### Calculating extended values

All extended values are calculated in [MeasurementValueCalculator.java](./src/main/java/fi/tkgwf/ruuvi/utils/MeasurementValueCalculator.java). Unfortunately I've lost the original sources for most of the equations, but with a little searching similar ones can be found, such as [this](https://www.vaisala.com/sites/default/files/documents/Humidity_Conversion_Formulas_B210973EN-F.pdf). Needless to say, the extended values are rough approximations, sufficient for the average home user. For scientific use, you should disable the extended values and use your own scientifically accurate formulas.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

RuuviCollector is an application for collecting sensor measurements from RuuviTags and storing them to InfluxDB. For more about how and for what this is used for, see [this](https://f.ruuvi.com/t/collecting-ruuvitag-measurements-and-displaying-them-with-grafana/267) post.

Note: As this is the first release of this application, there is very little documentation at this point, so some knowledge in Linux and Java is necessary for fully understanding how to use this at this point.
Note: As this application is still early in development, there is very little documentation at this point, so some knowledge in Linux and Java is necessary for fully understanding how to use this at this point.

### Features

Supports following RuuviTag [Data Formats](https://github.com/ruuvi/ruuvi-sensor-protocols):

- Data Format 2: Eddystone-URL, URL-safe base64 -encoded, kickstarter edition
- Data Format 3: "RAW v1" BLE Manufacturer specific data, all current sensor readings
- Data Format 4: Eddystone-URL, URL-safe base64 -encoded, with tag id.
- Data Format 4: Eddystone-URL, URL-safe base64 -encoded, with tag id
- Data Format 5: "RAW v2" BLE Manufacturer specific data, all current sensor readings + extra

Supports following data from the tag (depending on tag firmware):

- Temperature (Celcsius)
- Temperature (Celsius)
- Relative humidity (0-100%)
- Air pressure (Pascal)
- Acceleration for X, Y and Z axes (g)
Expand All @@ -34,6 +34,8 @@ Ability to calculate following values in addition to the raw data (the accuracy
- Air density (Accounts for humidity in the air, kg/m³)
- Acceleration angle from X, Y and Z axes (Degrees)

See [MEASUREMENTS.md](./MEASUREMENTS.md) for additional details about the measurements.

### Requirements

* Linux-based OS (this application uses the bluez stack for Bluetooth which is not available for Windows for example)
Expand Down

0 comments on commit 3d29cda

Please sign in to comment.