Comments (5)
Humidity uses t_fine
to as part of the compensation formula, which is the partially compensated temperature value before it's converted to human-readable degrees C.
BOSCH's own open-source BME680_driver does not demonstrate the method needed to alter or compensate this value during temperature compensation of other measurements.
While their BSEC software might, as far as I'm aware it's distributed only as binary blobs and is closed-source, so we can't extract the logic used from it.
If anyone can demonstrate a method of compensating temperature such that the degrees C and humidity results are accurate, then I would gladly integrate it into this library.
Looking at how t_fine is converted to degrees C:
Suggests that a compensation amount given in degrees C (since we can't expect the end user to know what units t_fine is expressed in) could be converted to an offset against t_fine using the following formula:
offset_in_t_fine = ((offset_in_c << 8) - 128) / 5
Which gives you a t_fine offset of 179
for 4.0C
.
To see if this corrects your results, you can subtract this value from the stored t_fine
calibration value here:
https://github.com/pimoroni/bme680/blob/master/library/bme680/__init__.py#L296
Let me know how it goes!
from bme680-python.
The bme280 suffers from the same problem.
Looking at the code for each, I see they are quite different in how they calculate things. I can see the bme280 is doing some sort of compensation, but it does not allow me to plug in a corrected temperature value (or offset).
@Gadgetoid , can we get a similar offset function in the bme280?
from bme680-python.
That's normal. The sensor is not factory calibrate for temperature. You need to add a temperature offset.
Not sure if the library supports.
Looking at a reference thermometer, we can see that our temperature is indeed a few degrees to high. Does that mean the temperature sensor inside the BME680 is inaccurate?
Actually no, it very accurately measures the temperature exactly where it is located on the board. But there also is the issue: our board as most devices contains some heat sources (e.g., MCU, WiFi chip, display, …). This means the temperature on our board is actually higher than the ambient temperature. Since the absolute amount of water in the air is approximately constant, this also causes the relative humidity to be lower on our board than elsewhere in the room.
As BSEC cannot know in which kind of device the sensor is integrated, we have provide some information to the algorithm to enable it to compensate this offset. In the simplest case, we have to deal with an embedded device with a constant workload and approximately constant self-heating. In such a case, we can simply supply a temperature offset to BSEC which will be subtracted from the temperature and will be used to correct the humidity reading as well.
from the Integration Guide - Bosch Software Environmental Cluster (BSEC)
from bme680-python.
Yes, it looks like only the BSEC does. I wish they had a more open platform.
To achieve this, we simply provide a non-zero temperature offset as the second argument to bsec_iot_init() as shown below. Here, we subtract a 5 degrees offset, for example.
/* Call to the function which initializes the BSEC library /* Switch on ultra-low-power mode and subtract a 5 degrees temperature offset */
ret = bsec_iot_init(BSEC_SAMPLE_RATE_ULP, 5.0f, bus_write, bus_read, sleep, state_load, config_load);
from bme680-python.
Thanks a lot guys!
To convert the offset_in_c to offset_in_t_fine you have to multiply it also by 100. Source
The function is: self.offset_temp_in_t_fine = int((((offset_in_c * 100) << 8) - 128) / 5)
SET offset 0
27.88 C,982.67 hPa,46.236 %RH
SET offset 4
23.89 C,976.18 hPa,45.770 %RH
SET offset 10
17.89 C,966.54 hPa,45.071 %RH
SET offset 20
7.90 C,950.56 hPa,44.036 %RH
I will commit a merge request later.
from bme680-python.
Related Issues (20)
- Invalid CHIP ID: 0x60 HOT 4
- IOError: [Errno 121] Remote I/O error HOT 16
- Temperature offset and humidity issue HOT 6
- can I make a pi with the bme680 hat act as a zigbee z-wave device ? HOT 1
- chip id issue with BME680 Breakout HOT 4
- Solution for "BME680 Not Found. Invalid CHIP ID: 0x-79"
- Broken link in readme? HOT 3
- SPI instead of I2C? HOT 3
- heat_stable goes to False, then intermittent Errno 121
- Add support for IAQ, eCO2 and bVOCe HOT 1
- Error in get_sensor_data (after running for some time)
- gas same value
- How can the heater be disabled? HOT 1
- constants don't match Bosch-version
- Micropython bme.data.gas_resistance always exact same reading (-1.986394e+07 Ohms)
- Altitude and sea level pressure HOT 2
- How do I force sleep mode?
- Can this be used in micropython? HOT 3
- Getting the estimated CO2 in ppm
- Using v2.0.0 with temperature_pressure_humidity.py unmodified example from repository HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bme680-python.