bme680 adafruit on pyboard

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: bme680 adafruit on pyboard

Post by Roberthh » Tue Jun 30, 2020 10:21 am

Github was broken yesterday afternoon. Now it seems to work again. The humidity sensor of the BME680 seems a little bit off. I made once a test series with various sensors in controlled humidity environments (Box with saturated solutions of various chemicals).The results are below. Green=within spec, Yellow=marginal, white=outside spec. The "University" column are the values form a close university weather station, which I took at a low wind weather condition. Pressure and temperature matched well with the "university" readings.
test results.jpg
test results.jpg (127.5 KiB) Viewed 12445 times
For re-conditioning I followed the procedure in the data sheet. What i have observed that after re-conditioning simple letting the sensor rest for 10-20 days will bring it to an reasonable error.

IHOXOHI
Posts: 119
Joined: Sat Apr 25, 2020 7:31 am

Re: bme680 adafruit on pyboard

Post by IHOXOHI » Tue Jun 30, 2020 10:39 am

Nice. Thanks Roberthh for this perfect job.

There is only one difference in the bme.gaz value construction between this lib and the adafruit-lib...

In the adafruit : "self._last_reading = time.monotonic()"

In this lib : "self._last_reading = time.ticks_ms()"

The value of bme.gas stay the same so maybe, the problem comes from this change...

IHOXOHI
Posts: 119
Joined: Sat Apr 25, 2020 7:31 am

Re: bme680 adafruit on pyboard

Post by IHOXOHI » Tue Jun 30, 2020 10:58 am

Sorry Roberthh,

I have tested until now with the bme680 from seeed... Until now, I have never seen difference between the bme680 from seed and the bme680 from adafruit. But Now, I have tested, and the g.gas works with the bme680 from adafruit... Others values are the same.

The bme.altitude works too.

Thanks for all.

Have a fun.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: bme680 adafruit on pyboard

Post by Roberthh » Tue Jun 30, 2020 6:48 pm

The driver now supports SPI.

sgrunc
Posts: 4
Joined: Sun Nov 07, 2021 4:53 pm

Re: bme680 adafruit on pyboard

Post by sgrunc » Sun Nov 07, 2021 5:04 pm

hello,

I'm not a programmer and started to use micropython.
I'm trying to use the seeed BME680 on a esp32 with micropython with your library, but yet isn't working.
I know this is made for a pyboard, but other times I was able to convert it.

with arduino code and library an these connection (I2c, scl=33, sda=32) works fine.
there the address is defined as (0x76)

anyway I tried to change it in the bme680.py but still not working

I'm trying to use this code:

Code: Select all

import machine
import time
import bme680

#from bme680 import *
from bme680 import BME680_I2C
from machine import I2C, Pin


#bme = BME680_I2C(I2C(-1, Pin(13), Pin(12)))
i2c = I2C(scl=Pin(33), sda=Pin(32))
bme = BME680_I2C(i2c=i2c)
#bme = BME680_I2C(I2C(-1, Pin(33), Pin(32)))

for _ in range(3):
    print(bme.temperature, bme.humidity, bme.pressure, bme.gas)
    time.sleep(1)

if I just use the "from bme680 import *" then upycraft syntax gives me this error
'from bme680 import *' used; unable to detect undefined names
so I had to try something else


maybe someone can help me?
tnx and regards

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: bme680 adafruit on pyboard

Post by Roberthh » Sun Nov 07, 2021 5:16 pm

The driver uses 0x77 as defualt address. If you devie is set to 0x76, you have to change the call into:

bme = BME680_I2C(i2c=i2c, address=0x76)

sgrunc
Posts: 4
Joined: Sun Nov 07, 2021 4:53 pm

Re: bme680 adafruit on pyboard

Post by sgrunc » Sun Nov 07, 2021 6:09 pm

hi Roberthh,

now it works.

thank you very much
regards

Post Reply