Closed AlexFuhr closed 4 years ago
I like the first solution with the relative pressure; great idea! As we discussed: please notify me, if your changes are ready to being used as submodule in this project.
I’m closing this issue now, as we’re using your modified fork of RIOT (#24) and respond with all the pressure values in CBOR (#19, #23). Feel free to reopen or add another issue, if there are more changes required, @AlexFuhr.
Work in progress, will add more information next week.
Problem:
The Saul-based communication between 2 stations transmits the atmospheric pressure in a 16-bit format and can thus have a value in the positive range up to 32767 and in the negative up to 32768.
Implementation by Saul: this line
False Code Implementation by Saul (drivers/bmx280/bmx280_saul.c):
Examle Output by Saul:
And that's exactly where the problem is. The sensor can read the data in Pascal, which are in a range over 1000000. The accuracy of the sensor goes beyond about two-tenths of the decimal of pascal value.
Example only sensor BME280 value:
This means that the value no longer fits into the PhyDat 16-bit variable or is automatically truncated. This means that the printing value becomes inaccurate. In order to be able to measure the pressure exactly with the sensor in order to calculate the height, we need the pressure value as accurately as possible. Because the resolution for the height measurement is 0.2 pa per 1.7 cm.
BME_280_Datasheet (Line 18)
This means that if the pressure value is only treated in hPa, the accuracy is reduced to 42 meters solely by setting the decimal places of the Pascal values.
Error Example
the value of 44,4 pascals is lost (44,4 Pa / 0.2 Pa * 1,7 cm) = 374 cm = 3,47 m
For the control of the air balloon the deviation of 3,47 meters is completely useless.
## Solutuions ##
Saul Interface has a 3 dimension 16 bit variable. So you need 2 dimensions for printing. One dimension is for the differential value of normal pressure and the second dimension is for the positive or negative sign.
One of the 16-bit variable allows the pressure of 685.57 hPa up to 1340.92 hPa (101325 +/- 32767 ).
The change in pressure per 1000 meters is 122.05 hPa, resulting in a measurable difference in height of about 2680 meters, both in the negative range and in the positive range.
From the historical weather data of the maximum deviations on the ground, there is a maximum of a positive deviation of 7155 Pa (1060.8 hPa on January 23, 1907 in Greifswald) and a negative deviation of 5885 Pa (954.4 hPa on November 27, 1983 in Emden).
Examle view
Split the pressure value in 2 dimensions
-First dimension: kilo pascal value -Second dimension: decimal pascal value -Third dimension: zero
Example view
Advantageous in this method, there is no limitation of the height measurement, The division into kilopascals and the remaining decimal places are logically followable values and can be easily understood by the user without documentation.