# BME688 Sensor

**URL:** <https://forums.pimoroni.com/t/bme688-sensor/21126>\
**Category:** Support\
**Created:** [January 5, 2023, 1:53pm UTC](https://forums.pimoroni.com/t/bme688-sensor/21126 "2023-01-05T13:53:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![MikeDabb](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@MikeDabb](https://forums.pimoroni.com/u/MikeDabb)\
**Post date:** [January 5, 2023, 1:53pm UTC](https://forums.pimoroni.com/t/bme688-sensor/21126/1 "2023-01-05T13:53:19Z")

</div>

I am trying to setup the BME688 sensor bought from Pimoroni but when I run the test code below I get the following error message:

ImportError: no module named ‘breakout\_bme68x’

The code I am using is:  
“”“BME688 / BME680 demo  
This demo will work for both the BME680 and BME688.  
“””  
import time  
from breakout\_bme68x import BreakoutBME68X, STATUS\_HEATER\_STABLE  
from pimoroni\_i2c import PimoroniI2C

PINS\_BREAKOUT\_GARDEN = {“sda”: 4, “scl”: 5}  
PINS\_PICO\_EXPLORER = {“sda”: 20, “scl”: 21}

i2c = PimoroniI2C(\*\*PINS\_BREAKOUT\_GARDEN)

bmp = BreakoutBME68X(i2c)

# If this gives an error, try the alternative address

# bmp = BreakoutBME68X(i2c, 0x77)

while True:  
temperature, pressure, humidity, gas, status, \_, \_ = bmp.read()  
heater = “Stable” if status & STATUS\_HEATER\_STABLE else “Unstable”  
print(“{:0.2f}c, {:0.2f}Pa, {:0.2f}%, {:0.2f} Ohms, Heater: {}”.format(  
temperature, pressure, humidity, gas, heater))  
time.sleep(1.0)

I have run the command below to setup the sensor but still get the same error message.  
curl [https://get.pimoroni.com/bme680](https://get.pimoroni.com/bme680) | bash

Any ideas?

Thanks Mike

---

<div class="post-metadata">

**Author:** ![hel](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/hel/32/6075_2.png) [@hel](https://forums.pimoroni.com/u/hel)\
**Post date:** [January 5, 2023, 2:09pm UTC](https://forums.pimoroni.com/t/bme688-sensor/21126/2 "2023-01-05T14:09:48Z")

</div>

What do you have the sensor connected to (and how do you have it connected?)

---

<div class="post-metadata">

**Author:** ![MikeDabb](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@MikeDabb](https://forums.pimoroni.com/u/MikeDabb)\
**Post date:** [January 5, 2023, 3:01pm UTC](https://forums.pimoroni.com/t/bme688-sensor/21126/3 "2023-01-05T15:01:57Z")

</div>

I don’t have the sensor connected as yet, I was connecting it over Stemma/QT (QW/ST)  
once I got the software to run through with no errors.

---

<div class="post-metadata">

**Author:** ![hel](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/hel/32/6075_2.png) [@hel](https://forums.pimoroni.com/u/hel)\
**Post date:** [January 5, 2023, 3:35pm UTC](https://forums.pimoroni.com/t/bme688-sensor/21126/4 "2023-01-05T15:35:47Z")

</div>

Might need some more info about your setup to be able to help here I’m afraid - are you using a Raspberry Pi or a Raspberry Pi Pico?

---

<div class="post-metadata">

**Author:** ![MikeDabb](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@MikeDabb](https://forums.pimoroni.com/u/MikeDabb)\
**Post date:** [January 5, 2023, 4:07pm UTC](https://forums.pimoroni.com/t/bme688-sensor/21126/5 "2023-01-05T16:07:47Z")

</div>

It is a Raspberry Pi Pico with ‘rp2-pico-20220618-v1.19.1.uf2’ installed.

---

<div class="post-metadata">

**Author:** ![hel](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/hel/32/6075_2.png) [@hel](https://forums.pimoroni.com/u/hel)\
**Post date:** [January 5, 2023, 4:37pm UTC](https://forums.pimoroni.com/t/bme688-sensor/21126/6 "2023-01-05T16:37:45Z")

</div>

Ah OK - is that a version of MicroPython downloaded from the Raspberry Pi website? You’ll need to install our custom MicroPython version to have the BME688 drivers built in: [Releases · pimoroni/pimoroni-pico · GitHub](https://github.com/pimoroni/pimoroni-pico/releases). You’ll need the Pico flavoured image - here’s a [direct link](https://github.com/pimoroni/pimoroni-pico/releases/download/v1.19.11/pimoroni-pico-v1.19.11-micropython.uf2).

Note that the example code may throw an error if you don’t have the breakout physically connected to the Pico, either by Qw/ST or by some other means.

---

<div class="post-metadata">

**Author:** ![MikeDabb](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@MikeDabb](https://forums.pimoroni.com/u/MikeDabb)\
**Post date:** [January 5, 2023, 5:08pm UTC](https://forums.pimoroni.com/t/bme688-sensor/21126/7 "2023-01-05T17:08:17Z")

</div>

I have now downloaded the correct UF2 file and it has gone past the initial error message.

I will now have a look at which I2C pins to use on the PICO

Thanks a lot for your help.

Mike

---

<div class="post-metadata">

**Author:** ![MikeDabb](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@MikeDabb](https://forums.pimoroni.com/u/MikeDabb)\
**Post date:** [January 5, 2023, 5:30pm UTC](https://forums.pimoroni.com/t/bme688-sensor/21126/8 "2023-01-05T17:30:48Z")

</div>

Everything working fine now.

Thanks again for your help.

Regards  
Mike

---

<div class="post-metadata">

**Author:** ![Marcus316](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@Marcus316](https://forums.pimoroni.com/u/Marcus316)\
**Post date:** [January 9, 2023, 6:24pm UTC](https://forums.pimoroni.com/t/bme688-sensor/21126/9 "2023-01-09T18:24:42Z")

</div>

Hi Mike,

Would you be able to share which pins you used to connect your Pico to the BME688?  
I can’t seem to find an official document on what that should be?

I found one for the BM280 and have been unsuccessful so far:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/5/583f4f648bbc78aafb35bd68f34fe540dbc67a9a.jpeg)  
Source: [Raspberry Pi Pico W: Wireless Weather Station - YouTube](https://youtu.be/3q807OdvtH0?t=481)

For reference, this is my code:

```auto
from breakout_bme68x import BreakoutBME68X
from pimoroni_i2c import PimoroniI2C

PINS_BREAKOUT_GARDEN = {"sda": 4, "scl": 5}
PINS_PICO_EXPLORER = {"sda": 0, "scl": 1}

i2c = PimoroniI2C(**PINS_PICO_EXPLORER)
bme = BreakoutBME68X(i2c)

```

---

<div class="post-metadata">

**Author:** ![MikeDabb](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@MikeDabb](https://forums.pimoroni.com/u/MikeDabb)\
**Post date:** [January 9, 2023, 8:37pm UTC](https://forums.pimoroni.com/t/bme688-sensor/21126/10 "2023-01-09T20:37:51Z")

</div>

Hi, I have connected the ME688 to pins 6 & 7  
For the SDA & SCL. If that doesn’t work, try reversing the two connections.
