Customer:
I purchased a BME680 sensor and loaded the Example program BME680_Read_All_Values. When the measured data is printed one value at a time, it reads humidity and pressure incorrectly (for example, humidity shows 244.85% and pressure shows 101.23hPa). I tried running the program both ways - printing measurements one by one or all at once. When measurements are taken all at once the results are normal, except for altitude which shows a negative number in both cases. I don’t know why this is happening. I tried other ways of printing but the result is always the same. I checked the sensor and ESP32 and they were in the box the whole time.
Original message (Croatian)
Pozdrav, kupio sam od Vas BME680 senzor i učitao Example program BME680_Read_All_Values, no kada ispisuje izmjerene podatke jedan po jedan krivo očitava vlažnost zraka i tlak (tipa za vlažnost ispisuje 244.85% a tlak bude 101.23hPa). Probao sam pokrenuti program na oba načina, da ispisuje mjerenja jedan po jedan ili sve odjednom. Kada mjeri podatke odjenom rezultati su normalni, osim nadmorske visine za koju ispisuje negativan broj u oba slučaja. Ne znam zašto je tako, probao sam i na druge načine ispisivat ali sve isto, pazio sam na senzor i na ESP32 bili su u kutiji cijelo vrijeme. Hvala unaprijed.
Originally submitted via email support on 24 February 2025. Migrated to the forum for community visibility.
Soldered Support:
To confirm I understand the problem correctly: within the example, the first part of the loop where values are read one by one produces incorrect readings, but the second part of the loop (after a 1s delay) produces correct readings?
Which ESP32 are you using, or are you using our Dasduino CONNECTPLUS? While I investigate with the sensor we have here, you could use the second reading method in your sketch for now.
Regarding negative altitude: this can sometimes occur because it’s calculated from pressure. Also, try leaving the sensor to read periodically for at least 30 minutes - this sensor has a warm-up period.
Try using only the second part of the loop with bme680.readSensorData(temperature2, humidity2, pressure2, gas2); and see if it works better.
Soldered Support:
If it’s now working correctly using that function, we may need to update our library, but if it’s not a critical issue we’ll leave that update for later this year when we’re planning to update documentation and libraries for many of our products.
If altitude is better and you need to use all library features, I recommend using the Adafruit library for the same sensor instead of ours: GitHub - adafruit/Adafruit_BME680 · GitHub
It can calculate altitude more accurately, but it requires knowing the hPa pressure at sea level at your location. This data should be entered through the library with sensor.seaLevelhPa and then altitude can be retrieved more precisely. Here’s the tutorial document that comes with the library: https://cdn-learn.adafruit.com/downloads/pdf/adafruit-bme680-humidity-temperature-barometic-pressure-voc-gas.pdf
To get that pressure via WiFi you can use a weather API like open-meteo or openweathermap.
Soldered Support:
Yes, this sensor can’t really measure altitude from its own limited data - it requires accurate external data and that warm-up period, so the calculation attempts to extrapolate it through mathematics.
I’m glad the sensor turned out to be useful, and you’re welcome for any help I could provide.
We’re also working on providing better tutorials and documentation for all Soldered products.